| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 6 #define MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Setting |drop_frames_| to true causes the renderer to drop expired frames. | 59 // Setting |drop_frames_| to true causes the renderer to drop expired frames. |
| 60 VideoRendererBase(const scoped_refptr<base::MessageLoopProxy>& message_loop, | 60 VideoRendererBase(const scoped_refptr<base::MessageLoopProxy>& message_loop, |
| 61 ScopedVector<VideoDecoder> decoders, | 61 ScopedVector<VideoDecoder> decoders, |
| 62 const SetDecryptorReadyCB& set_decryptor_ready_cb, | 62 const SetDecryptorReadyCB& set_decryptor_ready_cb, |
| 63 const PaintCB& paint_cb, | 63 const PaintCB& paint_cb, |
| 64 const SetOpaqueCB& set_opaque_cb, | 64 const SetOpaqueCB& set_opaque_cb, |
| 65 bool drop_frames); | 65 bool drop_frames); |
| 66 virtual ~VideoRendererBase(); | 66 virtual ~VideoRendererBase(); |
| 67 | 67 |
| 68 // VideoRenderer implementation. | 68 // VideoRenderer implementation. |
| 69 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 69 virtual void Initialize(DemuxerStream* stream, |
| 70 const PipelineStatusCB& init_cb, | 70 const PipelineStatusCB& init_cb, |
| 71 const StatisticsCB& statistics_cb, | 71 const StatisticsCB& statistics_cb, |
| 72 const TimeCB& max_time_cb, | 72 const TimeCB& max_time_cb, |
| 73 const NaturalSizeChangedCB& size_changed_cb, | 73 const NaturalSizeChangedCB& size_changed_cb, |
| 74 const base::Closure& ended_cb, | 74 const base::Closure& ended_cb, |
| 75 const PipelineStatusCB& error_cb, | 75 const PipelineStatusCB& error_cb, |
| 76 const TimeDeltaCB& get_time_cb, | 76 const TimeDeltaCB& get_time_cb, |
| 77 const TimeDeltaCB& get_duration_cb) OVERRIDE; | 77 const TimeDeltaCB& get_duration_cb) OVERRIDE; |
| 78 virtual void Play(const base::Closure& callback) OVERRIDE; | 78 virtual void Play(const base::Closure& callback) OVERRIDE; |
| 79 virtual void Pause(const base::Closure& callback) OVERRIDE; | 79 virtual void Pause(const base::Closure& callback) OVERRIDE; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 scoped_refptr<base::MessageLoopProxy> message_loop_; | 140 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 141 base::WeakPtrFactory<VideoRendererBase> weak_factory_; | 141 base::WeakPtrFactory<VideoRendererBase> weak_factory_; |
| 142 base::WeakPtr<VideoRendererBase> weak_this_; | 142 base::WeakPtr<VideoRendererBase> weak_this_; |
| 143 | 143 |
| 144 scoped_ptr<VideoDecoderSelector> decoder_selector_; | 144 scoped_ptr<VideoDecoderSelector> decoder_selector_; |
| 145 | 145 |
| 146 // Used for accessing data members. | 146 // Used for accessing data members. |
| 147 base::Lock lock_; | 147 base::Lock lock_; |
| 148 | 148 |
| 149 // Provides video frames to VideoRendererBase. | 149 // Provides video frames to VideoRendererBase. |
| 150 scoped_refptr<VideoFrameStream> video_frame_stream_; | 150 VideoFrameStream video_frame_stream_; |
| 151 | 151 |
| 152 // Queue of incoming frames yet to be painted. | 152 // Queue of incoming frames yet to be painted. |
| 153 typedef std::deque<scoped_refptr<VideoFrame> > VideoFrameQueue; | 153 typedef std::deque<scoped_refptr<VideoFrame> > VideoFrameQueue; |
| 154 VideoFrameQueue ready_frames_; | 154 VideoFrameQueue ready_frames_; |
| 155 | 155 |
| 156 // Keeps track of whether we received the end of stream buffer. | 156 // Keeps track of whether we received the end of stream buffer. |
| 157 bool received_end_of_stream_; | 157 bool received_end_of_stream_; |
| 158 | 158 |
| 159 // Used to signal |thread_| as frames are added to |frames_|. Rule of thumb: | 159 // Used to signal |thread_| as frames are added to |frames_|. Rule of thumb: |
| 160 // always check |state_| to see if it was set to STOPPED after waking up! | 160 // always check |state_| to see if it was set to STOPPED after waking up! |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // either for calling |paint_cb_| or for dropping. Set to kNoTimestamp() | 247 // either for calling |paint_cb_| or for dropping. Set to kNoTimestamp() |
| 248 // during flushing. | 248 // during flushing. |
| 249 base::TimeDelta last_timestamp_; | 249 base::TimeDelta last_timestamp_; |
| 250 | 250 |
| 251 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); | 251 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace media | 254 } // namespace media |
| 255 | 255 |
| 256 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 256 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
| OLD | NEW |