Index: media/base/filters.h |
diff --git a/media/base/filters.h b/media/base/filters.h |
index 88792333bace5aca2f83928701702e2300a79db1..e9d2c275390d37f8a6cab832ba1603407379d8aa 100644 |
--- a/media/base/filters.h |
+++ b/media/base/filters.h |
@@ -92,7 +92,7 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { |
// The pipeline has resumed playback. Filters can continue requesting reads. |
// Filters may implement this method if they need to respond to this call. |
- // TODO(boliu): Check that callback is not NULL in sublcasses. |
+ // TODO(boliu): Check that callback is not NULL in subclasses. |
virtual void Play(FilterCallback* callback) { |
DCHECK(callback); |
if (callback) { |
@@ -101,10 +101,9 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { |
} |
} |
- // The pipeline has paused playback. Filters should fulfill any existing read |
- // requests and then idle. Filters may implement this method if they need to |
- // respond to this call. |
- // TODO(boliu): Check that callback is not NULL in sublcasses. |
+ // The pipeline has paused playback. Filters should stop buffer exchange. |
+ // Filters may implement this method if they need to respond to this call. |
+ // TODO(boliu): Check that callback is not NULL in subclasses. |
virtual void Pause(FilterCallback* callback) { |
DCHECK(callback); |
if (callback) { |
@@ -113,9 +112,20 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { |
} |
} |
+ // The pipeline has been flushed. Filters should return buffer to owners. |
+ // Filters may implement this method if they need to respond to this call. |
+ // TODO(boliu): Check that callback is not NULL in subclasses. |
+ virtual void Flush(FilterCallback* callback) { |
+ DCHECK(callback); |
+ if (callback) { |
+ callback->Run(); |
+ delete callback; |
+ } |
+ } |
+ |
// The pipeline is being stopped either as a result of an error or because |
// the client called Stop(). |
- // TODO(boliu): Check that callback is not NULL in sublcasses. |
+ // TODO(boliu): Check that callback is not NULL in subclasses. |
virtual void Stop(FilterCallback* callback) { |
DCHECK(callback); |
if (callback) { |
@@ -293,6 +303,9 @@ class VideoDecoder : public MediaFilter { |
// We could also pass empty pointer here to let decoder provide buffers pool. |
virtual void FillThisBuffer(scoped_refptr<VideoFrame> frame) = 0; |
+ // Indicate whether decoder provides its own output buffers |
+ virtual bool ProvidesBuffer() = 0; |
+ |
private: |
scoped_ptr<FillBufferDoneCallback> fill_buffer_done_callback_; |
}; |