QVideoSurfaceFormat Class

The QVideoSurfaceFormat class specifies the stream format of a video presentation surface. More...

Header: #include <QVideoSurfaceFormat>
qmake: QT += multimedia

Public Types

enum Direction { TopToBottom, BottomToTop }
enum YCbCrColorSpace { YCbCr_Undefined, YCbCr_BT601, YCbCr_BT709, YCbCr_xvYCC601, YCbCr_xvYCC709, YCbCr_JPEG }

Detailed Description

A video surface presents a stream of video frames. The surface's format describes the type of the frames and determines how they should be presented.

The core properties of a video stream required to setup a video surface are the pixel format given by pixelFormat(), and the frame dimensions given by frameSize().

If the surface is to present frames using a frame's handle a surface format will also include a handle type which is given by the handleType() function.

The region of a frame that is actually displayed on a video surface is given by the viewport(). A stream may have a viewport less than the entire region of a frame to allow for videos smaller than the nearest optimal size of a video frame. For example the width of a frame may be extended so that the start of each scan line is eight byte aligned.

Other common properties are the pixelAspectRatio(), scanLineDirection(), and frameRate(). Additionally a stream may have some additional type specific properties which are listed by the dynamicPropertyNames() function and can be accessed using the property(), and setProperty() functions.

Member Type Documentation

enum QVideoSurfaceFormat::Direction

Enumerates the layout direction of video scan lines.

ConstantValueDescription
QVideoSurfaceFormat::TopToBottom0Scan lines are arranged from the top of the frame to the bottom.
QVideoSurfaceFormat::BottomToTop1Scan lines are arranged from the bottom of the frame to the top.

enum QVideoSurfaceFormat::YCbCrColorSpace

Enumerates the Y'CbCr color space of video frames.

ConstantValueDescription
QVideoSurfaceFormat::YCbCr_Undefined0No color space is specified.
QVideoSurfaceFormat::YCbCr_BT6011A Y'CbCr color space defined by ITU-R recommendation BT.601 with Y value range from 16 to 235, and Cb/Cr range from 16 to 240. Used in standard definition video.
QVideoSurfaceFormat::YCbCr_BT7092A Y'CbCr color space defined by ITU-R BT.709 with the same values range as YCbCr_BT601. Used for HDTV.
QVideoSurfaceFormat::YCbCr_xvYCC6013The BT.601 color space with the value range extended to 0 to 255. It is backward compatibile with BT.601 and uses values outside BT.601 range to represent a wider range of colors.
QVideoSurfaceFormat::YCbCr_xvYCC7094The BT.709 color space with the value range extended to 0 to 255.
QVideoSurfaceFormat::YCbCr_JPEG5The full range Y'CbCr color space used in JPEG files.