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