OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Is the collection empty? | 34 // Is the collection empty? |
35 bool IsEmpty() const; | 35 bool IsEmpty() const; |
36 | 36 |
37 // Remove remaining filters. | 37 // Remove remaining filters. |
38 void Clear(); | 38 void Clear(); |
39 | 39 |
40 // Selects a filter of the specified type from the collection. | 40 // Selects a filter of the specified type from the collection. |
41 // If the required filter cannot be found, NULL is returned. | 41 // If the required filter cannot be found, NULL is returned. |
42 // If a filter is returned it is removed from the collection. | 42 // If a filter is returned it is removed from the collection. |
43 // Filters are selected in FIFO order. | |
44 void SelectVideoDecoder(scoped_refptr<VideoDecoder>* filter_out); | 43 void SelectVideoDecoder(scoped_refptr<VideoDecoder>* filter_out); |
45 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* filter_out); | 44 void SelectAudioDecoder(scoped_refptr<AudioDecoder>* filter_out); |
46 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* filter_out); | 45 void SelectVideoRenderer(scoped_refptr<VideoRenderer>* filter_out); |
47 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* filter_out); | 46 void SelectAudioRenderer(scoped_refptr<AudioRenderer>* filter_out); |
48 | 47 |
49 private: | 48 private: |
50 // Identifies the type of filter implementation. Each filter has to be one of | 49 // Identifies the type of filter implementation. Each filter has to be one of |
51 // the following types. This is used to mark, identify, and support | 50 // the following types. This is used to mark, identify, and support |
52 // downcasting of different filter types stored in the filters_ list. | 51 // downcasting of different filter types stored in the filters_ list. |
53 enum FilterType { | 52 enum FilterType { |
(...skipping 19 matching lines...) Expand all Loading... |
73 | 72 |
74 // Helper function that searches the filters list for a specific filter type. | 73 // Helper function that searches the filters list for a specific filter type. |
75 void SelectFilter(FilterType filter_type, scoped_refptr<Filter>* filter_out); | 74 void SelectFilter(FilterType filter_type, scoped_refptr<Filter>* filter_out); |
76 | 75 |
77 DISALLOW_COPY_AND_ASSIGN(FilterCollection); | 76 DISALLOW_COPY_AND_ASSIGN(FilterCollection); |
78 }; | 77 }; |
79 | 78 |
80 } // namespace media | 79 } // namespace media |
81 | 80 |
82 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ | 81 #endif // MEDIA_BASE_FILTER_COLLECTION_H_ |
OLD | NEW |