VideoFormat

Struct representing the format of a video frame.

struct VideoFormat {
  OPTIONAL_ENUM_SIZE_T{
      kMaxWidthInPixels = 3840,
      kMaxHeightInPixels = 2160,
      kMaxFps = 60,
  };
  int width;
  int height;
  int fps;
  bool operator<(const VideoFormat& fmt) const {
    if (height != fmt.height) {
      return height < fmt.height;
    } else if (width != fmt.width) {
      return width < fmt.width;
    } else {
      return fps < fmt.fps;
    }
  }
  bool operator==(const VideoFormat& fmt) const {
    return width == fmt.width && height == fmt.height && fps == fmt.fps;
  }
  bool operator!=(const VideoFormat& fmt) const { return !operator==(fmt); }
};

Properties

width
Width of the video frame (in pixels). Default is 960.
height
Height of the video frame (in pixels). Default is 540.
fps
Frame rate of the video (frames per second). Default is 15.