| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef MEDIA_BASE_DECODER_FACTORY_H_ | 5 #ifndef MEDIA_BASE_DECODER_FACTORY_H_ |
| 6 #define MEDIA_BASE_DECODER_FACTORY_H_ | 6 #define MEDIA_BASE_DECODER_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 #include <vector> |
| 10 |
| 8 #include "base/macros.h" | 11 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_vector.h" | |
| 11 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 12 | 14 |
| 13 namespace base { | 15 namespace base { |
| 14 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace media { | 19 namespace media { |
| 18 | 20 |
| 19 class AudioDecoder; | 21 class AudioDecoder; |
| 20 class GpuVideoAcceleratorFactories; | 22 class GpuVideoAcceleratorFactories; |
| 21 class VideoDecoder; | 23 class VideoDecoder; |
| 22 | 24 |
| 23 // A factory class for creating audio and video decoders. | 25 // A factory class for creating audio and video decoders. |
| 24 class MEDIA_EXPORT DecoderFactory { | 26 class MEDIA_EXPORT DecoderFactory { |
| 25 public: | 27 public: |
| 26 DecoderFactory(); | 28 DecoderFactory(); |
| 27 virtual ~DecoderFactory(); | 29 virtual ~DecoderFactory(); |
| 28 | 30 |
| 29 // Creates audio decoders and append them to the end of |audio_decoders|. | 31 // Creates audio decoders and append them to the end of |audio_decoders|. |
| 30 // Decoders are single-threaded, each decoder should run on |task_runner|. | 32 // Decoders are single-threaded, each decoder should run on |task_runner|. |
| 31 virtual void CreateAudioDecoders( | 33 virtual void CreateAudioDecoders( |
| 32 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 34 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 33 ScopedVector<AudioDecoder>* audio_decoders); | 35 std::vector<std::unique_ptr<AudioDecoder>>* audio_decoders); |
| 34 | 36 |
| 35 // Creates video decoders and append them to the end of |video_decoders|. | 37 // Creates video decoders and append them to the end of |video_decoders|. |
| 36 // Decoders are single-threaded, each decoder should run on |task_runner|. | 38 // Decoders are single-threaded, each decoder should run on |task_runner|. |
| 37 virtual void CreateVideoDecoders( | 39 virtual void CreateVideoDecoders( |
| 38 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 39 GpuVideoAcceleratorFactories* gpu_factories, | 41 GpuVideoAcceleratorFactories* gpu_factories, |
| 40 ScopedVector<VideoDecoder>* video_decoders); | 42 std::vector<std::unique_ptr<VideoDecoder>>* video_decoders); |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(DecoderFactory); | 45 DISALLOW_COPY_AND_ASSIGN(DecoderFactory); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 } // namespace media | 48 } // namespace media |
| 47 | 49 |
| 48 #endif // MEDIA_BASE_DECODER_FACTORY_H_ | 50 #endif // MEDIA_BASE_DECODER_FACTORY_H_ |
| OLD | NEW |