| 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 "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 // Application itself needs to take care of setting the right flip_y | 605 // Application itself needs to take care of setting the right flip_y |
| 606 // value down to get the expected result. | 606 // value down to get the expected result. |
| 607 // flip_y==true means to reverse the video orientation while | 607 // flip_y==true means to reverse the video orientation while |
| 608 // flip_y==false means to keep the intrinsic orientation. | 608 // flip_y==false means to keep the intrinsic orientation. |
| 609 | 609 |
| 610 // The video's texture might be larger than the natural size because | 610 // The video's texture might be larger than the natural size because |
| 611 // the encoder might have had to round up to the size of a macroblock. | 611 // the encoder might have had to round up to the size of a macroblock. |
| 612 // Make sure to only copy the natural size to avoid putting garbage | 612 // Make sure to only copy the natural size to avoid putting garbage |
| 613 // into the bottom of the destination texture. | 613 // into the bottom of the destination texture. |
| 614 const gfx::Size& natural_size = video_frame->natural_size(); | 614 const gfx::Size& natural_size = video_frame->natural_size(); |
| 615 gl->CopySubTextureCHROMIUM(src_texture, 0, texture, 0, | 615 gl->CopySubTextureCHROMIUM(src_texture, 0, GL_TEXTURE_2D, texture, 0, 0, 0, 0, |
| 616 0, 0, 0, 0, | 616 0, natural_size.width(), natural_size.height(), |
| 617 natural_size.width(), natural_size.height(), | |
| 618 flip_y, premultiply_alpha, false); | 617 flip_y, premultiply_alpha, false); |
| 619 gl->DeleteTextures(1, &src_texture); | 618 gl->DeleteTextures(1, &src_texture); |
| 620 gl->Flush(); | 619 gl->Flush(); |
| 621 | 620 |
| 622 SyncTokenClientImpl client(gl); | 621 SyncTokenClientImpl client(gl); |
| 623 video_frame->UpdateReleaseSyncToken(&client); | 622 video_frame->UpdateReleaseSyncToken(&client); |
| 624 return true; | 623 return true; |
| 625 } | 624 } |
| 626 | 625 |
| 627 bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { | 626 bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 switches::kDisableMediaSuspend)) { | 1338 switches::kDisableMediaSuspend)) { |
| 1340 return false; | 1339 return false; |
| 1341 } | 1340 } |
| 1342 | 1341 |
| 1343 return base::FeatureList::IsEnabled(media::kResumeBackgroundVideo) && | 1342 return base::FeatureList::IsEnabled(media::kResumeBackgroundVideo) && |
| 1344 hasAudio() && !isRemote() && delegate_ && delegate_->IsFrameHidden() && | 1343 hasAudio() && !isRemote() && delegate_ && delegate_->IsFrameHidden() && |
| 1345 !delegate_->IsFrameClosed(); | 1344 !delegate_->IsFrameClosed(); |
| 1346 } | 1345 } |
| 1347 | 1346 |
| 1348 } // namespace content | 1347 } // namespace content |
| OLD | NEW |