QAbstractVideoBuffer Class Reference |
enum | HandleType { NoHandle, GLTextureHandle, UserHandle } |
enum | MapMode { NotMapped, ReadOnly, WriteOnly, ReadWrite } |
QAbstractVideoBuffer ( HandleType type ) | |
virtual | ~QAbstractVideoBuffer () |
virtual QVariant | handle () const |
HandleType | handleType () const |
virtual uchar * | map ( MapMode mode, int * numBytes, int * bytesPerLine ) = 0 |
virtual MapMode | mapMode () const = 0 |
virtual void | unmap () = 0 |
The QAbstractVideoBuffer class is an abstraction for video data.
The QVideoFrame class makes use of a QAbstractVideoBuffer internally to reference a buffer of video data. Creating a subclass of QAbstractVideoBuffer will allow you to construct video frames from preallocated or static buffers.
The contents of a buffer can be accessed by mapping the buffer to memory using the map() function which returns a pointer to memory containing the contents of the the video buffer. The memory returned by map() is released by calling the unmap() function.
The handle() of a buffer may also be used to manipulate it's contents using type specific APIs. The type of a buffer's handle is given by the handleType() function.
See also QVideoFrame.
Identifies the type of a video buffers handle.
Constant | Value | Description |
---|---|---|
QAbstractVideoBuffer::NoHandle | 0 | The buffer has no handle, its data can only be accessed by mapping the buffer. |
QAbstractVideoBuffer::GLTextureHandle | 1 | The handle of the buffer is an OpenGL texture ID. |
QAbstractVideoBuffer::UserHandle | 1000 | Start value for user defined handle types. |
See also handleType().
Enumerates how a video buffer's data is mapped to memory.
Constant | Value | Description |
---|---|---|
QAbstractVideoBuffer::NotMapped | 0x00 | The video buffer has is not mapped to memory. |
QAbstractVideoBuffer::ReadOnly | 0x01 | The mapped memory is populated with data from the video buffer when mapped, but the content of the mapped memory may be discarded when unmapped. |
QAbstractVideoBuffer::WriteOnly | 0x02 | The mapped memory in unitialized when mapped, and the content will be used to populate the video buffer when unmapped. |
QAbstractVideoBuffer::ReadWrite | ReadOnly | WriteOnly | The mapped memory is populated with data from the video buffer, and the video buffer is repopulated with the content of the mapped memory. |
Constructs an abstract video buffer of the given type.
Destroys an abstract video buffer.
Returns a type specific handle to the data buffer.
The type of the handle is given by handleType() function.
See also handleType().
Returns the type of a video buffer's handle.
See also handle().
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.
When access to the data is no longer needed be sure to call the unmap() function to release the mapped memory.
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 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() and mapMode().
Returns the mode a video buffer is mapped in.
See also map().
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().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com