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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1814763002: Cleanup of webrtc::VideoRenderer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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) 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 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after
2014 2014
2015 FakeVideoReceiveStream* stream = AddRecvStream(); 2015 FakeVideoReceiveStream* stream = AddRecvStream();
2016 cricket::FakeVideoRenderer renderer; 2016 cricket::FakeVideoRenderer renderer;
2017 EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer)); 2017 EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer));
2018 2018
2019 webrtc::VideoFrame video_frame; 2019 webrtc::VideoFrame video_frame;
2020 CreateBlackFrame(&video_frame, 4, 4); 2020 CreateBlackFrame(&video_frame, 4, 4);
2021 video_frame.set_timestamp(kInitialTimestamp); 2021 video_frame.set_timestamp(kInitialTimestamp);
2022 // Initial NTP time is not available on the first frame, but should still be 2022 // Initial NTP time is not available on the first frame, but should still be
2023 // able to be estimated. 2023 // able to be estimated.
2024 stream->InjectFrame(video_frame, 0); 2024 stream->InjectFrame(video_frame);
2025 2025
2026 EXPECT_EQ(1, renderer.num_rendered_frames()); 2026 EXPECT_EQ(1, renderer.num_rendered_frames());
2027 2027
2028 // This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which 2028 // This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which
2029 // triggers a constant-overflow warning, hence we're calculating it explicitly 2029 // triggers a constant-overflow warning, hence we're calculating it explicitly
2030 // here. 2030 // here.
2031 video_frame.set_timestamp(kFrameOffsetMs * 90 - 1); 2031 video_frame.set_timestamp(kFrameOffsetMs * 90 - 1);
2032 video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs); 2032 video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs);
2033 stream->InjectFrame(video_frame, 0); 2033 stream->InjectFrame(video_frame);
2034 2034
2035 EXPECT_EQ(2, renderer.num_rendered_frames()); 2035 EXPECT_EQ(2, renderer.num_rendered_frames());
2036 2036
2037 // Verify that NTP time has been correctly deduced. 2037 // Verify that NTP time has been correctly deduced.
2038 cricket::VideoMediaInfo info; 2038 cricket::VideoMediaInfo info;
2039 ASSERT_TRUE(channel_->GetStats(&info)); 2039 ASSERT_TRUE(channel_->GetStats(&info));
2040 ASSERT_EQ(1u, info.receivers.size()); 2040 ASSERT_EQ(1u, info.receivers.size());
2041 EXPECT_EQ(kInitialNtpTimeMs, info.receivers[0].capture_start_ntp_time_ms); 2041 EXPECT_EQ(kInitialNtpTimeMs, info.receivers[0].capture_start_ntp_time_ms);
2042 } 2042 }
2043 2043
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 } 3292 }
3293 3293
3294 // Test that we normalize send codec format size in simulcast. 3294 // Test that we normalize send codec format size in simulcast.
3295 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3295 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3296 cricket::VideoCodec codec(kVp8Codec270p); 3296 cricket::VideoCodec codec(kVp8Codec270p);
3297 codec.width += 1; 3297 codec.width += 1;
3298 codec.height += 1; 3298 codec.height += 1;
3299 VerifySimulcastSettings(codec, 2, 2); 3299 VerifySimulcastSettings(codec, 2, 2);
3300 } 3300 }
3301 } // namespace cricket 3301 } // namespace cricket
3302
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698