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 3755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3766 | 3766 |
3767 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { | 3767 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { |
3768 TestReceiveUnsignaledSsrcPacket(kRedRtxPayloadType, | 3768 TestReceiveUnsignaledSsrcPacket(kRedRtxPayloadType, |
3769 false /* expect_created_receive_stream */); | 3769 false /* expect_created_receive_stream */); |
3770 } | 3770 } |
3771 | 3771 |
3772 // Test that receiving any unsignalled SSRC works even if it changes. | 3772 // Test that receiving any unsignalled SSRC works even if it changes. |
3773 // The first unsignalled SSRC received will create a default receive stream. | 3773 // The first unsignalled SSRC received will create a default receive stream. |
3774 // Any different unsignalled SSRC received will replace the default. | 3774 // Any different unsignalled SSRC received will replace the default. |
3775 TEST_F(WebRtcVideoChannel2Test, ReceiveDifferentUnsignaledSsrc) { | 3775 TEST_F(WebRtcVideoChannel2Test, ReceiveDifferentUnsignaledSsrc) { |
3776 | |
3777 // Allow receiving VP8, VP9, H264 (if enabled). | 3776 // Allow receiving VP8, VP9, H264 (if enabled). |
3778 cricket::VideoRecvParameters parameters; | 3777 cricket::VideoRecvParameters parameters; |
3779 parameters.codecs.push_back(GetEngineCodec("VP8")); | 3778 parameters.codecs.push_back(GetEngineCodec("VP8")); |
3780 parameters.codecs.push_back(GetEngineCodec("VP9")); | 3779 parameters.codecs.push_back(GetEngineCodec("VP9")); |
3781 | 3780 |
3782 #if defined(WEBRTC_USE_H264) | 3781 #if defined(WEBRTC_USE_H264) |
3783 cricket::VideoCodec H264codec(126, "H264"); | 3782 cricket::VideoCodec H264codec(126, "H264"); |
3784 parameters.codecs.push_back(H264codec); | 3783 parameters.codecs.push_back(H264codec); |
3785 #endif | 3784 #endif |
3786 | 3785 |
(...skipping 29 matching lines...) Expand all Loading... |
3816 rtpHeader.ssrc = kIncomingUnsignalledSsrc+2; | 3815 rtpHeader.ssrc = kIncomingUnsignalledSsrc+2; |
3817 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); | 3816 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); |
3818 rtc::CopyOnWriteBuffer packet2(data, sizeof(data)); | 3817 rtc::CopyOnWriteBuffer packet2(data, sizeof(data)); |
3819 channel_->OnPacketReceived(&packet2, packet_time); | 3818 channel_->OnPacketReceived(&packet2, packet_time); |
3820 // VP9 packet should replace the default receive SSRC. | 3819 // VP9 packet should replace the default receive SSRC. |
3821 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); | 3820 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); |
3822 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; | 3821 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; |
3823 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); | 3822 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); |
3824 // Verify that the receive stream sinks to a renderer. | 3823 // Verify that the receive stream sinks to a renderer. |
3825 webrtc::VideoFrame video_frame2(CreateBlackFrameBuffer(4, 4), 200, 0, | 3824 webrtc::VideoFrame video_frame2(CreateBlackFrameBuffer(4, 4), 200, 0, |
3826 webrtc::kVideoRotation_0); | 3825 webrtc::kVideoRotation_0); |
3827 recv_stream->InjectFrame(video_frame2); | 3826 recv_stream->InjectFrame(video_frame2); |
3828 EXPECT_EQ(2, renderer.num_rendered_frames()); | 3827 EXPECT_EQ(2, renderer.num_rendered_frames()); |
3829 | 3828 |
3830 #if defined(WEBRTC_USE_H264) | 3829 #if defined(WEBRTC_USE_H264) |
3831 // Receive H264 packet on third SSRC. | 3830 // Receive H264 packet on third SSRC. |
3832 rtpHeader.payload_type = 126; | 3831 rtpHeader.payload_type = 126; |
3833 rtpHeader.ssrc = kIncomingUnsignalledSsrc+3; | 3832 rtpHeader.ssrc = kIncomingUnsignalledSsrc+3; |
3834 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); | 3833 cricket::SetRtpHeader(data, sizeof(data), rtpHeader); |
3835 rtc::CopyOnWriteBuffer packet3(data, sizeof(data)); | 3834 rtc::CopyOnWriteBuffer packet3(data, sizeof(data)); |
3836 channel_->OnPacketReceived(&packet3, packet_time); | 3835 channel_->OnPacketReceived(&packet3, packet_time); |
3837 // H264 packet should replace the default receive SSRC. | 3836 // H264 packet should replace the default receive SSRC. |
3838 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); | 3837 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); |
3839 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; | 3838 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; |
3840 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); | 3839 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); |
3841 // Verify that the receive stream sinks to a renderer. | 3840 // Verify that the receive stream sinks to a renderer. |
3842 webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0, | 3841 webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0, |
3843 webrtc::kVideoRotation_0); | 3842 webrtc::kVideoRotation_0); |
3844 recv_stream->InjectFrame(video_frame3); | 3843 recv_stream->InjectFrame(video_frame3); |
3845 EXPECT_EQ(3, renderer.num_rendered_frames()); | 3844 EXPECT_EQ(3, renderer.num_rendered_frames()); |
3846 #endif | 3845 #endif |
3847 } | 3846 } |
3848 | 3847 |
3849 TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { | 3848 TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { |
3850 AddSendStream(); | 3849 AddSendStream(); |
3851 | 3850 |
3852 cricket::FakeVideoCapturer capturer; | 3851 cricket::FakeVideoCapturer capturer; |
3853 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, &capturer)); | 3852 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, &capturer)); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4354 } | 4353 } |
4355 | 4354 |
4356 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) { | 4355 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) { |
4357 webrtc::test::ScopedFieldTrials override_field_trials_( | 4356 webrtc::test::ScopedFieldTrials override_field_trials_( |
4358 "WebRTC-SimulcastScreenshare/Enabled/"); | 4357 "WebRTC-SimulcastScreenshare/Enabled/"); |
4359 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true, | 4358 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true, |
4360 true); | 4359 true); |
4361 } | 4360 } |
4362 | 4361 |
4363 } // namespace cricket | 4362 } // namespace cricket |
OLD | NEW |