| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |