| 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 gpu::gles2::GLES2Interface* gl, | 766 gpu::gles2::GLES2Interface* gl, |
| 767 unsigned int texture, | 767 unsigned int texture, |
| 768 unsigned int internal_format, | 768 unsigned int internal_format, |
| 769 unsigned int type, | 769 unsigned int type, |
| 770 bool premultiply_alpha, | 770 bool premultiply_alpha, |
| 771 bool flip_y) { | 771 bool flip_y) { |
| 772 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture"); | 772 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture"); |
| 773 | 773 |
| 774 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); | 774 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); |
| 775 | 775 |
| 776 if (!video_frame.get() || !video_frame->HasTextures() || | 776 if (!video_frame.get() || !video_frame->HasTextures()) { |
| 777 media::VideoFrame::NumPlanes(video_frame->format()) != 1) { | |
| 778 return false; | 777 return false; |
| 779 } | 778 } |
| 780 | 779 |
| 781 SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture( | 780 Context3D context_3d; |
| 782 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha, | 781 if (!context_3d_cb_.is_null()) |
| 783 flip_y); | 782 context_3d = context_3d_cb_.Run(); |
| 784 return true; | 783 return skcanvas_video_renderer_.CopyVideoFrameTexturesToGLTexture( |
| 784 context_3d, gl, video_frame.get(), texture, internal_format, type, |
| 785 premultiply_alpha, flip_y); |
| 785 } | 786 } |
| 786 | 787 |
| 787 void WebMediaPlayerImpl::setContentDecryptionModule( | 788 void WebMediaPlayerImpl::setContentDecryptionModule( |
| 788 blink::WebContentDecryptionModule* cdm, | 789 blink::WebContentDecryptionModule* cdm, |
| 789 blink::WebContentDecryptionModuleResult result) { | 790 blink::WebContentDecryptionModuleResult result) { |
| 790 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 791 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 791 | 792 |
| 792 // Once the CDM is set it can't be cleared as there may be frames being | 793 // Once the CDM is set it can't be cleared as there may be frames being |
| 793 // decrypted on other threads. So fail this request. | 794 // decrypted on other threads. So fail this request. |
| 794 // http://crbug.com/462365#c7. | 795 // http://crbug.com/462365#c7. |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 if (isRemote()) | 1660 if (isRemote()) |
| 1660 return; | 1661 return; |
| 1661 #endif | 1662 #endif |
| 1662 | 1663 |
| 1663 // Idle timeout chosen arbitrarily. | 1664 // Idle timeout chosen arbitrarily. |
| 1664 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5), | 1665 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5), |
| 1665 this, &WebMediaPlayerImpl::OnPause); | 1666 this, &WebMediaPlayerImpl::OnPause); |
| 1666 } | 1667 } |
| 1667 | 1668 |
| 1668 } // namespace media | 1669 } // namespace media |
| OLD | NEW |