summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 23:20:40 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 23:20:40 +0000
commit79297e50bc383232cf53c4ac2323db28193c58f4 (patch)
treefeb5ff0503233bd2e4261108acf24b8c426ed02a
parent767718e56d9952608e58c8e65568877f95820baa (diff)
downloadchromium_src-79297e50bc383232cf53c4ac2323db28193c58f4.zip
chromium_src-79297e50bc383232cf53c4ac2323db28193c58f4.tar.gz
chromium_src-79297e50bc383232cf53c4ac2323db28193c58f4.tar.bz2
SendAllocateVideoFrames to the renderer
This is separated from a previous patch due to link error on mac. BUG=53714 TEST=Mac build bots are happy Review URL: http://codereview.chromium.org/3414011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60126 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/gpu_messages_internal.h8
-rw-r--r--chrome/common/gpu_video_common.cc61
-rw-r--r--chrome/common/gpu_video_common.h8
-rw-r--r--chrome/gpu/gpu_video_decoder.cc6
4 files changed, 12 insertions, 71 deletions
diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h
index 229e3db..2afb901 100644
--- a/chrome/common/gpu_messages_internal.h
+++ b/chrome/common/gpu_messages_internal.h
@@ -337,10 +337,10 @@ IPC_BEGIN_MESSAGES(GpuVideoDecoderHost)
// Allocate video frames for output of the hardware video decoder.
IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrames,
- int32, /* Numer of video frames to generate */
- int32, /* Width of the video frame */
- int32, /* Height of the video frame */
- media::VideoFrame::Format /* Format of the video frame */)
+ int32, /* Number of video frames to generate */
+ uint32, /* Width of the video frame */
+ uint32, /* Height of the video frame */
+ media::VideoFrame::Format) /* Format of the video frame */
// Release all video frames allocated for a hardware video decoder.
IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames)
diff --git a/chrome/common/gpu_video_common.cc b/chrome/common/gpu_video_common.cc
index 5c2e9257..17ad071 100644
--- a/chrome/common/gpu_video_common.cc
+++ b/chrome/common/gpu_video_common.cc
@@ -196,65 +196,4 @@ void ParamTraits<GpuVideoDecoderFormatChangeParam>::Log(
l->append(StringPrintf("%d", p.input_buffer_size));
}
-///////////////////////////////////////////////////////////////////////////////
-// Traits for media::VideoFrame::Format
-void ParamTraits<media::VideoFrame::Format>::Write(
- Message* m, const param_type& p) {
- m->WriteInt(p);
-}
-
-bool ParamTraits<media::VideoFrame::Format>::Read(
- const Message* m, void** iter, param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type))
- return false;
- *p = static_cast<param_type>(type);
- return true;
-}
-
-void ParamTraits<media::VideoFrame::Format>::Log(
- const param_type& p, std::string* l) {
- std::string s;
- switch (p) {
- case media::VideoFrame::RGB555:
- s = "RGB555";
- break;
- case media::VideoFrame::RGB565:
- s = "RGB565";
- break;
- case media::VideoFrame::RGB24:
- s = "RGB24";
- break;
- case media::VideoFrame::RGB32:
- s = "RGB32";
- break;
- case media::VideoFrame::RGBA:
- s = "RGBA";
- break;
- case media::VideoFrame::YV12:
- s = "YV12";
- break;
- case media::VideoFrame::YV16:
- s = "YV16";
- break;
- case media::VideoFrame::NV12:
- s = "NV12";
- break;
- case media::VideoFrame::EMPTY:
- s = "EMPTY";
- break;
- case media::VideoFrame::ASCII:
- s = "ASCII";
- break;
- case media::VideoFrame::INVALID:
- s = "INVALID";
- break;
- default:
- NOTIMPLEMENTED();
- s = "UNKNOWN";
- break;
- }
- LogParam(s, l);
-}
-
} // namespace IPC
diff --git a/chrome/common/gpu_video_common.h b/chrome/common/gpu_video_common.h
index 8102f3d..a72f799 100644
--- a/chrome/common/gpu_video_common.h
+++ b/chrome/common/gpu_video_common.h
@@ -1,3 +1,4 @@
+
// 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.
@@ -150,11 +151,8 @@ struct ParamTraits<GpuVideoDecoderFormatChangeParam> {
};
template <>
-struct ParamTraits<media::VideoFrame::Format> {
- typedef media::VideoFrame::Format param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::string* l);
+struct SimilarTypeTraits<media::VideoFrame::Format> {
+ typedef int Type;
};
} // namespace IPC
diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc
index 91758e0..bf5881ed 100644
--- a/chrome/gpu/gpu_video_decoder.cc
+++ b/chrome/gpu/gpu_video_decoder.cc
@@ -343,7 +343,11 @@ void GpuVideoDecoder::SendFillBufferDone(
void GpuVideoDecoder::SendAllocateVideoFrames(
int n, size_t width, size_t height, media::VideoFrame::Format format) {
- // TODO(hclam): Actually send the message.
+ if (!channel_->Send(
+ new GpuVideoDecoderHostMsg_AllocateVideoFrames(
+ route_id(), n, width, height, format))) {
+ LOG(ERROR) << "GpuVideoDecoderMsg_AllocateVideoFrames failed";
+ }
}
void GpuVideoDecoder::SendReleaseAllVideoFrames() {