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

Side by Side Diff: media/test/pipeline_integration_test_base.cc

Issue 2435603009: Use ffmpeg for opus decoding, no need to maintain our decoder. (Closed)
Patch Set: Created 4 years, 1 month 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 // 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "media/base/cdm_context.h" 14 #include "media/base/cdm_context.h"
15 #include "media/base/media_log.h" 15 #include "media/base/media_log.h"
16 #include "media/base/media_tracks.h" 16 #include "media/base/media_tracks.h"
17 #include "media/base/test_data_util.h" 17 #include "media/base/test_data_util.h"
18 #include "media/filters/chunk_demuxer.h" 18 #include "media/filters/chunk_demuxer.h"
19 #if !defined(MEDIA_DISABLE_FFMPEG) 19 #if !defined(MEDIA_DISABLE_FFMPEG)
20 #include "media/filters/ffmpeg_audio_decoder.h" 20 #include "media/filters/ffmpeg_audio_decoder.h"
21 #include "media/filters/ffmpeg_demuxer.h" 21 #include "media/filters/ffmpeg_demuxer.h"
22 #include "media/filters/ffmpeg_video_decoder.h" 22 #include "media/filters/ffmpeg_video_decoder.h"
23 #endif 23 #endif
24 #include "media/filters/file_data_source.h" 24 #include "media/filters/file_data_source.h"
25 #include "media/filters/memory_data_source.h" 25 #include "media/filters/memory_data_source.h"
26 #include "media/filters/opus_audio_decoder.h"
27 #include "media/renderers/audio_renderer_impl.h" 26 #include "media/renderers/audio_renderer_impl.h"
28 #include "media/renderers/renderer_impl.h" 27 #include "media/renderers/renderer_impl.h"
29 #if !defined(MEDIA_DISABLE_LIBVPX) 28 #if !defined(MEDIA_DISABLE_LIBVPX)
30 #include "media/filters/vpx_video_decoder.h" 29 #include "media/filters/vpx_video_decoder.h"
31 #endif 30 #endif
32 31
33 using ::testing::_; 32 using ::testing::_;
34 using ::testing::AnyNumber; 33 using ::testing::AnyNumber;
35 using ::testing::AtLeast; 34 using ::testing::AtLeast;
36 using ::testing::AtMost; 35 using ::testing::AtMost;
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 video_sink_.get(), std::move(video_decoders), false, nullptr, 314 video_sink_.get(), std::move(video_decoders), false, nullptr,
316 new MediaLog())); 315 new MediaLog()));
317 316
318 ScopedVector<AudioDecoder> audio_decoders; 317 ScopedVector<AudioDecoder> audio_decoders;
319 318
320 #if !defined(MEDIA_DISABLE_FFMPEG) 319 #if !defined(MEDIA_DISABLE_FFMPEG)
321 audio_decoders.push_back( 320 audio_decoders.push_back(
322 new FFmpegAudioDecoder(message_loop_.task_runner(), new MediaLog())); 321 new FFmpegAudioDecoder(message_loop_.task_runner(), new MediaLog()));
323 #endif 322 #endif
324 323
325 audio_decoders.push_back(new OpusAudioDecoder(message_loop_.task_runner()));
326
327 if (!clockless_playback_) { 324 if (!clockless_playback_) {
328 audio_sink_ = new NullAudioSink(message_loop_.task_runner()); 325 audio_sink_ = new NullAudioSink(message_loop_.task_runner());
329 } else { 326 } else {
330 clockless_audio_sink_ = new ClocklessAudioSink(OutputDeviceInfo( 327 clockless_audio_sink_ = new ClocklessAudioSink(OutputDeviceInfo(
331 "", OUTPUT_DEVICE_STATUS_OK, 328 "", OUTPUT_DEVICE_STATUS_OK,
332 // Don't allow the audio renderer to resample buffers if hashing is 329 // Don't allow the audio renderer to resample buffers if hashing is
333 // enabled: 330 // enabled:
334 hashing_enabled_ 331 hashing_enabled_
335 ? AudioParameters() 332 ? AudioParameters()
336 : AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, 333 : AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 DCHECK(clockless_playback_); 398 DCHECK(clockless_playback_);
402 return clockless_audio_sink_->render_time(); 399 return clockless_audio_sink_->render_time();
403 } 400 }
404 401
405 base::TimeTicks DummyTickClock::NowTicks() { 402 base::TimeTicks DummyTickClock::NowTicks() {
406 now_ += base::TimeDelta::FromSeconds(60); 403 now_ += base::TimeDelta::FromSeconds(60);
407 return now_; 404 return now_;
408 } 405 }
409 406
410 } // namespace media 407 } // namespace media
OLDNEW
« media/test/pipeline_integration_test.cc ('K') | « media/test/pipeline_integration_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698