blob: 9f00e8ef38ca7b3633267169f22444cc6ba38391 [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 {
niklase@google.com470e71d2011-07-07 08:21:25 +000021public:
stefan@webrtc.orgc3d89102011-09-08 06:50:28 +000022 VCMPacket();
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000023 VCMPacket(const uint8_t* ptr,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000024 const size_t size,
pwestin@webrtc.org56210572012-01-17 12:45:47 +000025 const WebRtcRTPHeader& rtpHeader);
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000026 VCMPacket(const uint8_t* ptr,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000027 size_t size,
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000028 uint16_t seqNum,
29 uint32_t timestamp,
pwestin@webrtc.org56210572012-01-17 12:45:47 +000030 bool markerBit);
niklase@google.com470e71d2011-07-07 08:21:25 +000031
stefan@webrtc.orgc3d89102011-09-08 06:50:28 +000032 void Reset();
33
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000034 uint8_t payloadType;
35 uint32_t timestamp;
wu@webrtc.org6c75c982014-04-15 17:46:33 +000036 // NTP time of the capture time in local timebase in milliseconds.
37 int64_t ntp_time_ms_;
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000038 uint16_t seqNum;
39 const uint8_t* dataPtr;
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000040 size_t sizeBytes;
niklase@google.com470e71d2011-07-07 08:21:25 +000041 bool markerBit;
42
43 FrameType frameType;
Wan-Teh Chang45b229c2015-05-28 13:45:28 -070044 VideoCodecType codec;
niklase@google.com470e71d2011-07-07 08:21:25 +000045
46 bool isFirstPacket; // Is this first packet in a frame.
47 VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete.
48 bool insertStartCode; // True if a start code should be inserted before this
49 // packet.
stefan@webrtc.org3417eb42013-05-21 15:25:53 +000050 int width;
51 int height;
stefan@webrtc.orgc3d89102011-09-08 06:50:28 +000052 RTPVideoHeader codecSpecificHeader;
niklase@google.com470e71d2011-07-07 08:21:25 +000053
54protected:
55 void CopyCodecSpecifics(const RTPVideoHeader& videoHeader);
56};
57
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000058} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000059#endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_H_