summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/gpu_video_decoder_host.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 18:50:03 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 18:50:03 +0000
commit6b723128f5c6b090b87949875dcc4e55304a4461 (patch)
treee842700264053ff9223e448cfee5a2f8d4651721 /chrome/renderer/gpu_video_decoder_host.cc
parent861100f087f00a810bae058af90bbd31fcc9aa2b (diff)
downloadchromium_src-6b723128f5c6b090b87949875dcc4e55304a4461.zip
chromium_src-6b723128f5c6b090b87949875dcc4e55304a4461.tar.gz
chromium_src-6b723128f5c6b090b87949875dcc4e55304a4461.tar.bz2
Connect GpuVideoDecodeServiceHost with ggl::Context and CommandBufferProxy
BUG=53714 A GpuVideoDecodeServiceHost needs to be connected with a ggl::Contect and its associated comand buffer for the following reasons: 1. The gpu video decoder in gpu process needs to be in the correct GLES2 context. 2. On context lost the gpu video decoder needs to destroy itself. This patch is able to connect the GpuVideoDecoderHost to the context although the context is not passed into the decoder, so the code path is currently broken. In a future patch we need to do the following: 1. Inject a ggl::Context into IpcVideoDecoder. 2. Complete the plumbing so that inside the gpu process we can associate a video decoder with a GLES2 context. Review URL: http://codereview.chromium.org/3215008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/gpu_video_decoder_host.cc')
-rw-r--r--chrome/renderer/gpu_video_decoder_host.cc27
1 files changed, 21 insertions, 6 deletions
diff --git a/chrome/renderer/gpu_video_decoder_host.cc b/chrome/renderer/gpu_video_decoder_host.cc
index a1a7962..c24d074 100644
--- a/chrome/renderer/gpu_video_decoder_host.cc
+++ b/chrome/renderer/gpu_video_decoder_host.cc
@@ -10,12 +10,11 @@
GpuVideoDecoderHost::GpuVideoDecoderHost(GpuVideoServiceHost* service_host,
GpuChannelHost* channel_host,
- EventHandler* event_handler,
- GpuVideoDecoderInfoParam decoder_info)
+ int context_route_id)
: gpu_video_service_host_(service_host),
channel_host_(channel_host),
- event_handler_(event_handler),
- decoder_info_(decoder_info),
+ context_route_id_(context_route_id),
+ event_handler_(NULL),
buffer_id_serial_(0),
state_(kStateUninitialized),
input_buffer_busy_(false) {
@@ -45,9 +44,26 @@ void GpuVideoDecoderHost::OnMessageReceived(const IPC::Message& msg) {
IPC_END_MESSAGE_MAP()
}
-bool GpuVideoDecoderHost::Initialize(const GpuVideoDecoderInitParam& param) {
+bool GpuVideoDecoderHost::Initialize(EventHandler* event_handler,
+ const GpuVideoDecoderInitParam& param) {
DCHECK_EQ(state_, kStateUninitialized);
+ // Save the event handler before we perform initialization operations so
+ // that we can report initialization events.
+ event_handler_ = event_handler;
+
+ // TODO(hclam): Pass the context route ID here.
+ // TODO(hclam): This create video decoder operation is synchronous, need to
+ // make it asynchronous.
+ if (!channel_host_->Send(
+ new GpuChannelMsg_CreateVideoDecoder(&decoder_info_))) {
+ LOG(ERROR) << "GpuChannelMsg_CreateVideoDecoder failed";
+ return false;
+ }
+
+ // Add the route so we'll receive messages.
+ gpu_video_service_host_->AddRoute(my_route_id(), this);
+
init_param_ = param;
if (!channel_host_ || !channel_host_->Send(
new GpuVideoDecoderMsg_Initialize(route_id(), param))) {
@@ -213,4 +229,3 @@ void GpuVideoDecoderHost::SendInputBufferToGpu() {
LOG(ERROR) << "GpuVideoDecoderMsg_EmptyThisBuffer failed";
}
}
-