summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/ggl
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/ggl')
-rw-r--r--chrome/renderer/ggl/ggl.cc13
-rw-r--r--chrome/renderer/ggl/ggl.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc
index 279247f..62453f7 100644
--- a/chrome/renderer/ggl/ggl.cc
+++ b/chrome/renderer/ggl/ggl.cc
@@ -11,6 +11,7 @@
#include "chrome/renderer/command_buffer_proxy.h"
#include "chrome/renderer/ggl/ggl.h"
#include "chrome/renderer/gpu_channel_host.h"
+#include "chrome/renderer/gpu_video_service_host.h"
#include "chrome/renderer/render_widget.h"
#include "ipc/ipc_channel_handle.h"
@@ -97,6 +98,9 @@ class Context : public base::SupportsWeakPtr<Context> {
// not useful at this point.
bool SwapBuffers();
+ // Create a hardware accelerated video decoder associated with this context.
+ GpuVideoDecoderHost* CreateVideoDecoder();
+
// Get the current error code.
Error GetError();
@@ -320,6 +324,11 @@ bool Context::SwapBuffers() {
return true;
}
+GpuVideoDecoderHost* Context::CreateVideoDecoder() {
+ return GpuVideoServiceHost::get()->CreateVideoDecoder(
+ command_buffer_->route_id());
+}
+
Error Context::GetError() {
gpu::CommandBuffer::State state = command_buffer_->GetState();
if (state.error == gpu::error::kNoError) {
@@ -456,6 +465,10 @@ bool DestroyContext(Context* context) {
#endif
}
+GpuVideoDecoderHost* CreateVideoDecoder(Context* context) {
+ return context->CreateVideoDecoder();
+}
+
Error GetError() {
#if defined(ENABLE_GPU)
Context* context = GetCurrentContext();
diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h
index 38f83ad..8d3f0e2 100644
--- a/chrome/renderer/ggl/ggl.h
+++ b/chrome/renderer/ggl/ggl.h
@@ -16,6 +16,7 @@
#include "gfx/size.h"
class GpuChannelHost;
+class GpuVideoDecoderHost;
namespace ggl {
@@ -114,6 +115,9 @@ bool SwapBuffers(Context* context);
// Destroy the given GGL context.
bool DestroyContext(Context* context);
+// Create a hardware video decoder corresponding to the context.
+GpuVideoDecoderHost* CreateVideoDecoder(Context* context);
+
// TODO(gman): Remove this
void DisableShaderTranslation(Context* context);