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

Unified Diff: media/base/filters.h

Issue 2101015: Change MediaFilter::Stop() to accept a callback so that Stop() is asynchronous. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Revert filter changes. Going to make that another patch. Created 10 years, 7 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
Index: media/base/filters.h
diff --git a/media/base/filters.h b/media/base/filters.h
index c4da5d9143f72477fc4b760903b573db8d41379f..141a75346a694eeb7a7cc232a84104e8a51c2800 100644
--- a/media/base/filters.h
+++ b/media/base/filters.h
@@ -108,9 +108,22 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> {
}
}
+ // TODO(boliu): Remove once Stop() is asynchronous in subclasses.
+ virtual void Stop() {}
+
// The pipeline is being stopped either as a result of an error or because
// the client called Stop().
- virtual void Stop() = 0;
+ // TODO(boliu): No implementation in subclasses yet.
+ virtual void Stop(FilterCallback* callback) {
+ // TODO(boliu): Call the synchronous version for now. Remove once
+ // all filters have asynchronous stop.
+ Stop();
+
+ if (callback) {
+ callback->Run();
+ delete callback;
+ }
+ }
// The pipeline playback rate has been changed. Filters may implement this
// method if they need to respond to this call.
« no previous file with comments | « media/base/filter_host.h ('k') | media/base/mock_filters.h » ('j') | media/base/pipeline_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698