OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> // max | 10 #include <algorithm> // max |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 } | 1216 } |
1217 | 1217 |
1218 enum TestState { | 1218 enum TestState { |
1219 kBeforeSuspend, | 1219 kBeforeSuspend, |
1220 kDuringSuspend, | 1220 kDuringSuspend, |
1221 kWaitingForPacket, | 1221 kWaitingForPacket, |
1222 kWaitingForStats | 1222 kWaitingForStats |
1223 }; | 1223 }; |
1224 | 1224 |
1225 virtual void SendRtcpFeedback(int remb_value) | 1225 virtual void SendRtcpFeedback(int remb_value) |
1226 EXCLUSIVE_LOCKS_REQUIRED(crit_) { | 1226 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) { |
1227 FakeReceiveStatistics receive_stats(kVideoSendSsrcs[0], | 1227 FakeReceiveStatistics receive_stats(kVideoSendSsrcs[0], |
1228 last_sequence_number_, rtp_count_, 0); | 1228 last_sequence_number_, rtp_count_, 0); |
1229 RTCPSender rtcp_sender(false, clock_, &receive_stats, nullptr, nullptr, | 1229 RTCPSender rtcp_sender(false, clock_, &receive_stats, nullptr, nullptr, |
1230 transport_adapter_.get()); | 1230 transport_adapter_.get()); |
1231 | 1231 |
1232 rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize); | 1232 rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize); |
1233 rtcp_sender.SetRemoteSSRC(kVideoSendSsrcs[0]); | 1233 rtcp_sender.SetRemoteSSRC(kVideoSendSsrcs[0]); |
1234 if (remb_value > 0) { | 1234 if (remb_value > 0) { |
1235 rtcp_sender.SetREMBStatus(true); | 1235 rtcp_sender.SetREMBStatus(true); |
1236 rtcp_sender.SetREMBData(remb_value, std::vector<uint32_t>()); | 1236 rtcp_sender.SetREMBData(remb_value, std::vector<uint32_t>()); |
1237 } | 1237 } |
1238 RTCPSender::FeedbackState feedback_state; | 1238 RTCPSender::FeedbackState feedback_state; |
1239 EXPECT_EQ(0, rtcp_sender.SendRTCP(feedback_state, kRtcpRr)); | 1239 EXPECT_EQ(0, rtcp_sender.SendRTCP(feedback_state, kRtcpRr)); |
1240 } | 1240 } |
1241 | 1241 |
1242 std::unique_ptr<internal::TransportAdapter> transport_adapter_; | 1242 std::unique_ptr<internal::TransportAdapter> transport_adapter_; |
1243 Clock* const clock_; | 1243 Clock* const clock_; |
1244 VideoSendStream* stream_; | 1244 VideoSendStream* stream_; |
1245 | 1245 |
1246 rtc::CriticalSection crit_; | 1246 rtc::CriticalSection crit_; |
1247 TestState test_state_ GUARDED_BY(crit_); | 1247 TestState test_state_ RTC_GUARDED_BY(crit_); |
1248 int rtp_count_ GUARDED_BY(crit_); | 1248 int rtp_count_ RTC_GUARDED_BY(crit_); |
1249 int last_sequence_number_ GUARDED_BY(crit_); | 1249 int last_sequence_number_ RTC_GUARDED_BY(crit_); |
1250 int suspended_frame_count_ GUARDED_BY(crit_); | 1250 int suspended_frame_count_ RTC_GUARDED_BY(crit_); |
1251 int low_remb_bps_ GUARDED_BY(crit_); | 1251 int low_remb_bps_ RTC_GUARDED_BY(crit_); |
1252 int high_remb_bps_ GUARDED_BY(crit_); | 1252 int high_remb_bps_ RTC_GUARDED_BY(crit_); |
1253 } test; | 1253 } test; |
1254 | 1254 |
1255 RunBaseTest(&test); | 1255 RunBaseTest(&test); |
1256 } | 1256 } |
1257 | 1257 |
1258 // This test that padding stops being send after a while if the Camera stops | 1258 // This test that padding stops being send after a while if the Camera stops |
1259 // producing video frames and that padding resumes if the camera restarts. | 1259 // producing video frames and that padding resumes if the camera restarts. |
1260 TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) { | 1260 TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) { |
1261 class NoPaddingWhenVideoIsMuted : public test::SendTest { | 1261 class NoPaddingWhenVideoIsMuted : public test::SendTest { |
1262 public: | 1262 public: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 kBeforeStopCapture, | 1319 kBeforeStopCapture, |
1320 kWaitingForPadding, | 1320 kWaitingForPadding, |
1321 kWaitingForNoPackets, | 1321 kWaitingForNoPackets, |
1322 kWaitingForPaddingAfterCameraRestart | 1322 kWaitingForPaddingAfterCameraRestart |
1323 }; | 1323 }; |
1324 | 1324 |
1325 TestState test_state_ = kBeforeStopCapture; | 1325 TestState test_state_ = kBeforeStopCapture; |
1326 Clock* const clock_; | 1326 Clock* const clock_; |
1327 std::unique_ptr<internal::TransportAdapter> transport_adapter_; | 1327 std::unique_ptr<internal::TransportAdapter> transport_adapter_; |
1328 rtc::CriticalSection crit_; | 1328 rtc::CriticalSection crit_; |
1329 int64_t last_packet_time_ms_ GUARDED_BY(crit_); | 1329 int64_t last_packet_time_ms_ RTC_GUARDED_BY(crit_); |
1330 test::FrameGeneratorCapturer* capturer_ GUARDED_BY(crit_); | 1330 test::FrameGeneratorCapturer* capturer_ RTC_GUARDED_BY(crit_); |
1331 } test; | 1331 } test; |
1332 | 1332 |
1333 RunBaseTest(&test); | 1333 RunBaseTest(&test); |
1334 } | 1334 } |
1335 | 1335 |
1336 TEST_F(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) { | 1336 TEST_F(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) { |
1337 const int kCapacityKbps = 10000; // 10 Mbps | 1337 const int kCapacityKbps = 10000; // 10 Mbps |
1338 class PaddingIsPrimarilyRetransmissions : public test::EndToEndTest { | 1338 class PaddingIsPrimarilyRetransmissions : public test::EndToEndTest { |
1339 public: | 1339 public: |
1340 PaddingIsPrimarilyRetransmissions() | 1340 PaddingIsPrimarilyRetransmissions() |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 SleepMs(5000); | 1388 SleepMs(5000); |
1389 { | 1389 { |
1390 rtc::CritScope lock(&crit_); | 1390 rtc::CritScope lock(&crit_); |
1391 // Expect padding to be a small percentage of total bytes sent. | 1391 // Expect padding to be a small percentage of total bytes sent. |
1392 EXPECT_LT(padding_length_, .1 * total_length_); | 1392 EXPECT_LT(padding_length_, .1 * total_length_); |
1393 } | 1393 } |
1394 } | 1394 } |
1395 | 1395 |
1396 rtc::CriticalSection crit_; | 1396 rtc::CriticalSection crit_; |
1397 Clock* const clock_; | 1397 Clock* const clock_; |
1398 size_t padding_length_ GUARDED_BY(crit_); | 1398 size_t padding_length_ RTC_GUARDED_BY(crit_); |
1399 size_t total_length_ GUARDED_BY(crit_); | 1399 size_t total_length_ RTC_GUARDED_BY(crit_); |
1400 Call* call_; | 1400 Call* call_; |
1401 } test; | 1401 } test; |
1402 | 1402 |
1403 RunBaseTest(&test); | 1403 RunBaseTest(&test); |
1404 } | 1404 } |
1405 | 1405 |
1406 // This test first observes "high" bitrate use at which point it sends a REMB to | 1406 // This test first observes "high" bitrate use at which point it sends a REMB to |
1407 // indicate that it should be lowered significantly. The test then observes that | 1407 // indicate that it should be lowered significantly. The test then observes that |
1408 // the bitrate observed is sinking well below the min-transmit-bitrate threshold | 1408 // the bitrate observed is sinking well below the min-transmit-bitrate threshold |
1409 // to verify that the min-transmit bitrate respects incoming REMB. | 1409 // to verify that the min-transmit bitrate respects incoming REMB. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 transport_overhead_); | 1627 transport_overhead_); |
1628 }); | 1628 }); |
1629 | 1629 |
1630 EXPECT_TRUE(Wait()); | 1630 EXPECT_TRUE(Wait()); |
1631 } | 1631 } |
1632 | 1632 |
1633 private: | 1633 private: |
1634 test::SingleThreadedTaskQueueForTesting* const task_queue_; | 1634 test::SingleThreadedTaskQueueForTesting* const task_queue_; |
1635 Call* call_; | 1635 Call* call_; |
1636 rtc::CriticalSection lock_; | 1636 rtc::CriticalSection lock_; |
1637 int packets_sent_ GUARDED_BY(lock_); | 1637 int packets_sent_ RTC_GUARDED_BY(lock_); |
1638 int transport_overhead_; | 1638 int transport_overhead_; |
1639 const size_t kMaxRtpPacketSize = 1000; | 1639 const size_t kMaxRtpPacketSize = 1000; |
1640 } test(&task_queue_); | 1640 } test(&task_queue_); |
1641 | 1641 |
1642 RunBaseTest(&test); | 1642 RunBaseTest(&test); |
1643 } | 1643 } |
1644 | 1644 |
1645 // Test class takes takes as argument a switch selecting if type switch should | 1645 // Test class takes takes as argument a switch selecting if type switch should |
1646 // occur and a function pointer to reset the send stream. This is necessary | 1646 // occur and a function pointer to reset the send stream. This is necessary |
1647 // since you cannot change the content type of a VideoSendStream, you need to | 1647 // since you cannot change the content type of a VideoSendStream, you need to |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 | 1735 |
1736 private: | 1736 private: |
1737 bool RunningWithoutPadding() const { | 1737 bool RunningWithoutPadding() const { |
1738 rtc::CritScope lock(&crit_); | 1738 rtc::CritScope lock(&crit_); |
1739 return running_without_padding_; | 1739 return running_without_padding_; |
1740 } | 1740 } |
1741 | 1741 |
1742 rtc::CriticalSection crit_; | 1742 rtc::CriticalSection crit_; |
1743 rtc::Event content_switch_event_; | 1743 rtc::Event content_switch_event_; |
1744 Call* call_; | 1744 Call* call_; |
1745 VideoSendStream* send_stream_ GUARDED_BY(crit_); | 1745 VideoSendStream* send_stream_ RTC_GUARDED_BY(crit_); |
1746 VideoSendStream::Config send_stream_config_; | 1746 VideoSendStream::Config send_stream_config_; |
1747 VideoEncoderConfig encoder_config_; | 1747 VideoEncoderConfig encoder_config_; |
1748 uint32_t packets_sent_ GUARDED_BY(crit_); | 1748 uint32_t packets_sent_ RTC_GUARDED_BY(crit_); |
1749 bool running_without_padding_; | 1749 bool running_without_padding_; |
1750 T* const stream_resetter_; | 1750 T* const stream_resetter_; |
1751 }; | 1751 }; |
1752 | 1752 |
1753 TEST_F(VideoSendStreamTest, RespectsMinTransmitBitrate) { | 1753 TEST_F(VideoSendStreamTest, RespectsMinTransmitBitrate) { |
1754 auto reset_fun = [](const VideoSendStream::Config& send_stream_config, | 1754 auto reset_fun = [](const VideoSendStream::Config& send_stream_config, |
1755 const VideoEncoderConfig& encoder_config) {}; | 1755 const VideoEncoderConfig& encoder_config) {}; |
1756 MaxPaddingSetTest<decltype(reset_fun)> test(false, &reset_fun); | 1756 MaxPaddingSetTest<decltype(reset_fun)> test(false, &reset_fun); |
1757 RunBaseTest(&test); | 1757 RunBaseTest(&test); |
1758 } | 1758 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 int32_t Encode(const VideoFrame& input_image, | 1826 int32_t Encode(const VideoFrame& input_image, |
1827 const CodecSpecificInfo* codec_specific_info, | 1827 const CodecSpecificInfo* codec_specific_info, |
1828 const std::vector<FrameType>* frame_types) override { | 1828 const std::vector<FrameType>* frame_types) override { |
1829 ADD_FAILURE() | 1829 ADD_FAILURE() |
1830 << "Unexpected Encode call since the send stream is not started"; | 1830 << "Unexpected Encode call since the send stream is not started"; |
1831 return 0; | 1831 return 0; |
1832 } | 1832 } |
1833 | 1833 |
1834 rtc::CriticalSection crit_; | 1834 rtc::CriticalSection crit_; |
1835 rtc::Event init_encode_called_; | 1835 rtc::Event init_encode_called_; |
1836 size_t number_of_initializations_ GUARDED_BY(&crit_); | 1836 size_t number_of_initializations_ RTC_GUARDED_BY(&crit_); |
1837 int last_initialized_frame_width_ GUARDED_BY(&crit_); | 1837 int last_initialized_frame_width_ RTC_GUARDED_BY(&crit_); |
1838 int last_initialized_frame_height_ GUARDED_BY(&crit_); | 1838 int last_initialized_frame_height_ RTC_GUARDED_BY(&crit_); |
1839 }; | 1839 }; |
1840 | 1840 |
1841 test::NullTransport transport; | 1841 test::NullTransport transport; |
1842 EncoderObserver encoder; | 1842 EncoderObserver encoder; |
1843 | 1843 |
1844 task_queue_.SendTask([this, &transport, &encoder]() { | 1844 task_queue_.SendTask([this, &transport, &encoder]() { |
1845 CreateSenderCall(Call::Config(event_log_.get())); | 1845 CreateSenderCall(Call::Config(event_log_.get())); |
1846 CreateSendConfig(1, 0, 0, &transport); | 1846 CreateSendConfig(1, 0, 0, &transport); |
1847 video_send_config_.encoder_settings.encoder = &encoder; | 1847 video_send_config_.encoder_settings.encoder = &encoder; |
1848 CreateVideoStreams(); | 1848 CreateVideoStreams(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 } | 1895 } |
1896 | 1896 |
1897 bool WaitForStartBitrate() { | 1897 bool WaitForStartBitrate() { |
1898 return start_bitrate_changed_.Wait( | 1898 return start_bitrate_changed_.Wait( |
1899 VideoSendStreamTest::kDefaultTimeoutMs); | 1899 VideoSendStreamTest::kDefaultTimeoutMs); |
1900 } | 1900 } |
1901 | 1901 |
1902 private: | 1902 private: |
1903 rtc::CriticalSection crit_; | 1903 rtc::CriticalSection crit_; |
1904 rtc::Event start_bitrate_changed_; | 1904 rtc::Event start_bitrate_changed_; |
1905 int start_bitrate_kbps_ GUARDED_BY(crit_); | 1905 int start_bitrate_kbps_ RTC_GUARDED_BY(crit_); |
1906 }; | 1906 }; |
1907 | 1907 |
1908 CreateSenderCall(Call::Config(event_log_.get())); | 1908 CreateSenderCall(Call::Config(event_log_.get())); |
1909 | 1909 |
1910 test::NullTransport transport; | 1910 test::NullTransport transport; |
1911 CreateSendConfig(1, 0, 0, &transport); | 1911 CreateSendConfig(1, 0, 0, &transport); |
1912 | 1912 |
1913 Call::Config::BitrateConfig bitrate_config; | 1913 Call::Config::BitrateConfig bitrate_config; |
1914 bitrate_config.start_bitrate_bps = 2 * video_encoder_config_.max_bitrate_bps; | 1914 bitrate_config.start_bitrate_bps = 2 * video_encoder_config_.max_bitrate_bps; |
1915 sender_call_->SetBitrateConfig(bitrate_config); | 1915 sender_call_->SetBitrateConfig(bitrate_config); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 return true; | 1985 return true; |
1986 } | 1986 } |
1987 } while (bitrate_changed_.Wait(VideoSendStreamTest::kDefaultTimeoutMs)); | 1987 } while (bitrate_changed_.Wait(VideoSendStreamTest::kDefaultTimeoutMs)); |
1988 return false; | 1988 return false; |
1989 } | 1989 } |
1990 | 1990 |
1991 private: | 1991 private: |
1992 rtc::CriticalSection crit_; | 1992 rtc::CriticalSection crit_; |
1993 rtc::Event encoder_init_; | 1993 rtc::Event encoder_init_; |
1994 rtc::Event bitrate_changed_; | 1994 rtc::Event bitrate_changed_; |
1995 rtc::Optional<int> bitrate_kbps_ GUARDED_BY(crit_); | 1995 rtc::Optional<int> bitrate_kbps_ RTC_GUARDED_BY(crit_); |
1996 }; | 1996 }; |
1997 | 1997 |
1998 test::NullTransport transport; | 1998 test::NullTransport transport; |
1999 StartStopBitrateObserver encoder; | 1999 StartStopBitrateObserver encoder; |
2000 | 2000 |
2001 task_queue_.SendTask([this, &transport, &encoder]() { | 2001 task_queue_.SendTask([this, &transport, &encoder]() { |
2002 CreateSenderCall(Call::Config(event_log_.get())); | 2002 CreateSenderCall(Call::Config(event_log_.get())); |
2003 CreateSendConfig(1, 0, 0, &transport); | 2003 CreateSendConfig(1, 0, 0, &transport); |
2004 | 2004 |
2005 sender_call_->SignalChannelNetworkState(MediaType::VIDEO, kNetworkUp); | 2005 sender_call_->SignalChannelNetworkState(MediaType::VIDEO, kNetworkUp); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 stream_->Start(); | 2237 stream_->Start(); |
2238 }); | 2238 }); |
2239 | 2239 |
2240 // Sanity check, make sure we still encode frames with this encoder. | 2240 // Sanity check, make sure we still encode frames with this encoder. |
2241 EXPECT_TRUE(Wait()) << "Timed out while waiting for Encode."; | 2241 EXPECT_TRUE(Wait()) << "Timed out while waiting for Encode."; |
2242 } | 2242 } |
2243 | 2243 |
2244 test::SingleThreadedTaskQueueForTesting* const task_queue_; | 2244 test::SingleThreadedTaskQueueForTesting* const task_queue_; |
2245 rtc::CriticalSection crit_; | 2245 rtc::CriticalSection crit_; |
2246 VideoSendStream* stream_; | 2246 VideoSendStream* stream_; |
2247 bool initialized_ GUARDED_BY(crit_); | 2247 bool initialized_ RTC_GUARDED_BY(crit_); |
2248 bool callback_registered_ GUARDED_BY(crit_); | 2248 bool callback_registered_ RTC_GUARDED_BY(crit_); |
2249 size_t num_releases_ GUARDED_BY(crit_); | 2249 size_t num_releases_ RTC_GUARDED_BY(crit_); |
2250 bool released_ GUARDED_BY(crit_); | 2250 bool released_ RTC_GUARDED_BY(crit_); |
2251 VideoEncoderConfig encoder_config_; | 2251 VideoEncoderConfig encoder_config_; |
2252 } test_encoder(&task_queue_); | 2252 } test_encoder(&task_queue_); |
2253 | 2253 |
2254 RunBaseTest(&test_encoder); | 2254 RunBaseTest(&test_encoder); |
2255 | 2255 |
2256 EXPECT_TRUE(test_encoder.IsReleased()); | 2256 EXPECT_TRUE(test_encoder.IsReleased()); |
2257 EXPECT_EQ(1u, test_encoder.num_releases()); | 2257 EXPECT_EQ(1u, test_encoder.num_releases()); |
2258 } | 2258 } |
2259 | 2259 |
2260 TEST_F(VideoSendStreamTest, EncoderSetupPropagatesCommonEncoderConfigValues) { | 2260 TEST_F(VideoSendStreamTest, EncoderSetupPropagatesCommonEncoderConfigValues) { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 } | 2550 } |
2551 | 2551 |
2552 return SEND_PACKET; | 2552 return SEND_PACKET; |
2553 } | 2553 } |
2554 | 2554 |
2555 void PerformTest() override { | 2555 void PerformTest() override { |
2556 EXPECT_TRUE(Wait()) << "Timed out while waiting for RTCP sender report."; | 2556 EXPECT_TRUE(Wait()) << "Timed out while waiting for RTCP sender report."; |
2557 } | 2557 } |
2558 | 2558 |
2559 rtc::CriticalSection crit_; | 2559 rtc::CriticalSection crit_; |
2560 size_t rtp_packets_sent_ GUARDED_BY(&crit_); | 2560 size_t rtp_packets_sent_ RTC_GUARDED_BY(&crit_); |
2561 size_t media_bytes_sent_ GUARDED_BY(&crit_); | 2561 size_t media_bytes_sent_ RTC_GUARDED_BY(&crit_); |
2562 } test; | 2562 } test; |
2563 | 2563 |
2564 RunBaseTest(&test); | 2564 RunBaseTest(&test); |
2565 } | 2565 } |
2566 | 2566 |
2567 TEST_F(VideoSendStreamTest, TranslatesTwoLayerScreencastToTargetBitrate) { | 2567 TEST_F(VideoSendStreamTest, TranslatesTwoLayerScreencastToTargetBitrate) { |
2568 static const int kScreencastTargetBitrateKbps = 200; | 2568 static const int kScreencastTargetBitrateKbps = 200; |
2569 | 2569 |
2570 class VideoStreamFactory | 2570 class VideoStreamFactory |
2571 : public VideoEncoderConfig::VideoStreamFactoryInterface { | 2571 : public VideoEncoderConfig::VideoStreamFactoryInterface { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2785 << "Encoder should have been reconfigured with the new value."; | 2785 << "Encoder should have been reconfigured with the new value."; |
2786 // Expected target bitrate is the start bitrate set in the call to | 2786 // Expected target bitrate is the start bitrate set in the call to |
2787 // call_->SetBitrateConfig. | 2787 // call_->SetBitrateConfig. |
2788 WaitForSetRates(kIncreasedStartBitrateKbps); | 2788 WaitForSetRates(kIncreasedStartBitrateKbps); |
2789 } | 2789 } |
2790 | 2790 |
2791 test::SingleThreadedTaskQueueForTesting* const task_queue_; | 2791 test::SingleThreadedTaskQueueForTesting* const task_queue_; |
2792 rtc::Event init_encode_event_; | 2792 rtc::Event init_encode_event_; |
2793 rtc::Event bitrate_changed_event_; | 2793 rtc::Event bitrate_changed_event_; |
2794 rtc::CriticalSection crit_; | 2794 rtc::CriticalSection crit_; |
2795 uint32_t target_bitrate_ GUARDED_BY(&crit_); | 2795 uint32_t target_bitrate_ RTC_GUARDED_BY(&crit_); |
2796 | 2796 |
2797 int num_initializations_; | 2797 int num_initializations_; |
2798 webrtc::Call* call_; | 2798 webrtc::Call* call_; |
2799 webrtc::VideoSendStream* send_stream_; | 2799 webrtc::VideoSendStream* send_stream_; |
2800 webrtc::VideoEncoderConfig encoder_config_; | 2800 webrtc::VideoEncoderConfig encoder_config_; |
2801 } test(&task_queue_); | 2801 } test(&task_queue_); |
2802 | 2802 |
2803 RunBaseTest(&test); | 2803 RunBaseTest(&test); |
2804 } | 2804 } |
2805 | 2805 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3450 { | 3450 { |
3451 rtc::CritScope lock(&crit_); | 3451 rtc::CritScope lock(&crit_); |
3452 EXPECT_LE(max_bitrate_bps_, 57760u); | 3452 EXPECT_LE(max_bitrate_bps_, 57760u); |
3453 } | 3453 } |
3454 } | 3454 } |
3455 | 3455 |
3456 private: | 3456 private: |
3457 test::SingleThreadedTaskQueueForTesting* const task_queue_; | 3457 test::SingleThreadedTaskQueueForTesting* const task_queue_; |
3458 Call* call_; | 3458 Call* call_; |
3459 rtc::CriticalSection crit_; | 3459 rtc::CriticalSection crit_; |
3460 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); | 3460 uint32_t max_bitrate_bps_ RTC_GUARDED_BY(&crit_); |
3461 bool first_packet_sent_ GUARDED_BY(&crit_); | 3461 bool first_packet_sent_ RTC_GUARDED_BY(&crit_); |
3462 rtc::Event bitrate_changed_event_; | 3462 rtc::Event bitrate_changed_event_; |
3463 } test(&task_queue_); | 3463 } test(&task_queue_); |
3464 RunBaseTest(&test); | 3464 RunBaseTest(&test); |
3465 } | 3465 } |
3466 | 3466 |
3467 TEST_F(VideoSendStreamTest, SendsKeepAlive) { | 3467 TEST_F(VideoSendStreamTest, SendsKeepAlive) { |
3468 const int kTimeoutMs = 50; // Really short timeout for testing. | 3468 const int kTimeoutMs = 50; // Really short timeout for testing. |
3469 | 3469 |
3470 class KeepaliveObserver : public test::SendTest { | 3470 class KeepaliveObserver : public test::SendTest { |
3471 public: | 3471 public: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3504 capturer_ = frame_generator_capturer; | 3504 capturer_ = frame_generator_capturer; |
3505 } | 3505 } |
3506 | 3506 |
3507 test::FrameGeneratorCapturer* capturer_ = nullptr; | 3507 test::FrameGeneratorCapturer* capturer_ = nullptr; |
3508 } test; | 3508 } test; |
3509 | 3509 |
3510 RunBaseTest(&test); | 3510 RunBaseTest(&test); |
3511 } | 3511 } |
3512 | 3512 |
3513 } // namespace webrtc | 3513 } // namespace webrtc |
OLD | NEW |