内容表

上一话题

QAbstractAudioOutput

下一话题

QAbstractVideoFilter

QAbstractVideoBuffer

QAbstractVideoBuffer class is an abstraction for video data. 更多

Inheritance diagram of PySide2.QtMultimedia.QAbstractVideoBuffer

概要

函数

虚函数

详细描述

QVideoFrame class makes use of a QAbstractVideoBuffer internally 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 QAbstractVideoBuffer will allow you to construct video frames from preallocated or static buffers, in cases where the QVideoFrame constructors taking a QByteArray QImage do 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 by map() is released by calling the unmap() 函数。

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 the handleType() 函数。

另请参阅

QVideoFrame

class 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

缓冲的句柄是 QPixmap .

QAbstractVideoBuffer.EGLImageHandle

缓冲的句柄是 EGLImageKHR。

QAbstractVideoBuffer.UserHandle

用户定义句柄类型的起始值。

另请参阅

handleType()

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() 函数。

另请参阅

handleType()

PySide2.QtMultimedia.QAbstractVideoBuffer. handleType ( )
返回类型

HandleType

Returns the type of a video buffer’s handle.

另请参阅

handle()

PySide2.QtMultimedia.QAbstractVideoBuffer. mapMode ( )
返回类型

MapMode

返回视频缓冲映射模式。

另请参阅

map()

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()