| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // values at millisecond resolution. | 116 // values at millisecond resolution. |
| 117 return duration_ < | 117 return duration_ < |
| 118 base::TimeDelta::FromMilliseconds(std::numeric_limits<int32>::max()); | 118 base::TimeDelta::FromMilliseconds(std::numeric_limits<int32>::max()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void MediaSourcePlayer::Start() { | 121 void MediaSourcePlayer::Start() { |
| 122 DVLOG(1) << __FUNCTION__; | 122 DVLOG(1) << __FUNCTION__; |
| 123 | 123 |
| 124 playing_ = true; | 124 playing_ = true; |
| 125 | 125 |
| 126 if (IsProtectedSurfaceRequired()) | 126 if (IsProtectedSurfaceRequired() && |
| 127 // Skip to request fullscreen when hole-punching is used. |
| 128 !manager()->ShouldUseVideoOverlayForEmbeddedEncryptedVideo()) { |
| 127 manager()->RequestFullScreen(player_id()); | 129 manager()->RequestFullScreen(player_id()); |
| 130 } |
| 128 | 131 |
| 129 StartInternal(); | 132 StartInternal(); |
| 130 } | 133 } |
| 131 | 134 |
| 132 void MediaSourcePlayer::Pause(bool is_media_related_action) { | 135 void MediaSourcePlayer::Pause(bool is_media_related_action) { |
| 133 DVLOG(1) << __FUNCTION__; | 136 DVLOG(1) << __FUNCTION__; |
| 134 | 137 |
| 135 // Since decoder jobs have their own thread, decoding is not fully paused | 138 // Since decoder jobs have their own thread, decoding is not fully paused |
| 136 // until all the decoder jobs call MediaDecoderCallback(). It is possible | 139 // until all the decoder jobs call MediaDecoderCallback(). It is possible |
| 137 // that Start() is called while the player is waiting for | 140 // that Start() is called while the player is waiting for |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 // release MediaDrm when the video is paused, or when the device goes to | 754 // release MediaDrm when the video is paused, or when the device goes to |
| 752 // sleep (see http://crbug.com/272421). | 755 // sleep (see http://crbug.com/272421). |
| 753 NOTREACHED() << "CDM detachment not supported."; | 756 NOTREACHED() << "CDM detachment not supported."; |
| 754 DCHECK(drm_bridge_); | 757 DCHECK(drm_bridge_); |
| 755 audio_decoder_job_->SetDrmBridge(NULL); | 758 audio_decoder_job_->SetDrmBridge(NULL); |
| 756 video_decoder_job_->SetDrmBridge(NULL); | 759 video_decoder_job_->SetDrmBridge(NULL); |
| 757 drm_bridge_ = NULL; | 760 drm_bridge_ = NULL; |
| 758 } | 761 } |
| 759 | 762 |
| 760 } // namespace media | 763 } // namespace media |
| OLD | NEW |