Chromium Code Reviews| Index: content/common/media/media_param_traits.cc |
| diff --git a/content/common/media/media_param_traits.cc b/content/common/media/media_param_traits.cc |
| index 280d908ccfc00386bb8f88217abbd6897acbe6eb..0ee7a7742c082b39c55412bf9b1308665ea4944d 100644 |
| --- a/content/common/media/media_param_traits.cc |
| +++ b/content/common/media/media_param_traits.cc |
| @@ -13,6 +13,7 @@ using media::AudioParameters; |
| using media::ChannelLayout; |
| using media::VideoCaptureFormat; |
| using media::VideoPixelFormat; |
| +using media::VideoPixelStorage; |
| namespace IPC { |
| @@ -63,23 +64,22 @@ void ParamTraits<VideoCaptureFormat>::Write(Message* m, |
| m->WriteInt(p.frame_size.height()); |
| m->WriteFloat(p.frame_rate); |
| m->WriteInt(static_cast<int>(p.pixel_format)); |
| + m->WriteInt(static_cast<int>(p.pixel_storage)); |
| } |
| bool ParamTraits<VideoCaptureFormat>::Read(const Message* m, |
| base::PickleIterator* iter, |
| VideoCaptureFormat* r) { |
| - int frame_size_width, frame_size_height, pixel_format; |
| - if (!iter->ReadInt(&frame_size_width) || |
| - !iter->ReadInt(&frame_size_height) || |
| - !iter->ReadFloat(&r->frame_rate) || |
| - !iter->ReadInt(&pixel_format)) |
| + int frame_size_width, frame_size_height; |
| + if (!ReadParam(m, iter, &frame_size_width) || |
|
dcheng
2015/06/24 21:41:48
ReadParam(m, iter, &r->frame_size)
mcasas
2015/06/25 01:19:51
no member named 'Read' in 'IPC::ParamTraits<gfx::S
|
| + !ReadParam(m, iter, &frame_size_height) || |
| + !ReadParam(m, iter, &r->frame_rate) || |
| + !ReadParam(m, iter, &r->pixel_format) || |
| + !ReadParam(m, iter, &r->pixel_storage)) |
|
dcheng
2015/06/24 21:41:47
Thanks, this is much better (the original patch di
dcheng
2015/06/24 21:43:33
Also, don't you need to IPC_ENUM_TRAITS_MAX_VALUE(
mcasas
2015/06/25 01:19:51
Done,
mcasas
2015/06/25 01:19:51
Acknowledged.
|
| return false; |
| r->frame_size.SetSize(frame_size_width, frame_size_height); |
| - r->pixel_format = static_cast<VideoPixelFormat>(pixel_format); |
| - if (!r->IsValid()) |
| - return false; |
| - return true; |
| + return r->IsValid(); |
| } |
| void ParamTraits<VideoCaptureFormat>::Log(const VideoCaptureFormat& p, |