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

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

Issue 1323093006: Change the media::PowerLineFrequency from an enum class to a proper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass around PowerLineFrequency objects in VideoCaptureDevice instead of integers Created 5 years, 3 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
« no previous file with comments | « content/common/media/media_param_traits.h ('k') | content/common/media/video_capture_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19c3b87975badff70e7cce7c8eeb4aa5b63b443a..338ecdcf09ca8a498cf7e3d591f7b7c119522bf2 100644
--- a/content/common/media/media_param_traits.cc
+++ b/content/common/media/media_param_traits.cc
@@ -14,6 +14,7 @@
using media::AudioParameters;
using media::ChannelLayout;
+using media::PowerLineFrequency;
using media::VideoCaptureFormat;
namespace IPC {
@@ -55,6 +56,29 @@ void ParamTraits<AudioParameters>::Log(const AudioParameters& p,
l->append(base::StringPrintf("<AudioParameters>"));
}
+void ParamTraits<PowerLineFrequency>::Write(Message *m,
+ const PowerLineFrequency& p) {
+ WriteParam(m, p.get());
+}
+
+bool ParamTraits<PowerLineFrequency>::Read(const Message* m,
+ base::PickleIterator* iter,
+ PowerLineFrequency* r) {
+ int freq;
+ if(!ReadParam(m, iter, &freq))
+ {
+ return false;
+ }
+ *r = PowerLineFrequency(freq);
+ return r->valid();
+}
+
+void ParamTraits<PowerLineFrequency>::Log(const PowerLineFrequency& p,
+ std::string *l) {
+ l->append(base::StringPrintf("<PowerLineFrequency> %d",
+ p.get()));
+}
+
void ParamTraits<VideoCaptureFormat>::Write(Message* m,
const VideoCaptureFormat& p) {
WriteParam(m, p.frame_size);
« no previous file with comments | « content/common/media/media_param_traits.h ('k') | content/common/media/video_capture_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698