OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 | 230 |
231 bool RTPPayloadRegistry::IsRtxInternal(const RTPHeader& header) const { | 231 bool RTPPayloadRegistry::IsRtxInternal(const RTPHeader& header) const { |
232 return rtx_ && ssrc_rtx_ == header.ssrc; | 232 return rtx_ && ssrc_rtx_ == header.ssrc; |
233 } | 233 } |
234 | 234 |
235 bool RTPPayloadRegistry::RestoreOriginalPacket(uint8_t** restored_packet, | 235 bool RTPPayloadRegistry::RestoreOriginalPacket(uint8_t** restored_packet, |
236 const uint8_t* packet, | 236 const uint8_t* packet, |
237 size_t* packet_length, | 237 size_t* packet_length, |
238 uint32_t original_ssrc, | 238 uint32_t original_ssrc, |
239 const RTPHeader& header) const { | 239 const RTPHeader& header) const { |
240 if (kRtxHeaderSize + header.headerLength > *packet_length) { | 240 if (kRtxHeaderSize + header.headerLength > |
241 *packet_length - header.paddingLength) { | |
stefan-webrtc
2015/07/01 11:38:17
Move header.paddingLength to other side of >
| |
241 return false; | 242 return false; |
242 } | 243 } |
243 const uint8_t* rtx_header = packet + header.headerLength; | 244 const uint8_t* rtx_header = packet + header.headerLength; |
244 uint16_t original_sequence_number = (rtx_header[0] << 8) + rtx_header[1]; | 245 uint16_t original_sequence_number = (rtx_header[0] << 8) + rtx_header[1]; |
245 | 246 |
246 // Copy the packet into the restored packet, except for the RTX header. | 247 // Copy the packet into the restored packet, except for the RTX header. |
247 memcpy(*restored_packet, packet, header.headerLength); | 248 memcpy(*restored_packet, packet, header.headerLength); |
248 memcpy(*restored_packet + header.headerLength, | 249 memcpy(*restored_packet + header.headerLength, |
249 packet + header.headerLength + kRtxHeaderSize, | 250 packet + header.headerLength + kRtxHeaderSize, |
250 *packet_length - header.headerLength - kRtxHeaderSize); | 251 *packet_length - header.headerLength - kRtxHeaderSize); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 RTPPayloadStrategy* RTPPayloadStrategy::CreateStrategy( | 461 RTPPayloadStrategy* RTPPayloadStrategy::CreateStrategy( |
461 const bool handling_audio) { | 462 const bool handling_audio) { |
462 if (handling_audio) { | 463 if (handling_audio) { |
463 return new RTPPayloadAudioStrategy(); | 464 return new RTPPayloadAudioStrategy(); |
464 } else { | 465 } else { |
465 return new RTPPayloadVideoStrategy(); | 466 return new RTPPayloadVideoStrategy(); |
466 } | 467 } |
467 } | 468 } |
468 | 469 |
469 } // namespace webrtc | 470 } // namespace webrtc |
OLD | NEW |