OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 275 |
276 // Verify capturer has turned off applying rotation. | 276 // Verify capturer has turned off applying rotation. |
277 EXPECT_FALSE(capturer.GetApplyRotation()); | 277 EXPECT_FALSE(capturer.GetApplyRotation()); |
278 } | 278 } |
279 | 279 |
280 TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) { | 280 TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) { |
281 cricket::FakeVideoCapturer capturer; | 281 cricket::FakeVideoCapturer capturer; |
282 | 282 |
283 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; | 283 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; |
284 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8"); | 284 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8"); |
| 285 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9"); |
285 cricket::VideoSendParameters parameters; | 286 cricket::VideoSendParameters parameters; |
286 parameters.codecs.push_back(kVp8Codec); | 287 parameters.codecs.push_back(kVp8Codec); |
| 288 parameters.codecs.push_back(kVp9Codec); |
287 | 289 |
288 std::unique_ptr<VideoMediaChannel> channel( | 290 std::unique_ptr<VideoMediaChannel> channel( |
289 SetUpForExternalEncoderFactory(&encoder_factory, parameters.codecs)); | 291 SetUpForExternalEncoderFactory(&encoder_factory, parameters.codecs)); |
290 EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc))); | 292 EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc))); |
291 | 293 |
292 // Set capturer. | 294 // Set capturer. |
293 EXPECT_TRUE(channel->SetCapturer(kSsrc, &capturer)); | 295 EXPECT_TRUE(channel->SetCapturer(kSsrc, &capturer)); |
294 | 296 |
| 297 // Verify capturer has turned on applying rotation. |
| 298 EXPECT_TRUE(capturer.GetApplyRotation()); |
| 299 |
295 // Add CVO extension. | 300 // Add CVO extension. |
296 const int id = 1; | 301 const int id = 1; |
297 parameters.extensions.push_back( | 302 parameters.extensions.push_back( |
298 cricket::RtpHeaderExtension(kRtpVideoRotationHeaderExtension, id)); | 303 cricket::RtpHeaderExtension(kRtpVideoRotationHeaderExtension, id)); |
| 304 // Also remove the first codec to trigger a codec change as well. |
| 305 parameters.codecs.erase(parameters.codecs.begin()); |
299 EXPECT_TRUE(channel->SetSendParameters(parameters)); | 306 EXPECT_TRUE(channel->SetSendParameters(parameters)); |
300 | 307 |
301 // Verify capturer has turned off applying rotation. | 308 // Verify capturer has turned off applying rotation. |
302 EXPECT_FALSE(capturer.GetApplyRotation()); | 309 EXPECT_FALSE(capturer.GetApplyRotation()); |
303 | 310 |
304 // Verify removing header extension turns on applying rotation. | 311 // Verify removing header extension turns on applying rotation. |
305 parameters.extensions.clear(); | 312 parameters.extensions.clear(); |
306 EXPECT_TRUE(channel->SetSendParameters(parameters)); | 313 EXPECT_TRUE(channel->SetSendParameters(parameters)); |
307 EXPECT_TRUE(capturer.GetApplyRotation()); | 314 EXPECT_TRUE(capturer.GetApplyRotation()); |
308 } | 315 } |
(...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3392 } | 3399 } |
3393 | 3400 |
3394 // Test that we normalize send codec format size in simulcast. | 3401 // Test that we normalize send codec format size in simulcast. |
3395 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3402 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3396 cricket::VideoCodec codec(kVp8Codec270p); | 3403 cricket::VideoCodec codec(kVp8Codec270p); |
3397 codec.width += 1; | 3404 codec.width += 1; |
3398 codec.height += 1; | 3405 codec.height += 1; |
3399 VerifySimulcastSettings(codec, 2, 2); | 3406 VerifySimulcastSettings(codec, 2, 2); |
3400 } | 3407 } |
3401 } // namespace cricket | 3408 } // namespace cricket |
OLD | NEW |