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

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

Issue 1307853003: Add support for converting I420 software frames into NV12 hardware frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@biplanar
Patch Set: Fix win_x64 build and format Created 5 years, 3 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/base/video_frame.cc ('k') | media/renderers/mock_gpu_video_accelerator_factories.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/skcanvas_video_renderer.h" 5 #include "media/blink/skcanvas_video_renderer.h"
6 6
7 #include "gpu/GLES2/gl2extchromium.h" 7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "gpu/command_buffer/client/gles2_interface.h" 8 #include "gpu/command_buffer/client/gles2_interface.h"
9 #include "gpu/command_buffer/common/mailbox_holder.h" 9 #include "gpu/command_buffer/common/mailbox_holder.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 gl->DeleteTextures(3, source_textures); 129 gl->DeleteTextures(3, source_textures);
130 return skia::AdoptRef(img); 130 return skia::AdoptRef(img);
131 } 131 }
132 132
133 // Creates a SkImage from a |video_frame| backed by native resources. 133 // Creates a SkImage from a |video_frame| backed by native resources.
134 // The SkImage will take ownership of the underlying resource. 134 // The SkImage will take ownership of the underlying resource.
135 skia::RefPtr<SkImage> NewSkImageFromVideoFrameNative( 135 skia::RefPtr<SkImage> NewSkImageFromVideoFrameNative(
136 VideoFrame* video_frame, 136 VideoFrame* video_frame,
137 const Context3D& context_3d) { 137 const Context3D& context_3d) {
138 DCHECK(PIXEL_FORMAT_ARGB == video_frame->format() || 138 DCHECK(PIXEL_FORMAT_ARGB == video_frame->format() ||
139 PIXEL_FORMAT_NV12 == video_frame->format() ||
139 PIXEL_FORMAT_UYVY == video_frame->format()); 140 PIXEL_FORMAT_UYVY == video_frame->format());
140 141
141 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0); 142 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0);
142 DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D || 143 DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D ||
143 mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB || 144 mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB ||
144 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) 145 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES)
145 << mailbox_holder.texture_target; 146 << mailbox_holder.texture_target;
146 147
147 gpu::gles2::GLES2Interface* gl = context_3d.gl; 148 gpu::gles2::GLES2Interface* gl = context_3d.gl;
148 unsigned source_texture = 0; 149 unsigned source_texture = 0;
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 video_frame->UpdateReleaseSyncPoint(&client); 570 video_frame->UpdateReleaseSyncPoint(&client);
570 } 571 }
571 572
572 void SkCanvasVideoRenderer::ResetCache() { 573 void SkCanvasVideoRenderer::ResetCache() {
573 // Clear cached values. 574 // Clear cached values.
574 last_image_ = nullptr; 575 last_image_ = nullptr;
575 last_timestamp_ = kNoTimestamp(); 576 last_timestamp_ = kNoTimestamp();
576 } 577 }
577 578
578 } // namespace media 579 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/renderers/mock_gpu_video_accelerator_factories.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698