| 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 #include "media/mojo/services/mojo_renderer_impl.h" | 5 #include "media/mojo/services/mojo_renderer_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 DCHECK(remote_renderer_.get()); // We always bind the renderer. | 148 DCHECK(remote_renderer_.get()); // We always bind the renderer. |
| 149 return !!demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); | 149 return !!demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool MojoRendererImpl::HasVideo() { | 152 bool MojoRendererImpl::HasVideo() { |
| 153 DVLOG(1) << __FUNCTION__; | 153 DVLOG(1) << __FUNCTION__; |
| 154 DCHECK(task_runner_->BelongsToCurrentThread()); | 154 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 155 return !!demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); | 155 return !!demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool MojoRendererImpl::AllowSuspend() { |
| 159 DVLOG(1) << __FUNCTION__; |
| 160 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 161 return true; |
| 162 } |
| 163 |
| 158 void MojoRendererImpl::OnTimeUpdate(int64_t time_usec, int64_t max_time_usec) { | 164 void MojoRendererImpl::OnTimeUpdate(int64_t time_usec, int64_t max_time_usec) { |
| 159 DVLOG(3) << __FUNCTION__ << ": " << time_usec << ", " << max_time_usec; | 165 DVLOG(3) << __FUNCTION__ << ": " << time_usec << ", " << max_time_usec; |
| 160 DCHECK(task_runner_->BelongsToCurrentThread()); | 166 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 161 | 167 |
| 162 base::AutoLock auto_lock(lock_); | 168 base::AutoLock auto_lock(lock_); |
| 163 time_ = base::TimeDelta::FromMicroseconds(time_usec); | 169 time_ = base::TimeDelta::FromMicroseconds(time_usec); |
| 164 } | 170 } |
| 165 | 171 |
| 166 void MojoRendererImpl::OnBufferingStateChange( | 172 void MojoRendererImpl::OnBufferingStateChange( |
| 167 interfaces::BufferingState state) { | 173 interfaces::BufferingState state) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 void MojoRendererImpl::OnInitialized(bool success) { | 207 void MojoRendererImpl::OnInitialized(bool success) { |
| 202 DVLOG(1) << __FUNCTION__; | 208 DVLOG(1) << __FUNCTION__; |
| 203 DCHECK(task_runner_->BelongsToCurrentThread()); | 209 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 204 DCHECK(!init_cb_.is_null()); | 210 DCHECK(!init_cb_.is_null()); |
| 205 | 211 |
| 206 base::ResetAndReturn(&init_cb_) | 212 base::ResetAndReturn(&init_cb_) |
| 207 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED); | 213 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED); |
| 208 } | 214 } |
| 209 | 215 |
| 210 } // namespace media | 216 } // namespace media |
| OLD | NEW |