Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "media/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/pipeline_integration_test_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "media/base/media_log.h" | 9 #include "media/base/media_log.h" |
| 10 #include "media/base/time_delta_interpolator.h" | 10 #include "media/base/time_delta_interpolator.h" |
| 11 #include "media/filters/audio_renderer_impl.h" | 11 #include "media/filters/audio_renderer_impl.h" |
| 12 #include "media/filters/chunk_demuxer.h" | 12 #include "media/filters/chunk_demuxer.h" |
| 13 #include "media/filters/ffmpeg_audio_decoder.h" | 13 #include "media/filters/ffmpeg_audio_decoder.h" |
| 14 #include "media/filters/ffmpeg_demuxer.h" | 14 #include "media/filters/ffmpeg_demuxer.h" |
| 15 #include "media/filters/ffmpeg_video_decoder.h" | 15 #include "media/filters/ffmpeg_video_decoder.h" |
| 16 #include "media/filters/file_data_source.h" | 16 #include "media/filters/file_data_source.h" |
| 17 #include "media/filters/opus_audio_decoder.h" | 17 #include "media/filters/opus_audio_decoder.h" |
| 18 #include "media/filters/vpx_video_decoder.h" | 18 #include "media/filters/vpx_video_decoder.h" |
| 19 | 19 |
| 20 using ::testing::_; | 20 using ::testing::_; |
| 21 using ::testing::AnyNumber; | 21 using ::testing::AnyNumber; |
| 22 using ::testing::AtMost; | 22 using ::testing::AtMost; |
| 23 using ::testing::Eq; | |
| 23 using ::testing::SaveArg; | 24 using ::testing::SaveArg; |
| 24 | 25 |
| 25 namespace media { | 26 namespace media { |
| 26 | 27 |
| 27 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; | 28 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; |
| 28 const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; | 29 const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; |
| 29 | 30 |
| 30 PipelineIntegrationTestBase::PipelineIntegrationTestBase() | 31 PipelineIntegrationTestBase::PipelineIntegrationTestBase() |
| 31 : hashing_enabled_(false), | 32 : hashing_enabled_(false), |
| 32 clockless_playback_(false), | 33 clockless_playback_(false), |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 300 audio_sink_->StartAudioHashForTesting(); | 301 audio_sink_->StartAudioHashForTesting(); |
| 301 scoped_ptr<AudioRenderer> audio_renderer(audio_renderer_impl); | 302 scoped_ptr<AudioRenderer> audio_renderer(audio_renderer_impl); |
| 302 collection->SetAudioRenderer(audio_renderer.Pass()); | 303 collection->SetAudioRenderer(audio_renderer.Pass()); |
| 303 | 304 |
| 304 return collection.Pass(); | 305 return collection.Pass(); |
| 305 } | 306 } |
| 306 | 307 |
| 307 void PipelineIntegrationTestBase::SetDecryptor( | 308 void PipelineIntegrationTestBase::SetDecryptor( |
| 308 Decryptor* decryptor, | 309 Decryptor* decryptor, |
| 309 const DecryptorReadyCB& decryptor_ready_cb) { | 310 const DecryptorReadyCB& decryptor_ready_cb) { |
| 310 decryptor_ready_cb.Run(decryptor); | 311 EXPECT_CALL(*this, DecryptorAttached(Eq(true))); |
|
ddorwin
2014/08/07 19:52:04
Is there a reason this comes first in this case?
jrummell
2014/08/08 20:58:28
I had assumed EXPECT... needs to be called before
| |
| 312 decryptor_ready_cb.Run( | |
| 313 decryptor, | |
| 314 base::Bind(&PipelineIntegrationTestBase::DecryptorAttached, | |
| 315 base::Unretained(this))); | |
| 311 } | 316 } |
| 312 | 317 |
| 313 void PipelineIntegrationTestBase::OnVideoRendererPaint( | 318 void PipelineIntegrationTestBase::OnVideoRendererPaint( |
| 314 const scoped_refptr<VideoFrame>& frame) { | 319 const scoped_refptr<VideoFrame>& frame) { |
| 315 last_video_frame_format_ = frame->format(); | 320 last_video_frame_format_ = frame->format(); |
| 316 if (!hashing_enabled_) | 321 if (!hashing_enabled_) |
| 317 return; | 322 return; |
| 318 frame->HashFrameForTesting(&md5_context_); | 323 frame->HashFrameForTesting(&md5_context_); |
| 319 } | 324 } |
| 320 | 325 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 334 DCHECK(clockless_playback_); | 339 DCHECK(clockless_playback_); |
| 335 return clockless_audio_sink_->render_time(); | 340 return clockless_audio_sink_->render_time(); |
| 336 } | 341 } |
| 337 | 342 |
| 338 base::TimeTicks DummyTickClock::NowTicks() { | 343 base::TimeTicks DummyTickClock::NowTicks() { |
| 339 now_ += base::TimeDelta::FromSeconds(60); | 344 now_ += base::TimeDelta::FromSeconds(60); |
| 340 return now_; | 345 return now_; |
| 341 } | 346 } |
| 342 | 347 |
| 343 } // namespace media | 348 } // namespace media |
| OLD | NEW |