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

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

Issue 83633008: Reland: Reorganize media::VideoCapture* types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 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) ||
+ !m->ReadInt(iter, &frame_size_height) ||
!m->ReadInt(iter, &r->frame_rate) ||
- !m->ReadInt(iter, &frame_size_type))
+ !m->ReadInt(iter, &pixel_format))
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;

Powered by Google App Engine
This is Rietveld 408576698