1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/video/capture/video_capture_types.h"
7 #include "media/base/limits.h"
11 VideoCaptureFormat::VideoCaptureFormat()
12 : frame_rate(0), pixel_format(PIXEL_FORMAT_UNKNOWN) {}
14 VideoCaptureFormat::VideoCaptureFormat(const gfx::Size& frame_size,
16 VideoPixelFormat pixel_format)
17 : frame_size(frame_size),
18 frame_rate(frame_rate),
19 pixel_format(pixel_format) {}
21 bool VideoCaptureFormat::IsValid() const {
22 return (frame_size.width() < media::limits::kMaxDimension) &&
23 (frame_size.height() < media::limits::kMaxDimension) &&
24 (frame_size.GetArea() >= 0) &&
25 (frame_size.GetArea() < media::limits::kMaxCanvas) &&
27 (frame_rate < media::limits::kMaxFramesPerSecond) &&
28 (pixel_format >= PIXEL_FORMAT_UNKNOWN) &&
29 (pixel_format < PIXEL_FORMAT_MAX);
32 VideoCaptureParams::VideoCaptureParams() : allow_resolution_change(false) {}