| 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/test/pipeline_integration_test_base.h" | 5 #include "media/test/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/cdm_context.h" | 9 #include "media/base/cdm_context.h" | 
| 10 #include "media/base/media_log.h" | 10 #include "media/base/media_log.h" | 
| 11 #include "media/base/test_data_util.h" | 11 #include "media/base/test_data_util.h" | 
| 12 #include "media/filters/audio_renderer_impl.h" | 12 #include "media/filters/audio_renderer_impl.h" | 
| 13 #include "media/filters/chunk_demuxer.h" | 13 #include "media/filters/chunk_demuxer.h" | 
|  | 14 #if !defined(MEDIA_DISABLE_FFMPEG) | 
| 14 #include "media/filters/ffmpeg_audio_decoder.h" | 15 #include "media/filters/ffmpeg_audio_decoder.h" | 
| 15 #include "media/filters/ffmpeg_demuxer.h" | 16 #include "media/filters/ffmpeg_demuxer.h" | 
| 16 #include "media/filters/ffmpeg_video_decoder.h" | 17 #include "media/filters/ffmpeg_video_decoder.h" | 
|  | 18 #endif | 
| 17 #include "media/filters/file_data_source.h" | 19 #include "media/filters/file_data_source.h" | 
| 18 #include "media/filters/opus_audio_decoder.h" | 20 #include "media/filters/opus_audio_decoder.h" | 
| 19 #include "media/filters/renderer_impl.h" | 21 #include "media/filters/renderer_impl.h" | 
|  | 22 #if !defined(MEDIA_DISABLE_LIBVPX) | 
| 20 #include "media/filters/vpx_video_decoder.h" | 23 #include "media/filters/vpx_video_decoder.h" | 
|  | 24 #endif | 
| 21 | 25 | 
| 22 using ::testing::_; | 26 using ::testing::_; | 
| 23 using ::testing::AnyNumber; | 27 using ::testing::AnyNumber; | 
| 24 using ::testing::AtMost; | 28 using ::testing::AtMost; | 
| 25 using ::testing::InvokeWithoutArgs; | 29 using ::testing::InvokeWithoutArgs; | 
| 26 using ::testing::SaveArg; | 30 using ::testing::SaveArg; | 
| 27 | 31 | 
| 28 namespace media { | 32 namespace media { | 
| 29 | 33 | 
| 30 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; | 34 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; | 
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 201 void PipelineIntegrationTestBase::CreateDemuxer(const std::string& filename) { | 205 void PipelineIntegrationTestBase::CreateDemuxer(const std::string& filename) { | 
| 202   FileDataSource* file_data_source = new FileDataSource(); | 206   FileDataSource* file_data_source = new FileDataSource(); | 
| 203   base::FilePath file_path(GetTestDataFilePath(filename)); | 207   base::FilePath file_path(GetTestDataFilePath(filename)); | 
| 204   CHECK(file_data_source->Initialize(file_path)) << "Is " << file_path.value() | 208   CHECK(file_data_source->Initialize(file_path)) << "Is " << file_path.value() | 
| 205                                                  << " missing?"; | 209                                                  << " missing?"; | 
| 206   data_source_.reset(file_data_source); | 210   data_source_.reset(file_data_source); | 
| 207 | 211 | 
| 208   Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb = | 212   Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb = | 
| 209       base::Bind(&PipelineIntegrationTestBase::DemuxerEncryptedMediaInitDataCB, | 213       base::Bind(&PipelineIntegrationTestBase::DemuxerEncryptedMediaInitDataCB, | 
| 210                  base::Unretained(this)); | 214                  base::Unretained(this)); | 
|  | 215 | 
|  | 216 #if !defined(MEDIA_DISABLE_FFMPEG) | 
| 211   demuxer_ = scoped_ptr<Demuxer>( | 217   demuxer_ = scoped_ptr<Demuxer>( | 
| 212       new FFmpegDemuxer(message_loop_.message_loop_proxy(), data_source_.get(), | 218       new FFmpegDemuxer(message_loop_.message_loop_proxy(), data_source_.get(), | 
| 213                         encrypted_media_init_data_cb, new MediaLog())); | 219                         encrypted_media_init_data_cb, new MediaLog())); | 
|  | 220 #endif | 
| 214 } | 221 } | 
| 215 | 222 | 
| 216 scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer() { | 223 scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer() { | 
| 217   ScopedVector<VideoDecoder> video_decoders; | 224   ScopedVector<VideoDecoder> video_decoders; | 
| 218 #if !defined(MEDIA_DISABLE_LIBVPX) | 225 #if !defined(MEDIA_DISABLE_LIBVPX) | 
| 219   video_decoders.push_back( | 226   video_decoders.push_back( | 
| 220       new VpxVideoDecoder(message_loop_.message_loop_proxy())); | 227       new VpxVideoDecoder(message_loop_.message_loop_proxy())); | 
| 221 #endif  // !defined(MEDIA_DISABLE_LIBVPX) | 228 #endif  // !defined(MEDIA_DISABLE_LIBVPX) | 
|  | 229 | 
|  | 230 #if !defined(MEDIA_DISABLE_FFMPEG) | 
| 222   video_decoders.push_back( | 231   video_decoders.push_back( | 
| 223       new FFmpegVideoDecoder(message_loop_.message_loop_proxy())); | 232       new FFmpegVideoDecoder(message_loop_.message_loop_proxy())); | 
|  | 233 #endif | 
| 224 | 234 | 
| 225   // Disable frame dropping if hashing is enabled. | 235   // Disable frame dropping if hashing is enabled. | 
| 226   scoped_ptr<VideoRenderer> video_renderer( | 236   scoped_ptr<VideoRenderer> video_renderer( | 
| 227       new VideoRendererImpl(message_loop_.message_loop_proxy(), | 237       new VideoRendererImpl(message_loop_.message_loop_proxy(), | 
| 228                             video_decoders.Pass(), false, new MediaLog())); | 238                             video_decoders.Pass(), false, new MediaLog())); | 
| 229 | 239 | 
| 230   if (!clockless_playback_) { | 240   if (!clockless_playback_) { | 
| 231     audio_sink_ = new NullAudioSink(message_loop_.message_loop_proxy()); | 241     audio_sink_ = new NullAudioSink(message_loop_.message_loop_proxy()); | 
| 232   } else { | 242   } else { | 
| 233     clockless_audio_sink_ = new ClocklessAudioSink(); | 243     clockless_audio_sink_ = new ClocklessAudioSink(); | 
| 234   } | 244   } | 
| 235 | 245 | 
| 236   ScopedVector<AudioDecoder> audio_decoders; | 246   ScopedVector<AudioDecoder> audio_decoders; | 
|  | 247 | 
|  | 248 #if !defined(MEDIA_DISABLE_FFMPEG) | 
| 237   audio_decoders.push_back( | 249   audio_decoders.push_back( | 
| 238       new FFmpegAudioDecoder(message_loop_.message_loop_proxy(), LogCB())); | 250       new FFmpegAudioDecoder(message_loop_.message_loop_proxy(), LogCB())); | 
|  | 251 #endif | 
|  | 252 | 
| 239   audio_decoders.push_back( | 253   audio_decoders.push_back( | 
| 240       new OpusAudioDecoder(message_loop_.message_loop_proxy())); | 254       new OpusAudioDecoder(message_loop_.message_loop_proxy())); | 
| 241 | 255 | 
| 242   AudioParameters out_params(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 256   AudioParameters out_params(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 
| 243                              CHANNEL_LAYOUT_STEREO, | 257                              CHANNEL_LAYOUT_STEREO, | 
| 244                              44100, | 258                              44100, | 
| 245                              16, | 259                              16, | 
| 246                              512); | 260                              512); | 
| 247   hardware_config_.UpdateOutputConfig(out_params); | 261   hardware_config_.UpdateOutputConfig(out_params); | 
| 248 | 262 | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 294   DCHECK(clockless_playback_); | 308   DCHECK(clockless_playback_); | 
| 295   return clockless_audio_sink_->render_time(); | 309   return clockless_audio_sink_->render_time(); | 
| 296 } | 310 } | 
| 297 | 311 | 
| 298 base::TimeTicks DummyTickClock::NowTicks() { | 312 base::TimeTicks DummyTickClock::NowTicks() { | 
| 299   now_ += base::TimeDelta::FromSeconds(60); | 313   now_ += base::TimeDelta::FromSeconds(60); | 
| 300   return now_; | 314   return now_; | 
| 301 } | 315 } | 
| 302 | 316 | 
| 303 }  // namespace media | 317 }  // namespace media | 
| OLD | NEW | 
|---|