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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 if (data.type == DemuxerStream::AUDIO) | 251 if (data.type == DemuxerStream::AUDIO) |
252 audio_decoder_job_->OnDataReceived(data); | 252 audio_decoder_job_->OnDataReceived(data); |
253 else if (data.type == DemuxerStream::VIDEO) | 253 else if (data.type == DemuxerStream::VIDEO) |
254 video_decoder_job_->OnDataReceived(data); | 254 video_decoder_job_->OnDataReceived(data); |
255 } | 255 } |
256 | 256 |
257 void MediaSourcePlayer::OnDemuxerDurationChanged(base::TimeDelta duration) { | 257 void MediaSourcePlayer::OnDemuxerDurationChanged(base::TimeDelta duration) { |
258 duration_ = duration; | 258 duration_ = duration; |
259 } | 259 } |
260 | 260 |
261 void MediaSourcePlayer::OnMediaCryptoReady() { | 261 void MediaSourcePlayer::OnMediaCryptoReady( |
262 MediaDrmBridge::JavaObjectPtr /* media_crypto */, | |
263 bool /* needs_protected_surface */) { | |
264 // Callback parameters are ignored in this player. They are intended for | |
265 // MediaCodecPlayer which uses a different threading scheme. | |
262 DCHECK(!drm_bridge_->GetMediaCrypto().is_null()); | 266 DCHECK(!drm_bridge_->GetMediaCrypto().is_null()); |
263 drm_bridge_->SetMediaCryptoReadyCB(base::Closure()); | 267 drm_bridge_->SetMediaCryptoReadyCB(MediaDrmBridge::MediaCryptoReadyCB()); |
xhwang
2015/09/29 17:28:24
As mentioned above, you can bind the callback to t
| |
264 | 268 |
265 // Retry decoder creation if the decoders are waiting for MediaCrypto. | 269 // Retry decoder creation if the decoders are waiting for MediaCrypto. |
266 RetryDecoderCreation(true, true); | 270 RetryDecoderCreation(true, true); |
267 } | 271 } |
268 | 272 |
269 void MediaSourcePlayer::SetCdm(BrowserCdm* cdm) { | 273 void MediaSourcePlayer::SetCdm(BrowserCdm* cdm) { |
270 // 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 |
271 // if the player is paused. | 275 // if the player is paused. |
272 // TODO(qinmin): support DRM change after playback has started. | 276 // TODO(qinmin): support DRM change after playback has started. |
273 // http://crbug.com/253792. | 277 // http://crbug.com/253792. |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release | 816 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release |
813 // MediaDrm when the video is paused, or when the device goes to sleep (see | 817 // MediaDrm when the video is paused, or when the device goes to sleep (see |
814 // http://crbug.com/272421). | 818 // http://crbug.com/272421). |
815 audio_decoder_job_->SetDrmBridge(NULL); | 819 audio_decoder_job_->SetDrmBridge(NULL); |
816 video_decoder_job_->SetDrmBridge(NULL); | 820 video_decoder_job_->SetDrmBridge(NULL); |
817 cdm_registration_id_ = 0; | 821 cdm_registration_id_ = 0; |
818 drm_bridge_ = NULL; | 822 drm_bridge_ = NULL; |
819 } | 823 } |
820 | 824 |
821 } // namespace media | 825 } // namespace media |
OLD | NEW |