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