summaryrefslogtreecommitdiffstats
path: root/content/renderer/gpu_video_service_host.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-17 19:15:35 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-17 19:15:35 +0000
commit6f516083864319feeb02ae4dc32609216455366b (patch)
tree285a57fee02c581e22d272951633d4a56a7846e6 /content/renderer/gpu_video_service_host.h
parent6421fe84fee932545c65ab77b7dcdc60be28accc (diff)
downloadchromium_src-6f516083864319feeb02ae4dc32609216455366b.zip
chromium_src-6f516083864319feeb02ae4dc32609216455366b.tar.gz
chromium_src-6f516083864319feeb02ae4dc32609216455366b.tar.bz2
Move a bunch of gpu/worker/plugin renderer code to content. I temporarily disabled the sad plugin code while I add a renderer chrome interface in a follow up.
TBR=avi Review URL: http://codereview.chromium.org/6713005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78579 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/gpu_video_service_host.h')
-rw-r--r--content/renderer/gpu_video_service_host.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/content/renderer/gpu_video_service_host.h b/content/renderer/gpu_video_service_host.h
new file mode 100644
index 0000000..543448d
--- /dev/null
+++ b/content/renderer/gpu_video_service_host.h
@@ -0,0 +1,53 @@
+// 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.
+
+#ifndef CONTENT_RENDERER_GPU_VIDEO_SERVICE_HOST_H_
+#define CONTENT_RENDERER_GPU_VIDEO_SERVICE_HOST_H_
+
+#include "base/singleton.h"
+#include "content/renderer/gpu_channel_host.h"
+#include "content/renderer/gpu_video_decoder_host.h"
+#include "ipc/ipc_channel.h"
+#include "media/base/buffers.h"
+#include "media/base/video_frame.h"
+
+// GpuVideoServiceHost lives on IO thread and is used to dispatch IPC messages
+// to GpuVideoDecoderHost objects.
+class GpuVideoServiceHost : public IPC::ChannelProxy::MessageFilter {
+ public:
+ GpuVideoServiceHost();
+
+ // IPC::ChannelProxy::MessageFilter implementations.
+ virtual bool OnMessageReceived(const IPC::Message& message);
+ virtual void OnFilterAdded(IPC::Channel* channel);
+ virtual void OnFilterRemoved();
+ virtual void OnChannelClosing();
+
+ // Called on RenderThread to create a hardware accelerated video decoder
+ // in the GPU process.
+ //
+ // A routing ID for the GLES2 context needs to be provided when creating a
+ // hardware video decoder. This is important because the resources used by
+ // the video decoder needs to be shared with the GLES2 context corresponding
+ // to the RenderView.
+ //
+ // This means that a GPU video decoder is tied to a specific RenderView and
+ // its GLES2 context in the GPU process.
+ //
+ // Returns a GpuVideoDecoderHost as a handle to control the video decoder.
+ GpuVideoDecoderHost* CreateVideoDecoder(int context_route_id);
+
+ private:
+ IPC::Channel* channel_;
+
+ // Router to send messages to a GpuVideoDecoderHost.
+ MessageRouter router_;
+
+ // ID for the next GpuVideoDecoderHost.
+ int32 next_decoder_host_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuVideoServiceHost);
+};
+
+#endif // CONTENT_RENDERER_GPU_VIDEO_SERVICE_HOST_H_