| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // A filter factory handles the creation of filters given a FilterType (i.e., | 5 // A filter factory handles the creation of filters given a FilterType (i.e., |
| 6 // FILTER_AUDIO_DECODER) and a MediaFormat. Generally a filter factory handles | 6 // FILTER_AUDIO_DECODER) and a MediaFormat. Generally a filter factory handles |
| 7 // creating a single type of filter, with multiple factories combined into a | 7 // creating a single type of filter, with multiple factories combined into a |
| 8 // FilterFactoryCollection. We use some template tricks to enforce type-safety | 8 // FilterFactoryCollection. We use some template tricks to enforce type-safety |
| 9 // and eliminate casting for callers. | 9 // and eliminate casting for callers. |
| 10 // | 10 // |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Returns true and assigns |filter_out| if the filter was created, false | 25 // Returns true and assigns |filter_out| if the filter was created, false |
| 26 // and assigns NULL otherwise. | 26 // and assigns NULL otherwise. |
| 27 // static bool Create(MediaFormat& media_format, YourFilterType** filter_out); | 27 // static bool Create(MediaFormat& media_format, YourFilterType** filter_out); |
| 28 // | 28 // |
| 29 | 29 |
| 30 #ifndef MEDIA_BASE_FACTORY_H_ | 30 #ifndef MEDIA_BASE_FACTORY_H_ |
| 31 #define MEDIA_BASE_FACTORY_H_ | 31 #define MEDIA_BASE_FACTORY_H_ |
| 32 | 32 |
| 33 #include <vector> | 33 #include <vector> |
| 34 | 34 |
| 35 #include "base/logging.h" |
| 35 #include "base/ref_counted.h" | 36 #include "base/ref_counted.h" |
| 36 #include "media/base/filters.h" | 37 #include "media/base/filters.h" |
| 37 | 38 |
| 38 namespace media { | 39 namespace media { |
| 39 | 40 |
| 40 class FilterFactoryCollection; | 41 class FilterFactoryCollection; |
| 41 | 42 |
| 42 class FilterFactory : public base::RefCountedThreadSafe<FilterFactory> { | 43 class FilterFactory : public base::RefCountedThreadSafe<FilterFactory> { |
| 43 public: | 44 public: |
| 44 // Creates a filter implementing the specified interface. Hides the casting | 45 // Creates a filter implementing the specified interface. Hides the casting |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 253 |
| 253 scoped_refptr<Filter> filter_; | 254 scoped_refptr<Filter> filter_; |
| 254 bool create_called_; | 255 bool create_called_; |
| 255 | 256 |
| 256 DISALLOW_COPY_AND_ASSIGN(InstanceFilterFactory); | 257 DISALLOW_COPY_AND_ASSIGN(InstanceFilterFactory); |
| 257 }; | 258 }; |
| 258 | 259 |
| 259 } // namespace media | 260 } // namespace media |
| 260 | 261 |
| 261 #endif // MEDIA_BASE_FACTORY_H_ | 262 #endif // MEDIA_BASE_FACTORY_H_ |
| OLD | NEW |