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

Side by Side Diff: media/blink/webmediaplayer_impl.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 | « media/blink/skcanvas_video_renderer.cc ('k') | no next file » | 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 10
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 unsigned int texture, 614 unsigned int texture,
615 unsigned int internal_format, 615 unsigned int internal_format,
616 unsigned int type, 616 unsigned int type,
617 bool premultiply_alpha, 617 bool premultiply_alpha,
618 bool flip_y) { 618 bool flip_y) {
619 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture"); 619 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture");
620 620
621 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); 621 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor();
622 622
623 if (!video_frame.get() || 623 if (!video_frame.get() ||
624 video_frame->storage_type() != VideoFrame::STORAGE_TEXTURE) { 624 video_frame->storage_type() != VideoFrame::STORAGE_TEXTURE ||
625 media::VideoFrame::NumPlanes(video_frame->format()) != 1) {
625 return false; 626 return false;
626 } 627 }
627 628
628 // TODO(dshwang): need more elegant way to convert WebGraphicsContext3D to 629 // TODO(dshwang): need more elegant way to convert WebGraphicsContext3D to
629 // GLES2Interface. 630 // GLES2Interface.
630 gpu::gles2::GLES2Interface* gl = 631 gpu::gles2::GLES2Interface* gl =
631 static_cast<gpu_blink::WebGraphicsContext3DImpl*>(web_graphics_context) 632 static_cast<gpu_blink::WebGraphicsContext3DImpl*>(web_graphics_context)
632 ->GetGLInterface(); 633 ->GetGLInterface();
633 SkCanvasVideoRenderer::CopyVideoFrameTextureToGLTexture( 634 SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture(
634 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha, 635 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha,
635 flip_y); 636 flip_y);
636 return true; 637 return true;
637 } 638 }
638 639
639 WebMediaPlayer::MediaKeyException 640 WebMediaPlayer::MediaKeyException
640 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, 641 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system,
641 const unsigned char* init_data, 642 const unsigned char* init_data,
642 unsigned init_data_length) { 643 unsigned init_data_length) {
643 DCHECK(main_task_runner_->BelongsToCurrentThread()); 644 DCHECK(main_task_runner_->BelongsToCurrentThread());
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 1037
1037 // pause() may be called after playback has ended and the HTMLMediaElement 1038 // pause() may be called after playback has ended and the HTMLMediaElement
1038 // requires that currentTime() == duration() after ending. We want to ensure 1039 // requires that currentTime() == duration() after ending. We want to ensure
1039 // |paused_time_| matches currentTime() in this case or a future seek() may 1040 // |paused_time_| matches currentTime() in this case or a future seek() may
1040 // incorrectly discard what it thinks is a seek to the existing time. 1041 // incorrectly discard what it thinks is a seek to the existing time.
1041 paused_time_ = 1042 paused_time_ =
1042 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); 1043 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
1043 } 1044 }
1044 1045
1045 } // namespace media 1046 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/skcanvas_video_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698