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

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

Issue 2127053004: Optimize webgl texImage2D from YUV video textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skianocopy
Patch Set: remove unnecessary change Created 4 years, 5 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 gpu::gles2::GLES2Interface* gl, 812 gpu::gles2::GLES2Interface* gl,
813 unsigned int texture, 813 unsigned int texture,
814 unsigned int internal_format, 814 unsigned int internal_format,
815 unsigned int type, 815 unsigned int type,
816 bool premultiply_alpha, 816 bool premultiply_alpha,
817 bool flip_y) { 817 bool flip_y) {
818 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture"); 818 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture");
819 819
820 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); 820 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor();
821 821
822 if (!video_frame.get() || !video_frame->HasTextures() || 822 if (!video_frame.get() || !video_frame->HasTextures()) {
823 media::VideoFrame::NumPlanes(video_frame->format()) != 1) {
824 return false; 823 return false;
825 } 824 }
826 825
827 SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture( 826 Context3D context_3d;
828 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha, 827 if (!context_3d_cb_.is_null())
829 flip_y); 828 context_3d = context_3d_cb_.Run();
830 return true; 829 return skcanvas_video_renderer_.CopyVideoFrameTexturesToGLTexture(
830 context_3d, gl, video_frame.get(), texture, internal_format, type,
831 premultiply_alpha, flip_y);
831 } 832 }
832 833
833 void WebMediaPlayerImpl::setContentDecryptionModule( 834 void WebMediaPlayerImpl::setContentDecryptionModule(
834 blink::WebContentDecryptionModule* cdm, 835 blink::WebContentDecryptionModule* cdm,
835 blink::WebContentDecryptionModuleResult result) { 836 blink::WebContentDecryptionModuleResult result) {
836 DCHECK(main_task_runner_->BelongsToCurrentThread()); 837 DCHECK(main_task_runner_->BelongsToCurrentThread());
837 838
838 // Once the CDM is set it can't be cleared as there may be frames being 839 // Once the CDM is set it can't be cleared as there may be frames being
839 // decrypted on other threads. So fail this request. 840 // decrypted on other threads. So fail this request.
840 // http://crbug.com/462365#c7. 841 // http://crbug.com/462365#c7.
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 if (isRemote()) 1720 if (isRemote())
1720 return; 1721 return;
1721 #endif 1722 #endif
1722 1723
1723 // Idle timeout chosen arbitrarily. 1724 // Idle timeout chosen arbitrarily.
1724 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5), 1725 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5),
1725 this, &WebMediaPlayerImpl::OnPause); 1726 this, &WebMediaPlayerImpl::OnPause);
1726 } 1727 }
1727 1728
1728 } // namespace media 1729 } // 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