| 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/task.h" | 10 #include "base/task.h" |
| 11 #include "media/base/filter_host.h" | 11 #include "media/base/filter_host.h" |
| 12 #include "media/base/filters.h" | 12 #include "media/base/filters.h" |
| 13 | 13 |
| 14 class MessageLoop; | 14 class MessageLoop; |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 | 17 |
| 18 class MEDIA_EXPORT CompositeFilter : public Filter { | 18 class MEDIA_EXPORT CompositeFilter : public Filter { |
| 19 public: | 19 public: |
| 20 explicit CompositeFilter(MessageLoop* message_loop); | 20 explicit CompositeFilter(MessageLoop* message_loop); |
| 21 | 21 |
| 22 // Adds a filter to the composite. This is only allowed after set_host() | 22 // Adds a filter to the composite. This is only allowed after set_host() |
| 23 // is called and before the first state changing operation such as Play(), | 23 // is called and before the first state changing operation such as Play(), |
| 24 // Flush(), Stop(), or Seek(). True is returned if the filter was successfully | 24 // Flush(), Stop(), or Seek(). True is returned if the filter was successfully |
| 25 // added to the composite. False is returned if the filter couldn't be added | 25 // added to the composite. False is returned if the filter couldn't be added |
| 26 // because the composite is in the wrong state. | 26 // because the composite is in the wrong state. |
| 27 bool AddFilter(scoped_refptr<Filter> filter); | 27 bool AddFilter(scoped_refptr<Filter> filter); |
| 28 | 28 |
| 29 // media::Filter methods. | 29 // media::Filter methods. |
| 30 virtual void set_host(FilterHost* host); | 30 virtual void set_host(FilterHost* host) OVERRIDE; |
| 31 virtual FilterHost* host(); | 31 virtual FilterHost* host() OVERRIDE; |
| 32 virtual void Play(FilterCallback* play_callback); | 32 virtual void Play(FilterCallback* play_callback) OVERRIDE; |
| 33 virtual void Pause(FilterCallback* pause_callback); | 33 virtual void Pause(FilterCallback* pause_callback) OVERRIDE; |
| 34 virtual void Flush(FilterCallback* flush_callback); | 34 virtual void Flush(FilterCallback* flush_callback) OVERRIDE; |
| 35 virtual void Stop(FilterCallback* stop_callback); | 35 virtual void Stop(FilterCallback* stop_callback) OVERRIDE; |
| 36 virtual void SetPlaybackRate(float playback_rate); | 36 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; |
| 37 virtual void Seek(base::TimeDelta time, const FilterStatusCB& seek_cb); | 37 virtual void Seek( |
| 38 virtual void OnAudioRendererDisabled(); | 38 base::TimeDelta time, const FilterStatusCB& seek_cb) OVERRIDE; |
| 39 virtual void OnAudioRendererDisabled() OVERRIDE; |
| 39 | 40 |
| 40 protected: | 41 protected: |
| 41 virtual ~CompositeFilter(); | 42 virtual ~CompositeFilter(); |
| 42 | 43 |
| 43 void SetError(PipelineStatus error); | 44 void SetError(PipelineStatus error); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 class FilterHostImpl; | 47 class FilterHostImpl; |
| 47 | 48 |
| 48 enum State { | 49 enum State { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 PipelineStatus status_; | 145 PipelineStatus status_; |
| 145 | 146 |
| 146 scoped_ptr<ScopedRunnableMethodFactory<CompositeFilter> > runnable_factory_; | 147 scoped_ptr<ScopedRunnableMethodFactory<CompositeFilter> > runnable_factory_; |
| 147 | 148 |
| 148 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); | 149 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 } // namespace media | 152 } // namespace media |
| 152 | 153 |
| 153 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ | 154 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ |
| OLD | NEW |