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

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

Issue 1528503003: Lint enabled for webrtc/modules/video_coding folder. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 <assert.h>
12
11 #include "webrtc/modules/include/module_common_types.h" 13 #include "webrtc/modules/include/module_common_types.h"
12 #include "webrtc/modules/video_coding/packet.h" 14 #include "webrtc/modules/video_coding/packet.h"
mflodman 2015/12/17 13:05:39 On top.
philipel 2015/12/18 12:23:16 Done.
13 15
14 #include <assert.h>
15
16 namespace webrtc { 16 namespace webrtc {
17 17
18 VCMPacket::VCMPacket() 18 VCMPacket::VCMPacket()
19 : payloadType(0), 19 : payloadType(0),
20 timestamp(0), 20 timestamp(0),
21 ntp_time_ms_(0), 21 ntp_time_ms_(0),
22 seqNum(0), 22 seqNum(0),
23 dataPtr(NULL), 23 dataPtr(NULL),
24 sizeBytes(0), 24 sizeBytes(0),
25 markerBit(false), 25 markerBit(false),
26 frameType(kEmptyFrame), 26 frameType(kEmptyFrame),
27 codec(kVideoCodecUnknown), 27 codec(kVideoCodecUnknown),
28 isFirstPacket(false), 28 isFirstPacket(false),
29 completeNALU(kNaluUnset), 29 completeNALU(kNaluUnset),
30 insertStartCode(false), 30 insertStartCode(false),
31 width(0), 31 width(0),
32 height(0), 32 height(0),
33 codecSpecificHeader() {} 33 codecSpecificHeader() {}
34 34
35 VCMPacket::VCMPacket(const uint8_t* ptr, 35 VCMPacket::VCMPacket(const uint8_t* ptr,
36 const size_t size, 36 const size_t size,
37 const WebRtcRTPHeader& rtpHeader) : 37 const WebRtcRTPHeader& rtpHeader)
38 payloadType(rtpHeader.header.payloadType), 38 : payloadType(rtpHeader.header.payloadType),
39 timestamp(rtpHeader.header.timestamp), 39 timestamp(rtpHeader.header.timestamp),
40 ntp_time_ms_(rtpHeader.ntp_time_ms), 40 ntp_time_ms_(rtpHeader.ntp_time_ms),
41 seqNum(rtpHeader.header.sequenceNumber), 41 seqNum(rtpHeader.header.sequenceNumber),
42 dataPtr(ptr), 42 dataPtr(ptr),
43 sizeBytes(size), 43 sizeBytes(size),
44 markerBit(rtpHeader.header.markerBit), 44 markerBit(rtpHeader.header.markerBit),
45 45
46 frameType(rtpHeader.frameType), 46 frameType(rtpHeader.frameType),
47 codec(kVideoCodecUnknown), 47 codec(kVideoCodecUnknown),
48 isFirstPacket(rtpHeader.type.Video.isFirstPacket), 48 isFirstPacket(rtpHeader.type.Video.isFirstPacket),
49 completeNALU(kNaluComplete), 49 completeNALU(kNaluComplete),
50 insertStartCode(false), 50 insertStartCode(false),
51 width(rtpHeader.type.Video.width), 51 width(rtpHeader.type.Video.width),
52 height(rtpHeader.type.Video.height), 52 height(rtpHeader.type.Video.height),
53 codecSpecificHeader(rtpHeader.type.Video) 53 codecSpecificHeader(rtpHeader.type.Video) {
54 { 54 CopyCodecSpecifics(rtpHeader.type.Video);
55 CopyCodecSpecifics(rtpHeader.type.Video);
56 } 55 }
57 56
58 VCMPacket::VCMPacket(const uint8_t* ptr, 57 VCMPacket::VCMPacket(const uint8_t* ptr,
59 size_t size, 58 size_t size,
60 uint16_t seq, 59 uint16_t seq,
61 uint32_t ts, 60 uint32_t ts,
62 bool mBit) : 61 bool mBit)
63 payloadType(0), 62 : payloadType(0),
64 timestamp(ts), 63 timestamp(ts),
65 ntp_time_ms_(0), 64 ntp_time_ms_(0),
66 seqNum(seq), 65 seqNum(seq),
67 dataPtr(ptr), 66 dataPtr(ptr),
68 sizeBytes(size), 67 sizeBytes(size),
69 markerBit(mBit), 68 markerBit(mBit),
70 69
71 frameType(kVideoFrameDelta), 70 frameType(kVideoFrameDelta),
72 codec(kVideoCodecUnknown), 71 codec(kVideoCodecUnknown),
73 isFirstPacket(false), 72 isFirstPacket(false),
74 completeNALU(kNaluComplete), 73 completeNALU(kNaluComplete),
75 insertStartCode(false), 74 insertStartCode(false),
76 width(0), 75 width(0),
77 height(0), 76 height(0),
78 codecSpecificHeader() 77 codecSpecificHeader() {}
79 {}
80 78
81 void VCMPacket::Reset() { 79 void VCMPacket::Reset() {
82 payloadType = 0; 80 payloadType = 0;
83 timestamp = 0; 81 timestamp = 0;
84 ntp_time_ms_ = 0; 82 ntp_time_ms_ = 0;
85 seqNum = 0; 83 seqNum = 0;
86 dataPtr = NULL; 84 dataPtr = NULL;
87 sizeBytes = 0; 85 sizeBytes = 0;
88 markerBit = false; 86 markerBit = false;
89 frameType = kEmptyFrame; 87 frameType = kEmptyFrame;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 codec = kVideoCodecH264; 143 codec = kVideoCodecH264;
146 return; 144 return;
147 case kRtpVideoGeneric: 145 case kRtpVideoGeneric:
148 case kRtpVideoNone: 146 case kRtpVideoNone:
149 codec = kVideoCodecUnknown; 147 codec = kVideoCodecUnknown;
150 return; 148 return;
151 } 149 }
152 } 150 }
153 151
154 } // namespace webrtc 152 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698