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

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

Issue 2199093002: Optimize webgl texImage2D from YUV video textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | media/renderers/skcanvas_video_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | media/renderers/skcanvas_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698