OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/base/android/media_source_player.h" | 5 #include "media/base/android/media_source_player.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Prevent player restart, including job re-creation attempts. | 193 // Prevent player restart, including job re-creation attempts. |
194 playing_ = false; | 194 playing_ = false; |
195 | 195 |
196 decoder_starvation_callback_.Cancel(); | 196 decoder_starvation_callback_.Cancel(); |
197 } | 197 } |
198 | 198 |
199 void MediaSourcePlayer::SetVolume(double volume) { | 199 void MediaSourcePlayer::SetVolume(double volume) { |
200 audio_decoder_job_->SetVolume(volume); | 200 audio_decoder_job_->SetVolume(volume); |
201 } | 201 } |
202 | 202 |
203 bool MediaSourcePlayer::IsSurfaceInUse() const { | |
204 return video_decoder_job_ && video_decoder_job_->is_decoding(); | |
205 } | |
206 | |
207 bool MediaSourcePlayer::CanPause() { | 203 bool MediaSourcePlayer::CanPause() { |
208 return Seekable(); | 204 return Seekable(); |
209 } | 205 } |
210 | 206 |
211 bool MediaSourcePlayer::CanSeekForward() { | 207 bool MediaSourcePlayer::CanSeekForward() { |
212 return Seekable(); | 208 return Seekable(); |
213 } | 209 } |
214 | 210 |
215 bool MediaSourcePlayer::CanSeekBackward() { | 211 bool MediaSourcePlayer::CanSeekBackward() { |
216 return Seekable(); | 212 return Seekable(); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release | 769 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release |
774 // MediaDrm when the video is paused, or when the device goes to sleep (see | 770 // MediaDrm when the video is paused, or when the device goes to sleep (see |
775 // http://crbug.com/272421). | 771 // http://crbug.com/272421). |
776 audio_decoder_job_->SetDrmBridge(NULL); | 772 audio_decoder_job_->SetDrmBridge(NULL); |
777 video_decoder_job_->SetDrmBridge(NULL); | 773 video_decoder_job_->SetDrmBridge(NULL); |
778 cdm_registration_id_ = 0; | 774 cdm_registration_id_ = 0; |
779 drm_bridge_ = NULL; | 775 drm_bridge_ = NULL; |
780 } | 776 } |
781 | 777 |
782 } // namespace media | 778 } // namespace media |
OLD | NEW |