Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1279)

Unified Diff: content/common/media/media_param_traits.cc

Issue 23551011: From Video Capture, abolish OnFrameInfo and enable resolution changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add assert to vcbp unittest Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>"));
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698