Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: webrtc/modules/video_coding/main/source/packet.cc

Issue 1371043003: Unify FrameType and VideoFrameType. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/modules/interface/module_common_types.h" 11 #include "webrtc/modules/interface/module_common_types.h"
12 #include "webrtc/modules/video_coding/main/source/packet.h" 12 #include "webrtc/modules/video_coding/main/source/packet.h"
13 13
14 #include <assert.h> 14 #include <assert.h>
15 15
16 namespace webrtc { 16 namespace webrtc {
17 17
18 VCMPacket::VCMPacket() 18 VCMPacket::VCMPacket()
19 : 19 : payloadType(0),
20 payloadType(0), 20 timestamp(0),
21 timestamp(0), 21 ntp_time_ms_(0),
22 ntp_time_ms_(0), 22 seqNum(0),
23 seqNum(0), 23 dataPtr(NULL),
24 dataPtr(NULL), 24 sizeBytes(0),
25 sizeBytes(0), 25 markerBit(false),
26 markerBit(false), 26 frameType(kEmptyFrame),
27 frameType(kFrameEmpty), 27 codec(kVideoCodecUnknown),
28 codec(kVideoCodecUnknown), 28 isFirstPacket(false),
29 isFirstPacket(false), 29 completeNALU(kNaluUnset),
30 completeNALU(kNaluUnset), 30 insertStartCode(false),
31 insertStartCode(false), 31 width(0),
32 width(0), 32 height(0),
33 height(0), 33 codecSpecificHeader() {}
34 codecSpecificHeader() {
35 }
36 34
37 VCMPacket::VCMPacket(const uint8_t* ptr, 35 VCMPacket::VCMPacket(const uint8_t* ptr,
38 const size_t size, 36 const size_t size,
39 const WebRtcRTPHeader& rtpHeader) : 37 const WebRtcRTPHeader& rtpHeader) :
40 payloadType(rtpHeader.header.payloadType), 38 payloadType(rtpHeader.header.payloadType),
41 timestamp(rtpHeader.header.timestamp), 39 timestamp(rtpHeader.header.timestamp),
42 ntp_time_ms_(rtpHeader.ntp_time_ms), 40 ntp_time_ms_(rtpHeader.ntp_time_ms),
43 seqNum(rtpHeader.header.sequenceNumber), 41 seqNum(rtpHeader.header.sequenceNumber),
44 dataPtr(ptr), 42 dataPtr(ptr),
45 sizeBytes(size), 43 sizeBytes(size),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 {} 79 {}
82 80
83 void VCMPacket::Reset() { 81 void VCMPacket::Reset() {
84 payloadType = 0; 82 payloadType = 0;
85 timestamp = 0; 83 timestamp = 0;
86 ntp_time_ms_ = 0; 84 ntp_time_ms_ = 0;
87 seqNum = 0; 85 seqNum = 0;
88 dataPtr = NULL; 86 dataPtr = NULL;
89 sizeBytes = 0; 87 sizeBytes = 0;
90 markerBit = false; 88 markerBit = false;
91 frameType = kFrameEmpty; 89 frameType = kEmptyFrame;
92 codec = kVideoCodecUnknown; 90 codec = kVideoCodecUnknown;
93 isFirstPacket = false; 91 isFirstPacket = false;
94 completeNALU = kNaluUnset; 92 completeNALU = kNaluUnset;
95 insertStartCode = false; 93 insertStartCode = false;
96 width = 0; 94 width = 0;
97 height = 0; 95 height = 0;
98 memset(&codecSpecificHeader, 0, sizeof(RTPVideoHeader)); 96 memset(&codecSpecificHeader, 0, sizeof(RTPVideoHeader));
99 } 97 }
100 98
101 void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) { 99 void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 codec = kVideoCodecH264; 145 codec = kVideoCodecH264;
148 return; 146 return;
149 case kRtpVideoGeneric: 147 case kRtpVideoGeneric:
150 case kRtpVideoNone: 148 case kRtpVideoNone:
151 codec = kVideoCodecUnknown; 149 codec = kVideoCodecUnknown;
152 return; 150 return;
153 } 151 }
154 } 152 }
155 153
156 } // namespace webrtc 154 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698