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 // Is the collection empty? |
42 bool IsEmpty() const; | 43 bool IsEmpty() const; |
Ami GONE FROM CHROMIUM
2012/08/09 20:30:18
I wonder if this is actually profitably used by an
acolwell GONE FROM CHROMIUM
2012/08/09 22:23:32
No. Removed.
| |
43 | 44 |
44 // Remove remaining filters. | 45 // Remove remaining filters. |
45 void Clear(); | 46 void Clear(); |
46 | 47 |
47 // Selects a filter of the specified type from the collection. | 48 // Selects a filter of the specified type from the collection. |
48 // If the required filter cannot be found, NULL is returned. | 49 // If the required filter cannot be found, NULL is returned. |
49 // If a filter is returned it is removed from the collection. | 50 // If a filter is returned it is removed from the collection. |
50 // Filters are selected in FIFO order. | 51 // Filters are selected in FIFO order. |
51 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* out); | 52 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* out); |
52 void SelectVideoDecoder(scoped_refptr<VideoDecoder>* out); | |
53 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* out); | 53 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* out); |
54 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* out); | 54 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* out); |
55 | 55 |
56 VideoDecoderList& GetVideoDecoders(); | |
Ami GONE FROM CHROMIUM
2012/08/09 20:30:18
Return a pointer, never a non-const-ref in chromiu
acolwell GONE FROM CHROMIUM
2012/08/09 22:23:32
Done.
| |
57 | |
56 private: | 58 private: |
57 scoped_refptr<Demuxer> demuxer_; | 59 scoped_refptr<Demuxer> demuxer_; |
58 std::list<scoped_refptr<AudioDecoder> > audio_decoders_; | 60 std::list<scoped_refptr<AudioDecoder> > audio_decoders_; |
59 std::list<scoped_refptr<VideoDecoder> > video_decoders_; | 61 VideoDecoderList video_decoders_; |
60 std::list<scoped_refptr<AudioRenderer> > audio_renderers_; | 62 std::list<scoped_refptr<AudioRenderer> > audio_renderers_; |
61 std::list<scoped_refptr<VideoRenderer> > video_renderers_; | 63 std::list<scoped_refptr<VideoRenderer> > video_renderers_; |
62 | 64 |
63 DISALLOW_COPY_AND_ASSIGN(FilterCollection); | 65 DISALLOW_COPY_AND_ASSIGN(FilterCollection); |
64 }; | 66 }; |
65 | 67 |
66 } // namespace media | 68 } // namespace media |
67 | 69 |
68 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ | 70 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ |
OLD | NEW |