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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 } | 1146 } |
1147 | 1147 |
1148 int GetMaxEncoderBitrate(cricket::FakeVideoCapturer& capturer) { | 1148 int GetMaxEncoderBitrate(cricket::FakeVideoCapturer& capturer) { |
1149 EXPECT_TRUE(capturer.CaptureFrame()); | 1149 EXPECT_TRUE(capturer.CaptureFrame()); |
1150 | 1150 |
1151 std::vector<FakeVideoSendStream*> streams = | 1151 std::vector<FakeVideoSendStream*> streams = |
1152 fake_call_->GetVideoSendStreams(); | 1152 fake_call_->GetVideoSendStreams(); |
1153 EXPECT_TRUE(streams.size() > 0); | 1153 EXPECT_TRUE(streams.size() > 0); |
1154 FakeVideoSendStream* stream = streams[streams.size() - 1]; | 1154 FakeVideoSendStream* stream = streams[streams.size() - 1]; |
1155 | 1155 |
1156 webrtc::VideoEncoderConfig encoder_config = | 1156 webrtc::VideoEncoderConfig encoder_config = stream->GetEncoderConfig(); |
1157 stream->GetEncoderConfig().Copy(); | |
1158 EXPECT_EQ(1, encoder_config.streams.size()); | 1157 EXPECT_EQ(1, encoder_config.streams.size()); |
1159 return encoder_config.streams[0].max_bitrate_bps; | 1158 return encoder_config.streams[0].max_bitrate_bps; |
1160 } | 1159 } |
1161 | 1160 |
1162 void SetAndExpectMaxBitrate(cricket::FakeVideoCapturer& capturer, | 1161 void SetAndExpectMaxBitrate(cricket::FakeVideoCapturer& capturer, |
1163 int global_max, | 1162 int global_max, |
1164 int stream_max, | 1163 int stream_max, |
1165 int expected_encoder_bitrate) { | 1164 int expected_encoder_bitrate) { |
1166 VideoSendParameters limited_send_params = send_parameters_; | 1165 VideoSendParameters limited_send_params = send_parameters_; |
1167 limited_send_params.max_bandwidth_bps = global_max; | 1166 limited_send_params.max_bandwidth_bps = global_max; |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 | 1638 |
1640 EXPECT_TRUE(channel_->SetSend(true)); | 1639 EXPECT_TRUE(channel_->SetSend(true)); |
1641 | 1640 |
1642 EXPECT_TRUE(capturer.CaptureFrame()); | 1641 EXPECT_TRUE(capturer.CaptureFrame()); |
1643 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1642 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
1644 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1643 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
1645 | 1644 |
1646 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); | 1645 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); |
1647 | 1646 |
1648 // Verify non-screencast settings. | 1647 // Verify non-screencast settings. |
1649 webrtc::VideoEncoderConfig encoder_config = | 1648 webrtc::VideoEncoderConfig encoder_config = send_stream->GetEncoderConfig(); |
1650 send_stream->GetEncoderConfig().Copy(); | |
1651 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, | 1649 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, |
1652 encoder_config.content_type); | 1650 encoder_config.content_type); |
1653 EXPECT_EQ(codec.width, encoder_config.streams.front().width); | 1651 EXPECT_EQ(codec.width, encoder_config.streams.front().width); |
1654 EXPECT_EQ(codec.height, encoder_config.streams.front().height); | 1652 EXPECT_EQ(codec.height, encoder_config.streams.front().height); |
1655 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) | 1653 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) |
1656 << "Non-screenshare shouldn't use min-transmit bitrate."; | 1654 << "Non-screenshare shouldn't use min-transmit bitrate."; |
1657 | 1655 |
1658 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); | 1656 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); |
1659 // Removing a capturer triggers a black frame to be sent. | 1657 // Removing a capturer triggers a black frame to be sent. |
1660 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); | 1658 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); |
1661 VideoOptions screencast_options; | 1659 VideoOptions screencast_options; |
1662 screencast_options.is_screencast = rtc::Optional<bool>(true); | 1660 screencast_options.is_screencast = rtc::Optional<bool>(true); |
1663 EXPECT_TRUE( | 1661 EXPECT_TRUE( |
1664 channel_->SetVideoSend(last_ssrc_, true, &screencast_options, &capturer)); | 1662 channel_->SetVideoSend(last_ssrc_, true, &screencast_options, &capturer)); |
1665 EXPECT_TRUE(capturer.CaptureFrame()); | 1663 EXPECT_TRUE(capturer.CaptureFrame()); |
1666 // Send stream not recreated after option change. | 1664 // Send stream not recreated after option change. |
1667 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); | 1665 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); |
1668 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); | 1666 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); |
1669 | 1667 |
1670 // Verify screencast settings. | 1668 // Verify screencast settings. |
1671 encoder_config = send_stream->GetEncoderConfig().Copy(); | 1669 encoder_config = send_stream->GetEncoderConfig(); |
1672 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1670 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
1673 encoder_config.content_type); | 1671 encoder_config.content_type); |
1674 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, | 1672 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, |
1675 encoder_config.min_transmit_bitrate_bps); | 1673 encoder_config.min_transmit_bitrate_bps); |
1676 | 1674 |
1677 EXPECT_EQ(capture_format_hd.width, encoder_config.streams.front().width); | 1675 EXPECT_EQ(capture_format_hd.width, encoder_config.streams.front().width); |
1678 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); | 1676 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); |
1679 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); | 1677 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); |
1680 | 1678 |
1681 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); | 1679 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); |
1682 } | 1680 } |
1683 | 1681 |
1684 TEST_F(WebRtcVideoChannel2Test, NoRecreateStreamForScreencast) { | 1682 TEST_F(WebRtcVideoChannel2Test, NoRecreateStreamForScreencast) { |
1685 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); | 1683 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
1686 ASSERT_TRUE( | 1684 ASSERT_TRUE( |
1687 channel_->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc))); | 1685 channel_->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc))); |
1688 EXPECT_TRUE(channel_->SetSend(true)); | 1686 EXPECT_TRUE(channel_->SetSend(true)); |
1689 | 1687 |
1690 cricket::FakeVideoCapturer capturer; | 1688 cricket::FakeVideoCapturer capturer; |
1691 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, &capturer)); | 1689 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, &capturer)); |
1692 EXPECT_EQ(cricket::CS_RUNNING, | 1690 EXPECT_EQ(cricket::CS_RUNNING, |
1693 capturer.Start(capturer.GetSupportedFormats()->front())); | 1691 capturer.Start(capturer.GetSupportedFormats()->front())); |
1694 EXPECT_TRUE(capturer.CaptureFrame()); | 1692 EXPECT_TRUE(capturer.CaptureFrame()); |
1695 | 1693 |
1696 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); | 1694 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); |
1697 FakeVideoSendStream* stream = fake_call_->GetVideoSendStreams().front(); | 1695 FakeVideoSendStream* stream = fake_call_->GetVideoSendStreams().front(); |
1698 webrtc::VideoEncoderConfig encoder_config = stream->GetEncoderConfig().Copy(); | 1696 webrtc::VideoEncoderConfig encoder_config = stream->GetEncoderConfig(); |
1699 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, | 1697 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, |
1700 encoder_config.content_type); | 1698 encoder_config.content_type); |
1701 | 1699 |
1702 EXPECT_EQ(1, stream->GetNumberOfSwappedFrames()); | 1700 EXPECT_EQ(1, stream->GetNumberOfSwappedFrames()); |
1703 | 1701 |
1704 /* Switch to screencast source. We expect a reconfigure of the | 1702 /* Switch to screencast source. We expect a reconfigure of the |
1705 * encoder, but no change of the send stream. */ | 1703 * encoder, but no change of the send stream. */ |
1706 struct VideoOptions video_options; | 1704 struct VideoOptions video_options; |
1707 video_options.is_screencast = rtc::Optional<bool>(true); | 1705 video_options.is_screencast = rtc::Optional<bool>(true); |
1708 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, &video_options, &capturer)); | 1706 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, &video_options, &capturer)); |
1709 | 1707 |
1710 EXPECT_TRUE(capturer.CaptureFrame()); | 1708 EXPECT_TRUE(capturer.CaptureFrame()); |
1711 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); | 1709 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); |
1712 ASSERT_EQ(stream, fake_call_->GetVideoSendStreams().front()); | 1710 ASSERT_EQ(stream, fake_call_->GetVideoSendStreams().front()); |
1713 EXPECT_EQ(2, stream->GetNumberOfSwappedFrames()); | 1711 EXPECT_EQ(2, stream->GetNumberOfSwappedFrames()); |
1714 | 1712 |
1715 encoder_config = stream->GetEncoderConfig().Copy(); | 1713 encoder_config = stream->GetEncoderConfig(); |
1716 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1714 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
1717 encoder_config.content_type); | 1715 encoder_config.content_type); |
1718 | 1716 |
1719 /* Switch back. */ | 1717 /* Switch back. */ |
1720 video_options.is_screencast = rtc::Optional<bool>(false); | 1718 video_options.is_screencast = rtc::Optional<bool>(false); |
1721 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, &video_options, &capturer)); | 1719 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, &video_options, &capturer)); |
1722 | 1720 |
1723 EXPECT_TRUE(capturer.CaptureFrame()); | 1721 EXPECT_TRUE(capturer.CaptureFrame()); |
1724 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); | 1722 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); |
1725 ASSERT_EQ(stream, fake_call_->GetVideoSendStreams().front()); | 1723 ASSERT_EQ(stream, fake_call_->GetVideoSendStreams().front()); |
1726 EXPECT_EQ(3, stream->GetNumberOfSwappedFrames()); | 1724 EXPECT_EQ(3, stream->GetNumberOfSwappedFrames()); |
1727 | 1725 |
1728 encoder_config = stream->GetEncoderConfig().Copy(); | 1726 encoder_config = stream->GetEncoderConfig(); |
1729 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, | 1727 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, |
1730 encoder_config.content_type); | 1728 encoder_config.content_type); |
1731 | 1729 |
1732 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, nullptr)); | 1730 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, nullptr)); |
1733 } | 1731 } |
1734 | 1732 |
1735 TEST_F(WebRtcVideoChannel2Test, | 1733 TEST_F(WebRtcVideoChannel2Test, |
1736 ConferenceModeScreencastConfiguresTemporalLayer) { | 1734 ConferenceModeScreencastConfiguresTemporalLayer) { |
1737 static const int kConferenceScreencastTemporalBitrateBps = | 1735 static const int kConferenceScreencastTemporalBitrateBps = |
1738 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; | 1736 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; |
1739 send_parameters_.conference_mode = true; | 1737 send_parameters_.conference_mode = true; |
1740 channel_->SetSendParameters(send_parameters_); | 1738 channel_->SetSendParameters(send_parameters_); |
1741 | 1739 |
1742 AddSendStream(); | 1740 AddSendStream(); |
1743 VideoOptions options; | 1741 VideoOptions options; |
1744 options.is_screencast = rtc::Optional<bool>(true); | 1742 options.is_screencast = rtc::Optional<bool>(true); |
1745 cricket::FakeVideoCapturer capturer; | 1743 cricket::FakeVideoCapturer capturer; |
1746 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options, &capturer)); | 1744 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options, &capturer)); |
1747 cricket::VideoFormat capture_format_hd = | 1745 cricket::VideoFormat capture_format_hd = |
1748 capturer.GetSupportedFormats()->front(); | 1746 capturer.GetSupportedFormats()->front(); |
1749 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1747 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
1750 | 1748 |
1751 EXPECT_TRUE(channel_->SetSend(true)); | 1749 EXPECT_TRUE(channel_->SetSend(true)); |
1752 | 1750 |
1753 EXPECT_TRUE(capturer.CaptureFrame()); | 1751 EXPECT_TRUE(capturer.CaptureFrame()); |
1754 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1752 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
1755 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1753 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
1756 | 1754 |
1757 webrtc::VideoEncoderConfig encoder_config = | 1755 webrtc::VideoEncoderConfig encoder_config = send_stream->GetEncoderConfig(); |
1758 send_stream->GetEncoderConfig().Copy(); | |
1759 | 1756 |
1760 // Verify screencast settings. | 1757 // Verify screencast settings. |
1761 encoder_config = send_stream->GetEncoderConfig().Copy(); | 1758 encoder_config = send_stream->GetEncoderConfig(); |
1762 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1759 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
1763 encoder_config.content_type); | 1760 encoder_config.content_type); |
1764 ASSERT_EQ(1u, encoder_config.streams.size()); | 1761 ASSERT_EQ(1u, encoder_config.streams.size()); |
1765 ASSERT_EQ(1u, encoder_config.streams[0].temporal_layer_thresholds_bps.size()); | 1762 ASSERT_EQ(1u, encoder_config.streams[0].temporal_layer_thresholds_bps.size()); |
1766 EXPECT_EQ(kConferenceScreencastTemporalBitrateBps, | 1763 EXPECT_EQ(kConferenceScreencastTemporalBitrateBps, |
1767 encoder_config.streams[0].temporal_layer_thresholds_bps[0]); | 1764 encoder_config.streams[0].temporal_layer_thresholds_bps[0]); |
1768 | 1765 |
1769 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); | 1766 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); |
1770 } | 1767 } |
1771 | 1768 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 | 2303 |
2307 VideoCodec codec; | 2304 VideoCodec codec; |
2308 EXPECT_TRUE(channel_->GetSendCodec(&codec)); | 2305 EXPECT_TRUE(channel_->GetSendCodec(&codec)); |
2309 EXPECT_TRUE(codec.Matches(engine_.codecs()[0])); | 2306 EXPECT_TRUE(codec.Matches(engine_.codecs()[0])); |
2310 | 2307 |
2311 // Using a RTX setup to verify that the default RTX payload type is good. | 2308 // Using a RTX setup to verify that the default RTX payload type is good. |
2312 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); | 2309 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); |
2313 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); | 2310 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); |
2314 FakeVideoSendStream* stream = AddSendStream( | 2311 FakeVideoSendStream* stream = AddSendStream( |
2315 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); | 2312 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); |
2316 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2313 webrtc::VideoSendStream::Config config = stream->GetConfig(); |
2317 | 2314 |
2318 // Make sure NACK and FEC are enabled on the correct payload types. | 2315 // Make sure NACK and FEC are enabled on the correct payload types. |
2319 EXPECT_EQ(1000, config.rtp.nack.rtp_history_ms); | 2316 EXPECT_EQ(1000, config.rtp.nack.rtp_history_ms); |
2320 EXPECT_EQ(default_ulpfec_codec_.id, config.rtp.fec.ulpfec_payload_type); | 2317 EXPECT_EQ(default_ulpfec_codec_.id, config.rtp.fec.ulpfec_payload_type); |
2321 EXPECT_EQ(default_red_codec_.id, config.rtp.fec.red_payload_type); | 2318 EXPECT_EQ(default_red_codec_.id, config.rtp.fec.red_payload_type); |
2322 | 2319 |
2323 EXPECT_EQ(1u, config.rtp.rtx.ssrcs.size()); | 2320 EXPECT_EQ(1u, config.rtp.rtx.ssrcs.size()); |
2324 EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]); | 2321 EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]); |
2325 VerifySendStreamHasRtxTypes(config, default_apt_rtx_types_); | 2322 VerifySendStreamHasRtxTypes(config, default_apt_rtx_types_); |
2326 // TODO(juberti): Check RTCP, PLI, TMMBR. | 2323 // TODO(juberti): Check RTCP, PLI, TMMBR. |
2327 } | 2324 } |
2328 | 2325 |
2329 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) { | 2326 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) { |
2330 cricket::VideoSendParameters parameters; | 2327 cricket::VideoSendParameters parameters; |
2331 parameters.codecs.push_back(kVp8Codec); | 2328 parameters.codecs.push_back(kVp8Codec); |
2332 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2329 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2333 | 2330 |
2334 FakeVideoSendStream* stream = AddSendStream(); | 2331 FakeVideoSendStream* stream = AddSendStream(); |
2335 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2332 webrtc::VideoSendStream::Config config = stream->GetConfig(); |
2336 | 2333 |
2337 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type); | 2334 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type); |
2338 EXPECT_EQ(-1, config.rtp.fec.red_payload_type); | 2335 EXPECT_EQ(-1, config.rtp.fec.red_payload_type); |
2339 } | 2336 } |
2340 | 2337 |
2341 TEST_F(WebRtcVideoChannel2Test, | 2338 TEST_F(WebRtcVideoChannel2Test, |
2342 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) { | 2339 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) { |
2343 cricket::VideoSendParameters parameters; | 2340 cricket::VideoSendParameters parameters; |
2344 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0); | 2341 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0); |
2345 parameters.codecs.push_back(rtx_codec); | 2342 parameters.codecs.push_back(rtx_codec); |
(...skipping 18 matching lines...) Expand all Loading... |
2364 << "RTX without matching video codec should be rejected."; | 2361 << "RTX without matching video codec should be rejected."; |
2365 } | 2362 } |
2366 | 2363 |
2367 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFecDisablesFec) { | 2364 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFecDisablesFec) { |
2368 cricket::VideoSendParameters parameters; | 2365 cricket::VideoSendParameters parameters; |
2369 parameters.codecs.push_back(kVp8Codec); | 2366 parameters.codecs.push_back(kVp8Codec); |
2370 parameters.codecs.push_back(kUlpfecCodec); | 2367 parameters.codecs.push_back(kUlpfecCodec); |
2371 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2368 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2372 | 2369 |
2373 FakeVideoSendStream* stream = AddSendStream(); | 2370 FakeVideoSendStream* stream = AddSendStream(); |
2374 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2371 webrtc::VideoSendStream::Config config = stream->GetConfig(); |
2375 | 2372 |
2376 EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type); | 2373 EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type); |
2377 | 2374 |
2378 parameters.codecs.pop_back(); | 2375 parameters.codecs.pop_back(); |
2379 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2376 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2380 stream = fake_call_->GetVideoSendStreams()[0]; | 2377 stream = fake_call_->GetVideoSendStreams()[0]; |
2381 ASSERT_TRUE(stream != NULL); | 2378 ASSERT_TRUE(stream != NULL); |
2382 config = stream->GetConfig().Copy(); | 2379 config = stream->GetConfig(); |
2383 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type) | 2380 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type) |
2384 << "SetSendCodec without FEC should disable current FEC."; | 2381 << "SetSendCodec without FEC should disable current FEC."; |
2385 } | 2382 } |
2386 | 2383 |
2387 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsChangesExistingStreams) { | 2384 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsChangesExistingStreams) { |
2388 cricket::VideoSendParameters parameters; | 2385 cricket::VideoSendParameters parameters; |
2389 parameters.codecs.push_back(kVp8Codec720p); | 2386 parameters.codecs.push_back(kVp8Codec720p); |
2390 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2387 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2391 channel_->SetSend(true); | 2388 channel_->SetSend(true); |
2392 | 2389 |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3851 } | 3848 } |
3852 | 3849 |
3853 // Test that we normalize send codec format size in simulcast. | 3850 // Test that we normalize send codec format size in simulcast. |
3854 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3851 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3855 cricket::VideoCodec codec(kVp8Codec270p); | 3852 cricket::VideoCodec codec(kVp8Codec270p); |
3856 codec.width += 1; | 3853 codec.width += 1; |
3857 codec.height += 1; | 3854 codec.height += 1; |
3858 VerifySimulcastSettings(codec, 2, 2); | 3855 VerifySimulcastSettings(codec, 2, 2); |
3859 } | 3856 } |
3860 } // namespace cricket | 3857 } // namespace cricket |
OLD | NEW |