PySide.QtMultimedia.QAbstractVideoBuffer class is an abstraction for video data.
PySide.QtMultimedia.QVideoFrame class makes use of a PySide.QtMultimedia.QAbstractVideoBuffer internally to reference a buffer of video data. Creating a subclass of PySide.QtMultimedia.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 PySide.QtMultimedia.QAbstractVideoBuffer.map() function which returns a pointer to memory containing the contents of the the video buffer. The memory returned by PySide.QtMultimedia.QAbstractVideoBuffer.map() is released by calling the PySide.QtMultimedia.QAbstractVideoBuffer.unmap() 函数。
PySide.QtMultimedia.QAbstractVideoBuffer.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 PySide.QtMultimedia.QAbstractVideoBuffer.handleType() 函数。
| 参数: | type – PySide.QtMultimedia.QAbstractVideoBuffer.HandleType |
|---|
构造抽象视频缓冲为给定 type .
Enumerates how a video buffer's data is mapped to memory.
| 常量 | 描述 |
|---|---|
| QAbstractVideoBuffer.NotMapped | The video buffer has is not mapped to memory. |
| 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, and the 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. |
另请参阅
PySide.QtMultimedia.QAbstractVideoBuffer.mapMode() PySide.QtMultimedia.QAbstractVideoBuffer.map()
标识视频缓冲句柄的类型。
| 常量 | 描述 |
|---|---|
| QAbstractVideoBuffer.NoHandle | 缓冲没有句柄,只能通过映射缓冲访问其数据。 |
| QAbstractVideoBuffer.GLTextureHandle | 缓冲句柄是 OpenGL 纹理 ID。 |
| QAbstractVideoBuffer.XvShmImageHandle | 句柄包含指向共享内存 XVideo 图像的指针。 |
| QAbstractVideoBuffer.CoreImageHandle | The handle contains pointer to Mac OS X CIImage. |
| QAbstractVideoBuffer.QPixmapHandle | 缓冲的句柄是 PySide.QtGui.QPixmap . |
| QAbstractVideoBuffer.UserHandle | 用户定义句柄类型的起始值。 |
| 返回类型: | object |
|---|
返回数据缓冲的特定句柄类型。
句柄类型的给出,通过 PySide.QtMultimedia.QAbstractVideoBuffer.handleType() 函数。
| 返回类型: | PySide.QtMultimedia.QAbstractVideoBuffer.HandleType |
|---|
返回视频缓冲的句柄类型。
| 返回类型: | PySide.QtMultimedia.QAbstractVideoBuffer.MapMode |
|---|
返回视频缓冲映射模式。
另请参阅
PySide.QtMultimedia.QAbstractVideoBuffer.map()
释放映射内存,映射通过 PySide.QtMultimedia.QAbstractVideoBuffer.map() function
若 QAbstractVideoBuffer.MapMode 包括 QAbstractVideoBuffer.WriteOnly 标志,则这会把映射内存当前内容坚持到视频帧。
另请参阅
PySide.QtMultimedia.QAbstractVideoBuffer.map()