blob: bb62cb9ac5ba38e5d70d52319d4b4ed7beaab664 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_MODULES_VIDEO_CODING_PACKET_H_
12#define WEBRTC_MODULES_VIDEO_CODING_PACKET_H_
13
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010014#include "webrtc/modules/include/module_common_types.h"
Henrik Kjellander2557b862015-11-18 22:00:21 +010015#include "webrtc/modules/video_coding/jitter_buffer_common.h"
pbos@webrtc.orga4407322013-07-16 12:32:05 +000016#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017
pbos@webrtc.org3004c792013-05-07 12:36:21 +000018namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000019
pbos@webrtc.org3004c792013-05-07 12:36:21 +000020class VCMPacket {
philipel9d3ab612015-12-21 04:12:39 -080021 public:
22 VCMPacket();
23 VCMPacket(const uint8_t* ptr,
24 const size_t size,
25 const WebRtcRTPHeader& rtpHeader);
26 VCMPacket(const uint8_t* ptr,
27 size_t size,
28 uint16_t seqNum,
29 uint32_t timestamp,
30 bool markerBit);
niklase@google.com470e71d2011-07-07 08:21:25 +000031
philipel9d3ab612015-12-21 04:12:39 -080032 void Reset();
stefan@webrtc.orgc3d89102011-09-08 06:50:28 +000033
philipel9d3ab612015-12-21 04:12:39 -080034 uint8_t payloadType;
35 uint32_t timestamp;
36 // NTP time of the capture time in local timebase in milliseconds.
37 int64_t ntp_time_ms_;
38 uint16_t seqNum;
39 const uint8_t* dataPtr;
40 size_t sizeBytes;
41 bool markerBit;
philipel5ceaaae2016-05-24 10:20:47 +020042 int timesNacked;
niklase@google.com470e71d2011-07-07 08:21:25 +000043
philipel9d3ab612015-12-21 04:12:39 -080044 FrameType frameType;
45 VideoCodecType codec;
niklase@google.com470e71d2011-07-07 08:21:25 +000046
philipel9d3ab612015-12-21 04:12:39 -080047 bool isFirstPacket; // Is this first packet in a frame.
48 VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete.
49 bool insertStartCode; // True if a start code should be inserted before this
50 // packet.
51 int width;
52 int height;
53 RTPVideoHeader codecSpecificHeader;
niklase@google.com470e71d2011-07-07 08:21:25 +000054
philipel9d3ab612015-12-21 04:12:39 -080055 protected:
56 void CopyCodecSpecifics(const RTPVideoHeader& videoHeader);
niklase@google.com470e71d2011-07-07 08:21:25 +000057};
58
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000059} // namespace webrtc
philipel9d3ab612015-12-21 04:12:39 -080060#endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_H_