QAbstractVideoBufferclass is an abstraction for video data. 更多 …
QVideoFrameclass makes use of aQAbstractVideoBufferinternally to reference a buffer of video data. Quite often video data buffers may reside in video memory rather than system memory, and this class provides an abstraction of the location.In addition, creating a subclass of
QAbstractVideoBufferwill allow you to construct video frames from preallocated or static buffers, in cases where theQVideoFrameconstructors taking aQByteArray或QImagedo not suffice. This may be necessary when implementing a new hardware accelerated video system, for example.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 video buffer. The memory returned bymap()is released by calling theunmap()函数。
handle()of a buffer may also be used to manipulate its contents using type specific APIs. The type of a buffer’s handle is given by thehandleType()函数。另请参阅
QAbstractVideoBuffer
(
type
)
¶
- param type
HandleType
构造抽象视频缓冲为给定
type
.
PySide2.QtMultimedia.QAbstractVideoBuffer.
HandleType
¶
标识视频缓冲句柄的类型。
|
常量 |
描述 |
|---|---|
|
QAbstractVideoBuffer.NoHandle |
缓冲没有句柄,只能通过映射缓冲访问其数据。 |
|
QAbstractVideoBuffer.GLTextureHandle |
缓冲句柄是 OpenGL 纹理 ID。 |
|
QAbstractVideoBuffer.XvShmImageHandle |
句柄包含指向共享内存 XVideo 图像的指针。 |
|
QAbstractVideoBuffer.CoreImageHandle |
句柄包含指向 macOS CIImage 的指针。 |
|
QAbstractVideoBuffer.QPixmapHandle |
缓冲的句柄是
|
|
QAbstractVideoBuffer.EGLImageHandle |
缓冲的句柄是 EGLImageKHR。 |
|
QAbstractVideoBuffer.UserHandle |
用户定义句柄类型的起始值。 |
另请参阅
PySide2.QtMultimedia.QAbstractVideoBuffer.
MapMode
¶
Enumerates how a video buffer’s data is mapped to system memory.
|
常量 |
描述 |
|---|---|
|
QAbstractVideoBuffer.NotMapped |
不把视频缓冲映射到内存。 |
|
QAbstractVideoBuffer.ReadOnly |
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 |
The mapped memory is uninitialized when mapped, but the possibly modified content will be used to populate the video buffer when unmapped. |
|
QAbstractVideoBuffer.ReadWrite |
The mapped memory is populated with data from the video buffer, and the video buffer is repopulated with the content of the mapped memory when it is unmapped. |
另请参阅
mapMode()
map()
PySide2.QtMultimedia.QAbstractVideoBuffer.
m_type
¶
PySide2.QtMultimedia.QAbstractVideoBuffer.
handle
(
)
¶
object
返回数据缓冲的特定句柄类型。
句柄类型的给出,通过
handleType()
函数。
另请参阅
PySide2.QtMultimedia.QAbstractVideoBuffer.
handleType
(
)
¶
Returns the type of a video buffer’s handle.
另请参阅
PySide2.QtMultimedia.QAbstractVideoBuffer.
release
(
)
¶
释放视频缓冲。
QVideoFrame
calls when the buffer is not used any more and can be destroyed or returned to the buffer pool.
The default implementation deletes the buffer instance.
PySide2.QtMultimedia.QAbstractVideoBuffer.
unmap
(
)
¶
释放映射内存,映射通过
map()
函数。
若
MapMode
包括
QAbstractVideoBuffer::WriteOnly
flag this will write the current content of the mapped memory back to the video frame.
另请参阅
map()