blob: 488c058a8ea13414fe8f6989a70ec397ad559dda [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
johan0d1b2b62017-01-10 04:21:35 -080014#include "webrtc/base/deprecation.h"
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010015#include "webrtc/modules/include/module_common_types.h"
Henrik Kjellander2557b862015-11-18 22:00:21 +010016#include "webrtc/modules/video_coding/jitter_buffer_common.h"
pbos@webrtc.orga4407322013-07-16 12:32:05 +000017#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000018
pbos@webrtc.org3004c792013-05-07 12:36:21 +000019namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000020
pbos@webrtc.org3004c792013-05-07 12:36:21 +000021class VCMPacket {
philipel9d3ab612015-12-21 04:12:39 -080022 public:
23 VCMPacket();
24 VCMPacket(const uint8_t* ptr,
25 const size_t size,
26 const WebRtcRTPHeader& rtpHeader);
niklase@google.com470e71d2011-07-07 08:21:25 +000027
philipel9d3ab612015-12-21 04:12:39 -080028 void Reset();
stefan@webrtc.orgc3d89102011-09-08 06:50:28 +000029
philipel9d3ab612015-12-21 04:12:39 -080030 uint8_t payloadType;
31 uint32_t timestamp;
32 // NTP time of the capture time in local timebase in milliseconds.
33 int64_t ntp_time_ms_;
34 uint16_t seqNum;
35 const uint8_t* dataPtr;
36 size_t sizeBytes;
37 bool markerBit;
philipel5ceaaae2016-05-24 10:20:47 +020038 int timesNacked;
niklase@google.com470e71d2011-07-07 08:21:25 +000039
philipel9d3ab612015-12-21 04:12:39 -080040 FrameType frameType;
41 VideoCodecType codec;
niklase@google.com470e71d2011-07-07 08:21:25 +000042
johan0d1b2b62017-01-10 04:21:35 -080043 union {
44 RTC_DEPRECATED bool isFirstPacket; // Is this first packet in a frame.
45 bool is_first_packet_in_frame;
46 };
philipel9d3ab612015-12-21 04:12:39 -080047 VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete.
48 bool insertStartCode; // True if a start code should be inserted before this
49 // packet.
50 int width;
51 int height;
isheriff6b4b5f32016-06-08 00:24:21 -070052 RTPVideoHeader video_header;
niklase@google.com470e71d2011-07-07 08:21:25 +000053
philipel9d3ab612015-12-21 04:12:39 -080054 protected:
55 void CopyCodecSpecifics(const RTPVideoHeader& videoHeader);
niklase@google.com470e71d2011-07-07 08:21:25 +000056};
57
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000058} // namespace webrtc
philipel9d3ab612015-12-21 04:12:39 -080059#endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_H_