| OLD | NEW |
| 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/include/module_common_types.h" | |
| 12 #include "webrtc/modules/video_coding/packet.h" | 11 #include "webrtc/modules/video_coding/packet.h" |
| 13 | 12 |
| 14 #include <assert.h> | 13 #include <assert.h> |
| 15 | 14 |
| 15 #include "webrtc/modules/include/module_common_types.h" |
| 16 |
| 16 namespace webrtc { | 17 namespace webrtc { |
| 17 | 18 |
| 18 VCMPacket::VCMPacket() | 19 VCMPacket::VCMPacket() |
| 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(kEmptyFrame), |
| 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() {} |
| 34 | 35 |
| 35 VCMPacket::VCMPacket(const uint8_t* ptr, | 36 VCMPacket::VCMPacket(const uint8_t* ptr, |
| 36 const size_t size, | 37 const size_t size, |
| 37 const WebRtcRTPHeader& rtpHeader) : | 38 const WebRtcRTPHeader& rtpHeader) |
| 38 payloadType(rtpHeader.header.payloadType), | 39 : payloadType(rtpHeader.header.payloadType), |
| 39 timestamp(rtpHeader.header.timestamp), | 40 timestamp(rtpHeader.header.timestamp), |
| 40 ntp_time_ms_(rtpHeader.ntp_time_ms), | 41 ntp_time_ms_(rtpHeader.ntp_time_ms), |
| 41 seqNum(rtpHeader.header.sequenceNumber), | 42 seqNum(rtpHeader.header.sequenceNumber), |
| 42 dataPtr(ptr), | 43 dataPtr(ptr), |
| 43 sizeBytes(size), | 44 sizeBytes(size), |
| 44 markerBit(rtpHeader.header.markerBit), | 45 markerBit(rtpHeader.header.markerBit), |
| 45 | 46 |
| 46 frameType(rtpHeader.frameType), | 47 frameType(rtpHeader.frameType), |
| 47 codec(kVideoCodecUnknown), | 48 codec(kVideoCodecUnknown), |
| 48 isFirstPacket(rtpHeader.type.Video.isFirstPacket), | 49 isFirstPacket(rtpHeader.type.Video.isFirstPacket), |
| 49 completeNALU(kNaluComplete), | 50 completeNALU(kNaluComplete), |
| 50 insertStartCode(false), | 51 insertStartCode(false), |
| 51 width(rtpHeader.type.Video.width), | 52 width(rtpHeader.type.Video.width), |
| 52 height(rtpHeader.type.Video.height), | 53 height(rtpHeader.type.Video.height), |
| 53 codecSpecificHeader(rtpHeader.type.Video) | 54 codecSpecificHeader(rtpHeader.type.Video) { |
| 54 { | 55 CopyCodecSpecifics(rtpHeader.type.Video); |
| 55 CopyCodecSpecifics(rtpHeader.type.Video); | |
| 56 } | 56 } |
| 57 | 57 |
| 58 VCMPacket::VCMPacket(const uint8_t* ptr, | 58 VCMPacket::VCMPacket(const uint8_t* ptr, |
| 59 size_t size, | 59 size_t size, |
| 60 uint16_t seq, | 60 uint16_t seq, |
| 61 uint32_t ts, | 61 uint32_t ts, |
| 62 bool mBit) : | 62 bool mBit) |
| 63 payloadType(0), | 63 : payloadType(0), |
| 64 timestamp(ts), | 64 timestamp(ts), |
| 65 ntp_time_ms_(0), | 65 ntp_time_ms_(0), |
| 66 seqNum(seq), | 66 seqNum(seq), |
| 67 dataPtr(ptr), | 67 dataPtr(ptr), |
| 68 sizeBytes(size), | 68 sizeBytes(size), |
| 69 markerBit(mBit), | 69 markerBit(mBit), |
| 70 | 70 |
| 71 frameType(kVideoFrameDelta), | 71 frameType(kVideoFrameDelta), |
| 72 codec(kVideoCodecUnknown), | 72 codec(kVideoCodecUnknown), |
| 73 isFirstPacket(false), | 73 isFirstPacket(false), |
| 74 completeNALU(kNaluComplete), | 74 completeNALU(kNaluComplete), |
| 75 insertStartCode(false), | 75 insertStartCode(false), |
| 76 width(0), | 76 width(0), |
| 77 height(0), | 77 height(0), |
| 78 codecSpecificHeader() | 78 codecSpecificHeader() {} |
| 79 {} | |
| 80 | 79 |
| 81 void VCMPacket::Reset() { | 80 void VCMPacket::Reset() { |
| 82 payloadType = 0; | 81 payloadType = 0; |
| 83 timestamp = 0; | 82 timestamp = 0; |
| 84 ntp_time_ms_ = 0; | 83 ntp_time_ms_ = 0; |
| 85 seqNum = 0; | 84 seqNum = 0; |
| 86 dataPtr = NULL; | 85 dataPtr = NULL; |
| 87 sizeBytes = 0; | 86 sizeBytes = 0; |
| 88 markerBit = false; | 87 markerBit = false; |
| 89 frameType = kEmptyFrame; | 88 frameType = kEmptyFrame; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 codec = kVideoCodecH264; | 144 codec = kVideoCodecH264; |
| 146 return; | 145 return; |
| 147 case kRtpVideoGeneric: | 146 case kRtpVideoGeneric: |
| 148 case kRtpVideoNone: | 147 case kRtpVideoNone: |
| 149 codec = kVideoCodecUnknown; | 148 codec = kVideoCodecUnknown; |
| 150 return; | 149 return; |
| 151 } | 150 } |
| 152 } | 151 } |
| 153 | 152 |
| 154 } // namespace webrtc | 153 } // namespace webrtc |
| OLD | NEW |