Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Unified Diff: media/base/filters.h

Issue 3030013: preparation for recycling buffer, patch 2 (Closed)
Patch Set: fix layout test Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/mock_filters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « no previous file | media/base/mock_filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698