Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(904)

Side by Side Diff: media/base/android/media_source_player.cc

Issue 1110833004: Move audio focus control from media/ to content/ and make it per WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 bool MediaSourcePlayer::IsPlayerReady() { 211 bool MediaSourcePlayer::IsPlayerReady() {
212 return audio_decoder_job_ || video_decoder_job_; 212 return audio_decoder_job_ || video_decoder_job_;
213 } 213 }
214 214
215 void MediaSourcePlayer::StartInternal() { 215 void MediaSourcePlayer::StartInternal() {
216 DVLOG(1) << __FUNCTION__; 216 DVLOG(1) << __FUNCTION__;
217 // If there are pending events, wait for them finish. 217 // If there are pending events, wait for them finish.
218 if (pending_event_ != NO_EVENT_PENDING) 218 if (pending_event_ != NO_EVENT_PENDING)
219 return; 219 return;
220 220
221 if (!manager()->RequestPlay(player_id()))
222 return;
223
221 // When we start, we could have new demuxed data coming in. This new data 224 // When we start, we could have new demuxed data coming in. This new data
222 // could be clear (not encrypted) or encrypted with different keys. So key 225 // could be clear (not encrypted) or encrypted with different keys. So key
223 // related info should all be cleared. 226 // related info should all be cleared.
224 is_waiting_for_key_ = false; 227 is_waiting_for_key_ = false;
225 key_added_while_decode_pending_ = false; 228 key_added_while_decode_pending_ = false;
226 AttachListener(NULL); 229 AttachListener(NULL);
227 230
228 SetPendingEvent(PREFETCH_REQUEST_EVENT_PENDING); 231 SetPendingEvent(PREFETCH_REQUEST_EVENT_PENDING);
229 ProcessPendingEvents(); 232 ProcessPendingEvents();
230 } 233 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release 838 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release
836 // MediaDrm when the video is paused, or when the device goes to sleep (see 839 // MediaDrm when the video is paused, or when the device goes to sleep (see
837 // http://crbug.com/272421). 840 // http://crbug.com/272421).
838 audio_decoder_job_->SetDrmBridge(NULL); 841 audio_decoder_job_->SetDrmBridge(NULL);
839 video_decoder_job_->SetDrmBridge(NULL); 842 video_decoder_job_->SetDrmBridge(NULL);
840 cdm_registration_id_ = 0; 843 cdm_registration_id_ = 0;
841 drm_bridge_ = NULL; 844 drm_bridge_ = NULL;
842 } 845 }
843 846
844 } // namespace media 847 } // namespace media
OLDNEW
« media/base/android/media_player_manager.h ('K') | « media/base/android/media_player_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698