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

Unified Diff: media/filters/video_renderer_base.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/filters/video_renderer_base.h
diff --git a/media/filters/video_renderer_base.h b/media/filters/video_renderer_base.h
index 1f3bd6c6e982b0c4fd295377330fd0515fbc269a..592f5d1e7788d29980d786b1f32b2bd6d31837ca 100644
--- a/media/filters/video_renderer_base.h
+++ b/media/filters/video_renderer_base.h
@@ -11,6 +11,7 @@
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/threading/platform_thread.h"
+#include "media/base/demuxer_stream.h"
#include "media/base/pipeline_status.h"
#include "media/base/video_decoder.h"
#include "media/base/video_frame.h"
@@ -50,7 +51,8 @@ class MEDIA_EXPORT VideoRendererBase
bool drop_frames);
// VideoRenderer implementation.
- 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& max_time_cb,
@@ -66,6 +68,7 @@ class MEDIA_EXPORT VideoRendererBase
const PipelineStatusCB& cb) OVERRIDE;
virtual void Stop(const base::Closure& callback) OVERRIDE;
virtual void SetPlaybackRate(float playback_rate) OVERRIDE;
+ virtual void PrepareForShutdownHack() OVERRIDE;
// PlatformThread::Delegate implementation.
virtual void ThreadMain() OVERRIDE;
@@ -119,6 +122,18 @@ class MEDIA_EXPORT VideoRendererBase
// |size_changed_cb_| if the natural size changes.
void SetCurrentFrameToNextReadyFrame();
+ // Pops the front of |decoders|, assigns it to |decoder_| and then
+ // calls initialize on the new decoder.
+ void InitializeNextDecoder(const scoped_refptr<DemuxerStream>& demuxer_stream,
+ scoped_ptr<VideoDecoderList> decoders);
+
+ // Called when |decoder_| initialization completes.
+ // |demuxer_stream| & |decoders| are used if initialization failed and
+ // InitializeNextDecoder() needs to be called again.
+ void OnDecoderInitDone(const scoped_refptr<DemuxerStream>& demuxer_stream,
+ scoped_ptr<VideoDecoderList> decoders,
+ PipelineStatus status);
+
// Used for accessing data members.
base::Lock lock_;
@@ -210,6 +225,7 @@ class MEDIA_EXPORT VideoRendererBase
PipelineStatusCB preroll_cb_;
// Event callbacks.
+ PipelineStatusCB init_cb_;
StatisticsCB statistics_cb_;
TimeCB max_time_cb_;
NaturalSizeChangedCB size_changed_cb_;

Powered by Google App Engine
This is Rietveld 408576698