diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 15:53:30 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 15:53:30 +0000 |
commit | 768708171bb6c8dec34509c11460d3bc355a3e81 (patch) | |
tree | 0759c4e4c4fc9bd6d115e5e4ade74f81225756ff /chrome/common/gpu_video_common.cc | |
parent | 8f8b6b856f85ec92504ca3e48ea4e0d0886ac7b2 (diff) | |
download | chromium_src-768708171bb6c8dec34509c11460d3bc355a3e81.zip chromium_src-768708171bb6c8dec34509c11460d3bc355a3e81.tar.gz chromium_src-768708171bb6c8dec34509c11460d3bc355a3e81.tar.bz2 |
Added FakeGlVideoDecodeEngine to exercise the IPC protocol for hardware video decoding
There are several things done in this patch:
1. Added FakeGlVideoDecodeEngine
2. Fixed style problem in VideoDecodeEngine and gpu_video_common.h
3. Added route to pass texture from gpu process to WebKit
BUG=53714
TEST=Tree is green
Review URL: http://codereview.chromium.org/3335014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gpu_video_common.cc')
-rw-r--r-- | chrome/common/gpu_video_common.cc | 117 |
1 files changed, 60 insertions, 57 deletions
diff --git a/chrome/common/gpu_video_common.cc b/chrome/common/gpu_video_common.cc index 2042c1b..928bb44 100644 --- a/chrome/common/gpu_video_common.cc +++ b/chrome/common/gpu_video_common.cc @@ -8,16 +8,16 @@ namespace IPC { void ParamTraits<GpuVideoServiceInfoParam>::Write( Message* m, const GpuVideoServiceInfoParam& p) { - m->WriteInt(p.video_service_route_id_); - m->WriteInt(p.video_service_host_route_id_); - m->WriteInt(p.service_available_); + m->WriteInt(p.video_service_route_id); + m->WriteInt(p.video_service_host_route_id); + m->WriteInt(p.service_available); } bool ParamTraits<GpuVideoServiceInfoParam>::Read( const Message* m, void** iter, GpuVideoServiceInfoParam* r) { - if (!m->ReadInt(iter, &r->video_service_route_id_) || - !m->ReadInt(iter, &r->video_service_host_route_id_) || - !m->ReadInt(iter, &r->service_available_)) + if (!m->ReadInt(iter, &r->video_service_route_id) || + !m->ReadInt(iter, &r->video_service_host_route_id) || + !m->ReadInt(iter, &r->service_available)) return false; return true; } @@ -25,9 +25,9 @@ bool ParamTraits<GpuVideoServiceInfoParam>::Read( void ParamTraits<GpuVideoServiceInfoParam>::Log( const GpuVideoServiceInfoParam& p, std::string* l) { l->append(StringPrintf("(%d, %d, %d)", - p.video_service_route_id_, - p.video_service_host_route_id_, - p.service_available_)); + p.video_service_route_id, + p.video_service_host_route_id, + p.service_available)); } /////////////////////////////////////////////////////////////////////////////// @@ -62,76 +62,76 @@ void ParamTraits<GpuVideoDecoderInfoParam>::Log( void ParamTraits<GpuVideoDecoderInitParam>::Write( Message* m, const GpuVideoDecoderInitParam& p) { - m->WriteInt(p.codec_id_); - m->WriteInt(p.width_); - m->WriteInt(p.height_); + m->WriteInt(p.codec_id); + m->WriteInt(p.width); + m->WriteInt(p.height); } bool ParamTraits<GpuVideoDecoderInitParam>::Read( const Message* m, void** iter, GpuVideoDecoderInitParam* r) { - if (!m->ReadInt(iter, &r->codec_id_) || - !m->ReadInt(iter, &r->width_) || - !m->ReadInt(iter, &r->height_)) + if (!m->ReadInt(iter, &r->codec_id) || + !m->ReadInt(iter, &r->width) || + !m->ReadInt(iter, &r->height)) return false; return true; } void ParamTraits<GpuVideoDecoderInitParam>::Log( const GpuVideoDecoderInitParam& p, std::string* l) { - l->append(StringPrintf("(%d, %d %d)", p.codec_id_, p.width_, p.height_)); + l->append(StringPrintf("(%d, %d %d)", p.codec_id, p.width, p.height)); } /////////////////////////////////////////////////////////////////////////////// void ParamTraits<GpuVideoDecoderInitDoneParam>::Write( Message* m, const GpuVideoDecoderInitDoneParam& p) { - m->WriteInt(p.success_); - m->WriteInt(p.stride_); - m->WriteInt(p.format_); - m->WriteInt(p.surface_type_); - m->WriteInt(p.input_buffer_size_); - m->WriteInt(p.output_buffer_size_); + m->WriteInt(p.success); + m->WriteInt(p.stride); + m->WriteInt(p.format); + m->WriteInt(p.surface_type); + m->WriteInt(p.input_buffer_size); + m->WriteInt(p.output_buffer_size); IPC::ParamTraits<base::SharedMemoryHandle>::Write( - m, p.input_buffer_handle_); + m, p.input_buffer_handle); IPC::ParamTraits<base::SharedMemoryHandle>::Write( - m, p.output_buffer_handle_); + m, p.output_buffer_handle); } bool ParamTraits<GpuVideoDecoderInitDoneParam>::Read( const Message* m, void** iter, GpuVideoDecoderInitDoneParam* r) { - if (!m->ReadInt(iter, &r->success_) || - !m->ReadInt(iter, &r->stride_) || - !m->ReadInt(iter, &r->format_) || - !m->ReadInt(iter, &r->surface_type_) || - !m->ReadInt(iter, &r->input_buffer_size_) || - !m->ReadInt(iter, &r->output_buffer_size_) || + if (!m->ReadInt(iter, &r->success) || + !m->ReadInt(iter, &r->stride) || + !m->ReadInt(iter, &r->format) || + !m->ReadInt(iter, &r->surface_type) || + !m->ReadInt(iter, &r->input_buffer_size) || + !m->ReadInt(iter, &r->output_buffer_size) || !IPC::ParamTraits<base::SharedMemoryHandle>::Read( - m, iter, &r->input_buffer_handle_) || + m, iter, &r->input_buffer_handle) || !IPC::ParamTraits<base::SharedMemoryHandle>::Read( - m, iter, &r->output_buffer_handle_)) + m, iter, &r->output_buffer_handle)) return false; return true; } void ParamTraits<GpuVideoDecoderInitDoneParam>::Log( const GpuVideoDecoderInitDoneParam& p, std::string* l) { - l->append(StringPrintf("(%d)", p.stride_)); + l->append(StringPrintf("(%d)", p.stride)); } /////////////////////////////////////////////////////////////////////////////// void ParamTraits<GpuVideoDecoderInputBufferParam>::Write( Message* m, const GpuVideoDecoderInputBufferParam& p) { - m->WriteInt64(p.timestamp_); - m->WriteInt(p.offset_); - m->WriteInt(p.size_); + m->WriteInt64(p.timestamp); + m->WriteInt(p.offset); + m->WriteInt(p.size); } bool ParamTraits<GpuVideoDecoderInputBufferParam>::Read( const Message* m, void** iter, GpuVideoDecoderInputBufferParam* r) { - if (!m->ReadInt64(iter, &r->timestamp_) || - !m->ReadInt(iter, &r->offset_) || - !m->ReadInt(iter, &r->size_)) + if (!m->ReadInt64(iter, &r->timestamp) || + !m->ReadInt(iter, &r->offset) || + !m->ReadInt(iter, &r->size)) return false; return true; } @@ -139,34 +139,37 @@ bool ParamTraits<GpuVideoDecoderInputBufferParam>::Read( void ParamTraits<GpuVideoDecoderInputBufferParam>::Log( const GpuVideoDecoderInputBufferParam& p, std::string* l) { l->append(StringPrintf("(%d %d %d)", - static_cast<int>(p.timestamp_), - p.offset_, p.size_)); + static_cast<int>(p.timestamp), + p.offset, p.size)); } /////////////////////////////////////////////////////////////////////////////// void ParamTraits<GpuVideoDecoderOutputBufferParam>::Write( Message* m, const GpuVideoDecoderOutputBufferParam& p) { - m->WriteInt64(p.timestamp_); - m->WriteInt64(p.duration_); - m->WriteInt(p.flags_); + m->WriteInt64(p.timestamp); + m->WriteInt64(p.duration); + m->WriteInt(p.flags); + m->WriteInt(p.texture); } bool ParamTraits<GpuVideoDecoderOutputBufferParam>::Read( const Message* m, void** iter, GpuVideoDecoderOutputBufferParam* r) { - if (!m->ReadInt64(iter, &r->timestamp_) || - !m->ReadInt64(iter, &r->duration_) || - !m->ReadInt(iter, &r->flags_)) + if (!m->ReadInt64(iter, &r->timestamp) || + !m->ReadInt64(iter, &r->duration) || + !m->ReadInt(iter, &r->flags) || + !m->ReadInt(iter, &r->texture)) return false; return true; } void ParamTraits<GpuVideoDecoderOutputBufferParam>::Log( const GpuVideoDecoderOutputBufferParam& p, std::string* l) { - l->append(StringPrintf("(%d %d) %x", - static_cast<int>(p.timestamp_), - static_cast<int>(p.duration_), - p.flags_)); + l->append(StringPrintf("(%d %d) %x texture = x%d", + static_cast<int>(p.timestamp), + static_cast<int>(p.duration), + p.flags, + p.texture)); } /////////////////////////////////////////////////////////////////////////////// @@ -192,21 +195,21 @@ void ParamTraits<GpuVideoDecoderErrorInfoParam>::Log( void ParamTraits<GpuVideoDecoderFormatChangeParam>::Write( Message* m, const GpuVideoDecoderFormatChangeParam& p) { - m->WriteInt(p.input_buffer_size_); - m->WriteInt(p.output_buffer_size_); + m->WriteInt(p.input_buffer_size); + m->WriteInt(p.output_buffer_size); } bool ParamTraits<GpuVideoDecoderFormatChangeParam>::Read( const Message* m, void** iter, GpuVideoDecoderFormatChangeParam* r) { - if (!m->ReadInt(iter, &r->input_buffer_size_) || - !m->ReadInt(iter, &r->output_buffer_size_)) + if (!m->ReadInt(iter, &r->input_buffer_size) || + !m->ReadInt(iter, &r->output_buffer_size)) return false; return true; } void ParamTraits<GpuVideoDecoderFormatChangeParam>::Log( const GpuVideoDecoderFormatChangeParam& p, std::string* l) { - l->append(StringPrintf("(%d %d)", p.input_buffer_size_, - p.output_buffer_size_)); + l->append(StringPrintf("(%d %d)", p.input_buffer_size, + p.output_buffer_size)); } }; |