| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_RENDERER_IMPL_H_ |
| 6 #define MEDIA_FILTERS_RENDERER_IMPL_H_ | 6 #define MEDIA_FILTERS_RENDERER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // part of JS sync API. |get_duration_cb| is used to get the duration of the | 37 // part of JS sync API. |get_duration_cb| is used to get the duration of the |
| 38 // stream. | 38 // stream. |
| 39 RendererImpl(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 39 RendererImpl(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 40 Demuxer* demuxer, | 40 Demuxer* demuxer, |
| 41 scoped_ptr<AudioRenderer> audio_renderer, | 41 scoped_ptr<AudioRenderer> audio_renderer, |
| 42 scoped_ptr<VideoRenderer> video_renderer); | 42 scoped_ptr<VideoRenderer> video_renderer); |
| 43 | 43 |
| 44 virtual ~RendererImpl(); | 44 virtual ~RendererImpl(); |
| 45 | 45 |
| 46 // Renderer implementation. | 46 // Renderer implementation. |
| 47 virtual void Initialize(const PipelineStatusCB& init_cb, | 47 virtual void Initialize(const base::Closure& init_cb, |
| 48 const StatisticsCB& statistics_cb, | 48 const StatisticsCB& statistics_cb, |
| 49 const base::Closure& ended_cb, | 49 const base::Closure& ended_cb, |
| 50 const PipelineStatusCB& error_cb, | 50 const PipelineStatusCB& error_cb, |
| 51 const BufferingStateCB& buffering_state_cb, | 51 const BufferingStateCB& buffering_state_cb, |
| 52 const TimeDeltaCB& get_duration_cb) OVERRIDE; | 52 const TimeDeltaCB& get_duration_cb) OVERRIDE; |
| 53 virtual void Flush(const base::Closure& flush_cb) OVERRIDE; | 53 virtual void Flush(const base::Closure& flush_cb) OVERRIDE; |
| 54 virtual void StartPlayingFrom(base::TimeDelta time) OVERRIDE; | 54 virtual void StartPlayingFrom(base::TimeDelta time) OVERRIDE; |
| 55 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; | 55 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; |
| 56 virtual void SetVolume(float volume) OVERRIDE; | 56 virtual void SetVolume(float volume) OVERRIDE; |
| 57 virtual base::TimeDelta GetMediaTime() OVERRIDE; | 57 virtual base::TimeDelta GetMediaTime() OVERRIDE; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Permanent callback to get the media duration. | 133 // Permanent callback to get the media duration. |
| 134 TimeDeltaCB get_duration_cb_; | 134 TimeDeltaCB get_duration_cb_; |
| 135 | 135 |
| 136 // Permanent callbacks to notify various renderer states/stats. | 136 // Permanent callbacks to notify various renderer states/stats. |
| 137 StatisticsCB statistics_cb_; | 137 StatisticsCB statistics_cb_; |
| 138 base::Closure ended_cb_; | 138 base::Closure ended_cb_; |
| 139 PipelineStatusCB error_cb_; | 139 PipelineStatusCB error_cb_; |
| 140 BufferingStateCB buffering_state_cb_; | 140 BufferingStateCB buffering_state_cb_; |
| 141 | 141 |
| 142 // Temporary callback used for Initialize() and Flush(). | 142 // Temporary callback used for Initialize() and Flush(). |
| 143 PipelineStatusCB init_cb_; | 143 base::Closure init_cb_; |
| 144 base::Closure flush_cb_; | 144 base::Closure flush_cb_; |
| 145 | 145 |
| 146 scoped_ptr<AudioRenderer> audio_renderer_; | 146 scoped_ptr<AudioRenderer> audio_renderer_; |
| 147 scoped_ptr<VideoRenderer> video_renderer_; | 147 scoped_ptr<VideoRenderer> video_renderer_; |
| 148 | 148 |
| 149 // Renderer-provided time source used to control playback. | 149 // Renderer-provided time source used to control playback. |
| 150 TimeSource* time_source_; | 150 TimeSource* time_source_; |
| 151 | 151 |
| 152 // The time to start playback from after starting/seeking has completed. | 152 // The time to start playback from after starting/seeking has completed. |
| 153 base::TimeDelta start_time_; | 153 base::TimeDelta start_time_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // NOTE: Weak pointers must be invalidated before all other member variables. | 190 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 191 base::WeakPtrFactory<RendererImpl> weak_factory_; | 191 base::WeakPtrFactory<RendererImpl> weak_factory_; |
| 192 base::WeakPtr<RendererImpl> weak_this_; | 192 base::WeakPtr<RendererImpl> weak_this_; |
| 193 | 193 |
| 194 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 194 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 } // namespace media | 197 } // namespace media |
| 198 | 198 |
| 199 #endif // MEDIA_FILTERS_RENDERER_IMPL_H_ | 199 #endif // MEDIA_FILTERS_RENDERER_IMPL_H_ |
| OLD | NEW |