1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QVideoSurfaceFormat Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QVideoSurfaceFormat Class Reference<br /><sup><sup>[<a href="qtmultimedia.html">QtMultimedia</a> module]</sup></sup></h1><p>The QVideoSurfaceFormat class specifies the stream format of a
video presentation surface. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qvideosurfaceformat.html#Direction-enum">Direction</a></b> { TopToBottom, BottomToTop }</li><li><div class="fn" />enum <b><a href="qvideosurfaceformat.html#YCbCrColorSpace-enum">YCbCrColorSpace</a></b> { YCbCr_Undefined, YCbCr_BT601, YCbCr_BT709, YCbCr_xvYCC601, YCbCr_xvYCC709, YCbCr_JPEG }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qvideosurfaceformat.html#QVideoSurfaceFormat">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#QVideoSurfaceFormat-2">__init__</a></b> (<i>self</i>, QSize <i>size</i>, QVideoFrame.PixelFormat <i>format</i>, QAbstractVideoBuffer.HandleType <i>type</i> = QAbstractVideoBuffer.NoHandle)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#QVideoSurfaceFormat-3">__init__</a></b> (<i>self</i>, QVideoSurfaceFormat <i>format</i>)</li><li><div class="fn" />int <b><a href="qvideosurfaceformat.html#frameHeight">frameHeight</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qvideosurfaceformat.html#frameRate">frameRate</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qvideosurfaceformat.html#frameSize">frameSize</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qvideosurfaceformat.html#frameWidth">frameWidth</a></b> (<i>self</i>)</li><li><div class="fn" />QAbstractVideoBuffer.HandleType <b><a href="qvideosurfaceformat.html#handleType">handleType</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qvideosurfaceformat.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qvideosurfaceformat.html#pixelAspectRatio">pixelAspectRatio</a></b> (<i>self</i>)</li><li><div class="fn" />QVideoFrame.PixelFormat <b><a href="qvideosurfaceformat.html#pixelFormat">pixelFormat</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qvideosurfaceformat.html#property">property</a></b> (<i>self</i>, str <i>name</i>)</li><li><div class="fn" />unknown-type <b><a href="qvideosurfaceformat.html#propertyNames">propertyNames</a></b> (<i>self</i>)</li><li><div class="fn" />Direction <b><a href="qvideosurfaceformat.html#scanLineDirection">scanLineDirection</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setFrameRate">setFrameRate</a></b> (<i>self</i>, float <i>rate</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setFrameSize">setFrameSize</a></b> (<i>self</i>, QSize <i>size</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setFrameSize-2">setFrameSize</a></b> (<i>self</i>, int <i>width</i>, int <i>height</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setPixelAspectRatio">setPixelAspectRatio</a></b> (<i>self</i>, QSize <i>ratio</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setPixelAspectRatio-2">setPixelAspectRatio</a></b> (<i>self</i>, int <i>width</i>, int <i>height</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setProperty">setProperty</a></b> (<i>self</i>, str <i>name</i>, QVariant <i>value</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setScanLineDirection">setScanLineDirection</a></b> (<i>self</i>, Direction <i>direction</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setViewport">setViewport</a></b> (<i>self</i>, QRect <i>viewport</i>)</li><li><div class="fn" /><b><a href="qvideosurfaceformat.html#setYCbCrColorSpace">setYCbCrColorSpace</a></b> (<i>self</i>, YCbCrColorSpace <i>colorSpace</i>)</li><li><div class="fn" />QSize <b><a href="qvideosurfaceformat.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />QRect <b><a href="qvideosurfaceformat.html#viewport">viewport</a></b> (<i>self</i>)</li><li><div class="fn" />YCbCrColorSpace <b><a href="qvideosurfaceformat.html#yCbCrColorSpace">yCbCrColorSpace</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qvideosurfaceformat.html#__eq__">__eq__</a></b> (<i>self</i>, QVideoSurfaceFormat <i>format</i>)</li><li><div class="fn" />bool <b><a href="qvideosurfaceformat.html#__ne__">__ne__</a></b> (<i>self</i>, QVideoSurfaceFormat <i>format</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QVideoSurfaceFormat class specifies the stream format of a
video presentation surface.</p>
<p>A video surface presents a stream of video frames. The surface's
format describes the type of the frames and determines how they
should be presented.</p>
<p>The core properties of a video stream required to setup a video
surface are the pixel format given by <a href="qvideosurfaceformat.html#pixelFormat">pixelFormat</a>(), and the
frame dimensions given by <a href="qvideosurfaceformat.html#frameSize">frameSize</a>().</p>
<p>If the surface is to present frames using a frame's handle a
surface format will also include a handle type which is given by
the <a href="qvideosurfaceformat.html#handleType">handleType</a>()
function.</p>
<p>The region of a frame that is actually displayed on a video
surface is given by the <a href="qvideosurfaceformat.html#viewport">viewport</a>(). A stream may
have a viewport less than the entire region of a frame to allow for
videos smaller than the nearest optimal size of a video frame. For
example the width of a frame may be extended so that the start of
each scan line is eight byte aligned.</p>
<p>Other common properties are the <a href="qvideosurfaceformat.html#pixelAspectRatio">pixelAspectRatio</a>(),
<a href="qvideosurfaceformat.html#scanLineDirection">scanLineDirection</a>(),
and <a href="qvideosurfaceformat.html#frameRate">frameRate</a>().
Additionally a stream may have some additional type specific
properties which are listed by the dynamicPropertyNames() function
and can be accessed using the <a href="qvideosurfaceformat.html#property">property</a>(), and <a href="qvideosurfaceformat.html#setProperty">setProperty</a>()
functions.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Direction-enum" />QVideoSurfaceFormat.Direction</h3><p>Enumerates the layout direction of video scan lines.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QVideoSurfaceFormat.TopToBottom</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Scan lines are arranged from the top of the
frame to the bottom.</td>
</tr>
<tr>
<td class="topAlign"><tt>QVideoSurfaceFormat.BottomToTop</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Scan lines are arranged from the bottom of the
frame to the top.</td>
</tr>
</table>
<h3 class="fn"><a name="YCbCrColorSpace-enum" />QVideoSurfaceFormat.YCbCrColorSpace</h3><p>Enumerates the Y'CbCr color space of video frames.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QVideoSurfaceFormat.YCbCr_Undefined</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">No color space is specified.</td>
</tr>
<tr>
<td class="topAlign"><tt>QVideoSurfaceFormat.YCbCr_BT601</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">A Y'CbCr color space defined by ITU-R
recommendation BT.601 with Y value range from 16 to 235, and Cb/Cr
range from 16 to 240. Used in standard definition video.</td>
</tr>
<tr>
<td class="topAlign"><tt>QVideoSurfaceFormat.YCbCr_BT709</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">A Y'CbCr color space defined by ITU-R BT.709
with the same values range as YCbCr_BT601. Used for HDTV.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QVideoSurfaceFormat.YCbCr_xvYCC601</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The BT.601 color space with the value range
extended to 0 to 255. It is backward compatibile with BT.601 and
uses values outside BT.601 range to represent wider colors
range.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QVideoSurfaceFormat.YCbCr_xvYCC709</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The BT.709 color space with the value range
extended to 0 to 255.</td>
</tr>
<tr>
<td class="topAlign"><tt>QVideoSurfaceFormat.YCbCr_JPEG</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The full range Y'CbCr color space used in JPEG
files.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QVideoSurfaceFormat" />QVideoSurfaceFormat.__init__ (<i>self</i>)</h3><p>Constructs a null video stream format.</p>
<h3 class="fn"><a name="QVideoSurfaceFormat-2" />QVideoSurfaceFormat.__init__ (<i>self</i>, <a href="qsize.html">QSize</a> <i>size</i>, <a href="qvideoframe.html#PixelFormat-enum">QVideoFrame.PixelFormat</a> <i>format</i>, <a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer.HandleType</a> <i>type</i> = QAbstractVideoBuffer.NoHandle)</h3><p>Contructs a description of stream which receives stream of
<i>type</i> buffers with given frame <i>size</i> and pixel
<i>format</i>.</p>
<h3 class="fn"><a name="QVideoSurfaceFormat-3" />QVideoSurfaceFormat.__init__ (<i>self</i>, <a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a> <i>format</i>)</h3><p>Constructs a copy of <i>other</i>.</p>
<h3 class="fn"><a name="frameHeight" />int QVideoSurfaceFormat.frameHeight (<i>self</i>)</h3><p>Returns the height of frame in a video stream.</p>
<h3 class="fn"><a name="frameRate" />float QVideoSurfaceFormat.frameRate (<i>self</i>)</h3><p>Returns the frame rate of a video stream in frames per
second.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setFrameRate">setFrameRate</a>().</p>
<h3 class="fn"><a name="frameSize" /><a href="qsize.html">QSize</a> QVideoSurfaceFormat.frameSize (<i>self</i>)</h3><p>Returns the size of frames in a video stream.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setFrameSize">setFrameSize</a>(),
<a href="qvideosurfaceformat.html#frameWidth">frameWidth</a>(), and
<a href="qvideosurfaceformat.html#frameHeight">frameHeight</a>().</p>
<h3 class="fn"><a name="frameWidth" />int QVideoSurfaceFormat.frameWidth (<i>self</i>)</h3><p>Returns the width of frames in a video stream.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#frameSize">frameSize</a>() and <a href="qvideosurfaceformat.html#frameHeight">frameHeight</a>().</p>
<h3 class="fn"><a name="handleType" /><a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer.HandleType</a> QVideoSurfaceFormat.handleType (<i>self</i>)</h3><p>Returns the type of handle the surface uses to present the frame
data.</p>
<p>If the handle type is <a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer.NoHandle</a>
buffers with any handle type are valid provided they can be
<a href="qabstractvideobuffer.html#map">mapped</a> with the
<a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer.ReadOnly</a>
flag. If the handleType() is not <a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer.NoHandle</a>
then the handle type of the buffer be the same as that of the
surface format.</p>
<h3 class="fn"><a name="isValid" />bool QVideoSurfaceFormat.isValid (<i>self</i>)</h3><p>Identifies if a video surface format has a valid pixel format
and frame size.</p>
<p>Returns true if the format is valid, and false otherwise.</p>
<h3 class="fn"><a name="pixelAspectRatio" /><a href="qsize.html">QSize</a> QVideoSurfaceFormat.pixelAspectRatio (<i>self</i>)</h3><p>Returns a video stream's pixel aspect ratio.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setPixelAspectRatio">setPixelAspectRatio</a>().</p>
<h3 class="fn"><a name="pixelFormat" /><a href="qvideoframe.html#PixelFormat-enum">QVideoFrame.PixelFormat</a> QVideoSurfaceFormat.pixelFormat (<i>self</i>)</h3><p>Returns the pixel format of frames in a video stream.</p>
<h3 class="fn"><a name="property" />QVariant QVideoSurfaceFormat.property (<i>self</i>, str <i>name</i>)</h3><p>Returns the value of the video format's <i>name</i>
property.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setProperty">setProperty</a>().</p>
<h3 class="fn"><a name="propertyNames" />unknown-type QVideoSurfaceFormat.propertyNames (<i>self</i>)</h3><p>Returns a list of video format dynamic property names.</p>
<h3 class="fn"><a name="scanLineDirection" /><a href="qvideosurfaceformat.html#Direction-enum">Direction</a> QVideoSurfaceFormat.scanLineDirection (<i>self</i>)</h3><p>Returns the direction of scan lines.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setScanLineDirection">setScanLineDirection</a>().</p>
<h3 class="fn"><a name="setFrameRate" />QVideoSurfaceFormat.setFrameRate (<i>self</i>, float <i>rate</i>)</h3><p>Sets the frame <i>rate</i> of a video stream in frames per
second.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#frameRate">frameRate</a>().</p>
<h3 class="fn"><a name="setFrameSize" />QVideoSurfaceFormat.setFrameSize (<i>self</i>, <a href="qsize.html">QSize</a> <i>size</i>)</h3><p>Sets the size of frames in a video stream to <i>size</i>.</p>
<p>This will reset the <a href="qvideosurfaceformat.html#viewport">viewport</a>() to fill the
entire frame.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#frameSize">frameSize</a>().</p>
<h3 class="fn"><a name="setFrameSize-2" />QVideoSurfaceFormat.setFrameSize (<i>self</i>, int <i>width</i>, int <i>height</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the <i>width</i> and <i>height</i> of frames in a video
stream.</p>
<p>This will reset the <a href="qvideosurfaceformat.html#viewport">viewport</a>() to fill the
entire frame.</p>
<h3 class="fn"><a name="setPixelAspectRatio" />QVideoSurfaceFormat.setPixelAspectRatio (<i>self</i>, <a href="qsize.html">QSize</a> <i>ratio</i>)</h3><p>Sets a video stream's pixel aspect <i>ratio</i>.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#pixelAspectRatio">pixelAspectRatio</a>().</p>
<h3 class="fn"><a name="setPixelAspectRatio-2" />QVideoSurfaceFormat.setPixelAspectRatio (<i>self</i>, int <i>width</i>, int <i>height</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the <i>horizontal</i> and <i>vertical</i> elements of a
video stream's pixel aspect ratio.</p>
<h3 class="fn"><a name="setProperty" />QVideoSurfaceFormat.setProperty (<i>self</i>, str <i>name</i>, QVariant <i>value</i>)</h3><p>Sets the video format's <i>name</i> property to
<i>value</i>.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#property">property</a>().</p>
<h3 class="fn"><a name="setScanLineDirection" />QVideoSurfaceFormat.setScanLineDirection (<i>self</i>, <a href="qvideosurfaceformat.html#Direction-enum">Direction</a> <i>direction</i>)</h3><p>Sets the <i>direction</i> of scan lines.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#scanLineDirection">scanLineDirection</a>().</p>
<h3 class="fn"><a name="setViewport" />QVideoSurfaceFormat.setViewport (<i>self</i>, <a href="qrect.html">QRect</a> <i>viewport</i>)</h3><p>Sets the viewport of a video stream to <i>viewport</i>.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#viewport">viewport</a>().</p>
<h3 class="fn"><a name="setYCbCrColorSpace" />QVideoSurfaceFormat.setYCbCrColorSpace (<i>self</i>, <a href="qvideosurfaceformat.html#YCbCrColorSpace-enum">YCbCrColorSpace</a> <i>colorSpace</i>)</h3><p>Sets the Y'CbCr color <i>space</i> of a video stream. It is only
used with raw YUV frame types.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#yCbCrColorSpace">yCbCrColorSpace</a>().</p>
<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QVideoSurfaceFormat.sizeHint (<i>self</i>)</h3><p>Returns a suggested size in pixels for the video stream.</p>
<p>This is the size of the viewport scaled according to the pixel
aspect ratio.</p>
<h3 class="fn"><a name="viewport" /><a href="qrect.html">QRect</a> QVideoSurfaceFormat.viewport (<i>self</i>)</h3><p>Returns the viewport of a video stream.</p>
<p>The viewport is the region of a video frame that is actually
displayed.</p>
<p>By default the viewport covers an entire frame.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setViewport">setViewport</a>().</p>
<h3 class="fn"><a name="yCbCrColorSpace" /><a href="qvideosurfaceformat.html#YCbCrColorSpace-enum">YCbCrColorSpace</a> QVideoSurfaceFormat.yCbCrColorSpace (<i>self</i>)</h3><p>Returns the Y'CbCr color space of a video stream.</p>
<p><b>See also</b> <a href="qvideosurfaceformat.html#setYCbCrColorSpace">setYCbCrColorSpace</a>().</p>
<h3 class="fn"><a name="__eq__" />bool QVideoSurfaceFormat.__eq__ (<i>self</i>, <a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a> <i>format</i>)</h3><h3 class="fn"><a name="__ne__" />bool QVideoSurfaceFormat.__ne__ (<i>self</i>, <a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a> <i>format</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|