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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 base::TimeDelta MojoRendererImpl::GetMediaTime() { | 108 base::TimeDelta MojoRendererImpl::GetMediaTime() { |
109 base::AutoLock auto_lock(lock_); | 109 base::AutoLock auto_lock(lock_); |
110 DVLOG(3) << __FUNCTION__ << ": " << time_.InMilliseconds() << " ms"; | 110 DVLOG(3) << __FUNCTION__ << ": " << time_.InMilliseconds() << " ms"; |
111 return time_; | 111 return time_; |
112 } | 112 } |
113 | 113 |
114 bool MojoRendererImpl::HasAudio() { | 114 bool MojoRendererImpl::HasAudio() { |
115 DVLOG(1) << __FUNCTION__; | 115 DVLOG(1) << __FUNCTION__; |
116 DCHECK(task_runner_->BelongsToCurrentThread()); | 116 DCHECK(task_runner_->BelongsToCurrentThread()); |
117 DCHECK(remote_audio_renderer_.get()); // We always bind the renderer. | 117 DCHECK(remote_audio_renderer_.get()); // We always bind the renderer. |
118 return true; | 118 return demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); |
119 } | 119 } |
120 | 120 |
121 bool MojoRendererImpl::HasVideo() { | 121 bool MojoRendererImpl::HasVideo() { |
122 DVLOG(1) << __FUNCTION__; | 122 DVLOG(1) << __FUNCTION__; |
123 DCHECK(task_runner_->BelongsToCurrentThread()); | 123 DCHECK(task_runner_->BelongsToCurrentThread()); |
124 return false; | 124 return demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); |
125 } | 125 } |
126 | 126 |
127 void MojoRendererImpl::SetCdm(MediaKeys* cdm) { | 127 void MojoRendererImpl::SetCdm(MediaKeys* cdm) { |
128 DVLOG(1) << __FUNCTION__; | 128 DVLOG(1) << __FUNCTION__; |
129 DCHECK(task_runner_->BelongsToCurrentThread()); | 129 DCHECK(task_runner_->BelongsToCurrentThread()); |
130 NOTIMPLEMENTED(); | 130 NOTIMPLEMENTED(); |
131 } | 131 } |
132 | 132 |
133 void MojoRendererImpl::OnTimeUpdate(int64_t time_usec, int64_t max_time_usec) { | 133 void MojoRendererImpl::OnTimeUpdate(int64_t time_usec, int64_t max_time_usec) { |
134 DVLOG(3) << __FUNCTION__ << ": " << time_usec << ", " << max_time_usec; | 134 DVLOG(3) << __FUNCTION__ << ": " << time_usec << ", " << max_time_usec; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 void MojoRendererImpl::OnInitialized() { | 195 void MojoRendererImpl::OnInitialized() { |
196 DVLOG(1) << __FUNCTION__; | 196 DVLOG(1) << __FUNCTION__; |
197 DCHECK(task_runner_->BelongsToCurrentThread()); | 197 DCHECK(task_runner_->BelongsToCurrentThread()); |
198 DCHECK(!init_cb_.is_null()); | 198 DCHECK(!init_cb_.is_null()); |
199 | 199 |
200 base::ResetAndReturn(&init_cb_).Run(); | 200 base::ResetAndReturn(&init_cb_).Run(); |
201 } | 201 } |
202 | 202 |
203 } // namespace media | 203 } // namespace media |
OLD | NEW |