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 return; |
| 222 |
220 // When we start, we could have new demuxed data coming in. This new data | 223 // 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 | 224 // could be clear (not encrypted) or encrypted with different keys. So key |
222 // related info should all be cleared. | 225 // related info should all be cleared. |
223 is_waiting_for_key_ = false; | 226 is_waiting_for_key_ = false; |
224 key_added_while_decode_pending_ = false; | 227 key_added_while_decode_pending_ = false; |
225 AttachListener(NULL); | 228 AttachListener(NULL); |
226 | 229 |
227 SetPendingEvent(PREFETCH_REQUEST_EVENT_PENDING); | 230 SetPendingEvent(PREFETCH_REQUEST_EVENT_PENDING); |
228 ProcessPendingEvents(); | 231 ProcessPendingEvents(); |
229 } | 232 } |
(...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 | 837 // 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 | 838 // MediaDrm when the video is paused, or when the device goes to sleep (see |
836 // http://crbug.com/272421). | 839 // http://crbug.com/272421). |
837 audio_decoder_job_->SetDrmBridge(NULL); | 840 audio_decoder_job_->SetDrmBridge(NULL); |
838 video_decoder_job_->SetDrmBridge(NULL); | 841 video_decoder_job_->SetDrmBridge(NULL); |
839 cdm_registration_id_ = 0; | 842 cdm_registration_id_ = 0; |
840 drm_bridge_ = NULL; | 843 drm_bridge_ = NULL; |
841 } | 844 } |
842 | 845 |
843 } // namespace media | 846 } // namespace media |
OLD | NEW |