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

Unified Diff: content/renderer/renderer_gpu_video_decoder_factories.cc

Issue 8897022: Revert 113895 - <video> decode in hardware! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | « content/renderer/renderer_gpu_video_decoder_factories.h ('k') | media/base/composite_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_gpu_video_decoder_factories.cc
===================================================================
--- content/renderer/renderer_gpu_video_decoder_factories.cc (revision 113907)
+++ content/renderer/renderer_gpu_video_decoder_factories.cc (working copy)
@@ -1,63 +0,0 @@
-// Copyright (c) 2011 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 "content/renderer/renderer_gpu_video_decoder_factories.h"
-
-#include "content/common/child_thread.h"
-#include "content/renderer/gpu/command_buffer_proxy.h"
-#include "content/renderer/gpu/gpu_channel_host.h"
-#include "content/renderer/gpu/renderer_gl_context.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
-
-RendererGpuVideoDecoderFactories::~RendererGpuVideoDecoderFactories() {}
-RendererGpuVideoDecoderFactories::RendererGpuVideoDecoderFactories(
- GpuChannelHost* gpu_channel_host, base::WeakPtr<RendererGLContext> context)
- : gpu_channel_host_(gpu_channel_host), context_(context) {
-}
-
-media::VideoDecodeAccelerator*
-RendererGpuVideoDecoderFactories::CreateVideoDecodeAccelerator(
- media::VideoDecodeAccelerator::Profile profile,
- media::VideoDecodeAccelerator::Client* client) {
- if (!context_)
- return NULL;
- return gpu_channel_host_->CreateVideoDecoder(
- context_->GetCommandBufferProxy()->route_id(), profile, client);
-}
-
-bool RendererGpuVideoDecoderFactories::CreateTextures(
- int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids) {
- if (!context_)
- return false;
- gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
- texture_ids->resize(count);
- gles2->GenTextures(count, &texture_ids->at(0));
- for (int i = 0; i < count; ++i) {
- gles2->ActiveTexture(GL_TEXTURE0);
- uint32 texture_id = texture_ids->at(i);
- gles2->BindTexture(GL_TEXTURE_2D, texture_id);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- gles2->TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- gles2->TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- gles2->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(),
- 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- }
- DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
- return true;
-}
-
-bool RendererGpuVideoDecoderFactories::DeleteTexture(uint32 texture_id) {
- if (!context_)
- return false;
- gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
- gles2->DeleteTextures(1, &texture_id);
- DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
- return true;
-}
-
-base::SharedMemory* RendererGpuVideoDecoderFactories::CreateSharedMemory(
- size_t size) {
- return ChildThread::current()->AllocateSharedMemory(size);
-}
« no previous file with comments | « content/renderer/renderer_gpu_video_decoder_factories.h ('k') | media/base/composite_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698