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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 1153623002: media: SkCanvasVideoRenderer support for YUV native videoframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set the color format. Created 5 years, 6 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 | « no previous file | media/blink/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 "content/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); 422 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture");
423 DCHECK(thread_checker_.CalledOnValidThread()); 423 DCHECK(thread_checker_.CalledOnValidThread());
424 424
425 scoped_refptr<media::VideoFrame> video_frame; 425 scoped_refptr<media::VideoFrame> video_frame;
426 { 426 {
427 base::AutoLock auto_lock(current_frame_lock_); 427 base::AutoLock auto_lock(current_frame_lock_);
428 video_frame = current_frame_; 428 video_frame = current_frame_;
429 } 429 }
430 430
431 if (!video_frame.get() || 431 if (!video_frame.get() ||
432 video_frame->storage_type() != media::VideoFrame::STORAGE_TEXTURE) { 432 video_frame->storage_type() != media::VideoFrame::STORAGE_TEXTURE ||
433 media::VideoFrame::NumPlanes(video_frame->format()) != 1) {
433 return false; 434 return false;
434 } 435 }
435 436
436 // TODO(dshwang): need more elegant way to convert WebGraphicsContext3D to 437 // TODO(dshwang): need more elegant way to convert WebGraphicsContext3D to
437 // GLES2Interface. 438 // GLES2Interface.
438 gpu::gles2::GLES2Interface* gl = 439 gpu::gles2::GLES2Interface* gl =
439 static_cast<gpu_blink::WebGraphicsContext3DImpl*>(web_graphics_context) 440 static_cast<gpu_blink::WebGraphicsContext3DImpl*>(web_graphics_context)
440 ->GetGLInterface(); 441 ->GetGLInterface();
441 media::SkCanvasVideoRenderer::CopyVideoFrameTextureToGLTexture( 442 media::SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture(
442 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha, 443 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha,
443 flip_y); 444 flip_y);
444 return true; 445 return true;
445 } 446 }
446 447
447 void WebMediaPlayerMS::SetVideoFrameProviderClient( 448 void WebMediaPlayerMS::SetVideoFrameProviderClient(
448 cc::VideoFrameProvider::Client* client) { 449 cc::VideoFrameProvider::Client* client) {
449 // This is called from both the main renderer thread and the compositor 450 // This is called from both the main renderer thread and the compositor
450 // thread (when the main thread is blocked). 451 // thread (when the main thread is blocked).
451 if (video_frame_provider_client_) 452 if (video_frame_provider_client_)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 GetClient()->readyStateChanged(); 554 GetClient()->readyStateChanged();
554 } 555 }
555 556
556 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { 557 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() {
557 DCHECK(thread_checker_.CalledOnValidThread()); 558 DCHECK(thread_checker_.CalledOnValidThread());
558 DCHECK(client_); 559 DCHECK(client_);
559 return client_; 560 return client_;
560 } 561 }
561 562
562 } // namespace content 563 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/blink/skcanvas_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698