OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Filters are connected in a strongly typed manner, with downstream filters | 5 // Filters are connected in a strongly typed manner, with downstream filters |
6 // always reading data from upstream filters. Upstream filters have no clue | 6 // always reading data from upstream filters. Upstream filters have no clue |
7 // who is actually reading from them, and return the results via callbacks. | 7 // who is actually reading from them, and return the results via callbacks. |
8 // | 8 // |
9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer | 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer |
10 // DataSource <- Demuxer < | 10 // DataSource <- Demuxer < |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // The pipeline has paused playback. Filters should fulfill any existing read | 101 // The pipeline has paused playback. Filters should fulfill any existing read |
102 // requests and then idle. Filters may implement this method if they need to | 102 // requests and then idle. Filters may implement this method if they need to |
103 // respond to this call. | 103 // respond to this call. |
104 virtual void Pause(FilterCallback* callback) { | 104 virtual void Pause(FilterCallback* callback) { |
105 if (callback) { | 105 if (callback) { |
106 callback->Run(); | 106 callback->Run(); |
107 delete callback; | 107 delete callback; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
| 111 // TODO(boliu): Remove once Stop() is asynchronous in subclasses. |
| 112 virtual void Stop() {} |
| 113 |
111 // The pipeline is being stopped either as a result of an error or because | 114 // The pipeline is being stopped either as a result of an error or because |
112 // the client called Stop(). | 115 // the client called Stop(). |
113 virtual void Stop() = 0; | 116 // TODO(boliu): No implementation in subclasses yet. |
| 117 virtual void Stop(FilterCallback* callback) { |
| 118 // TODO(boliu): Call the synchronous version for now. Remove once |
| 119 // all filters have asynchronous stop. |
| 120 Stop(); |
| 121 |
| 122 if (callback) { |
| 123 callback->Run(); |
| 124 delete callback; |
| 125 } |
| 126 } |
114 | 127 |
115 // The pipeline playback rate has been changed. Filters may implement this | 128 // The pipeline playback rate has been changed. Filters may implement this |
116 // method if they need to respond to this call. | 129 // method if they need to respond to this call. |
117 virtual void SetPlaybackRate(float playback_rate) {} | 130 virtual void SetPlaybackRate(float playback_rate) {} |
118 | 131 |
119 // Carry out any actions required to seek to the given time, executing the | 132 // Carry out any actions required to seek to the given time, executing the |
120 // callback upon completion. | 133 // callback upon completion. |
121 virtual void Seek(base::TimeDelta time, FilterCallback* callback) { | 134 virtual void Seek(base::TimeDelta time, FilterCallback* callback) { |
122 scoped_ptr<FilterCallback> seek_callback(callback); | 135 scoped_ptr<FilterCallback> seek_callback(callback); |
123 if (seek_callback.get()) { | 136 if (seek_callback.get()) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // buffer. | 375 // buffer. |
363 virtual bool HasEnded() = 0; | 376 virtual bool HasEnded() = 0; |
364 | 377 |
365 // Sets the output volume. | 378 // Sets the output volume. |
366 virtual void SetVolume(float volume) = 0; | 379 virtual void SetVolume(float volume) = 0; |
367 }; | 380 }; |
368 | 381 |
369 } // namespace media | 382 } // namespace media |
370 | 383 |
371 #endif // MEDIA_BASE_FILTERS_H_ | 384 #endif // MEDIA_BASE_FILTERS_H_ |
OLD | NEW |