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

Unified Diff: media/base/video_renderer.h

Issue 10836167: Move VideoDecoder initialization into VideoRendererBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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
Index: media/base/video_renderer.h
diff --git a/media/base/video_renderer.h b/media/base/video_renderer.h
index 285592e00ef6bc74e9dce07473fb91fcafaa09e9..0ac60e8189453613a4546c9dbe361bb42d9bac06 100644
--- a/media/base/video_renderer.h
+++ b/media/base/video_renderer.h
@@ -5,6 +5,8 @@
#ifndef MEDIA_BASE_VIDEO_RENDERER_H_
#define MEDIA_BASE_VIDEO_RENDERER_H_
+#include <list>
+
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
@@ -17,11 +19,14 @@ class Size;
namespace media {
+class DemuxerStream;
class VideoDecoder;
class MEDIA_EXPORT VideoRenderer
: public base::RefCountedThreadSafe<VideoRenderer> {
public:
+ typedef std::list<scoped_refptr<VideoDecoder> > VideoDecoderList;
+
// 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;
@@ -50,7 +55,8 @@ class MEDIA_EXPORT VideoRenderer
// |get_time_cb| is used to query the current media playback time.
//
// |get_duration_cb| is used to query the media duration.
- virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder,
+ virtual void Initialize(const scoped_refptr<DemuxerStream>& stream,
+ const VideoDecoderList& decoders,
const PipelineStatusCB& init_cb,
const StatisticsCB& statistics_cb,
const TimeCB& time_cb,
@@ -85,6 +91,13 @@ class MEDIA_EXPORT VideoRenderer
// Updates the current playback rate.
virtual void SetPlaybackRate(float playback_rate) = 0;
+ // Prepare decoder for shutdown. This is a HACK needed because
+ // PipelineImpl::Stop() goes through a Pause/Flush/Stop dance to all its
+ // filters, waiting for each state transition to complete before starting the
+ // next, but WebMediaPlayerImpl::Destroy() holds the renderer loop hostage for
+ // the duration. http://crbug.com/110228 tracks removing this.
+ virtual void PrepareForShutdownHack() = 0;
+
protected:
friend class base::RefCountedThreadSafe<VideoRenderer>;

Powered by Google App Engine
This is Rietveld 408576698