The QAbstractVideoBuffer class is an abstraction for video data. 更多...
| 頭: | #include <QAbstractVideoBuffer> |
| Since: | Qt 4.6 |
| enum | HandleType { NoHandle, GLTextureHandle, XvShmImageHandle, CoreImageHandle, QPixmapHandle, 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 () 函數。
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 () 函數。
另請參閱 QVideoFrame .
標識視頻緩衝句柄的類型。
| 常量 | 值 | 描述 |
|---|---|---|
QAbstractVideoBuffer::NoHandle
|
0
|
緩衝沒有句柄,隻能通過映射緩衝訪問其數據。 |
QAbstractVideoBuffer::GLTextureHandle
|
1
|
The handle of the buffer is an OpenGL texture ID. |
QAbstractVideoBuffer::XvShmImageHandle
|
2
|
句柄包含指嚮共享內存 XVideo 圖像的指針。 |
QAbstractVideoBuffer::CoreImageHandle
|
3
|
The handle contains pointer to Mac OS X CIImage. |
QAbstractVideoBuffer::QPixmapHandle
|
4
|
緩衝的句柄是 QPixmap . |
QAbstractVideoBuffer::UserHandle
|
1000
|
用戶定義句柄類型的起始值。 |
另請參閱 handleType ().
Enumerates how a video buffer's data is mapped to memory.
| 常量 | 值 | 描述 |
|---|---|---|
QAbstractVideoBuffer::NotMapped
|
0x00
|
The video buffer has is not mapped to memory. |
QAbstractVideoBuffer::ReadOnly
|
0x01
|
采用來自視頻緩衝的數據填充映射內存當映射時,但可能丟棄所映射內存的內容當取消映射時。 |
QAbstractVideoBuffer::WriteOnly
|
0x02
|
The mapped memory is uninitialized 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. |
構造抽象視頻緩衝為給定 type .
[虛擬]
QAbstractVideoBuffer::
~QAbstractVideoBuffer
()
銷毀抽象視頻緩衝。
[虛擬]
QVariant
QAbstractVideoBuffer::
handle
() const
返迴數據緩衝的特定句柄類型。
句柄類型的給齣,通過 handleType () 函數。
另請參閱 handleType ().
返迴視頻緩衝的句柄類型。
另請參閱 handle ().
[pure virtual]
uchar
* QAbstractVideoBuffer::
map
(
MapMode
mode
,
int
*
numBytes
,
int
*
bytesPerLine
)
將視頻緩衝內容映射到內存。
映射 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.
注意: Writing to memory that is mapped as read-only is undefined, and may result in changes to shared data.
[pure virtual]
MapMode
QAbstractVideoBuffer::
mapMode
() const
返迴視頻緩衝映射模式。
另請參閱 map ().
[pure virtual]
void
QAbstractVideoBuffer::
unmap
()
釋放內存映射通過 map () 函數
若 MapMode 包括 QAbstractVideoBuffer::WriteOnly 標誌,則這會把映射內存當前內容堅持到視頻幀。
另請參閱 map ().