| 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 3951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3962 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; | 3962 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; |
| 3963 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); | 3963 EXPECT_EQ(rtpHeader.ssrc, recv_stream->GetConfig().rtp.remote_ssrc); |
| 3964 // Verify that the receive stream sinks to a renderer. | 3964 // Verify that the receive stream sinks to a renderer. |
| 3965 webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0, | 3965 webrtc::VideoFrame video_frame3(CreateBlackFrameBuffer(4, 4), 300, 0, |
| 3966 webrtc::kVideoRotation_0); | 3966 webrtc::kVideoRotation_0); |
| 3967 recv_stream->InjectFrame(video_frame3); | 3967 recv_stream->InjectFrame(video_frame3); |
| 3968 EXPECT_EQ(3, renderer.num_rendered_frames()); | 3968 EXPECT_EQ(3, renderer.num_rendered_frames()); |
| 3969 #endif | 3969 #endif |
| 3970 } | 3970 } |
| 3971 | 3971 |
| 3972 // This test verifies that when a new default stream is created for a new |
| 3973 // unsignaled SSRC, the new stream does not overwrite any old stream that had |
| 3974 // been the default receive stream before being properly signaled. |
| 3975 TEST_F(WebRtcVideoChannel2Test, |
| 3976 NewUnsignaledStreamDoesNotDestroyPreviouslyUnsignaledStream) { |
| 3977 cricket::VideoRecvParameters parameters; |
| 3978 parameters.codecs.push_back(GetEngineCodec("VP8")); |
| 3979 ASSERT_TRUE(channel_->SetRecvParameters(parameters)); |
| 3980 |
| 3981 // No streams signaled and no packets received, so we should not have any |
| 3982 // stream objects created yet. |
| 3983 EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); |
| 3984 |
| 3985 // Receive packet on an unsignaled SSRC. |
| 3986 uint8_t data[kMinRtpPacketLen]; |
| 3987 cricket::RtpHeader rtp_header; |
| 3988 rtp_header.payload_type = GetEngineCodec("VP8").id; |
| 3989 rtp_header.seq_num = rtp_header.timestamp = 0; |
| 3990 rtp_header.ssrc = kSsrcs3[0]; |
| 3991 cricket::SetRtpHeader(data, sizeof(data), rtp_header); |
| 3992 rtc::CopyOnWriteBuffer packet(data, sizeof(data)); |
| 3993 rtc::PacketTime packet_time; |
| 3994 channel_->OnPacketReceived(&packet, packet_time); |
| 3995 // Default receive stream should be created. |
| 3996 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); |
| 3997 FakeVideoReceiveStream* recv_stream0 = |
| 3998 fake_call_->GetVideoReceiveStreams()[0]; |
| 3999 EXPECT_EQ(kSsrcs3[0], recv_stream0->GetConfig().rtp.remote_ssrc); |
| 4000 |
| 4001 // Signal the SSRC. |
| 4002 EXPECT_TRUE( |
| 4003 channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrcs3[0]))); |
| 4004 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); |
| 4005 recv_stream0 = fake_call_->GetVideoReceiveStreams()[0]; |
| 4006 EXPECT_EQ(kSsrcs3[0], recv_stream0->GetConfig().rtp.remote_ssrc); |
| 4007 |
| 4008 // Receive packet on a different unsignaled SSRC. |
| 4009 rtp_header.ssrc = kSsrcs3[1]; |
| 4010 cricket::SetRtpHeader(data, sizeof(data), rtp_header); |
| 4011 packet.SetData(data, sizeof(data)); |
| 4012 channel_->OnPacketReceived(&packet, packet_time); |
| 4013 // New default receive stream should be created, but old stream should remain. |
| 4014 ASSERT_EQ(2u, fake_call_->GetVideoReceiveStreams().size()); |
| 4015 EXPECT_EQ(recv_stream0, fake_call_->GetVideoReceiveStreams()[0]); |
| 4016 FakeVideoReceiveStream* recv_stream1 = |
| 4017 fake_call_->GetVideoReceiveStreams()[1]; |
| 4018 EXPECT_EQ(kSsrcs3[1], recv_stream1->GetConfig().rtp.remote_ssrc); |
| 4019 } |
| 4020 |
| 3972 TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { | 4021 TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { |
| 3973 AddSendStream(); | 4022 AddSendStream(); |
| 3974 | 4023 |
| 3975 cricket::FakeVideoCapturer capturer; | 4024 cricket::FakeVideoCapturer capturer; |
| 3976 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, &capturer)); | 4025 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, &capturer)); |
| 3977 cricket::VideoFormat capture_format_hd = | 4026 cricket::VideoFormat capture_format_hd = |
| 3978 capturer.GetSupportedFormats()->front(); | 4027 capturer.GetSupportedFormats()->front(); |
| 3979 EXPECT_EQ(1280, capture_format_hd.width); | 4028 EXPECT_EQ(1280, capture_format_hd.width); |
| 3980 EXPECT_EQ(720, capture_format_hd.height); | 4029 EXPECT_EQ(720, capture_format_hd.height); |
| 3981 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 4030 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4528 | 4577 |
| 4529 TEST_F(WebRtcVideoChannel2SimulcastTest, | 4578 TEST_F(WebRtcVideoChannel2SimulcastTest, |
| 4530 NoSimulcastScreenshareWithoutConference) { | 4579 NoSimulcastScreenshareWithoutConference) { |
| 4531 webrtc::test::ScopedFieldTrials override_field_trials_( | 4580 webrtc::test::ScopedFieldTrials override_field_trials_( |
| 4532 "WebRTC-SimulcastScreenshare/Enabled/"); | 4581 "WebRTC-SimulcastScreenshare/Enabled/"); |
| 4533 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, | 4582 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, |
| 4534 false); | 4583 false); |
| 4535 } | 4584 } |
| 4536 | 4585 |
| 4537 } // namespace cricket | 4586 } // namespace cricket |
| OLD | NEW |