public base::PlatformThread::Delegate {
public:
typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> PaintCB;
public base::PlatformThread::Delegate {
public:
typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> PaintCB;
// |decoders| contains the VideoDecoders to use when initializing.
//
// |paint_cb| is executed on the video frame timing thread whenever a new
// frame is available for painting.
//
// |decoders| contains the VideoDecoders to use when initializing.
//
// |paint_cb| is executed on the video frame timing thread whenever a new
// frame is available for painting.
//
// Implementors should avoid doing any sort of heavy work in this method and
// instead post a task to a common/worker thread to handle rendering. Slowing
// down the video thread may result in losing synchronization with audio.
// Implementors should avoid doing any sort of heavy work in this method and
// instead post a task to a common/worker thread to handle rendering. Slowing
// down the video thread may result in losing synchronization with audio.
ScopedVector<VideoDecoder> decoders,
const SetDecryptorReadyCB& set_decryptor_ready_cb,
const PaintCB& paint_cb,
ScopedVector<VideoDecoder> decoders,
const SetDecryptorReadyCB& set_decryptor_ready_cb,
const PaintCB& paint_cb,
bool drop_frames);
virtual ~VideoRendererImpl();
// VideoRenderer implementation.
virtual void Initialize(DemuxerStream* stream,
bool drop_frames);
virtual ~VideoRendererImpl();
// VideoRenderer implementation.
virtual void Initialize(DemuxerStream* stream,
const PipelineStatusCB& init_cb,
const StatisticsCB& statistics_cb,
const TimeCB& max_time_cb,
const PipelineStatusCB& init_cb,
const StatisticsCB& statistics_cb,
const TimeCB& max_time_cb,
// Callback for |video_frame_stream_| to deliver decoded video frames and
// report video decoding status.
// Callback for |video_frame_stream_| to deliver decoded video frames and
// report video decoding status.
// Queue of incoming frames yet to be painted.
typedef std::deque<scoped_refptr<VideoFrame> > VideoFrameQueue;
VideoFrameQueue ready_frames_;
// Queue of incoming frames yet to be painted.
typedef std::deque<scoped_refptr<VideoFrame> > VideoFrameQueue;
VideoFrameQueue ready_frames_;
// Used to signal |thread_| as frames are added to |frames_|. Rule of thumb:
// always check |state_| to see if it was set to STOPPED after waking up!
// Used to signal |thread_| as frames are added to |frames_|. Rule of thumb:
// always check |state_| to see if it was set to STOPPED after waking up!
// The timestamp of the last frame removed from the |ready_frames_| queue,
// either for calling |paint_cb_| or for dropping. Set to kNoTimestamp()
// during flushing.
// The timestamp of the last frame removed from the |ready_frames_| queue,
// either for calling |paint_cb_| or for dropping. Set to kNoTimestamp()
// during flushing.