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_RENDERERS_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_ |
6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ | 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // Used to defer underflow for video when audio is present. | 222 // Used to defer underflow for video when audio is present. |
223 base::CancelableClosure deferred_video_underflow_cb_; | 223 base::CancelableClosure deferred_video_underflow_cb_; |
224 | 224 |
225 // Used to defer underflow for audio when restarting audio playback. | 225 // Used to defer underflow for audio when restarting audio playback. |
226 base::CancelableClosure deferred_audio_restart_underflow_cb_; | 226 base::CancelableClosure deferred_audio_restart_underflow_cb_; |
227 | 227 |
228 // The amount of time to wait before declaring underflow if the video renderer | 228 // The amount of time to wait before declaring underflow if the video renderer |
229 // runs out of data but the audio renderer still has enough. | 229 // runs out of data but the audio renderer still has enough. |
230 base::TimeDelta video_underflow_threshold_; | 230 base::TimeDelta video_underflow_threshold_; |
231 | 231 |
| 232 // Lock used to protect access to the |restarting_audio_| flag and |
| 233 // |restarting_audio_time_|. |
| 234 // TODO(servolk): Get rid of the lock and replace restarting_audio_ with |
| 235 // std::atomic<bool> when atomics are unbanned in Chromium. |
| 236 base::Lock restarting_audio_lock_; |
232 bool restarting_audio_ = false; | 237 bool restarting_audio_ = false; |
| 238 base::TimeDelta restarting_audio_time_ = kNoTimestamp; |
| 239 |
233 bool restarting_video_ = false; | 240 bool restarting_video_ = false; |
234 | 241 |
235 // Flush operations and media track status changes must be serialized to avoid | 242 // Flush operations and media track status changes must be serialized to avoid |
236 // interfering with each other. This list will hold a list of postponed | 243 // interfering with each other. This list will hold a list of postponed |
237 // actions that need to be completed after the current async operation is | 244 // actions that need to be completed after the current async operation is |
238 // completed. | 245 // completed. |
239 std::list<base::Closure> pending_actions_; | 246 std::list<base::Closure> pending_actions_; |
240 | 247 |
241 base::WeakPtr<RendererImpl> weak_this_; | 248 base::WeakPtr<RendererImpl> weak_this_; |
242 base::WeakPtrFactory<RendererImpl> weak_factory_; | 249 base::WeakPtrFactory<RendererImpl> weak_factory_; |
243 | 250 |
244 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 251 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
245 }; | 252 }; |
246 | 253 |
247 } // namespace media | 254 } // namespace media |
248 | 255 |
249 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ | 256 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ |
OLD | NEW |