| 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_COMPOSITE_FILTER_H_ | 5 #ifndef MEDIA_BASE_COMPOSITE_FILTER_H_ |
| 6 #define MEDIA_BASE_COMPOSITE_FILTER_H_ | 6 #define MEDIA_BASE_COMPOSITE_FILTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "media/base/filter_host.h" | 12 #include "media/base/filter_host.h" |
| 13 #include "media/base/filters.h" | 13 #include "media/base/filters.h" |
| 14 | 14 |
| 15 class MessageLoop; | 15 class MessageLoop; |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 class MEDIA_EXPORT CompositeFilter : public Filter { | 19 class MEDIA_EXPORT CompositeFilter : public Filter { |
| 20 public: | 20 public: |
| 21 explicit CompositeFilter(MessageLoop* message_loop); | 21 explicit CompositeFilter(MessageLoop* message_loop); |
| 22 | 22 |
| 23 // Adds a filter to the composite. This is only allowed after set_host() | 23 // Adds a filter to the composite. This is only allowed after set_host() |
| 24 // is called and before the first state changing operation such as Play(), | 24 // is called and before the first state changing operation such as Play(), |
| 25 // Flush(), Stop(), or Seek(). True is returned if the filter was successfully | 25 // Flush(), Stop(), or Seek(). True is returned if the filter was successfully |
| 26 // added to the composite. False is returned if the filter couldn't be added | 26 // added to the composite. False is returned if the filter couldn't be added |
| 27 // because the composite is in the wrong state. | 27 // because the composite is in the wrong state. |
| 28 bool AddFilter(scoped_refptr<Filter> filter); | 28 bool AddFilter(scoped_refptr<Filter> filter); |
| 29 | 29 |
| 30 // Undoes AddFilter's actions. CHECK-fails if |filter| is unknown. |
| 31 void RemoveFilter(scoped_refptr<Filter> filter); |
| 32 |
| 30 // media::Filter methods. | 33 // media::Filter methods. |
| 31 virtual void set_host(FilterHost* host) OVERRIDE; | 34 virtual void set_host(FilterHost* host) OVERRIDE; |
| 32 virtual FilterHost* host() OVERRIDE; | 35 virtual FilterHost* host() OVERRIDE; |
| 33 virtual void Play(const base::Closure& play_callback) OVERRIDE; | 36 virtual void Play(const base::Closure& play_callback) OVERRIDE; |
| 34 virtual void Pause(const base::Closure& pause_callback) OVERRIDE; | 37 virtual void Pause(const base::Closure& pause_callback) OVERRIDE; |
| 35 virtual void Flush(const base::Closure& flush_callback) OVERRIDE; | 38 virtual void Flush(const base::Closure& flush_callback) OVERRIDE; |
| 36 virtual void Stop(const base::Closure& stop_callback) OVERRIDE; | 39 virtual void Stop(const base::Closure& stop_callback) OVERRIDE; |
| 37 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; | 40 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; |
| 38 virtual void Seek( | 41 virtual void Seek( |
| 39 base::TimeDelta time, const FilterStatusCB& seek_cb) OVERRIDE; | 42 base::TimeDelta time, const FilterStatusCB& seek_cb) OVERRIDE; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 PipelineStatus status_; | 143 PipelineStatus status_; |
| 141 | 144 |
| 142 base::WeakPtrFactory<CompositeFilter> weak_ptr_factory_; | 145 base::WeakPtrFactory<CompositeFilter> weak_ptr_factory_; |
| 143 | 146 |
| 144 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); | 147 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); |
| 145 }; | 148 }; |
| 146 | 149 |
| 147 } // namespace media | 150 } // namespace media |
| 148 | 151 |
| 149 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ | 152 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ |
| OLD | NEW |