| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ | 6 #define MEDIA_FILTERS_VIDEO_RENDERER_IMPL_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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/synchronization/condition_variable.h" | 14 #include "base/synchronization/condition_variable.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
| 17 #include "media/base/decryptor.h" | 17 #include "media/base/decryptor.h" |
| 18 #include "media/base/demuxer_stream.h" | 18 #include "media/base/demuxer_stream.h" |
| 19 #include "media/base/media_log.h" |
| 19 #include "media/base/pipeline_status.h" | 20 #include "media/base/pipeline_status.h" |
| 20 #include "media/base/video_decoder.h" | 21 #include "media/base/video_decoder.h" |
| 21 #include "media/base/video_frame.h" | 22 #include "media/base/video_frame.h" |
| 22 #include "media/base/video_renderer.h" | 23 #include "media/base/video_renderer.h" |
| 23 #include "media/filters/decoder_stream.h" | 24 #include "media/filters/decoder_stream.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class SingleThreadTaskRunner; | 27 class SingleThreadTaskRunner; |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 // Implementors should avoid doing any sort of heavy work in this method and | 47 // Implementors should avoid doing any sort of heavy work in this method and |
| 47 // instead post a task to a common/worker thread to handle rendering. Slowing | 48 // instead post a task to a common/worker thread to handle rendering. Slowing |
| 48 // down the video thread may result in losing synchronization with audio. | 49 // down the video thread may result in losing synchronization with audio. |
| 49 // | 50 // |
| 50 // Setting |drop_frames_| to true causes the renderer to drop expired frames. | 51 // Setting |drop_frames_| to true causes the renderer to drop expired frames. |
| 51 VideoRendererImpl( | 52 VideoRendererImpl( |
| 52 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 53 ScopedVector<VideoDecoder> decoders, | 54 ScopedVector<VideoDecoder> decoders, |
| 54 const SetDecryptorReadyCB& set_decryptor_ready_cb, | 55 const SetDecryptorReadyCB& set_decryptor_ready_cb, |
| 55 const PaintCB& paint_cb, | 56 const PaintCB& paint_cb, |
| 56 bool drop_frames); | 57 bool drop_frames, |
| 58 const LogCB& log_cb); |
| 57 virtual ~VideoRendererImpl(); | 59 virtual ~VideoRendererImpl(); |
| 58 | 60 |
| 59 // VideoRenderer implementation. | 61 // VideoRenderer implementation. |
| 60 virtual void Initialize(DemuxerStream* stream, | 62 virtual void Initialize(DemuxerStream* stream, |
| 61 bool low_delay, | 63 bool low_delay, |
| 62 const PipelineStatusCB& init_cb, | 64 const PipelineStatusCB& init_cb, |
| 63 const StatisticsCB& statistics_cb, | 65 const StatisticsCB& statistics_cb, |
| 64 const TimeCB& max_time_cb, | 66 const TimeCB& max_time_cb, |
| 65 const BufferingStateCB& buffering_state_cb, | 67 const BufferingStateCB& buffering_state_cb, |
| 66 const base::Closure& ended_cb, | 68 const base::Closure& ended_cb, |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 213 |
| 212 // NOTE: Weak pointers must be invalidated before all other member variables. | 214 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 213 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; | 215 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; |
| 214 | 216 |
| 215 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); | 217 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); |
| 216 }; | 218 }; |
| 217 | 219 |
| 218 } // namespace media | 220 } // namespace media |
| 219 | 221 |
| 220 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ | 222 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ |
| OLD | NEW |