QVideoSurfaceFormat Class Reference
[QtMultimedia module]
该QVideoSurfaceFormat类指定视频演示表面的流格式。More...
Types
-
enum Direction { TopToBottom, BottomToTop }
-
enum YCbCrColorSpace { YCbCr_Undefined, YCbCr_BT601, YCbCr_BT709, YCbCr_xvYCC601, YCbCr_xvYCC709, YCbCr_JPEG }
Methods
-
__init__ (self)
-
__init__ (self, QSize size, QVideoFrame.PixelFormat format, QAbstractVideoBuffer.HandleType type = QAbstractVideoBuffer.NoHandle)
-
__init__ (self, QVideoSurfaceFormat format)
-
int frameHeight (self)
-
float frameRate (self)
-
QSize frameSize (self)
-
int frameWidth (self)
-
QAbstractVideoBuffer.HandleType handleType (self)
-
bool isValid (self)
-
QSize pixelAspectRatio (self)
-
QVideoFrame.PixelFormat pixelFormat (self)
-
QVariant property (self, str name)
-
list-of-QByteArray propertyNames (self)
-
Direction scanLineDirection (self)
-
setFrameRate (self, float rate)
-
setFrameSize (self, QSize size)
-
setFrameSize (self, int width, int height)
-
setPixelAspectRatio (self, QSize ratio)
-
setPixelAspectRatio (self, int width, int height)
-
setProperty (self, str name, QVariant value)
-
setScanLineDirection (self, Direction direction)
-
setViewport (self, QRect viewport)
-
setYCbCrColorSpace (self, YCbCrColorSpace colorSpace)
-
QSize sizeHint (self)
-
QRect viewport (self)
-
YCbCrColorSpace yCbCrColorSpace (self)
Special Methods
-
bool __eq__ (self, QVideoSurfaceFormat format)
-
bool __ne__ (self, QVideoSurfaceFormat format)
Detailed Description
该QVideoSurfaceFormat类指定视频演示表面的流格式。
视频表面呈现的视频帧流。表面的形式描述了帧的类型,并确定应如何呈现。
需要设置一个视频表面上的视频信息流的核心属性是由给定的像素格式pixelFormat( ) ,并给出了框架尺寸frameSize( ) 。
如果表面是用一帧的把手表面的格式呈现的帧也将包括由给定的一个句柄类型handleType()函数。
实际上是显示在视频面一帧的区域是通过在给定viewport( ) 。甲流可具有视口比一帧的整个区域减去,以允许视频比视频帧的最接近的最佳尺寸。例如一帧的宽度可以延伸,使得每个扫描行的开始是8字节对齐的。
其他常见的属性是pixelAspectRatio( )scanLineDirection()和frameRate( ) 。另外一个数据流可以具有所列的dynamicPropertyNames一些额外类型的特定属性()函数,并且可以使用被访问的property()和setProperty()函数。
Type Documentation
QVideoSurfaceFormat.Direction
列举的视频扫描线的布局方向。
| Constant |
Value |
Description |
| QVideoSurfaceFormat.TopToBottom |
0 |
扫描线被布置在框架的顶部向底部。 |
| QVideoSurfaceFormat.BottomToTop |
1 |
扫描线被布置在框架的底部到顶部。 |
QVideoSurfaceFormat.YCbCrColorSpace
列举了视频帧的Y'CbCr的色彩空间。
| Constant |
Value |
Description |
|
QVideoSurfaceFormat.YCbCr_Undefined
|
0 |
未指定的色彩空间。 |
| QVideoSurfaceFormat.YCbCr_BT601 |
1 |
由ITU -R BT.601建议与Y值的范围从16到235 ,和CB / CR范围从16到240定义的Y'CbCr的色彩空间。用于标准清晰度视频。 |
| QVideoSurfaceFormat.YCbCr_BT709 |
2 |
由ITU- R BT.709具有相同的值定义的Y'CbCr的色彩空间范围内YCbCr_BT601 。用于高清晰度电视。 |
|
QVideoSurfaceFormat.YCbCr_xvYCC601
|
3 |
同的数值范围的BT.601颜色空间扩大到0 〜255。它是落后的。兼容与BT.601和使用外BT.601范围值来表示更广泛的色彩范围。 |
|
QVideoSurfaceFormat.YCbCr_xvYCC709
|
4 |
同的数值范围的BT.709颜色空间扩大到0 〜255。 |
| QVideoSurfaceFormat.YCbCr_JPEG |
5 |
在JPEG文件中使用的全范围Y'CbCr的色彩空间。 |
Method Documentation
QVideoSurfaceFormat.__init__ (self)
构造一个空的视频流格式。
Contructs流的描述,它接收的数据流type缓冲区与给定的框架size和像素format。
QVideoSurfaceFormat.__init__ (self, QVideoSurfaceFormat format)
构造的副本other。
int QVideoSurfaceFormat.frameHeight (self)
返回帧中的视频流的高度。
float QVideoSurfaceFormat.frameRate (self)
返回以每秒帧数的视频流的帧速率。
See also setFrameRate( ) 。
QSize QVideoSurfaceFormat.frameSize (self)
返回视频流中的帧的大小。
See also setFrameSize( )frameWidth()和frameHeight( ) 。
int QVideoSurfaceFormat.frameWidth (self)
返回视频流中帧的宽度。
See also frameSize()和frameHeight( ) 。
返回表面采用提呈本帧数据处理的类型。
如果句柄类型是QAbstractVideoBuffer.NoHandle缓冲区与任何句柄类型是有效的,只要它们能mapped与QAbstractVideoBuffer.ReadOnly标志。如果handleType ()不是QAbstractVideoBuffer.NoHandle然后缓冲区的句柄类型是相同的,该表面的格式。
bool QVideoSurfaceFormat.isValid (self)
如果识别的视频格式,表面具有有效像素格式和帧大小。
返回True如果该格式是有效的,否则为False。
QSize QVideoSurfaceFormat.pixelAspectRatio (self)
返回视频流的像素宽高比。
See also setPixelAspectRatio( ) 。
返回视频流中的帧的像素格式。
QVariant QVideoSurfaceFormat.property (self, str name)
传回的视频格式的值name属性。
See also setProperty( ) 。
list-of-QByteArray QVideoSurfaceFormat.propertyNames (self)
传回的视频格式动态属性名称的列表。
Direction QVideoSurfaceFormat.scanLineDirection (self)
返回扫描线的方向。
See also setScanLineDirection( ) 。
QVideoSurfaceFormat.setFrameRate (self, float rate)
设置框架rate在帧每秒的视频流。
See also frameRate( ) 。
QVideoSurfaceFormat.setFrameSize (self, QSize size)
设置帧的大小在视频流中,以size。
这将重置viewport()来填满整个画面。
See also frameSize( ) 。
QVideoSurfaceFormat.setFrameSize (self, int width, int height)
这是一个重载函数。
设置width和height的帧中的视频流。
这将重置viewport()来填满整个画面。
QVideoSurfaceFormat.setPixelAspectRatio (self, QSize ratio)
设置一个视频流的像素宽高比ratio。
See also pixelAspectRatio( ) 。
QVideoSurfaceFormat.setPixelAspectRatio (self, int width, int height)
这是一个重载函数。
设置horizontal和vertical的视频流的像素宽高比的元素。
QVideoSurfaceFormat.setProperty (self, str name, QVariant value)
设置视频格式的name属性为value。
See also property( ) 。
QVideoSurfaceFormat.setScanLineDirection (self, Direction direction)
设置direction的扫描线。
See also scanLineDirection( ) 。
QVideoSurfaceFormat.setViewport (self, QRect viewport)
设置一个视频流的视口viewport。
See also viewport( ) 。
QVideoSurfaceFormat.setYCbCrColorSpace (self, YCbCrColorSpace colorSpace)
设置Y'CbCr的颜色space的视频流。它仅用于与原始YUV帧类型。
See also yCbCrColorSpace( ) 。
QSize QVideoSurfaceFormat.sizeHint (self)
返回视频流像素的建议的大小。
这是根据该像素纵横比缩放的视口的大小。
QRect QVideoSurfaceFormat.viewport (self)
返回视频流的视口。
视口是实际显示一个视频帧的区域。
默认情况下,视口复盖整个帧。
See also setViewport( ) 。
YCbCrColorSpace QVideoSurfaceFormat.yCbCrColorSpace (self)
返回视频流的Y'CbCr的色彩空间。
See also setYCbCrColorSpace( ) 。
bool QVideoSurfaceFormat.__eq__ (self, QVideoSurfaceFormat format)
bool QVideoSurfaceFormat.__ne__ (self, QVideoSurfaceFormat format)