1#ifndef ZAO_ENDPOINT_VIDEO_VIDEO_FORMAT_HPP_
2#define ZAO_ENDPOINT_VIDEO_VIDEO_FORMAT_HPP_
4#include <linux/videodev2.h>
36 VideoFormat(
int width,
int height,
bool interlaced,
double fps,
37 uint32_t pixelformat, v4l2_quantization quantization,
38 v4l2_colorspace colorspace) noexcept
41 interlaced_(interlaced),
43 pixelformat_(pixelformat),
44 quantization_(quantization),
45 colorspace_(colorspace) {}
54 void GetFramerate(
int& numerator,
int& denominator)
const noexcept {
57 numerator = fps_ * denominator;
68 int GetWidth() const noexcept {
return width_; }
85 return interlaced_ ? height_ / 2 : height_;
115 return ((this->width_ == other.width_) &&
116 (this->height_ == other.height_) &&
117 (this->interlaced_ == other.interlaced_) &&
118 (std::abs(this->fps_ - other.fps_) < 0.01) &&
119 (this->pixelformat_ == other.pixelformat_) &&
120 (this->quantization_ == other.quantization_) &&
121 (this->colorspace_ == other.colorspace_));
124 bool operator!=(
const VideoFormat& other)
const {
return !(*
this == other); }
129 bool interlaced_ =
false;
134 uint32_t pixelformat_ = 0;
135 v4l2_quantization quantization_ =
136 v4l2_quantization::V4L2_QUANTIZATION_DEFAULT;
137 v4l2_colorspace colorspace_ = v4l2_colorspace::V4L2_COLORSPACE_DEFAULT;
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11