QVideoFrame Class ReferenceThe QVideoFrame class provides a representation of a frame of video data. More... #include <QVideoFrame> This class was introduced in Qt 4.6. Public Types
Public Functions
Static Public Members
Detailed DescriptionThe QVideoFrame class provides a representation of a frame of video data. A QVideoFrame encapsulates the data of a video frame, and information about the frame. The contents of a video frame can be mapped to memory using the map() function. While mapped the video data can accessed using the bits() function which returns a pointer to a buffer, the total size of which is given by the mappedBytes(), and the size of each line is given by bytesPerLine(). The return value of the handle() function may be used to access frame data using the internal buffer's native APIs. The video data in a QVideoFrame is encapsulated in a QAbstractVideoBuffer. A QVideoFrame may be constructed from any buffer type by subclassing the QAbstractVideoBuffer class. Note: QVideoFrame is explicitly shared, any change made to video frame will also apply to any copies. Member Type Documentationenum QVideoFrame::FieldTypeSpecifies the field an interlaced video frame belongs to.
enum QVideoFrame::PixelFormatEnumerates video data types.
Member Function DocumentationQVideoFrame::QVideoFrame ()Constructs a null video frame. QVideoFrame::QVideoFrame ( QAbstractVideoBuffer * buffer, const QSize & size, PixelFormat format )Constructs a video frame from a buffer of the given pixel format and size in pixels. Note: This doesn't increment the reference count of the video buffer. QVideoFrame::QVideoFrame ( int bytes, const QSize & size, int bytesPerLine, PixelFormat format )Constructs a video frame of the given pixel format and size in pixels. The bytesPerLine (stride) is the length of each scan line in bytes, and bytes is the total number of bytes that must be allocated for the frame. QVideoFrame::QVideoFrame ( const QImage & image )Constructs a video frame from an image. Note: This will construct an invalid video frame if there is no frame type equivalent to the image format. See also pixelFormatFromImageFormat(). QVideoFrame::QVideoFrame ( const QVideoFrame & other )Constructs a copy of other. QVideoFrame::~QVideoFrame ()Destroys a video frame. uchar * QVideoFrame::bits ()Returns a pointer to the start of the frame data buffer. This value is only valid while the frame data is mapped. See also map(), mappedBytes(), and bytesPerLine(). const uchar * QVideoFrame::bits () constReturns a pointer to the start of the frame data buffer. This value is only valid while the frame data is mapped. See also map(), mappedBytes(), and bytesPerLine(). int QVideoFrame::bytesPerLine () constReturns the number of bytes in a scan line. Note: This is the bytes per line of the first plane only. The bytes per line of subsequent planes should be calculated as per the frame type. This value is only valid while the frame data is mapped. See also bits(), map(), and mappedBytes(). qint64 QVideoFrame::endTime () constReturns the presentation time when a frame should stop being displayed. See also setEndTime(). FieldType QVideoFrame::fieldType () constReturns the field an interlaced video frame belongs to. If the video is not interlaced this will return WholeFrame. See also setFieldType(). QVariant QVideoFrame::handle () constReturns a type specific handle to a video frame's buffer. For an OpenGL texture this would be the texture ID. See also QAbstractVideoBuffer::handle(). QAbstractVideoBuffer::HandleType QVideoFrame::handleType () constReturns the type of a video frame's handle. int QVideoFrame::height () constReturns the height of a video frame. QImage::Format QVideoFrame::imageFormatFromPixelFormat ( PixelFormat format ) [static]Returns an image format equivalent to a video frame pixel format. If there is no equivalent format QImage::Format_Invalid is returned instead. bool QVideoFrame::isMapped () constIdentifies if a video frame's contents are currently mapped to system memory. This is a convenience function which checks that the MapMode of the frame is not equal to QAbstractVideoBuffer::NotMapped. Returns true if the contents of the video frame are mapped to system memory, and false otherwise. See also mapMode() and QAbstractVideoBuffer::MapMode. bool QVideoFrame::isReadable () constIdentifies if the mapped contents of a video frame were read from the frame when it was mapped. This is a convenience function which checks if the MapMode contains the QAbstractVideoBuffer::WriteOnly flag. Returns true if the contents of the mapped memory were read from the video frame, and false otherwise. See also mapMode() and QAbstractVideoBuffer::MapMode. bool QVideoFrame::isValid () constIdentifies whether a video frame is valid. An invalid frame has no video buffer associated with it. Returns true if the frame is valid, and false if it is not. bool QVideoFrame::isWritable () constIdentifies if the mapped contents of a video frame will be persisted when the frame is unmapped. This is a convenience function which checks if the MapMode contains the QAbstractVideoBuffer::WriteOnly flag. Returns true if the video frame will be updated when unmapped, and false otherwise. Note: The result of altering the data of a frame that is mapped in read-only mode is undefined. Depending on the buffer implementation the changes may be persisted, or worse alter a shared buffer. See also mapMode() and QAbstractVideoBuffer::MapMode. bool QVideoFrame::map ( QAbstractVideoBuffer::MapMode mode )Maps the contents of a video frame to memory. The map mode indicates whether the contents of the mapped memory should be read from and/or written to the frame. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the mapped memory will be populated with the content of the video frame when mapped. If the map mode inclues the QAbstractVideoBuffer::WriteOnly flag the content of the mapped memory will be persisted in the frame when unmapped. While mapped the contents of a video frame can be accessed directly through the pointer returned by the bits() function. When access to the data is no longer needed be sure to call the unmap() function to release the mapped memory. Returns true if the buffer was mapped to memory in the given mode and false otherwise. See also unmap(), mapMode(), and bits(). QAbstractVideoBuffer::MapMode QVideoFrame::mapMode () constReturns the mode a video frame was mapped to system memory in. See also map() and QAbstractVideoBuffer::MapMode. int QVideoFrame::mappedBytes () constReturns the number of bytes occupied by the mapped frame data. This value is only valid while the frame data is mapped. See also map(). PixelFormat QVideoFrame::pixelFormat () constReturns the color format of a video frame. PixelFormat QVideoFrame::pixelFormatFromImageFormat ( QImage::Format format ) [static]Returns an video pixel format equivalent to an image format. If there is no equivalent format QVideoFrame::InvalidType is returned instead. void QVideoFrame::setEndTime ( qint64 time )Sets the presentation time when a frame should stop being displayed. See also endTime(). void QVideoFrame::setFieldType ( FieldType field )Sets the field an interlaced video frame belongs to. See also fieldType(). void QVideoFrame::setStartTime ( qint64 time )Sets the presentation time when the frame should be displayed. See also startTime(). QSize QVideoFrame::size () constReturns the size of a video frame. qint64 QVideoFrame::startTime () constReturns the presentation time when the frame should be displayed. See also setStartTime(). void QVideoFrame::unmap ()Releases the memory mapped by the map() function. If the MapMode included the QAbstractVideoBuffer::WriteOnly flag this will persist the current content of the mapped memory to the video frame. See also map(). int QVideoFrame::width () constReturns the width of a video frame. QVideoFrame & QVideoFrame::operator= ( const QVideoFrame & other )Assigns the contents of other to a video frame. X
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |