Chromium Code Reviews| 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. | |
|
xhwang
2017/05/24 00:23:41
nit: Also protecting restarting_audio_time_?
servolk
2017/05/24 00:28:00
Done.
| |
| 233 // TODO(servolk): Get rid of the lock and replace restarting_audio_ with | |
| 234 // std::atomic<bool> when atomics are unbanned in Chromium. | |
| 235 base::Lock restarting_audio_lock_; | |
| 232 bool restarting_audio_ = false; | 236 bool restarting_audio_ = false; |
| 237 base::TimeDelta restarting_audio_time_ = kNoTimestamp; | |
|
xhwang
2017/05/24 00:23:41
nit: add an empty line here since restarting_video
servolk
2017/05/24 00:28:00
Done.
| |
| 233 bool restarting_video_ = false; | 238 bool restarting_video_ = false; |
| 234 | 239 |
| 235 // Flush operations and media track status changes must be serialized to avoid | 240 // 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 | 241 // 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 | 242 // actions that need to be completed after the current async operation is |
| 238 // completed. | 243 // completed. |
| 239 std::list<base::Closure> pending_actions_; | 244 std::list<base::Closure> pending_actions_; |
| 240 | 245 |
| 241 base::WeakPtr<RendererImpl> weak_this_; | 246 base::WeakPtr<RendererImpl> weak_this_; |
| 242 base::WeakPtrFactory<RendererImpl> weak_factory_; | 247 base::WeakPtrFactory<RendererImpl> weak_factory_; |
| 243 | 248 |
| 244 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 249 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
| 245 }; | 250 }; |
| 246 | 251 |
| 247 } // namespace media | 252 } // namespace media |
| 248 | 253 |
| 249 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ | 254 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ |
| OLD | NEW |