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<AudioDecoder> > AudioDecoderList; | |
28 typedef std::list<scoped_refptr<VideoDecoder> > VideoDecoderList; | 29 typedef std::list<scoped_refptr<VideoDecoder> > VideoDecoderList; |
29 | 30 |
30 FilterCollection(); | 31 FilterCollection(); |
31 ~FilterCollection(); | 32 ~FilterCollection(); |
32 | 33 |
33 // Demuxer accessor methods. | 34 // Demuxer accessor methods. |
34 void SetDemuxer(const scoped_refptr<Demuxer>& demuxer); | 35 void SetDemuxer(const scoped_refptr<Demuxer>& demuxer); |
35 const scoped_refptr<Demuxer>& GetDemuxer(); | 36 const scoped_refptr<Demuxer>& GetDemuxer(); |
36 | 37 |
37 // Adds a filter to the collection. | 38 // Adds a filter to the collection. |
38 void AddAudioDecoder(AudioDecoder* audio_decoder); | |
39 void AddAudioRenderer(AudioRenderer* audio_renderer); | 39 void AddAudioRenderer(AudioRenderer* audio_renderer); |
40 void AddVideoRenderer(VideoRenderer* video_renderer); | 40 void AddVideoRenderer(VideoRenderer* video_renderer); |
41 | 41 |
42 // Remove remaining filters. | 42 // Remove remaining filters. |
43 void Clear(); | 43 void Clear(); |
44 | 44 |
45 // Selects a filter of the specified type from the collection. | 45 // Selects a filter of the specified type from the collection. |
46 // If the required filter cannot be found, NULL is returned. | 46 // If the required filter cannot be found, NULL is returned. |
47 // If a filter is returned it is removed from the collection. | 47 // If a filter is returned it is removed from the collection. |
48 // Filters are selected in FIFO order. | 48 // Filters are selected in FIFO order. |
49 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* out); | 49 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* out); |
Ami GONE FROM CHROMIUM
2012/09/07 14:40:02
delete
| |
50 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* out); | 50 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* out); |
51 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* out); | 51 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* out); |
52 | 52 |
53 AudioDecoderList* GetAudioDecoders(); | |
53 VideoDecoderList* GetVideoDecoders(); | 54 VideoDecoderList* GetVideoDecoders(); |
54 | 55 |
55 private: | 56 private: |
56 scoped_refptr<Demuxer> demuxer_; | 57 scoped_refptr<Demuxer> demuxer_; |
57 std::list<scoped_refptr<AudioDecoder> > audio_decoders_; | 58 AudioDecoderList audio_decoders_; |
58 VideoDecoderList video_decoders_; | 59 VideoDecoderList video_decoders_; |
59 std::list<scoped_refptr<AudioRenderer> > audio_renderers_; | 60 std::list<scoped_refptr<AudioRenderer> > audio_renderers_; |
60 std::list<scoped_refptr<VideoRenderer> > video_renderers_; | 61 std::list<scoped_refptr<VideoRenderer> > video_renderers_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(FilterCollection); | 63 DISALLOW_COPY_AND_ASSIGN(FilterCollection); |
63 }; | 64 }; |
64 | 65 |
65 } // namespace media | 66 } // namespace media |
66 | 67 |
67 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ | 68 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ |
OLD | NEW |