| 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 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 kAbsoluteSendTimeLength), | 325 kAbsoluteSendTimeLength), |
| 326 rtp_sender_->RtpHeaderExtensionLength()); | 326 rtp_sender_->RtpHeaderExtensionLength()); |
| 327 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(kRtpExtensionAudioLevel, | 327 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(kRtpExtensionAudioLevel, |
| 328 kAudioLevelExtensionId)); | 328 kAudioLevelExtensionId)); |
| 329 EXPECT_EQ(RtpUtility::Word32Align( | 329 EXPECT_EQ(RtpUtility::Word32Align( |
| 330 kRtpOneByteHeaderLength + kTransmissionTimeOffsetLength + | 330 kRtpOneByteHeaderLength + kTransmissionTimeOffsetLength + |
| 331 kAbsoluteSendTimeLength + kAudioLevelLength), | 331 kAbsoluteSendTimeLength + kAudioLevelLength), |
| 332 rtp_sender_->RtpHeaderExtensionLength()); | 332 rtp_sender_->RtpHeaderExtensionLength()); |
| 333 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( | 333 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( |
| 334 kRtpExtensionVideoRotation, kVideoRotationExtensionId)); | 334 kRtpExtensionVideoRotation, kVideoRotationExtensionId)); |
| 335 EXPECT_TRUE(rtp_sender_->ActivateCVORtpHeaderExtension()); | |
| 336 EXPECT_EQ(RtpUtility::Word32Align(kRtpOneByteHeaderLength + | 335 EXPECT_EQ(RtpUtility::Word32Align(kRtpOneByteHeaderLength + |
| 337 kTransmissionTimeOffsetLength + | 336 kTransmissionTimeOffsetLength + |
| 338 kAbsoluteSendTimeLength + | 337 kAbsoluteSendTimeLength + |
| 339 kAudioLevelLength + kVideoRotationLength), | 338 kAudioLevelLength + kVideoRotationLength), |
| 340 rtp_sender_->RtpHeaderExtensionLength()); | 339 rtp_sender_->RtpHeaderExtensionLength()); |
| 341 | 340 |
| 342 // Deregister starts. | 341 // Deregister starts. |
| 343 EXPECT_EQ(0, rtp_sender_->DeregisterRtpHeaderExtension( | 342 EXPECT_EQ(0, rtp_sender_->DeregisterRtpHeaderExtension( |
| 344 kRtpExtensionTransmissionTimeOffset)); | 343 kRtpExtensionTransmissionTimeOffset)); |
| 345 EXPECT_EQ(RtpUtility::Word32Align(kRtpOneByteHeaderLength + | 344 EXPECT_EQ(RtpUtility::Word32Align(kRtpOneByteHeaderLength + |
| (...skipping 12 matching lines...) Expand all Loading... |
| 358 rtp_sender_->RtpHeaderExtensionLength()); | 357 rtp_sender_->RtpHeaderExtensionLength()); |
| 359 EXPECT_EQ( | 358 EXPECT_EQ( |
| 360 0, rtp_sender_->DeregisterRtpHeaderExtension(kRtpExtensionVideoRotation)); | 359 0, rtp_sender_->DeregisterRtpHeaderExtension(kRtpExtensionVideoRotation)); |
| 361 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); | 360 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); |
| 362 } | 361 } |
| 363 | 362 |
| 364 TEST_F(RtpSenderTestWithoutPacer, RegisterRtpVideoRotationHeaderExtension) { | 363 TEST_F(RtpSenderTestWithoutPacer, RegisterRtpVideoRotationHeaderExtension) { |
| 365 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); | 364 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); |
| 366 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( | 365 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( |
| 367 kRtpExtensionVideoRotation, kVideoRotationExtensionId)); | 366 kRtpExtensionVideoRotation, kVideoRotationExtensionId)); |
| 368 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); | |
| 369 | 367 |
| 370 EXPECT_TRUE(rtp_sender_->ActivateCVORtpHeaderExtension()); | |
| 371 EXPECT_EQ( | 368 EXPECT_EQ( |
| 372 RtpUtility::Word32Align(kRtpOneByteHeaderLength + kVideoRotationLength), | 369 RtpUtility::Word32Align(kRtpOneByteHeaderLength + kVideoRotationLength), |
| 373 rtp_sender_->RtpHeaderExtensionLength()); | 370 rtp_sender_->RtpHeaderExtensionLength()); |
| 374 EXPECT_EQ( | 371 EXPECT_EQ( |
| 375 0, rtp_sender_->DeregisterRtpHeaderExtension(kRtpExtensionVideoRotation)); | 372 0, rtp_sender_->DeregisterRtpHeaderExtension(kRtpExtensionVideoRotation)); |
| 376 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); | 373 EXPECT_EQ(0u, rtp_sender_->RtpHeaderExtensionLength()); |
| 377 } | 374 } |
| 378 | 375 |
| 379 TEST_F(RtpSenderTestWithoutPacer, AllocatePacketSetCsrc) { | 376 TEST_F(RtpSenderTestWithoutPacer, AllocatePacketSetCsrc) { |
| 380 // Configure rtp_sender with csrc. | 377 // Configure rtp_sender with csrc. |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1428 } | 1425 } |
| 1429 | 1426 |
| 1430 // Verify that all packets of a frame have CVO byte set. | 1427 // Verify that all packets of a frame have CVO byte set. |
| 1431 TEST_F(RtpSenderVideoTest, SendVideoWithCVO) { | 1428 TEST_F(RtpSenderVideoTest, SendVideoWithCVO) { |
| 1432 uint8_t kFrame[kMaxPacketLength]; | 1429 uint8_t kFrame[kMaxPacketLength]; |
| 1433 RTPVideoHeader hdr = {0}; | 1430 RTPVideoHeader hdr = {0}; |
| 1434 hdr.rotation = kVideoRotation_90; | 1431 hdr.rotation = kVideoRotation_90; |
| 1435 | 1432 |
| 1436 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( | 1433 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( |
| 1437 kRtpExtensionVideoRotation, kVideoRotationExtensionId)); | 1434 kRtpExtensionVideoRotation, kVideoRotationExtensionId)); |
| 1438 EXPECT_TRUE(rtp_sender_->ActivateCVORtpHeaderExtension()); | |
| 1439 | |
| 1440 EXPECT_EQ( | 1435 EXPECT_EQ( |
| 1441 RtpUtility::Word32Align(kRtpOneByteHeaderLength + kVideoRotationLength), | 1436 RtpUtility::Word32Align(kRtpOneByteHeaderLength + kVideoRotationLength), |
| 1442 rtp_sender_->RtpHeaderExtensionLength()); | 1437 rtp_sender_->RtpHeaderExtensionLength()); |
| 1443 | 1438 |
| 1444 rtp_sender_video_->SendVideo(kRtpVideoGeneric, kVideoFrameKey, kPayload, | 1439 rtp_sender_video_->SendVideo(kRtpVideoGeneric, kVideoFrameKey, kPayload, |
| 1445 kTimestamp, 0, kFrame, sizeof(kFrame), nullptr, | 1440 kTimestamp, 0, kFrame, sizeof(kFrame), nullptr, |
| 1446 &hdr); | 1441 &hdr); |
| 1447 | 1442 |
| 1448 RtpHeaderExtensionMap map; | 1443 RtpHeaderExtensionMap map; |
| 1449 map.Register(kRtpExtensionVideoRotation, kVideoRotationExtensionId); | 1444 map.Register(kRtpExtensionVideoRotation, kVideoRotationExtensionId); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1475 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 0)); | 1470 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 0)); |
| 1476 EXPECT_EQ(kVideoRotation_90, | 1471 EXPECT_EQ(kVideoRotation_90, |
| 1477 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 1)); | 1472 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 1)); |
| 1478 EXPECT_EQ(kVideoRotation_180, | 1473 EXPECT_EQ(kVideoRotation_180, |
| 1479 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 2)); | 1474 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 2)); |
| 1480 EXPECT_EQ(kVideoRotation_270, | 1475 EXPECT_EQ(kVideoRotation_270, |
| 1481 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 3)); | 1476 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 3)); |
| 1482 } | 1477 } |
| 1483 | 1478 |
| 1484 } // namespace webrtc | 1479 } // namespace webrtc |
| OLD | NEW |