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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 bool MediaSourcePlayer::IsPlayerReady() { | 210 bool MediaSourcePlayer::IsPlayerReady() { |
211 return audio_decoder_job_ || video_decoder_job_; | 211 return audio_decoder_job_ || video_decoder_job_; |
212 } | 212 } |
213 | 213 |
214 void MediaSourcePlayer::StartInternal() { | 214 void MediaSourcePlayer::StartInternal() { |
215 DVLOG(1) << __FUNCTION__; | 215 DVLOG(1) << __FUNCTION__; |
216 // If there are pending events, wait for them finish. | 216 // If there are pending events, wait for them finish. |
217 if (pending_event_ != NO_EVENT_PENDING) | 217 if (pending_event_ != NO_EVENT_PENDING) |
218 return; | 218 return; |
219 | 219 |
| 220 if (!manager()->RequestPlay(player_id())) { |
| 221 Pause(true); |
| 222 return; |
| 223 } |
| 224 |
220 // When we start, we could have new demuxed data coming in. This new data | 225 // When we start, we could have new demuxed data coming in. This new data |
221 // could be clear (not encrypted) or encrypted with different keys. So key | 226 // could be clear (not encrypted) or encrypted with different keys. So key |
222 // related info should all be cleared. | 227 // related info should all be cleared. |
223 is_waiting_for_key_ = false; | 228 is_waiting_for_key_ = false; |
224 key_added_while_decode_pending_ = false; | 229 key_added_while_decode_pending_ = false; |
225 AttachListener(NULL); | 230 AttachListener(NULL); |
226 | 231 |
227 SetPendingEvent(PREFETCH_REQUEST_EVENT_PENDING); | 232 SetPendingEvent(PREFETCH_REQUEST_EVENT_PENDING); |
228 ProcessPendingEvents(); | 233 ProcessPendingEvents(); |
229 } | 234 } |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release | 839 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release |
835 // MediaDrm when the video is paused, or when the device goes to sleep (see | 840 // MediaDrm when the video is paused, or when the device goes to sleep (see |
836 // http://crbug.com/272421). | 841 // http://crbug.com/272421). |
837 audio_decoder_job_->SetDrmBridge(NULL); | 842 audio_decoder_job_->SetDrmBridge(NULL); |
838 video_decoder_job_->SetDrmBridge(NULL); | 843 video_decoder_job_->SetDrmBridge(NULL); |
839 cdm_registration_id_ = 0; | 844 cdm_registration_id_ = 0; |
840 drm_bridge_ = NULL; | 845 drm_bridge_ = NULL; |
841 } | 846 } |
842 | 847 |
843 } // namespace media | 848 } // namespace media |
OLD | NEW |