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

Unified Diff: chrome/gpu/media/fake_gl_video_device.cc

Issue 6684015: Move chrome\gpu to content\gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/gpu/media/fake_gl_video_device.h ('k') | chrome/gpu/media/gpu_video_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/media/fake_gl_video_device.cc
===================================================================
--- chrome/gpu/media/fake_gl_video_device.cc (revision 77878)
+++ chrome/gpu/media/fake_gl_video_device.cc (working copy)
@@ -1,58 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/gpu/media/fake_gl_video_device.h"
-
-#include "app/gfx/gl/gl_bindings.h"
-#include "media/base/video_frame.h"
-
-void* FakeGlVideoDevice::GetDevice() {
- // No actual hardware device should be used.
- return NULL;
-}
-
-bool FakeGlVideoDevice::CreateVideoFrameFromGlTextures(
- size_t width, size_t height, media::VideoFrame::Format format,
- const std::vector<media::VideoFrame::GlTexture>& textures,
- scoped_refptr<media::VideoFrame>* frame) {
- media::VideoFrame::GlTexture texture_array[media::VideoFrame::kMaxPlanes];
- memset(texture_array, 0, sizeof(texture_array));
-
- for (size_t i = 0; i < textures.size(); ++i) {
- texture_array[i] = textures[i];
- }
-
- media::VideoFrame::CreateFrameGlTexture(format,
- width,
- height,
- texture_array,
- frame);
- return *frame != NULL;
-}
-
-void FakeGlVideoDevice::ReleaseVideoFrame(
- const scoped_refptr<media::VideoFrame>& frame) {
- // We didn't need to anything here because we didin't allocate any resources
- // for the VideoFrame(s) generated.
-}
-
-bool FakeGlVideoDevice::ConvertToVideoFrame(
- void* buffer, scoped_refptr<media::VideoFrame> frame) {
- // Assume we are in the right context and then upload the content to the
- // texture.
- glBindTexture(GL_TEXTURE_2D,
- frame->gl_texture(media::VideoFrame::kRGBPlane));
-
- // |buffer| is also a VideoFrame.
- scoped_refptr<media::VideoFrame> frame_to_upload(
- reinterpret_cast<media::VideoFrame*>(buffer));
- DCHECK_EQ(frame->width(), frame_to_upload->width());
- DCHECK_EQ(frame->height(), frame_to_upload->height());
- DCHECK_EQ(frame->format(), frame_to_upload->format());
- glTexImage2D(
- GL_TEXTURE_2D, 0, GL_RGBA, frame_to_upload->width(),
- frame_to_upload->height(), 0, GL_RGBA,
- GL_UNSIGNED_BYTE, frame_to_upload->data(media::VideoFrame::kRGBPlane));
- return true;
-}
« no previous file with comments | « chrome/gpu/media/fake_gl_video_device.h ('k') | chrome/gpu/media/gpu_video_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698