Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QVideoFrame Class Reference
[QtMediaModule]

The QVideoFrame class represents a single frame of displayable data More...

    #include <QVideoFrame>

Public Types

Public Functions

Static Public Members


Detailed Description

The QVideoFrame class represents a single frame of displayable data


Member Type Documentation

enum QVideoFrame::PixelFormat

Pixel formats (please see http://www.fourcc.org/yuv.php for formats description)

ConstantValue
QVideoFrame::Format_Invalid0
QVideoFrame::Format_ARGB321
QVideoFrame::Format_RGB322
QVideoFrame::Format_RGB243
QVideoFrame::Format_RGB5654
QVideoFrame::Format_BGRA325
QVideoFrame::Format_BGR326
QVideoFrame::Format_BGR247
QVideoFrame::Format_BGR5658
QVideoFrame::Format_YUV4449
QVideoFrame::Format_YUV420P10
QVideoFrame::Format_YV1211
QVideoFrame::Format_UYVY12
QVideoFrame::Format_YUYV13
QVideoFrame::Format_Y814


Member Function Documentation

QVideoFrame::QVideoFrame ()

Contructs an empty QVideoFrame

QVideoFrame::QVideoFrame ( const QVideoFrame & other )

Copy contructor. Create's a video frame from other Data is implicitly shared

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size )

Contructs an empty video frame specific with pixel format format and frame size with size

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size, const uchar * data, BufferHelper * helper = 0 )

Constructs a video frame with the given width, height and format, that uses an existing memory buffer, data. The width and height must be specified in pixels and is given by size, data must be 32-bit aligned, and each plane and scanline of data in the image must also be 32-bit aligned.

The buffer must remain valid throughout the life of the QVideoFrame and all copies that have not been modified or otherwise detached from the original buffer. The QVideoFrame does not delete the buffer at destruction. The helper parameter provides thread safety.

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size, uchar * data, BufferHelper * helper = 0 )

Constructs a video frame with the given width, height and format, that uses an existing memory buffer, data. The width and height must be specified in pixels given by size, data must be 32-bit aligned, and each plane and scanline of data in the image must also be 32-bit aligned.

The buffer must remain valid throughout the life of the QVideoFrame and all copies that have not been modified or otherwise detached from the original buffer. The QVideoFrame does not delete the buffer at destruction. The helper parameter provides thread safety.

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size, const uchar * planeData, int bytesPerLine, BufferHelper * helper = 0 )

Create Video frame for interlaced formats with one plane, like Format_RGB24 or Format_YUYV.

The pixel format is specified with format, the frame has image size size, planeData contains the raw image data, and the image stride is given by bytesPerLine. The buffer must remain valid throughout the life of the QVideoFrame and all copies that have not been modified or otherwise detached from the original buffer. The QVideoFrame does not delete the buffer at destruction. The helper parameter provides thread safety.

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size, uchar * planeData, int bytesPerLine, BufferHelper * helper = 0 )

Create Video frame for interlaced formats with one plane, like Format_RGB24 or Format_YUYV.

The pixel format is specified with format, the frame has image size size, planeData contains the raw image data, and the image stride is given by bytesPerLine.

The buffer must remain valid throughout the life of the QVideoFrame and all copies that have not been modified or otherwise detached from the original buffer. The QVideoFrame does not delete the buffer at destruction. The helper parameter provides thread safety.

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size, const uchar * planeData1, const uchar * planeData2, const uchar * planeData3, int bytesPerLine1, int bytesPerLine2, int bytesPerLine3, BufferHelper * helper = 0 )

Create Video frame for planar formats (with planes separated), like Format_YUV420P or Format_YUV422P.

The pixel format is specified with format, the frame has image size size, planeData1, planeData2, planeData3 contain the raw image data, and the their respective strides are given by bytesPerLine1, bytesPerLine2, bytesPerLine3.

The buffers must remain valid throughout the life of the QVideoFrame and all copies that have not been modified or otherwise detached from the original buffer. The QVideoFrame does not delete the buffers at destruction. The helper parameter provides thread safety.

QVideoFrame::QVideoFrame ( PixelFormat format, const QSize & size, uchar * planeData1, uchar * planeData2, uchar * planeData3, int bytesPerLine1, int bytesPerLine2, int bytesPerLine3, BufferHelper * helper = 0 )

Create Video frame for planar formats (with planes separated), like Format_YUV420P or Format_YUV422P.

The pixel format is specified with format, the frame has image size size, planeData1, planeData2, planeData3 contain the raw image data, and the their respective image strides are given by bytesPerLine1, bytesPerLine2, bytesPerLine3.

The buffers must remain valid throughout the life of the QVideoFrame and all copies that have not been modified or otherwise detached from the original buffer. The QVideoFrame does not delete the buffers at destruction. The helper parameter provides thread safety.

QVideoFrame::QVideoFrame ( const QImage & img )

Create Video frame from QImage img,

QVideoFrame::~QVideoFrame ()   [virtual]

Does nothing

double QVideoFrame::aspectRatio () const

Returns the frame aspect ratio, which is equal to width/height or previously assigned with setAspectRatio() custom value.

See also setAspectRatio() and hasCustomAspectRatio().

int QVideoFrame::bytesPerLine ( int planeNumber ) const

Returns the number of bytes per scanline of plane planeNumber.

int QVideoFrame::colorDepth ( QVideoFrame::PixelFormat format, int planeNumber )   [static]

Returns the color depth of a data plane in planeNumber in the particualr pixel format format

const uchar * QVideoFrame::constPlaneData ( int planeNumber ) const

Returns a constant pointer to the pixel data given by plane number planeNumber

PixelFormat QVideoFrame::format () const

Returns the current format of the video frame

bool QVideoFrame::hasCustomAspectRatio () const

Returns true if custom aspect ratio was set with setAspectRatio().

See also aspectRatio() and setAspectRatio().

bool QVideoFrame::isNull () const

Returns true if the frame is valid, false otherwise

bool QVideoFrame::isPlanar ( QVideoFrame::PixelFormat format )   [static]

Returns true if the pixel format format is planar, false otherwise

uchar * QVideoFrame::planeData ( int planeNumber )

Returns a pointer to the first pixel index by planeNumber. This function performs a deep copy of the shared pixel data, thus ensuring that this QVideoFrame is the only one using the current return value.

const uchar * QVideoFrame::planeData ( int planeNumber ) const

This is an overloaded member function, provided for convenience.

Returns a pointer to the pixel data given by plane number planeNumber

QSize QVideoFrame::planeSize ( int planeNumber ) const

Returns the plane number planeNumber plane size in pixels. In most cases it equals to the image size, except of U and V planes of planar YUV formats.

int QVideoFrame::planesCount ( QVideoFrame::PixelFormat format )   [static]

Returns the number fo planes for the pixel format format

void QVideoFrame::setAspectRatio ( double customRatio )

Set the frame aspect ratio to customRatio, if the actual frame proportion differs from width/height.

See also aspectRatio() and hasCustomAspectRatio().

QSize QVideoFrame::size () const

Returns the current size of the video frame

QVideoFrame & QVideoFrame::operator= ( const QVideoFrame & other )

Do a copy of the frame other, data is implicitly shared


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3