This source file includes following definitions.
- pixel_format
- pixel_format
- IsValid
#include "media/video/capture/video_capture_types.h"
#include "media/base/limits.h"
namespace media {
VideoCaptureFormat::VideoCaptureFormat()
: frame_rate(0), pixel_format(PIXEL_FORMAT_UNKNOWN) {}
VideoCaptureFormat::VideoCaptureFormat(const gfx::Size& frame_size,
int frame_rate,
VideoPixelFormat pixel_format)
: frame_size(frame_size),
frame_rate(frame_rate),
pixel_format(pixel_format) {}
bool VideoCaptureFormat::IsValid() const {
return (frame_size.width() < media::limits::kMaxDimension) &&
(frame_size.height() < media::limits::kMaxDimension) &&
(frame_size.GetArea() >= 0) &&
(frame_size.GetArea() < media::limits::kMaxCanvas) &&
(frame_rate > 0) &&
(frame_rate < media::limits::kMaxFramesPerSecond) &&
(pixel_format >= PIXEL_FORMAT_UNKNOWN) &&
(pixel_format < PIXEL_FORMAT_MAX);
}
VideoCaptureParams::VideoCaptureParams() : allow_resolution_change(false) {}
}