summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 22:03:16 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 22:03:16 +0000
commit1318e92f70e240d7ae71320ea7e4fcae18f2ce3e (patch)
tree412ee9192a850d9867bea3a841d800f67081ebe3 /chrome/common
parent9fcd39385ae39a68d3509238bd9ef83af1868fc7 (diff)
downloadchromium_src-1318e92f70e240d7ae71320ea7e4fcae18f2ce3e.zip
chromium_src-1318e92f70e240d7ae71320ea7e4fcae18f2ce3e.tar.gz
chromium_src-1318e92f70e240d7ae71320ea7e4fcae18f2ce3e.tar.bz2
Resubmit GpuVideoDecoder and related patches.
BUG=53714 TEST=Tree is green Review URL: http://codereview.chromium.org/3442006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/gpu_messages_internal.h2
-rw-r--r--chrome/common/gpu_video_common.cc35
-rw-r--r--chrome/common/gpu_video_common.h18
3 files changed, 15 insertions, 40 deletions
diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h
index 5a4d505..229e3db 100644
--- a/chrome/common/gpu_messages_internal.h
+++ b/chrome/common/gpu_messages_internal.h
@@ -336,7 +336,7 @@ IPC_BEGIN_MESSAGES(GpuVideoDecoderHost)
GpuVideoDecoderOutputBufferParam)
// Allocate video frames for output of the hardware video decoder.
- IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrame,
+ IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrames,
int32, /* Numer of video frames to generate */
int32, /* Width of the video frame */
int32, /* Height of the video frame */
diff --git a/chrome/common/gpu_video_common.cc b/chrome/common/gpu_video_common.cc
index 826ef20..5c2e9257 100644
--- a/chrome/common/gpu_video_common.cc
+++ b/chrome/common/gpu_video_common.cc
@@ -86,32 +86,22 @@ void ParamTraits<GpuVideoDecoderInitParam>::Log(
void ParamTraits<GpuVideoDecoderInitDoneParam>::Write(
Message* m, const GpuVideoDecoderInitDoneParam& p) {
WriteParam(m, p.success);
- WriteParam(m, p.stride);
- WriteParam(m, p.format);
- WriteParam(m, p.surface_type);
WriteParam(m, p.input_buffer_size);
- WriteParam(m, p.output_buffer_size);
WriteParam(m, p.input_buffer_handle);
- WriteParam(m, p.output_buffer_handle);
}
bool ParamTraits<GpuVideoDecoderInitDoneParam>::Read(
const Message* m, void** iter, GpuVideoDecoderInitDoneParam* r) {
if (!ReadParam(m, iter, &r->success) ||
- !ReadParam(m, iter, &r->stride) ||
- !ReadParam(m, iter, &r->format) ||
- !ReadParam(m, iter, &r->surface_type) ||
!ReadParam(m, iter, &r->input_buffer_size) ||
- !ReadParam(m, iter, &r->output_buffer_size) ||
- !ReadParam(m, iter, &r->input_buffer_handle) ||
- !ReadParam(m, iter, &r->output_buffer_handle))
+ !ReadParam(m, iter, &r->input_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 %d)", p.success, p.input_buffer_size));
}
///////////////////////////////////////////////////////////////////////////////
@@ -143,29 +133,29 @@ void ParamTraits<GpuVideoDecoderInputBufferParam>::Log(
void ParamTraits<GpuVideoDecoderOutputBufferParam>::Write(
Message* m, const GpuVideoDecoderOutputBufferParam& p) {
+ WriteParam(m, p.frame_id);
WriteParam(m, p.timestamp);
WriteParam(m, p.duration);
WriteParam(m, p.flags);
- WriteParam(m, p.texture);
}
bool ParamTraits<GpuVideoDecoderOutputBufferParam>::Read(
const Message* m, void** iter, GpuVideoDecoderOutputBufferParam* r) {
- if (!ReadParam(m, iter, &r->timestamp) ||
+ if (!ReadParam(m, iter, &r->frame_id) ||
+ !ReadParam(m, iter, &r->timestamp) ||
!ReadParam(m, iter, &r->duration) ||
- !ReadParam(m, iter, &r->flags) ||
- !ReadParam(m, iter, &r->texture))
+ !ReadParam(m, iter, &r->flags))
return false;
return true;
}
void ParamTraits<GpuVideoDecoderOutputBufferParam>::Log(
const GpuVideoDecoderOutputBufferParam& p, std::string* l) {
- l->append(StringPrintf("(%d %d) %x texture = x%d",
+ l->append(StringPrintf("(%d %d %d %x)",
+ p.frame_id,
static_cast<int>(p.timestamp),
static_cast<int>(p.duration),
- p.flags,
- p.texture));
+ p.flags));
}
///////////////////////////////////////////////////////////////////////////////
@@ -192,21 +182,18 @@ void ParamTraits<GpuVideoDecoderErrorInfoParam>::Log(
void ParamTraits<GpuVideoDecoderFormatChangeParam>::Write(
Message* m, const GpuVideoDecoderFormatChangeParam& p) {
WriteParam(m, p.input_buffer_size);
- WriteParam(m, p.output_buffer_size);
}
bool ParamTraits<GpuVideoDecoderFormatChangeParam>::Read(
const Message* m, void** iter, GpuVideoDecoderFormatChangeParam* r) {
- if (!ReadParam(m, iter, &r->input_buffer_size) ||
- !ReadParam(m, iter, &r->output_buffer_size))
+ if (!ReadParam(m, iter, &r->input_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", p.input_buffer_size));
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/common/gpu_video_common.h b/chrome/common/gpu_video_common.h
index ee3f1e3..8102f3d 100644
--- a/chrome/common/gpu_video_common.h
+++ b/chrome/common/gpu_video_common.h
@@ -48,15 +48,8 @@ struct GpuVideoDecoderInitParam {
struct GpuVideoDecoderInitDoneParam {
int32 success; // other parameter is only meaningful when this is true.
- int32 provides_buffer;
- media::VideoFrame::Format format;
- int32 surface_type; // TODO(hclam): Remove this. We only pass GL textures.
- int32 stride;
int32 input_buffer_size;
- int32 output_buffer_size;
base::SharedMemoryHandle input_buffer_handle;
- // we do not need this if hardware composition is ready.
- base::SharedMemoryHandle output_buffer_handle;
};
struct GpuVideoDecoderInputBufferParam {
@@ -66,16 +59,14 @@ struct GpuVideoDecoderInputBufferParam {
int32 flags; // miscellaneous flag bit mask
};
+// A message that contains formation of a video frame that is ready to be
+// rendered by the Renderer process.
struct GpuVideoDecoderOutputBufferParam {
+ int32 frame_id; // ID of the video frame that is ready to be rendered.
int64 timestamp; // In unit of microseconds.
int64 duration; // In unit of microseconds.
int32 flags; // miscellaneous flag bit mask
- // TODO(hclam): This is really ugly and should be removed. Instead of sending
- // a texture id we should send a buffer id that signals that a buffer is ready
- // to be consumed. Before that we need API to establish the buffers.
- int32 texture;
-
enum {
kFlagsEndOfStream = 0x00000001,
kFlagsDiscontinuous = 0x00000002,
@@ -88,11 +79,8 @@ struct GpuVideoDecoderErrorInfoParam {
// TODO(jiesun): define this.
struct GpuVideoDecoderFormatChangeParam {
- int32 stride;
int32 input_buffer_size;
- int32 output_buffer_size;
base::SharedMemoryHandle input_buffer_handle;
- base::SharedMemoryHandle output_buffer_handle;
};
namespace IPC {