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

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

Issue 81693003: Release media player resources when device is locked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a mistake I just realized Created 7 years, 1 month 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 audio_decoder_job_.reset(); 250 audio_decoder_job_.reset();
251 ResetVideoDecoderJob(); 251 ResetVideoDecoderJob();
252 252
253 // Prevent job re-creation attempts in OnDemuxerConfigsAvailable() 253 // Prevent job re-creation attempts in OnDemuxerConfigsAvailable()
254 reconfig_audio_decoder_ = false; 254 reconfig_audio_decoder_ = false;
255 reconfig_video_decoder_ = false; 255 reconfig_video_decoder_ = false;
256 256
257 // Prevent player restart, including job re-creation attempts. 257 // Prevent player restart, including job re-creation attempts.
258 playing_ = false; 258 playing_ = false;
259 259
260 // Note: we don't release the surface because we might
261 // need to reuse it when restarting.
262
260 decoder_starvation_callback_.Cancel(); 263 decoder_starvation_callback_.Cancel();
261 surface_ = gfx::ScopedJavaSurface();
262 manager()->ReleaseMediaResources(player_id()); 264 manager()->ReleaseMediaResources(player_id());
263 if (process_pending_events) { 265 if (process_pending_events) {
264 DVLOG(1) << __FUNCTION__ << " : Resuming seek or config change processing"; 266 DVLOG(1) << __FUNCTION__ << " : Resuming seek or config change processing";
265 ProcessPendingEvents(); 267 ProcessPendingEvents();
266 } 268 }
267 } 269 }
268 270
269 void MediaSourcePlayer::SetVolume(double volume) { 271 void MediaSourcePlayer::SetVolume(double volume) {
270 volume_ = volume; 272 volume_ = volume;
271 SetVolumeInternal(); 273 SetVolumeInternal();
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 956
955 void MediaSourcePlayer::ClearPendingEvent(PendingEventFlags event) { 957 void MediaSourcePlayer::ClearPendingEvent(PendingEventFlags event) {
956 DVLOG(1) << __FUNCTION__ << "(" << GetEventName(event) << ")"; 958 DVLOG(1) << __FUNCTION__ << "(" << GetEventName(event) << ")";
957 DCHECK_NE(event, NO_EVENT_PENDING); 959 DCHECK_NE(event, NO_EVENT_PENDING);
958 DCHECK(IsEventPending(event)) << GetEventName(event); 960 DCHECK(IsEventPending(event)) << GetEventName(event);
959 961
960 pending_event_ &= ~event; 962 pending_event_ &= ~event;
961 } 963 }
962 964
963 } // namespace media 965 } // namespace media
OLDNEW
« media/base/android/media_player_bridge.cc ('K') | « media/base/android/media_player_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698