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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 void MediaSourcePlayer::OnDemuxerDurationChanged(base::TimeDelta duration) { | 258 void MediaSourcePlayer::OnDemuxerDurationChanged(base::TimeDelta duration) { |
259 duration_ = duration; | 259 duration_ = duration; |
260 } | 260 } |
261 | 261 |
262 void MediaSourcePlayer::OnMediaCryptoReady( | 262 void MediaSourcePlayer::OnMediaCryptoReady( |
263 MediaDrmBridge::JavaObjectPtr /* media_crypto */, | 263 MediaDrmBridge::JavaObjectPtr /* media_crypto */, |
264 bool /* needs_protected_surface */) { | 264 bool /* needs_protected_surface */) { |
265 // Callback parameters are ignored in this player. They are intended for | 265 // Callback parameters are ignored in this player. They are intended for |
266 // MediaCodecPlayer which uses a different threading scheme. | 266 // MediaCodecPlayer which uses a different threading scheme. |
267 DCHECK(!drm_bridge_->GetMediaCrypto().is_null()); | 267 DCHECK(!drm_bridge_->GetMediaCrypto().is_null()); |
268 drm_bridge_->SetMediaCryptoReadyCB(MediaDrmBridge::MediaCryptoReadyCB()); | |
269 | 268 |
270 // Retry decoder creation if the decoders are waiting for MediaCrypto. | 269 // Retry decoder creation if the decoders are waiting for MediaCrypto. |
271 RetryDecoderCreation(true, true); | 270 RetryDecoderCreation(true, true); |
272 } | 271 } |
273 | 272 |
274 void MediaSourcePlayer::SetCdm(BrowserCdm* cdm) { | 273 void MediaSourcePlayer::SetCdm(BrowserCdm* cdm) { |
275 // Currently we don't support DRM change during the middle of playback, even | 274 // Currently we don't support DRM change during the middle of playback, even |
276 // if the player is paused. | 275 // if the player is paused. |
277 // TODO(qinmin): support DRM change after playback has started. | 276 // TODO(qinmin): support DRM change after playback has started. |
278 // http://crbug.com/253792. | 277 // http://crbug.com/253792. |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release | 817 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release |
819 // MediaDrm when the video is paused, or when the device goes to sleep (see | 818 // MediaDrm when the video is paused, or when the device goes to sleep (see |
820 // http://crbug.com/272421). | 819 // http://crbug.com/272421). |
821 audio_decoder_job_->SetDrmBridge(NULL); | 820 audio_decoder_job_->SetDrmBridge(NULL); |
822 video_decoder_job_->SetDrmBridge(NULL); | 821 video_decoder_job_->SetDrmBridge(NULL); |
823 cdm_registration_id_ = 0; | 822 cdm_registration_id_ = 0; |
824 drm_bridge_ = NULL; | 823 drm_bridge_ = NULL; |
825 } | 824 } |
826 | 825 |
827 } // namespace media | 826 } // namespace media |
OLD | NEW |