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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1822153002: Attempt at suspend fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 1114
1115 void WebMediaPlayerImpl::OnSuspendRequested(bool must_suspend) { 1115 void WebMediaPlayerImpl::OnSuspendRequested(bool must_suspend) {
1116 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1116 DCHECK(main_task_runner_->BelongsToCurrentThread());
1117 1117
1118 #if defined(OS_ANDROID) // WMPI_CAST 1118 #if defined(OS_ANDROID) // WMPI_CAST
1119 // If we're remote, the pipeline should already be suspended. 1119 // If we're remote, the pipeline should already be suspended.
1120 if (isRemote()) 1120 if (isRemote())
1121 return; 1121 return;
1122 #endif 1122 #endif
1123 1123
1124 #if defined(OS_MACOSX) 1124 printf("OnSuspendRequest\n");
1125 #if 0
1125 // TODO(sandersd): Idle suspend is disabled on OSX since hardware decoded 1126 // TODO(sandersd): Idle suspend is disabled on OSX since hardware decoded
1126 // frames are owned by the video decoder in the GPU process. A mechanism for 1127 // frames are owned by the video decoder in the GPU process. A mechanism for
1127 // detaching ownership from the decoder is needed. http://crbug.com/595716. 1128 // detaching ownership from the decoder is needed. http://crbug.com/595716.
1128 return; 1129 return;
1129 #else 1130 #else
1130 // Suspend should never be requested unless required or we're already in an 1131 // Suspend should never be requested unless required or we're already in an
1131 // idle state (paused or ended). 1132 // idle state (paused or ended).
1132 DCHECK(must_suspend || paused_ || ended_); 1133 DCHECK(must_suspend || paused_ || ended_);
1133 1134
1134 // Always suspend, but only notify the delegate if we must; this allows any 1135 // Always suspend, but only notify the delegate if we must; this allows any
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { 1529 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() {
1529 #if defined(OS_ANDROID) 1530 #if defined(OS_ANDROID)
1530 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); 1531 return !hasVideo() || (delegate_ && !delegate_->IsHidden());
1531 #else 1532 #else
1532 // On non-Android platforms Resume() is always allowed. 1533 // On non-Android platforms Resume() is always allowed.
1533 return true; 1534 return true;
1534 #endif 1535 #endif
1535 } 1536 }
1536 1537
1537 } // namespace media 1538 } // namespace media
OLDNEW
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator_mac.cc ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698