Index: media/video/capture/video_capture_types.cc |
diff --git a/media/video/capture/video_capture_types.cc b/media/video/capture/video_capture_types.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..863e8dcf1b72f3c2ac9e5382796921a6761415fe |
--- /dev/null |
+++ b/media/video/capture/video_capture_types.cc |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "media/video/capture/video_capture_types.h" |
+ |
+#include "media/base/limits.h" |
+ |
+namespace media { |
+ |
+bool VideoCaptureFormat::IsValid() const { |
+ return (width > 0) && (height > 0) && (frame_rate > 0) && |
+ (frame_rate < media::limits::kMaxFramesPerSecond) && |
+ (width < media::limits::kMaxDimension) && |
+ (height < media::limits::kMaxDimension) && |
+ (width * height < media::limits::kMaxCanvas) && |
+ (frame_size_type >= 0) && |
+ (frame_size_type < media::MaxVideoCaptureResolutionType); |
+} |
+ |
+bool VideoCaptureParams::IsValid() const { |
+ return (width > 0) && (height > 0) && (frame_rate > 0) && |
+ (frame_rate < media::limits::kMaxFramesPerSecond) && |
+ (width < media::limits::kMaxDimension) && |
+ (height < media::limits::kMaxDimension) && |
+ (width * height < media::limits::kMaxCanvas) && |
+ (frame_size_type >= 0) && |
+ (frame_size_type < media::MaxVideoCaptureResolutionType); |
+} |
+ |
+} // namespace media |