OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1268 if (delta > 100) { | 1268 if (delta > 100) { |
1269 EXPECT_EQ(kNewDelay - kTargetPlayoutDelayMs + kFrameTimerMs, delta); | 1269 EXPECT_EQ(kNewDelay - kTargetPlayoutDelayMs + kFrameTimerMs, delta); |
1270 EXPECT_EQ(0u, jump); | 1270 EXPECT_EQ(0u, jump); |
1271 jump = i; | 1271 jump = i; |
1272 } | 1272 } |
1273 } | 1273 } |
1274 EXPECT_GT(jump, 49u); | 1274 EXPECT_GT(jump, 49u); |
1275 EXPECT_LT(jump, 120u); | 1275 EXPECT_LT(jump, 120u); |
1276 } | 1276 } |
1277 | 1277 |
1278 namespace { | |
1279 | |
1280 void OnEncodedVideoFrame(scoped_ptr<EncodedFrame> encoded_frame) { | |
1281 const uint32_t frame_id = encoded_frame->frame_id; | |
1282 if ((frame_id == 0) || (frame_id == 3)) | |
1283 EXPECT_EQ(encoded_frame->dependency, EncodedFrame::KEY); | |
1284 else | |
1285 EXPECT_EQ(encoded_frame->dependency, EncodedFrame::DEPENDENT); | |
1286 } | |
1287 | |
1288 } // namespace | |
1289 | |
1290 TEST_F(End2EndTest, TestPliGeneratingKeyFrames) { | |
miu
2016/02/29 23:00:45
IMO, we don't need this extra test here. These en
xjz
2016/03/01 01:14:27
Removed this test.
| |
1291 Configure(CODEC_VIDEO_VP8, CODEC_AUDIO_PCM16); | |
1292 Create(); | |
1293 | |
1294 // Enqueue request of 5 frames from the encoder. | |
1295 for (int i = 0; i < 5; ++i) { | |
1296 cast_receiver_->RequestEncodedVideoFrame(base::Bind(&OnEncodedVideoFrame)); | |
1297 } | |
1298 // Encode 3 frames. | |
1299 for (int frame_id = 0; frame_id < 3; ++frame_id) { | |
1300 SendVideoFrame(frame_id, testing_clock_.NowTicks()); | |
1301 RunTasks(33); | |
1302 } | |
1303 // Send Pli from receiver. | |
1304 RtcpPliMessage pli_message(video_sender_config_.ssrc); | |
1305 transport_receiver_->SendRtcpFromRtpReceiver( | |
1306 video_sender_config_.receiver_ssrc, video_sender_config_.ssrc, | |
1307 media::cast::RtcpTimeData(), nullptr, &pli_message, base::TimeDelta(), | |
1308 nullptr, nullptr); | |
1309 // Encode 2 other frames. | |
1310 for (int frame_id = 3; frame_id < 5; ++frame_id) { | |
1311 SendVideoFrame(frame_id, testing_clock_.NowTicks() + | |
1312 base::TimeDelta::FromMilliseconds(500)); | |
1313 RunTasks(33); | |
1314 } | |
1315 } | |
1316 | |
1278 } // namespace cast | 1317 } // namespace cast |
1279 } // namespace media | 1318 } // namespace media |
OLD | NEW |