blob: 43c05867b10f748dfc1354021964a3a8f02a682e [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
14#include "typedefs.h"
15#include "module_common_types.h"
16#include "jitter_buffer_common.h"
17
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,
24 const uint32_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,
27 uint32_t size,
28 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;
36 uint16_t seqNum;
37 const uint8_t* dataPtr;
38 uint32_t sizeBytes;
niklase@google.com470e71d2011-07-07 08:21:25 +000039 bool markerBit;
40
41 FrameType frameType;
42 webrtc::VideoCodecType codec;
43
44 bool isFirstPacket; // Is this first packet in a frame.
45 VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete.
46 bool insertStartCode; // True if a start code should be inserted before this
47 // packet.
stefan@webrtc.org3417eb42013-05-21 15:25:53 +000048 int width;
49 int height;
stefan@webrtc.orgc3d89102011-09-08 06:50:28 +000050 RTPVideoHeader codecSpecificHeader;
niklase@google.com470e71d2011-07-07 08:21:25 +000051
52protected:
53 void CopyCodecSpecifics(const RTPVideoHeader& videoHeader);
54};
55
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000056} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000057#endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_H_