CopperSpice API  1.7.2
QAbstractPlanarVideoBuffer Class Referenceabstract

The QAbstractPlanarVideoBuffer class is an abstraction for planar video data. More...

Inheritance diagram for QAbstractPlanarVideoBuffer:
QAbstractVideoBuffer

Public Methods

 QAbstractPlanarVideoBuffer (HandleType type)
 
virtual ~QAbstractPlanarVideoBuffer ()
 
ucharmap (MapMode mode, int *numBytes, int *bytesPerLine)
 
virtual int map (MapMode mode, int *numBytes, int bytesPerLine[4], uchar *data[4]) = 0
 
- Public Methods inherited from QAbstractVideoBuffer
 QAbstractVideoBuffer (HandleType type)
 
virtual ~QAbstractVideoBuffer ()
 
virtual QVariant handle () const
 
HandleType handleType () const
 
virtual MapMode mapMode () const = 0
 
int mapPlanes (MapMode mode, int *numBytes, int bytesPerLine[4], uchar *data[4])
 
virtual void release ()
 
virtual void unmap () = 0
 

Additional Inherited Members

- Public Types inherited from QAbstractVideoBuffer
enum  HandleType
 
enum  MapMode
 

Detailed Description

QAbstractPlanarVideoBuffer extends QAbstractVideoBuffer to support mapping non-continuous planar video data. Implement this instead of QAbstractVideoBuffer when the abstracted video data stores planes in separate buffers or includes padding between planes which would interfere with calculating offsets from the bytes per line and frame height.

See also
QAbstractVideoBuffer::mapPlanes()

Constructor & Destructor Documentation

QAbstractPlanarVideoBuffer::QAbstractPlanarVideoBuffer ( HandleType  type)

Constructs an abstract planar video buffer of the given type.

QAbstractPlanarVideoBuffer::~QAbstractPlanarVideoBuffer ( )
virtual

Destroys an abstract planar video buffer.

Method Documentation

uchar* QAbstractPlanarVideoBuffer::map ( MapMode  mode,
int *  numBytes,
int *  bytesPerLine 
)
virtual

Maps the contents of a video buffer to memory.

The map mode indicates whether the contents of the mapped memory should be read from and/or written to the buffer. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the mapped memory will be populated with the content of the video buffer when mapped. If the map mode includes the QAbstractVideoBuffer::WriteOnly flag the content of the mapped memory will be persisted in the buffer when unmapped.

Returns a pointer to the mapped memory region, or a null pointer if the mapping failed. The size in bytes of the mapped memory region is returned in numBytes, and the line stride in bytesPerLine.

When access to the data is no longer needed be sure to call the unmap() function to release the mapped memory. When access to the data is no longer needed be sure to unmap() the buffer.

Note
Writing to memory that is mapped as read-only is undefined, and may result in changes to shared data.
See also
unmap(), mapMode()

Implements QAbstractVideoBuffer.

int QAbstractPlanarVideoBuffer::map ( MapMode  mode,
int *  numBytes,
int  bytesPerLine[4],
uchar data[4] 
)
pure virtual

Maps the contents of a video buffer to memory.

The map mode indicates whether the contents of the mapped memory should be read from and/or written to the buffer. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the mapped memory will be populated with the content of the buffer when initially mapped. If the map mode includes the QAbstractVideoBuffer::WriteOnly flag the content of the possibly modified mapped memory will be written back to the buffer when unmapped. When access to the data is no longer needed be sure to call the unmap() function to release the mapped memory and possibly update the buffer contents.

Returns the number of planes in the mapped video data. For each plane the line stride of that plane will be returned in bytesPerLine, and a pointer to the plane data will be returned in data. The accumulative size of the mapped data is returned in numBytes.

See also
QAbstractVideoBuffer::map(), QAbstractVideoBuffer::unmap(), QAbstractVideoBuffer::mapMode()