| 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 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 | 2054 |
| 2055 FakeVideoReceiveStream* stream = AddRecvStream(); | 2055 FakeVideoReceiveStream* stream = AddRecvStream(); |
| 2056 cricket::FakeVideoRenderer renderer; | 2056 cricket::FakeVideoRenderer renderer; |
| 2057 EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer)); | 2057 EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer)); |
| 2058 | 2058 |
| 2059 webrtc::VideoFrame video_frame; | 2059 webrtc::VideoFrame video_frame; |
| 2060 CreateBlackFrame(&video_frame, 4, 4); | 2060 CreateBlackFrame(&video_frame, 4, 4); |
| 2061 video_frame.set_timestamp(kInitialTimestamp); | 2061 video_frame.set_timestamp(kInitialTimestamp); |
| 2062 // Initial NTP time is not available on the first frame, but should still be | 2062 // Initial NTP time is not available on the first frame, but should still be |
| 2063 // able to be estimated. | 2063 // able to be estimated. |
| 2064 stream->InjectFrame(video_frame, 0); | 2064 stream->InjectFrame(video_frame); |
| 2065 | 2065 |
| 2066 EXPECT_EQ(1, renderer.num_rendered_frames()); | 2066 EXPECT_EQ(1, renderer.num_rendered_frames()); |
| 2067 | 2067 |
| 2068 // This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which | 2068 // This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which |
| 2069 // triggers a constant-overflow warning, hence we're calculating it explicitly | 2069 // triggers a constant-overflow warning, hence we're calculating it explicitly |
| 2070 // here. | 2070 // here. |
| 2071 video_frame.set_timestamp(kFrameOffsetMs * 90 - 1); | 2071 video_frame.set_timestamp(kFrameOffsetMs * 90 - 1); |
| 2072 video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs); | 2072 video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs); |
| 2073 stream->InjectFrame(video_frame, 0); | 2073 stream->InjectFrame(video_frame); |
| 2074 | 2074 |
| 2075 EXPECT_EQ(2, renderer.num_rendered_frames()); | 2075 EXPECT_EQ(2, renderer.num_rendered_frames()); |
| 2076 | 2076 |
| 2077 // Verify that NTP time has been correctly deduced. | 2077 // Verify that NTP time has been correctly deduced. |
| 2078 cricket::VideoMediaInfo info; | 2078 cricket::VideoMediaInfo info; |
| 2079 ASSERT_TRUE(channel_->GetStats(&info)); | 2079 ASSERT_TRUE(channel_->GetStats(&info)); |
| 2080 ASSERT_EQ(1u, info.receivers.size()); | 2080 ASSERT_EQ(1u, info.receivers.size()); |
| 2081 EXPECT_EQ(kInitialNtpTimeMs, info.receivers[0].capture_start_ntp_time_ms); | 2081 EXPECT_EQ(kInitialNtpTimeMs, info.receivers[0].capture_start_ntp_time_ms); |
| 2082 } | 2082 } |
| 2083 | 2083 |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3392 } | 3392 } |
| 3393 | 3393 |
| 3394 // Test that we normalize send codec format size in simulcast. | 3394 // Test that we normalize send codec format size in simulcast. |
| 3395 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3395 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
| 3396 cricket::VideoCodec codec(kVp8Codec270p); | 3396 cricket::VideoCodec codec(kVp8Codec270p); |
| 3397 codec.width += 1; | 3397 codec.width += 1; |
| 3398 codec.height += 1; | 3398 codec.height += 1; |
| 3399 VerifySimulcastSettings(codec, 2, 2); | 3399 VerifySimulcastSettings(codec, 2, 2); |
| 3400 } | 3400 } |
| 3401 } // namespace cricket | 3401 } // namespace cricket |
| OLD | NEW |