| 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 #ifndef MEDIA_BASE_FILTER_COLLECTION_H_ | 5 #ifndef MEDIA_BASE_FILTER_COLLECTION_H_ |
| 6 #define MEDIA_BASE_FILTER_COLLECTION_H_ | 6 #define MEDIA_BASE_FILTER_COLLECTION_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 class AudioDecoder; | 15 class AudioDecoder; |
| 16 class AudioRenderer; | 16 class AudioRenderer; |
| 17 class Demuxer; | 17 class Demuxer; |
| 18 class VideoDecoder; | 18 class VideoDecoder; |
| 19 class VideoRenderer; | 19 class VideoRenderer; |
| 20 | 20 |
| 21 // Represents a set of uninitialized demuxer and audio/video decoders and | 21 // Represents a set of uninitialized demuxer and audio/video decoders and |
| 22 // renderers. Used to start a Pipeline object for media playback. | 22 // renderers. Used to start a Pipeline object for media playback. |
| 23 // | 23 // |
| 24 // TODO(scherkus): Replace FilterCollection with something sensible, see | 24 // TODO(scherkus): Replace FilterCollection with something sensible, see |
| 25 // http://crbug.com/110800 | 25 // http://crbug.com/110800 |
| 26 class MEDIA_EXPORT FilterCollection { | 26 class MEDIA_EXPORT FilterCollection { |
| 27 public: | 27 public: |
| 28 typedef std::list<scoped_refptr<VideoDecoder> > VideoDecoderList; |
| 29 |
| 28 FilterCollection(); | 30 FilterCollection(); |
| 29 ~FilterCollection(); | 31 ~FilterCollection(); |
| 30 | 32 |
| 31 // Demuxer accessor methods. | 33 // Demuxer accessor methods. |
| 32 void SetDemuxer(const scoped_refptr<Demuxer>& demuxer); | 34 void SetDemuxer(const scoped_refptr<Demuxer>& demuxer); |
| 33 const scoped_refptr<Demuxer>& GetDemuxer(); | 35 const scoped_refptr<Demuxer>& GetDemuxer(); |
| 34 | 36 |
| 35 // Adds a filter to the collection. | 37 // Adds a filter to the collection. |
| 36 void AddAudioDecoder(AudioDecoder* audio_decoder); | 38 void AddAudioDecoder(AudioDecoder* audio_decoder); |
| 37 void AddVideoDecoder(VideoDecoder* video_decoder); | |
| 38 void AddAudioRenderer(AudioRenderer* audio_renderer); | 39 void AddAudioRenderer(AudioRenderer* audio_renderer); |
| 39 void AddVideoRenderer(VideoRenderer* video_renderer); | 40 void AddVideoRenderer(VideoRenderer* video_renderer); |
| 40 | 41 |
| 41 // Is the collection empty? | |
| 42 bool IsEmpty() const; | |
| 43 | |
| 44 // Remove remaining filters. | 42 // Remove remaining filters. |
| 45 void Clear(); | 43 void Clear(); |
| 46 | 44 |
| 47 // Selects a filter of the specified type from the collection. | 45 // Selects a filter of the specified type from the collection. |
| 48 // If the required filter cannot be found, NULL is returned. | 46 // If the required filter cannot be found, NULL is returned. |
| 49 // If a filter is returned it is removed from the collection. | 47 // If a filter is returned it is removed from the collection. |
| 50 // Filters are selected in FIFO order. | 48 // Filters are selected in FIFO order. |
| 51 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* out); | 49 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* out); |
| 52 void SelectVideoDecoder(scoped_refptr<VideoDecoder>* out); | |
| 53 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* out); | 50 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* out); |
| 54 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* out); | 51 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* out); |
| 55 | 52 |
| 53 VideoDecoderList* GetVideoDecoders(); |
| 54 |
| 56 private: | 55 private: |
| 57 scoped_refptr<Demuxer> demuxer_; | 56 scoped_refptr<Demuxer> demuxer_; |
| 58 std::list<scoped_refptr<AudioDecoder> > audio_decoders_; | 57 std::list<scoped_refptr<AudioDecoder> > audio_decoders_; |
| 59 std::list<scoped_refptr<VideoDecoder> > video_decoders_; | 58 VideoDecoderList video_decoders_; |
| 60 std::list<scoped_refptr<AudioRenderer> > audio_renderers_; | 59 std::list<scoped_refptr<AudioRenderer> > audio_renderers_; |
| 61 std::list<scoped_refptr<VideoRenderer> > video_renderers_; | 60 std::list<scoped_refptr<VideoRenderer> > video_renderers_; |
| 62 | 61 |
| 63 DISALLOW_COPY_AND_ASSIGN(FilterCollection); | 62 DISALLOW_COPY_AND_ASSIGN(FilterCollection); |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 } // namespace media | 65 } // namespace media |
| 67 | 66 |
| 68 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ | 67 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ |
| OLD | NEW |