Chromium Code Reviews| Index: media/filters/video_renderer_base.h |
| diff --git a/media/filters/video_renderer_base.h b/media/filters/video_renderer_base.h |
| index baad0b7315e01c508d1779707c7edbb3006b6372..4446d36234fe0ad53cff873ce45c01c0acd7600c 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, |
| @@ -67,6 +69,7 @@ class MEDIA_EXPORT VideoRendererBase |
| virtual void Stop(const base::Closure& callback) OVERRIDE; |
| virtual void SetPlaybackRate(float playback_rate) OVERRIDE; |
| virtual bool HasEnded() OVERRIDE; |
| + virtual void PrepareForShutdownHack() OVERRIDE; |
| // PlatformThread::Delegate implementation. |
| virtual void ThreadMain() OVERRIDE; |
| @@ -120,9 +123,20 @@ 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(); |
| + |
| + // Called when |decoder_| initialization completes. |
| + void OnDecoderInitDone(PipelineStatus status); |
| + |
| // Used for accessing data members. |
| base::Lock lock_; |
| + // List of candidate decoders to try during initialization. |
| + VideoDecoderList decoders_; |
|
Ami GONE FROM CHROMIUM
2012/08/09 20:30:18
This is only used during initialization, so could
acolwell GONE FROM CHROMIUM
2012/08/09 22:23:32
Done.
|
| + |
| + scoped_refptr<DemuxerStream> demuxer_stream_; |
|
Ami GONE FROM CHROMIUM
2012/08/09 20:30:18
ditto
acolwell GONE FROM CHROMIUM
2012/08/09 22:23:32
Done.
|
| scoped_refptr<VideoDecoder> decoder_; |
| // Queue of incoming frames as well as the current frame since the last time |
| @@ -211,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_; |