QAbstractVideoSurface

概要

函数

虚函数

详细描述

PySide.QtMultimedia.QAbstractVideoSurface class is a base class for video presentation surfaces.

PySide.QtMultimedia.QAbstractVideoSurface class defines the standard interface that video producers use to inter-operate with video presentation surfaces. It is not supposed to be instantiated directly. Instead, you should subclass it to create new video surfaces.

A video surface presents a continuous stream of identically formatted frames, where the format of each frame is compatible with a stream format supplied when starting a presentation.

表面能呈现的像素列表格式,给出通过 PySide.QtMultimedia.QAbstractVideoSurface.supportedPixelFormats() function, and the PySide.QtMultimedia.QAbstractVideoSurface.isFormatSupported() function will test if a video surface format is supported. If a format is not supported the PySide.QtMultimedia.QAbstractVideoSurface.nearestFormat() function may be able to suggest a similar format. For example if a surface supports fixed set of resolutions it may suggest the smallest supported resolution that contains the proposed resolution.

PySide.QtMultimedia.QAbstractVideoSurface.start() function takes a supported format and enables a video surface. Once started a surface will begin displaying the frames it receives in the PySide.QtMultimedia.QAbstractVideoSurface.present() function. Surfaces may hold a reference to the buffer of a presented video frame until a new frame is presented or streaming is stopped. The PySide.QtMultimedia.QAbstractVideoSurface.stop() function will disable a surface and a release any video buffers it holds references to.

class PySide.QtMultimedia. QAbstractVideoSurface ( [ parent=None ] )
参数: parent PySide.QtCore.QObject

构造视频表面采用给定 parent .

PySide.QtMultimedia.QAbstractVideoSurface. Error

此枚举描述可能的错误,错误返回通过 PySide.QtMultimedia.QAbstractVideoSurface.error() 函数。

常量 描述
QAbstractVideoSurface.NoError 没有发生错误。
QAbstractVideoSurface.UnsupportedFormatError 视频格式不被支持。
QAbstractVideoSurface.IncorrectFormatError 视频帧不兼容表面格式。
QAbstractVideoSurface.StoppedError 表面尚未开始。
QAbstractVideoSurface.ResourceError 表面无法分配一些资源。
PySide.QtMultimedia.QAbstractVideoSurface. activeChanged ( active )
参数: active PySide.QtCore.bool
PySide.QtMultimedia.QAbstractVideoSurface. error ( )
返回类型: PySide.QtMultimedia.QAbstractVideoSurface.Error

返回上次发生的错误。

If a surface fails to PySide.QtMultimedia.QAbstractVideoSurface.start() , or stops unexpectedly this function can be called to discover what error occurred.

PySide.QtMultimedia.QAbstractVideoSurface. isActive ( )
返回类型: PySide.QtCore.bool

指示视频表面是否已启动。

返回 true 若表面已启动,否则返回 false。

PySide.QtMultimedia.QAbstractVideoSurface. isFormatSupported ( format )
参数: format PySide.QtMultimedia.QVideoSurfaceFormat
返回类型: PySide.QtCore.bool

测试视频表面 format 以确定表面是否能接受它。

返回 true,若格式被表面支持,否则,返回 false。

PySide.QtMultimedia.QAbstractVideoSurface. nearestFormat ( format )
参数: format PySide.QtMultimedia.QVideoSurfaceFormat
返回类型: PySide.QtMultimedia.QVideoSurfaceFormat

返回所支持的视频表面格式,类似于 format .

A similar surface format is one that has the same pixel format and handle type but differs in some of the other properties. For example if there are restrictions on the frame sizes a video surface can accept it may suggest a format with a larger frame size and a PySide.QtMultimedia.QVideoSurfaceFormat.viewport() the size of the original frame size.

If the format is already supported it will be returned unchanged, or if there is no similar supported format an invalid format will be returned.

PySide.QtMultimedia.QAbstractVideoSurface. present ( frame )
参数: frame PySide.QtMultimedia.QVideoFrame
返回类型: PySide.QtCore.bool

呈现视频 frame .

返回 true,若帧被呈现;返回 false,若发生错误。

Not all surfaces will block until the presentation of a frame has completed. Calling PySide.QtMultimedia.QAbstractVideoSurface.present() on a non-blocking surface may fail if called before the presentation of a previous frame has completed. In such cases the surface may not return to a ready state until it's had an opportunity to process events.

PySide.QtMultimedia.QAbstractVideoSurface.present() fails for any other reason the surface will immediately enter the stopped state and an PySide.QtMultimedia.QAbstractVideoSurface.error() value will be set.

A video surface must be in the started state for PySide.QtMultimedia.QAbstractVideoSurface.present() to succeed, and the format of the video frame must be compatible with the current video surface format.

PySide.QtMultimedia.QAbstractVideoSurface. setError ( error )
参数: error PySide.QtMultimedia.QAbstractVideoSurface.Error

设置值为 PySide.QtMultimedia.QAbstractVideoSurface.error() to error .

PySide.QtMultimedia.QAbstractVideoSurface. start ( format )
参数: format PySide.QtMultimedia.QVideoSurfaceFormat
返回类型: PySide.QtCore.bool

使视频表面开始呈现 format 帧。

返回 true,若表面已开始;返回 false,若发生错误。

PySide.QtMultimedia.QAbstractVideoSurface. stop ( )

停止在视频表面呈现帧,并释放任何获得资源在 PySide.QtMultimedia.QAbstractVideoSurface.start() .

PySide.QtMultimedia.QAbstractVideoSurface. supportedFormatsChanged ( )
PySide.QtMultimedia.QAbstractVideoSurface. supportedPixelFormats ( [ handleType=QAbstractVideoBuffer.NoHandle ] )
参数: handleType PySide.QtMultimedia.QAbstractVideoBuffer.HandleType
返回类型:
PySide.QtMultimedia.QAbstractVideoSurface. surfaceFormat ( )
返回类型: PySide.QtMultimedia.QVideoSurfaceFormat

返回视频表面的格式。

PySide.QtMultimedia.QAbstractVideoSurface. surfaceFormatChanged ( format )
参数: format PySide.QtMultimedia.QVideoSurfaceFormat