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 3785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3796 | 3796 |
3797 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { | 3797 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { |
3798 TestReceiveUnsignaledSsrcPacket(kRedRtxPayloadType, | 3798 TestReceiveUnsignaledSsrcPacket(kRedRtxPayloadType, |
3799 false /* expect_created_receive_stream */); | 3799 false /* expect_created_receive_stream */); |
3800 } | 3800 } |
3801 | 3801 |
3802 // Test that receiving any unsignalled SSRC works even if it changes. | 3802 // Test that receiving any unsignalled SSRC works even if it changes. |
3803 // The first unsignalled SSRC received will create a default receive stream. | 3803 // The first unsignalled SSRC received will create a default receive stream. |
3804 // Any different unsignalled SSRC received will replace the default. | 3804 // Any different unsignalled SSRC received will replace the default. |
3805 TEST_F(WebRtcVideoChannel2Test, ReceiveDifferentUnsignaledSsrc) { | 3805 TEST_F(WebRtcVideoChannel2Test, ReceiveDifferentUnsignaledSsrc) { |
3806 | |
3807 // Allow receiving VP8, VP9, H264 (if enabled). | 3806 // Allow receiving VP8, VP9, H264 (if enabled). |
3808 cricket::VideoRecvParameters parameters; | 3807 cricket::VideoRecvParameters parameters; |
3809 parameters.codecs.push_back(GetEngineCodec("VP8")); | 3808 parameters.codecs.push_back(GetEngineCodec("VP8")); |
3810 parameters.codecs.push_back(GetEngineCodec("VP9")); | 3809 parameters.codecs.push_back(GetEngineCodec("VP9")); |
3811 | 3810 |
3812 #if defined(WEBRTC_USE_H264) | 3811 #if defined(WEBRTC_USE_H264) |
3813 cricket::VideoCodec H264codec(126, "H264"); | 3812 cricket::VideoCodec H264codec(126, "H264"); |
3814 parameters.codecs.push_back(H264codec); | 3813 parameters.codecs.push_back(H264codec); |
3815 #endif | 3814 #endif |
3816 | 3815 |
(...skipping 29 matching lines...) Expand all Loading... |
3846 rtpHeader.ssrc = kIncomingUnsignalledSsrc+2; | 3845 rtpHeader.ssrc = kIncomingUnsignalledSsrc+2; |
3847 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); | 3846 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); |
3848 rtc::CopyOnWriteBuffer packet2(data, sizeof(data)); | 3847 rtc::CopyOnWriteBuffer packet2(data, sizeof(data)); |
3849 channel_->OnPacketReceived(&packet2, packet_time); | 3848 channel_->OnPacketReceived(&packet2, packet_time); |
3850 // VP9 packet should replace the default receive SSRC. | 3849 // VP9 packet should replace the default receive SSRC. |
3851 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); | 3850 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); |
3852 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; | 3851 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; |
3853 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); | 3852 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); |
3854 // Verify that the receive stream sinks to a renderer. | 3853 // Verify that the receive stream sinks to a renderer. |
3855 webrtc::VideoFrame video_frame2(CreateBlackFrameBuffer(4, 4), 200, 0, | 3854 webrtc::VideoFrame video_frame2(CreateBlackFrameBuffer(4, 4), 200, 0, |
3856 webrtc::kVideoRotation_0); | 3855 webrtc::kVideoRotation_0); |
3857 recv_stream->InjectFrame(video_frame2); | 3856 recv_stream->InjectFrame(video_frame2); |
3858 EXPECT_EQ(2, renderer.num_rendered_frames()); | 3857 EXPECT_EQ(2, renderer.num_rendered_frames()); |
3859 | 3858 |
3860 #if defined(WEBRTC_USE_H264) | 3859 #if defined(WEBRTC_USE_H264) |
3861 // Receive H264 packet on third SSRC. | 3860 // Receive H264 packet on third SSRC. |
3862 rtpHeader.payload_type = 126; | 3861 rtpHeader.payload_type = 126; |
3863 rtpHeader.ssrc = kIncomingUnsignalledSsrc+3; | 3862 rtpHeader.ssrc = kIncomingUnsignalledSsrc+3; |
3864 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); | 3863 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); |
3865 rtc::CopyOnWriteBuffer packet3(data, sizeof(data)); | 3864 rtc::CopyOnWriteBuffer packet3(data, sizeof(data)); |
3866 channel_->OnPacketReceived(&packet3, packet_time); | 3865 channel_->OnPacketReceived(&packet3, packet_time); |
3867 // H264 packet should replace the default receive SSRC. | 3866 // H264 packet should replace the default receive SSRC. |
3868 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); | 3867 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); |
3869 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; | 3868 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; |
3870 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); | 3869 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); |
3871 // Verify that the receive stream sinks to a renderer. | 3870 // Verify that the receive stream sinks to a renderer. |
3872 webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0, | 3871 webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0, |
3873 webrtc::kVideoRotation_0); | 3872 webrtc::kVideoRotation_0); |
3874 recv_stream->InjectFrame(video_frame3); | 3873 recv_stream->InjectFrame(video_frame3); |
3875 EXPECT_EQ(3, renderer.num_rendered_frames()); | 3874 EXPECT_EQ(3, renderer.num_rendered_frames()); |
3876 #endif | 3875 #endif |
3877 } | 3876 } |
3878 | 3877 |
3879 TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { | 3878 TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { |
3880 AddSendStream(); | 3879 AddSendStream(); |
3881 | 3880 |
3882 cricket::FakeVideoCapturer capturer; | 3881 cricket::FakeVideoCapturer capturer; |
3883 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, &capturer)); | 3882 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, &capturer)); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4392 | 4391 |
4393 TEST_F(WebRtcVideoChannel2SimulcastTest, | 4392 TEST_F(WebRtcVideoChannel2SimulcastTest, |
4394 NoSimulcastScreenshareWithoutConference) { | 4393 NoSimulcastScreenshareWithoutConference) { |
4395 webrtc::test::ScopedFieldTrials override_field_trials_( | 4394 webrtc::test::ScopedFieldTrials override_field_trials_( |
4396 "WebRTC-SimulcastScreenshare/Enabled/"); | 4395 "WebRTC-SimulcastScreenshare/Enabled/"); |
4397 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, | 4396 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, |
4398 false); | 4397 false); |
4399 } | 4398 } |
4400 | 4399 |
4401 } // namespace cricket | 4400 } // namespace cricket |
OLD | NEW |