10#ifndef ZEP_VIDEO_VIDEO_FORMAT_HPP_
11#define ZEP_VIDEO_VIDEO_FORMAT_HPP_
13#include <linux/videodev2.h>
44 VideoFormat(
int width,
int height,
bool interlaced,
double fps,
45 uint32_t pixelformat, v4l2_quantization quantization,
46 v4l2_colorspace colorspace) noexcept
49 interlaced_(interlaced),
51 pixelformat_(pixelformat),
52 quantization_(quantization),
53 colorspace_(colorspace) {}
62 void GetFramerate(
int& numerator,
int& denominator)
const noexcept {
65 numerator = fps_ * denominator;
76 int GetWidth() const noexcept {
return width_; }
93 return interlaced_ ? height_ / 2 : height_;
123 return ((this->width_ == other.width_) &&
124 (this->height_ == other.height_) &&
125 (this->interlaced_ == other.interlaced_) &&
126 (std::abs(this->fps_ - other.fps_) < 0.01) &&
127 (this->pixelformat_ == other.pixelformat_) &&
128 (this->quantization_ == other.quantization_) &&
129 (this->colorspace_ == other.colorspace_));
132 bool operator!=(
const VideoFormat& other)
const {
return !(*
this == other); }
137 bool interlaced_ =
false;
142 uint32_t pixelformat_ = 0;
143 v4l2_quantization quantization_ =
144 v4l2_quantization::V4L2_QUANTIZATION_DEFAULT;
145 v4l2_colorspace colorspace_ = v4l2_colorspace::V4L2_COLORSPACE_DEFAULT;
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19