Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 2853503002: Dont request keyframes if the stream is inactive or if we are currently receiving a keyframe. (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 10 #include <algorithm>
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 test::PacketTransport* receive_transport_; 2222 test::PacketTransport* receive_transport_;
2223 rtc::Event stop_event_; 2223 rtc::Event stop_event_;
2224 rtc::PlatformThread poller_thread_; 2224 rtc::PlatformThread poller_thread_;
2225 TestState state_; 2225 TestState state_;
2226 RateLimiter retransmission_rate_limiter_; 2226 RateLimiter retransmission_rate_limiter_;
2227 } test; 2227 } test;
2228 2228
2229 RunBaseTest(&test); 2229 RunBaseTest(&test);
2230 } 2230 }
2231 2231
2232 TEST_F(EndToEndTest, StopSendingKeyframeRequestsForInactiveStream) {
2233 class KeyframeRequestObserver : public test::EndToEndTest {
2234 public:
2235 KeyframeRequestObserver() : clock_(Clock::GetRealTimeClock()) {}
2236
2237 void OnVideoStreamsCreated(
2238 VideoSendStream* send_stream,
2239 const std::vector<VideoReceiveStream*>& receive_streams) override {
2240 RTC_DCHECK_EQ(1, receive_streams.size());
2241 send_stream_ = send_stream;
2242 receive_stream_ = receive_streams[0];
2243 }
2244
2245 void PerformTest() override {
2246 bool frame_decoded = false;
2247 int64_t start_time = clock_->TimeInMilliseconds();
2248 while (clock_->TimeInMilliseconds() - start_time <= 5000) {
2249 if (receive_stream_->GetStats().frames_decoded > 0) {
2250 frame_decoded = true;
2251 break;
2252 }
2253 SleepMs(100);
2254 }
2255 ASSERT_TRUE(frame_decoded);
2256 send_stream_->Stop();
2257 SleepMs(10000);
2258 ASSERT_EQ(
2259 1U, receive_stream_->GetStats().rtcp_packet_type_counts.pli_packets);
2260 }
2261
2262 private:
2263 Clock* clock_;
2264 VideoSendStream* send_stream_;
2265 VideoReceiveStream* receive_stream_;
2266 } test;
2267
2268 RunBaseTest(&test);
2269 }
2270
2232 class ProbingTest : public test::EndToEndTest { 2271 class ProbingTest : public test::EndToEndTest {
2233 public: 2272 public:
2234 explicit ProbingTest(int start_bitrate_bps) 2273 explicit ProbingTest(int start_bitrate_bps)
2235 : clock_(Clock::GetRealTimeClock()), 2274 : clock_(Clock::GetRealTimeClock()),
2236 start_bitrate_bps_(start_bitrate_bps), 2275 start_bitrate_bps_(start_bitrate_bps),
2237 state_(0), 2276 state_(0),
2238 sender_call_(nullptr) {} 2277 sender_call_(nullptr) {}
2239 2278
2240 ~ProbingTest() {} 2279 ~ProbingTest() {}
2241 2280
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after
4470 std::unique_ptr<VideoEncoder> encoder_; 4509 std::unique_ptr<VideoEncoder> encoder_;
4471 std::unique_ptr<VideoDecoder> decoder_; 4510 std::unique_ptr<VideoDecoder> decoder_;
4472 rtc::CriticalSection crit_; 4511 rtc::CriticalSection crit_;
4473 int recorded_frames_ GUARDED_BY(crit_); 4512 int recorded_frames_ GUARDED_BY(crit_);
4474 } test(this); 4513 } test(this);
4475 4514
4476 RunBaseTest(&test); 4515 RunBaseTest(&test);
4477 } 4516 }
4478 4517
4479 } // namespace webrtc 4518 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/video_packet_buffer_unittest.cc ('k') | webrtc/video/rtp_stream_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698