[QtMultimedia module]
该QAbstractVideoSurface类是视频演示表面的基类。More…
继承QObject。
Types
enum Error { NoError, UnsupportedFormatError, IncorrectFormatError, StoppedError, ResourceError }
Methods
__init__ (self, QObject parent = None)Error error (self)bool isActive (self)bool isFormatSupported (self, QVideoSurfaceFormat format)QVideoSurfaceFormat nearestFormat (self, QVideoSurfaceFormat format)bool present (self, QVideoFrame frame)setError (self, Error error)bool start (self, QVideoSurfaceFormat format)stop (self)list-of-QVideoFrame.PixelFormat supportedPixelFormats (self, QAbstractVideoBuffer.HandleType type = QAbstractVideoBuffer.NoHandle)QVideoSurfaceFormat surfaceFormat (self)
Qt Signals
void activeChanged (bool)void supportedFormatsChanged ()void surfaceFormatChanged (const QVideoSurfaceFormat&)
Detailed Description
该QAbstractVideoSurface类是视频演示表面的基类。
该QAbstractVideoSurface类定义了视频制作者用它来与视频演示表面互操作的标准接口。它不应该被直接实例化。相反,你应该继承它来创建新的视频表面。
一种视频表面呈现格式相同的帧,其中每个帧的格式与开始演示时供给的流格式兼容的连续流。
像素的列表格式的表面可呈现由给定supportedPixelFormats()函数,并且isFormatSupported()函数将测试是否受支持的视频格式表面。如果不支持的格式nearestFormat()函数可能能够提供一个类似的格式。例如,如果一个表面上支持固定的分辨率可能暗示包含提呈之决议案的最小支持的分辨率。
该start( )函数接受一个支持的格式,使视频的表面。一旦开始了表面会开始显示它接收的帧present()函数。表面可持有,直到一个新的框架,提出或流停止时的参考,提出了视频帧的缓冲区。该stop( )函数将禁用表面和发布任何视频缓冲其持有的引用。
Type Documentation
QAbstractVideoSurface.Error
该枚举描述了可以通过返回的错误error()函数。
| Constant | Value | Description |
|---|---|---|
QAbstractVideoSurface.NoError |
0 |
未发生错误。 |
QAbstractVideoSurface.UnsupportedFormatError |
1 |
不支持的视频格式。 |
QAbstractVideoSurface.IncorrectFormatError |
2 |
一个视频帧是不与该表面的格式不兼容。 |
QAbstractVideoSurface.StoppedError |
3 |
表面尚未启动。 |
QAbstractVideoSurface.ResourceError |
4 |
表面无法分配一些资源。 |
Method Documentation
QAbstractVideoSurface.__init__ (self, QObject parent = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个视频面与给定parent。
Error QAbstractVideoSurface.error (self)
[
返回所发生的最后一个错误。
](docs_qabstractvideosurface.html#Error-enum)
如果表面不start( ) ,或意外停止此功能可以被调用来发现什么错误发生。
See also setError( ) 。
bool QAbstractVideoSurface.isActive (self)
表示视频表面是否已经启动。
返回True如果表面已经启动,否则返回False 。
bool QAbstractVideoSurface.isFormatSupported (self, QVideoSurfaceFormat format)
测试一个视频面format以确定是否一个面都能接受。
如果格式是由表面支撑,否则为False ,则返回True 。
QVideoSurfaceFormat QAbstractVideoSurface.nearestFormat (self, QVideoSurfaceFormat format)
[
返回一个支持的视频格式的表面,类似于format。
](docs_qvideosurfaceformat.html)
类似的表面格式是一个具有相同pixel format和handle type但在其他一些特性是不同的。例如,如果有就限制frame sizes视频表面可以接受它可能意味着一种格式具有较大的帧大小和viewport原始帧尺寸的大小。
如果已支持的格式也将原样返回,或如果没有类似支持的格式无效的格式将被退回。
bool QAbstractVideoSurface.present (self, QVideoFrame frame)
这种方法是抽象的,应在任何子类中重新实现。
提出了一个视频frame。
返回True如果在发生错误的帧被提出,并假的。
不是所有的表面将被阻塞,直到一个帧的显示已经完成。如果调用前一帧的呈现完成之前无阻塞表面上调用存在( )可能会失败。在这种情况下,直到它有机会处理事件的表面可能不会返回到就绪状态。
如果存在( )失败因任何其他原因,表面会立即进入停止状态和error( )值将被设置。
视频表面必须处于启动状态的存在( )成功,和视频帧的格式必须与当前的视频表面格式兼容。
See also error( ) 。
QAbstractVideoSurface.setError (self, Error error)
设置的值error()来error。
See also error( ) 。
bool QAbstractVideoSurface.start (self, QVideoSurfaceFormat format)
开始视频表面呈现format帧。
如果表面已经开始,并且假,如果发生错误,则返回True 。
QAbstractVideoSurface.stop (self)
停止视频表面呈现帧并释放所收购的任何资源start( ) 。
See also isActive()和start( ) 。
list-of-QVideoFrame.PixelFormat QAbstractVideoSurface.supportedPixelFormats (self, QAbstractVideoBuffer.HandleType type = QAbstractVideoBuffer.NoHandle)
这种方法是抽象的,应在任何子类中重新实现。
返回的像素格式的视频表面可呈现为一个给定的句柄列表type。
像素格式返回的QAbstractVideoBuffer.NoHandle类型是有效的,可以映射到只读模式的任何缓冲区。
这是第一个在列表中的类型可以被假定为更快的渲染。
QVideoSurfaceFormat QAbstractVideoSurface.surfaceFormat (self)
[
返回视频表面的格式。
Qt Signal Documentation
void activeChanged (bool)
这是该信号的默认超载。
信号的active视频表面状态发生了变化。
](docs_qvideosurfaceformat.html)
See also isActive( )start()和stop( ) 。
void supportedFormatsChanged ()
这是该信号的默认超载。
该组由视频表面支持的格式发生了变化的信号。
See also supportedPixelFormats()和isFormatSupported( ) 。
void surfaceFormatChanged (const QVideoSurfaceFormat&)
这是该信号的默认超载。
所配置的信号format的一个视频表面发生了变化。
See also surfaceFormat()和start( ) 。
