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

Unified Diff: media/base/filters.h

Issue 6969026: Convert Filter::Seek() to use new callback system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add files in content/renderer/media Created 9 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 901a91bc4f3950dc446f51880557150b6fe63b0c..e9a9dbb90e259c03d146f20ed255b9442d3059b7 100644
--- a/media/base/filters.h
+++ b/media/base/filters.h
@@ -33,6 +33,7 @@
#include "base/time.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media_format.h"
+#include "media/base/pipeline_status.h"
#include "media/base/video_frame.h"
struct AVStream;
@@ -62,6 +63,12 @@ enum Preload {
// Used for completing asynchronous methods.
typedef Callback0::Type FilterCallback;
+typedef base::Callback<void(PipelineStatus)> FilterStatusCB;
+
+// This function copies |cb|, calls Reset() on |cb|, and then returns
+// the copy. This is used in the common case where you need to clear
+// a callback member variable before calling the callback.
+FilterStatusCB CopyAndResetCB(FilterStatusCB& cb);
Ami GONE FROM CHROMIUM 2011/05/12 20:42:16 style guide says no non-const reference passing.
Ami GONE FROM CHROMIUM 2011/05/12 20:42:16 I think you only use this to immediately Run() the
acolwell GONE FROM CHROMIUM 2011/05/12 22:30:40 Done.
acolwell GONE FROM CHROMIUM 2011/05/12 22:30:40 Created a slightly modified version that uses a te
// Used for updating pipeline statistics.
typedef Callback1<const PipelineStatistics&>::Type StatisticsCallback;
@@ -104,7 +111,7 @@ class Filter : public base::RefCountedThreadSafe<Filter> {
// Carry out any actions required to seek to the given time, executing the
// callback upon completion.
- virtual void Seek(base::TimeDelta time, FilterCallback* callback);
+ virtual void Seek(base::TimeDelta time, const FilterStatusCB& callback);
// This method is called from the pipeline when the audio renderer
// is disabled. Filters can ignore the notification if they do not

Powered by Google App Engine
This is Rietveld 408576698