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 18058d8ffa81edf41e522fc6e2a73e7a55062893..f6eaec1a85ffccb0eda2a822bb6ab2921d6c417f 100644 |
| --- a/content/common/media/media_param_traits.cc |
| +++ b/content/common/media/media_param_traits.cc |
| @@ -12,7 +12,7 @@ |
| using media::AudioParameters; |
| using media::ChannelLayout; |
| using media::VideoCaptureFormat; |
| -using media::VideoCaptureSessionId; |
| +using media::VideoPixelFormat; |
| namespace IPC { |
| @@ -56,25 +56,24 @@ void ParamTraits<AudioParameters>::Log(const AudioParameters& p, |
| void ParamTraits<VideoCaptureFormat>::Write(Message* m, |
| const VideoCaptureFormat& p) { |
| - m->WriteInt(p.width); |
| - m->WriteInt(p.height); |
| + m->WriteInt(p.frame_size.width()); |
| + m->WriteInt(p.frame_size.height()); |
| m->WriteInt(p.frame_rate); |
| - m->WriteInt(static_cast<int>(p.frame_size_type)); |
| + m->WriteInt(static_cast<int>(p.pixel_format)); |
| } |
| bool ParamTraits<VideoCaptureFormat>::Read(const Message* m, |
| PickleIterator* iter, |
| VideoCaptureFormat* r) { |
| - int frame_size_type; |
| - if (!m->ReadInt(iter, &r->width) || |
| - !m->ReadInt(iter, &r->height) || |
| + int frame_size_width, frame_size_height, pixel_format; |
| + if (!m->ReadInt(iter, &frame_size_width) || |
|
jschuh
2013/11/22 14:34:06
These values need sane upper bounds and negative c
ncarter (slow)
2013/11/22 14:47:43
That all happens in isvalid, right?
jschuh
2013/11/22 14:57:14
Ah, must have skimmed to quickly. The enum range i
|
| + !m->ReadInt(iter, &frame_size_height) || |
| !m->ReadInt(iter, &r->frame_rate) || |
| - !m->ReadInt(iter, &frame_size_type)) |
| + !m->ReadInt(iter, &pixel_format)) |
|
jschuh
2013/11/22 14:34:06
pixel_format needs to be defined as a proper IPC e
|
| return false; |
| - r->frame_size_type = |
| - static_cast<media::VideoCaptureResolutionType>( |
| - frame_size_type); |
| + 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; |