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

Unified Diff: media/video/capture/video_capture_types.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 | « media/video/capture/video_capture_types.h ('k') | media/video/capture/win/sink_input_pin_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..058b1684b34b6c9599bafedafaf344e358e87696
--- /dev/null
+++ b/media/video/capture/video_capture_types.cc
@@ -0,0 +1,60 @@
+// 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 {
+
+VideoCaptureFormat::VideoCaptureFormat()
+ : width(0),
+ height(0),
+ frame_rate(0),
+ frame_size_type(ConstantResolutionVideoCaptureDevice) {}
+
+VideoCaptureFormat::VideoCaptureFormat(
+ int width,
+ int height,
+ int frame_rate,
+ VideoCaptureResolutionType frame_size_type)
+ : width(width),
+ height(height),
+ frame_rate(frame_rate),
+ frame_size_type(frame_size_type) {}
+
+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);
+}
+
+VideoCaptureParams::VideoCaptureParams()
+ : session_id(0) {}
+
+VideoCaptureCapability::VideoCaptureCapability()
+ : color(PIXEL_FORMAT_UNKNOWN),
+ expected_capture_delay(0),
+ interlaced(false),
+ session_id(0) {}
+
+VideoCaptureCapability::VideoCaptureCapability(
+ int width,
+ int height,
+ int frame_rate,
+ VideoPixelFormat color,
+ int delay,
+ bool interlaced,
+ VideoCaptureResolutionType frame_size_type)
+ : VideoCaptureFormat(width, height, frame_rate, frame_size_type),
+ color(color),
+ expected_capture_delay(delay),
+ interlaced(interlaced),
+ session_id(0) {}
+
+} // namespace media
« no previous file with comments | « media/video/capture/video_capture_types.h ('k') | media/video/capture/win/sink_input_pin_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698