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 7c2bca4d72265e1f004bcc6b7fcdfde6afc4641b..b8791cde1481b88b52772df28aeb3be4bafd5ffe 100644 |
| --- a/content/common/media/media_param_traits.cc |
| +++ b/content/common/media/media_param_traits.cc |
| @@ -11,6 +11,7 @@ |
| using media::AudioParameters; |
| using media::ChannelLayout; |
| +using media::VideoCaptureFormat; |
| using media::VideoCaptureParams; |
| using media::VideoCaptureSessionId; |
| @@ -88,4 +89,35 @@ void ParamTraits<VideoCaptureParams>::Log(const VideoCaptureParams& p, |
| l->append(base::StringPrintf("<VideoCaptureParams>")); |
| } |
| +void ParamTraits<VideoCaptureFormat>::Write(Message* m, |
|
Ami GONE FROM CHROMIUM
2013/10/04 00:24:15
Since this is only sent from the browser to the re
ncarter (slow)
2013/10/16 02:08:40
I shifted to something slightly different:
* Kept
|
| + const VideoCaptureFormat& p) { |
| + m->WriteInt(p.width); |
| + m->WriteInt(p.height); |
| + m->WriteInt(p.frame_rate); |
| + m->WriteInt(static_cast<int>(p.frame_size_type)); |
| +} |
| + |
| +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) || |
| + !m->ReadInt(iter, &r->frame_rate) || |
| + !m->ReadInt(iter, &frame_size_type)) |
| + return false; |
| + |
| + r->frame_size_type = |
| + static_cast<media::VideoCaptureResolutionType>( |
| + frame_size_type); |
| + if (!r->IsValid()) |
| + return false; |
| + return true; |
| +} |
| + |
| +void ParamTraits<VideoCaptureFormat>::Log(const VideoCaptureFormat& p, |
| + std::string* l) { |
| + l->append(base::StringPrintf("<VideoCaptureFormat>")); |
| +} |
| + |
| } |