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