summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/ggl
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 17:33:56 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 17:33:56 +0000
commit3190f36c2f7ac99d06a07b3df1e12ac36fc11d08 (patch)
treecc79fda358672e6502b75760a51916f82c3ec27b /chrome/renderer/ggl
parent9cb851f3e229cf290497c040d2fef79f59bcaf14 (diff)
downloadchromium_src-3190f36c2f7ac99d06a07b3df1e12ac36fc11d08.zip
chromium_src-3190f36c2f7ac99d06a07b3df1e12ac36fc11d08.tar.gz
chromium_src-3190f36c2f7ac99d06a07b3df1e12ac36fc11d08.tar.bz2
Resubmit - Some cleanup work in GpuVideoDecoderHost and IpcVideoDecoder
TBR=sergeyu BUG=None. TEST=None. Review URL: http://codereview.chromium.org/3571007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/ggl')
-rw-r--r--chrome/renderer/ggl/ggl.cc24
-rw-r--r--chrome/renderer/ggl/ggl.h20
2 files changed, 37 insertions, 7 deletions
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc
index 62453f7..4ae8c9f 100644
--- a/chrome/renderer/ggl/ggl.cc
+++ b/chrome/renderer/ggl/ggl.cc
@@ -12,6 +12,8 @@
#include "chrome/renderer/ggl/ggl.h"
#include "chrome/renderer/gpu_channel_host.h"
#include "chrome/renderer/gpu_video_service_host.h"
+#include "chrome/renderer/media/gles2_video_decode_context.h"
+#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_widget.h"
#include "ipc/ipc_channel_handle.h"
@@ -99,7 +101,10 @@ class Context : public base::SupportsWeakPtr<Context> {
bool SwapBuffers();
// Create a hardware accelerated video decoder associated with this context.
- GpuVideoDecoderHost* CreateVideoDecoder();
+ media::VideoDecodeEngine* CreateVideoDecodeEngine();
+
+ // Create a hardware video decode context associated with this context.
+ media::VideoDecodeContext* CreateVideoDecodeContext(bool hardware_decoder);
// Get the current error code.
Error GetError();
@@ -324,11 +329,17 @@ bool Context::SwapBuffers() {
return true;
}
-GpuVideoDecoderHost* Context::CreateVideoDecoder() {
+media::VideoDecodeEngine* Context::CreateVideoDecodeEngine() {
return GpuVideoServiceHost::get()->CreateVideoDecoder(
command_buffer_->route_id());
}
+media::VideoDecodeContext* Context::CreateVideoDecodeContext(
+ bool hardware_decoder) {
+ return new Gles2VideoDecodeContext(
+ RenderThread::current()->message_loop(), hardware_decoder, this);
+}
+
Error Context::GetError() {
gpu::CommandBuffer::State state = command_buffer_->GetState();
if (state.error == gpu::error::kNoError) {
@@ -465,8 +476,13 @@ bool DestroyContext(Context* context) {
#endif
}
-GpuVideoDecoderHost* CreateVideoDecoder(Context* context) {
- return context->CreateVideoDecoder();
+media::VideoDecodeEngine* CreateVideoDecodeEngine(Context* context) {
+ return context->CreateVideoDecodeEngine();
+}
+
+media::VideoDecodeContext* CreateVideoDecodeContext(
+ Context* context, bool hardware_decoder) {
+ return context->CreateVideoDecodeContext(hardware_decoder);
}
Error GetError() {
diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h
index 8d3f0e2..c20e91b 100644
--- a/chrome/renderer/ggl/ggl.h
+++ b/chrome/renderer/ggl/ggl.h
@@ -16,7 +16,13 @@
#include "gfx/size.h"
class GpuChannelHost;
-class GpuVideoDecoderHost;
+
+namespace media {
+
+class VideoDecodeContext;
+class VideoDecodeEngine;
+
+}
namespace ggl {
@@ -115,8 +121,16 @@ 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);
+// Create a hardware video decode engine corresponding to the context.
+media::VideoDecodeEngine* CreateVideoDecodeEngine(Context* context);
+
+// Create a hardware video decode context to pair with the hardware video
+// decode engine. It can also be used with a software decode engine.
+//
+// Set |hardware_decoder| to true if this context is for a hardware video
+// engine.
+media::VideoDecodeContext* CreateVideoDecodeContext(Context* context,
+ bool hardware_decoder);
// TODO(gman): Remove this
void DisableShaderTranslation(Context* context);