diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 00:00:29 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 00:00:29 +0000 |
commit | 1804aa715fd72666c7c22d2cf6a773ecbd6eb43d (patch) | |
tree | 2b2ee2e3ed91882f0547a98e504407d324a8f154 /chrome/common | |
parent | 2722ec565d738f5431d9680c9f1bd2b79e0d5471 (diff) | |
download | chromium_src-1804aa715fd72666c7c22d2cf6a773ecbd6eb43d.zip chromium_src-1804aa715fd72666c7c22d2cf6a773ecbd6eb43d.tar.gz chromium_src-1804aa715fd72666c7c22d2cf6a773ecbd6eb43d.tar.bz2 |
Revert r60126 that broke the build.
TBR=scherkus
BUG=53714
TEST=
Review URL: http://codereview.chromium.org/3393017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/gpu_messages_internal.h | 8 | ||||
-rw-r--r-- | chrome/common/gpu_video_common.cc | 61 | ||||
-rw-r--r-- | chrome/common/gpu_video_common.h | 8 |
3 files changed, 70 insertions, 7 deletions
diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h index 2afb901..229e3db 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, /* 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 */ + 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 */) // 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 17ad071..5c2e9257 100644 --- a/chrome/common/gpu_video_common.cc +++ b/chrome/common/gpu_video_common.cc @@ -196,4 +196,65 @@ 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 a72f799..8102f3d 100644 --- a/chrome/common/gpu_video_common.h +++ b/chrome/common/gpu_video_common.h @@ -1,4 +1,3 @@ - // 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. @@ -151,8 +150,11 @@ struct ParamTraits<GpuVideoDecoderFormatChangeParam> { }; template <> -struct SimilarTypeTraits<media::VideoFrame::Format> { - typedef int Type; +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); }; } // namespace IPC |