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

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

Issue 22876027: Consolidate duplicated frame / capability structures in video_capture_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased: changed media::VideoCaptureCapability::kI420 -> media::PIXEL_FORMAT_I420 etc. Created 7 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/renderer/media/rtc_video_capturer.cc » ('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 df4eb71299c74efe6a29b0631a61d2c567f5688b..7c2bca4d72265e1f004bcc6b7fcdfde6afc4641b 100644
--- a/content/common/media/media_param_traits.cc
+++ b/content/common/media/media_param_traits.cc
@@ -58,7 +58,7 @@ void ParamTraits<VideoCaptureParams>::Write(Message* m,
const VideoCaptureParams& p) {
m->WriteInt(p.width);
m->WriteInt(p.height);
- m->WriteInt(p.frame_per_second);
+ m->WriteInt(p.frame_rate);
m->WriteInt(static_cast<int>(p.session_id));
m->WriteInt(static_cast<int>(p.frame_size_type));
}
@@ -69,7 +69,7 @@ bool ParamTraits<VideoCaptureParams>::Read(const Message* m,
int session_id, frame_size_type;
if (!m->ReadInt(iter, &r->width) ||
!m->ReadInt(iter, &r->height) ||
- !m->ReadInt(iter, &r->frame_per_second) ||
+ !m->ReadInt(iter, &r->frame_rate) ||
!m->ReadInt(iter, &session_id) ||
!m->ReadInt(iter, &frame_size_type))
return false;
@@ -78,18 +78,8 @@ bool ParamTraits<VideoCaptureParams>::Read(const Message* m,
r->frame_size_type =
static_cast<media::VideoCaptureResolutionType>(
frame_size_type);
-
- // TODO(wjia): Replace with IsValid() method on VideoCaptureParams.
- if (r->width <= 0 || r->height <= 0 || r->frame_per_second <= 0 ||
- r->frame_per_second > media::limits::kMaxFramesPerSecond ||
- r->width > media::limits::kMaxDimension ||
- r->height > media::limits::kMaxDimension ||
- r->width * r->height > media::limits::kMaxCanvas ||
- r->frame_size_type < 0 ||
- r->frame_size_type >= media::MaxVideoCaptureResolutionType) {
+ if (!r->IsValid())
return false;
- }
-
return true;
}
« no previous file with comments | « content/common/media/media_param_traits.h ('k') | content/renderer/media/rtc_video_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698