| 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 "base/task.h" | 8 #include "base/task.h" |
| 9 #include "media/base/filter_host.h" | 9 #include "media/base/filter_host.h" |
| 10 #include "media/base/filters.h" | 10 #include "media/base/filters.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 virtual void Pause(FilterCallback* pause_callback); | 31 virtual void Pause(FilterCallback* pause_callback); |
| 32 virtual void Flush(FilterCallback* flush_callback); | 32 virtual void Flush(FilterCallback* flush_callback); |
| 33 virtual void Stop(FilterCallback* stop_callback); | 33 virtual void Stop(FilterCallback* stop_callback); |
| 34 virtual void SetPlaybackRate(float playback_rate); | 34 virtual void SetPlaybackRate(float playback_rate); |
| 35 virtual void Seek(base::TimeDelta time, FilterCallback* seek_callback); | 35 virtual void Seek(base::TimeDelta time, FilterCallback* seek_callback); |
| 36 virtual void OnAudioRendererDisabled(); | 36 virtual void OnAudioRendererDisabled(); |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 virtual ~CompositeFilter(); | 39 virtual ~CompositeFilter(); |
| 40 | 40 |
| 41 void SetError(PipelineError error); | 41 void SetError(PipelineStatus error); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 class FilterHostImpl; | 44 class FilterHostImpl; |
| 45 | 45 |
| 46 enum State { | 46 enum State { |
| 47 kInvalid, | 47 kInvalid, |
| 48 kCreated, | 48 kCreated, |
| 49 kPaused, | 49 kPaused, |
| 50 kPlayPending, | 50 kPlayPending, |
| 51 kStopWhilePlayPending, | 51 kStopWhilePlayPending, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 82 // Filter callback for a serial sequence. | 82 // Filter callback for a serial sequence. |
| 83 void SerialCallback(); | 83 void SerialCallback(); |
| 84 | 84 |
| 85 // Filter callback for a parallel sequence. | 85 // Filter callback for a parallel sequence. |
| 86 void ParallelCallback(); | 86 void ParallelCallback(); |
| 87 | 87 |
| 88 // Called when a parallel or serial call sequence completes. | 88 // Called when a parallel or serial call sequence completes. |
| 89 void OnCallSequenceDone(); | 89 void OnCallSequenceDone(); |
| 90 | 90 |
| 91 // Helper function for sending an error to the FilterHost. | 91 // Helper function for sending an error to the FilterHost. |
| 92 void SendErrorToHost(PipelineError error); | 92 void SendErrorToHost(PipelineStatus error); |
| 93 | 93 |
| 94 // Helper function for handling errors during call sequences. | 94 // Helper function for handling errors during call sequences. |
| 95 void HandleError(PipelineError error); | 95 void HandleError(PipelineStatus error); |
| 96 | 96 |
| 97 // Creates a callback that can be called from any thread, but is guaranteed | 97 // Creates a callback that can be called from any thread, but is guaranteed |
| 98 // to call the specified method on the thread associated with this filter. | 98 // to call the specified method on the thread associated with this filter. |
| 99 FilterCallback* NewThreadSafeCallback(void (CompositeFilter::*method)()); | 99 FilterCallback* NewThreadSafeCallback(void (CompositeFilter::*method)()); |
| 100 | 100 |
| 101 // Helper function used by NewThreadSafeCallback() to make sure the | 101 // Helper function used by NewThreadSafeCallback() to make sure the |
| 102 // method gets called on the right thread. | 102 // method gets called on the right thread. |
| 103 static void OnCallback(MessageLoop* message_loop, | 103 static void OnCallback(MessageLoop* message_loop, |
| 104 CancelableTask* task); | 104 CancelableTask* task); |
| 105 | 105 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 123 // The index of the filter currently processing a request. | 123 // The index of the filter currently processing a request. |
| 124 unsigned int sequence_index_; | 124 unsigned int sequence_index_; |
| 125 | 125 |
| 126 // Message loop passed into the constructor. | 126 // Message loop passed into the constructor. |
| 127 MessageLoop* message_loop_; | 127 MessageLoop* message_loop_; |
| 128 | 128 |
| 129 // FilterHost implementation passed to Filters owned by this | 129 // FilterHost implementation passed to Filters owned by this |
| 130 // object. | 130 // object. |
| 131 scoped_ptr<FilterHostImpl> host_impl_; | 131 scoped_ptr<FilterHostImpl> host_impl_; |
| 132 | 132 |
| 133 // Error passed in the last SetError() call. | 133 // PIPELINE_OK, or last error passed to SetError(). |
| 134 PipelineError error_; | 134 PipelineStatus status_; |
| 135 | 135 |
| 136 scoped_ptr<ScopedRunnableMethodFactory<CompositeFilter> > runnable_factory_; | 136 scoped_ptr<ScopedRunnableMethodFactory<CompositeFilter> > runnable_factory_; |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); | 138 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace media | 141 } // namespace media |
| 142 | 142 |
| 143 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ | 143 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ |
| OLD | NEW |