| 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 <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/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_vector.h" | |
| 13 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 15 #include "media/base/media_log.h" | 14 #include "media/base/media_log.h" |
| 16 #include "media/base/media_tracks.h" | 15 #include "media/base/media_tracks.h" |
| 17 #include "media/base/test_data_util.h" | 16 #include "media/base/test_data_util.h" |
| 18 #if !defined(MEDIA_DISABLE_FFMPEG) | 17 #if !defined(MEDIA_DISABLE_FFMPEG) |
| 19 #include "media/filters/ffmpeg_audio_decoder.h" | 18 #include "media/filters/ffmpeg_audio_decoder.h" |
| 20 #include "media/filters/ffmpeg_demuxer.h" | 19 #include "media/filters/ffmpeg_demuxer.h" |
| 21 #include "media/filters/ffmpeg_video_decoder.h" | 20 #include "media/filters/ffmpeg_video_decoder.h" |
| 22 #endif | 21 #endif |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 using ::testing::AnyNumber; | 33 using ::testing::AnyNumber; |
| 35 using ::testing::AtLeast; | 34 using ::testing::AtLeast; |
| 36 using ::testing::AtMost; | 35 using ::testing::AtMost; |
| 37 using ::testing::Invoke; | 36 using ::testing::Invoke; |
| 38 using ::testing::InvokeWithoutArgs; | 37 using ::testing::InvokeWithoutArgs; |
| 39 using ::testing::Return; | 38 using ::testing::Return; |
| 40 using ::testing::SaveArg; | 39 using ::testing::SaveArg; |
| 41 | 40 |
| 42 namespace media { | 41 namespace media { |
| 43 | 42 |
| 44 static ScopedVector<VideoDecoder> CreateVideoDecodersForTest( | 43 static std::vector<std::unique_ptr<VideoDecoder>> CreateVideoDecodersForTest( |
| 45 MediaLog* media_log, | 44 MediaLog* media_log, |
| 46 CreateVideoDecodersCB prepend_video_decoders_cb) { | 45 CreateVideoDecodersCB prepend_video_decoders_cb) { |
| 47 ScopedVector<VideoDecoder> video_decoders; | 46 std::vector<std::unique_ptr<VideoDecoder>> video_decoders; |
| 48 | 47 |
| 49 if (!prepend_video_decoders_cb.is_null()) { | 48 if (!prepend_video_decoders_cb.is_null()) { |
| 50 video_decoders = prepend_video_decoders_cb.Run(); | 49 video_decoders = prepend_video_decoders_cb.Run(); |
| 51 DCHECK(!video_decoders.empty()); | 50 DCHECK(!video_decoders.empty()); |
| 52 } | 51 } |
| 53 | 52 |
| 54 #if !defined(MEDIA_DISABLE_LIBVPX) | 53 #if !defined(MEDIA_DISABLE_LIBVPX) |
| 55 video_decoders.push_back(new VpxVideoDecoder()); | 54 video_decoders.push_back(base::MakeUnique<VpxVideoDecoder>()); |
| 56 #endif // !defined(MEDIA_DISABLE_LIBVPX) | 55 #endif // !defined(MEDIA_DISABLE_LIBVPX) |
| 57 | 56 |
| 58 // Android does not have an ffmpeg video decoder. | 57 // Android does not have an ffmpeg video decoder. |
| 59 #if !defined(MEDIA_DISABLE_FFMPEG) && !defined(OS_ANDROID) && \ | 58 #if !defined(MEDIA_DISABLE_FFMPEG) && !defined(OS_ANDROID) && \ |
| 60 !defined(DISABLE_FFMPEG_VIDEO_DECODERS) | 59 !defined(DISABLE_FFMPEG_VIDEO_DECODERS) |
| 61 video_decoders.push_back(new FFmpegVideoDecoder(media_log)); | 60 video_decoders.push_back(base::MakeUnique<FFmpegVideoDecoder>(media_log)); |
| 62 #endif | 61 #endif |
| 63 return video_decoders; | 62 return video_decoders; |
| 64 } | 63 } |
| 65 | 64 |
| 66 static ScopedVector<AudioDecoder> CreateAudioDecodersForTest( | 65 static std::vector<std::unique_ptr<AudioDecoder>> CreateAudioDecodersForTest( |
| 67 MediaLog* media_log, | 66 MediaLog* media_log, |
| 68 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 67 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| 69 CreateAudioDecodersCB prepend_audio_decoders_cb) { | 68 CreateAudioDecodersCB prepend_audio_decoders_cb) { |
| 70 ScopedVector<AudioDecoder> audio_decoders; | 69 std::vector<std::unique_ptr<AudioDecoder>> audio_decoders; |
| 71 | 70 |
| 72 if (!prepend_audio_decoders_cb.is_null()) { | 71 if (!prepend_audio_decoders_cb.is_null()) { |
| 73 audio_decoders = prepend_audio_decoders_cb.Run(); | 72 audio_decoders = prepend_audio_decoders_cb.Run(); |
| 74 DCHECK(!audio_decoders.empty()); | 73 DCHECK(!audio_decoders.empty()); |
| 75 } | 74 } |
| 76 | 75 |
| 77 #if !defined(MEDIA_DISABLE_FFMPEG) | 76 #if !defined(MEDIA_DISABLE_FFMPEG) |
| 78 audio_decoders.push_back( | 77 audio_decoders.push_back( |
| 79 new FFmpegAudioDecoder(media_task_runner, media_log)); | 78 base::MakeUnique<FFmpegAudioDecoder>(media_task_runner, media_log)); |
| 80 #endif | 79 #endif |
| 81 return audio_decoders; | 80 return audio_decoders; |
| 82 } | 81 } |
| 83 | 82 |
| 84 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; | 83 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; |
| 85 const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; | 84 const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; |
| 86 | 85 |
| 87 class RendererFactoryImpl final : public PipelineTestRendererFactory { | 86 class RendererFactoryImpl final : public PipelineTestRendererFactory { |
| 88 public: | 87 public: |
| 89 explicit RendererFactoryImpl(PipelineIntegrationTestBase* integration_test) | 88 explicit RendererFactoryImpl(PipelineIntegrationTestBase* integration_test) |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 base::RunLoop().Run(); | 561 base::RunLoop().Run(); |
| 563 return pipeline_status_; | 562 return pipeline_status_; |
| 564 } | 563 } |
| 565 | 564 |
| 566 base::TimeTicks DummyTickClock::NowTicks() { | 565 base::TimeTicks DummyTickClock::NowTicks() { |
| 567 now_ += base::TimeDelta::FromSeconds(60); | 566 now_ += base::TimeDelta::FromSeconds(60); |
| 568 return now_; | 567 return now_; |
| 569 } | 568 } |
| 570 | 569 |
| 571 } // namespace media | 570 } // namespace media |
| OLD | NEW |