OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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/rtp_rtcp/source/rtp_utility.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
12 | 12 |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include "webrtc/base/logging.h" | 15 #include "webrtc/base/logging.h" |
| 16 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" |
16 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 17 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
17 | 18 |
18 namespace webrtc { | 19 namespace webrtc { |
19 | 20 |
20 RtpData* NullObjectRtpData() { | 21 RtpData* NullObjectRtpData() { |
21 static NullRtpData null_rtp_data; | 22 static NullRtpData null_rtp_data; |
22 return &null_rtp_data; | 23 return &null_rtp_data; |
23 } | 24 } |
24 | 25 |
25 RtpFeedback* NullObjectRtpFeedback() { | 26 RtpFeedback* NullObjectRtpFeedback() { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 header->extension.hasAbsoluteSendTime = false; | 240 header->extension.hasAbsoluteSendTime = false; |
240 header->extension.absoluteSendTime = 0; | 241 header->extension.absoluteSendTime = 0; |
241 | 242 |
242 // May not be present in packet. | 243 // May not be present in packet. |
243 header->extension.hasAudioLevel = false; | 244 header->extension.hasAudioLevel = false; |
244 header->extension.voiceActivity = false; | 245 header->extension.voiceActivity = false; |
245 header->extension.audioLevel = 0; | 246 header->extension.audioLevel = 0; |
246 | 247 |
247 // May not be present in packet. | 248 // May not be present in packet. |
248 header->extension.hasVideoRotation = false; | 249 header->extension.hasVideoRotation = false; |
249 header->extension.videoRotation = 0; | 250 header->extension.videoRotation = kVideoRotation_0; |
250 | 251 |
251 // May not be present in packet. | 252 // May not be present in packet. |
252 header->extension.playout_delay.min_ms = -1; | 253 header->extension.playout_delay.min_ms = -1; |
253 header->extension.playout_delay.max_ms = -1; | 254 header->extension.playout_delay.max_ms = -1; |
254 | 255 |
255 if (X) { | 256 if (X) { |
256 /* RTP header extension, RFC 3550. | 257 /* RTP header extension, RFC 3550. |
257 0 1 2 3 | 258 0 1 2 3 |
258 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 259 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 260 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 LOG(LS_WARNING) | 391 LOG(LS_WARNING) |
391 << "Incorrect coordination of video coordination len: " << len; | 392 << "Incorrect coordination of video coordination len: " << len; |
392 return; | 393 return; |
393 } | 394 } |
394 // 0 1 | 395 // 0 1 |
395 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 | 396 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 |
396 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 397 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
397 // | ID | len=0 |0 0 0 0 C F R R| | 398 // | ID | len=0 |0 0 0 0 C F R R| |
398 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 399 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
399 header->extension.hasVideoRotation = true; | 400 header->extension.hasVideoRotation = true; |
400 header->extension.videoRotation = ptr[0]; | 401 header->extension.videoRotation = |
| 402 ConvertCVOByteToVideoRotation(ptr[0]); |
401 break; | 403 break; |
402 } | 404 } |
403 case kRtpExtensionTransportSequenceNumber: { | 405 case kRtpExtensionTransportSequenceNumber: { |
404 if (len != 1) { | 406 if (len != 1) { |
405 LOG(LS_WARNING) << "Incorrect transport sequence number len: " | 407 LOG(LS_WARNING) << "Incorrect transport sequence number len: " |
406 << len; | 408 << len; |
407 return; | 409 return; |
408 } | 410 } |
409 // 0 1 2 | 411 // 0 1 2 |
410 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 | 412 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 if (*ptr != 0) { | 459 if (*ptr != 0) { |
458 return num_zero_bytes; | 460 return num_zero_bytes; |
459 } | 461 } |
460 ptr++; | 462 ptr++; |
461 num_zero_bytes++; | 463 num_zero_bytes++; |
462 } | 464 } |
463 return num_zero_bytes; | 465 return num_zero_bytes; |
464 } | 466 } |
465 } // namespace RtpUtility | 467 } // namespace RtpUtility |
466 } // namespace webrtc | 468 } // namespace webrtc |
OLD | NEW |