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

Unified Diff: media/base/video_renderer.h

Issue 10796074: Move VideoRenderer out of Filter heirarchy. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 8 years, 5 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/video_renderer.h
diff --git a/media/base/video_renderer.h b/media/base/video_renderer.h
index 8907610595de103bc66290b5f81243df7fd9a19e..a4d3dcb18fb0f46b4df9f13d24c8f2002bb563f4 100644
--- a/media/base/video_renderer.h
+++ b/media/base/video_renderer.h
@@ -8,33 +8,79 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
-#include "media/base/filters.h"
#include "media/base/media_export.h"
#include "media/base/pipeline_status.h"
+namespace gfx {
+class Size;
+}
+
namespace media {
class VideoDecoder;
-class MEDIA_EXPORT VideoRenderer : public Filter {
+class MEDIA_EXPORT VideoRenderer
+ : public base::RefCountedThreadSafe<VideoRenderer> {
public:
// Used to update the pipeline's clock time. The parameter is the time that
// the clock should not exceed.
typedef base::Callback<void(base::TimeDelta)> TimeCB;
+ // Executed when the natural size of the video has changed.
+ typedef base::Callback<void(const gfx::Size& size)> NaturalSizeChangedCB;
+
+ // Used to query the current time and duration of the media.
Ami GONE FROM CHROMIUM 2012/07/21 05:02:35 s/and/or/
scherkus (not reviewing) 2012/07/23 03:21:12 Done.
+ typedef base::Callback<base::TimeDelta()> TimeDeltaCB;
+
// Initialize a VideoRenderer with the given VideoDecoder, executing the
// callback upon completion.
virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder,
const PipelineStatusCB& status_cb,
const StatisticsCB& statistics_cb,
- const TimeCB& time_cb) = 0;
+ const TimeCB& time_cb,
+ const NaturalSizeChangedCB& size_changed_cb,
+ const base::Closure& ended_cb,
+ const PipelineStatusCB& error_cb,
Ami GONE FROM CHROMIUM 2012/07/21 05:02:35 This highlights that "status_cb" is a bad name (sh
scherkus (not reviewing) 2012/07/23 03:21:12 Agreed - changed status_cb to init_cb
+ const TimeDeltaCB& get_time_cb,
+ const TimeDeltaCB& get_duration_cb) = 0;
+
+ // Start audio decoding and rendering at the current playback rate, executing
+ // |callback| when playback is underway.
+ virtual void Play(const base::Closure& callback) = 0;
+
+ // Temporarily suspend decoding and rendering video, executing |callback| when
+ // playback has been suspended.
+ virtual void Pause(const base::Closure& callback) = 0;
+
+ // Discard any video data, executing |callback| when completed.
+ virtual void Flush(const base::Closure& callback) = 0;
- // Returns true if this filter has received and processed an end-of-stream
- // buffer.
+ // Start prerolling video data for samples starting at |time|, executing
+ // |callback| when completed.
+ //
+ // Only valid to call after a successful Initialize() or Flush().
+ //
+ // TODO(scherkus): rename this to Preroll().
+ virtual void Seek(base::TimeDelta time, const PipelineStatusCB& callback) = 0;
+
+ // Stop all operations in preparation for being deleted, executing |callback|
+ // when complete.
+ virtual void Stop(const base::Closure& callback) = 0;
+
+ // Updates the current playback rate.
+ virtual void SetPlaybackRate(float playback_rate) = 0;
+
+ // Returns true if all video data has been rendered.
virtual bool HasEnded() = 0;
protected:
- virtual ~VideoRenderer() {}
+ friend class base::RefCountedThreadSafe<VideoRenderer>;
+
+ VideoRenderer();
+ virtual ~VideoRenderer();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VideoRenderer);
};
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698