| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 348 } |
| 349 | 349 |
| 350 void MediaSourcePlayer::OnMediaCryptoReady() { | 350 void MediaSourcePlayer::OnMediaCryptoReady() { |
| 351 DCHECK(!drm_bridge_->GetMediaCrypto().is_null()); | 351 DCHECK(!drm_bridge_->GetMediaCrypto().is_null()); |
| 352 drm_bridge_->SetMediaCryptoReadyCB(base::Closure()); | 352 drm_bridge_->SetMediaCryptoReadyCB(base::Closure()); |
| 353 | 353 |
| 354 if (playing_) | 354 if (playing_) |
| 355 StartInternal(); | 355 StartInternal(); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void MediaSourcePlayer::SetCdm(MediaKeys* cdm) { | 358 void MediaSourcePlayer::SetCdm(MediaDrmBridge* cdm) { |
| 359 // Currently we don't support DRM change during the middle of playback, even | 359 // Currently we don't support DRM change during the middle of playback, even |
| 360 // if the player is paused. | 360 // if the player is paused. |
| 361 // TODO(qinmin): support DRM change after playback has started. | 361 // TODO(qinmin): support DRM change after playback has started. |
| 362 // http://crbug.com/253792. | 362 // http://crbug.com/253792. |
| 363 if (GetCurrentTime() > base::TimeDelta()) { | 363 if (GetCurrentTime() > base::TimeDelta()) { |
| 364 VLOG(0) << "Setting DRM bridge after playback has started. " | 364 VLOG(0) << "Setting DRM bridge after playback has started. " |
| 365 << "This is not well supported!"; | 365 << "This is not well supported!"; |
| 366 } | 366 } |
| 367 | 367 |
| 368 // Only MediaDrmBridge will be set on MediaSourcePlayer. | 368 // Only MediaDrmBridge will be set on MediaSourcePlayer. |
| 369 drm_bridge_ = static_cast<MediaDrmBridge*>(cdm); | 369 drm_bridge_ = cdm; |
| 370 | 370 |
| 371 if (drm_bridge_->GetMediaCrypto().is_null()) { | 371 if (drm_bridge_->GetMediaCrypto().is_null()) { |
| 372 drm_bridge_->SetMediaCryptoReadyCB(base::Bind( | 372 drm_bridge_->SetMediaCryptoReadyCB(base::Bind( |
| 373 &MediaSourcePlayer::OnMediaCryptoReady, weak_factory_.GetWeakPtr())); | 373 &MediaSourcePlayer::OnMediaCryptoReady, weak_factory_.GetWeakPtr())); |
| 374 return; | 374 return; |
| 375 } | 375 } |
| 376 | 376 |
| 377 if (playing_) | 377 if (playing_) |
| 378 StartInternal(); | 378 StartInternal(); |
| 379 } | 379 } |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 audio_extra_data_ = configs.audio_extra_data; | 1016 audio_extra_data_ = configs.audio_extra_data; |
| 1017 } else { | 1017 } else { |
| 1018 video_codec_ = configs.video_codec; | 1018 video_codec_ = configs.video_codec; |
| 1019 width_ = configs.video_size.width(); | 1019 width_ = configs.video_size.width(); |
| 1020 height_ = configs.video_size.height(); | 1020 height_ = configs.video_size.height(); |
| 1021 is_video_encrypted_ = configs.is_video_encrypted; | 1021 is_video_encrypted_ = configs.is_video_encrypted; |
| 1022 } | 1022 } |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 } // namespace media | 1025 } // namespace media |
| OLD | NEW |