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
|
<?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>QAbstractVideoBuffer 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">QAbstractVideoBuffer Class Reference<br /><sup><sup>[<a href="qtmultimedia.html">QtMultimedia</a> module]</sup></sup></h1><p>The QAbstractVideoBuffer class is an abstraction for video data.
<a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qabstractvideobuffer.html#HandleType-enum">HandleType</a></b> { NoHandle, GLTextureHandle, XvShmImageHandle, CoreImageHandle, QPixmapHandle, UserHandle }</li><li><div class="fn" />enum <b><a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a></b> { NotMapped, ReadOnly, WriteOnly, ReadWrite }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstractvideobuffer.html#QAbstractVideoBuffer">__init__</a></b> (<i>self</i>, HandleType <i>type</i>)</li><li><div class="fn" />QVariant <b><a href="qabstractvideobuffer.html#handle">handle</a></b> (<i>self</i>)</li><li><div class="fn" />HandleType <b><a href="qabstractvideobuffer.html#handleType">handleType</a></b> (<i>self</i>)</li><li><div class="fn" />(object, int <i>numBytes</i>, int <i>bytesPerLine</i>) <b><a href="qabstractvideobuffer.html#map">map</a></b> (<i>self</i>, MapMode <i>mode</i>)</li><li><div class="fn" />MapMode <b><a href="qabstractvideobuffer.html#mapMode">mapMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractvideobuffer.html#unmap">unmap</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractVideoBuffer class is an abstraction for video
data.</p>
<p>The <a href="qvideoframe.html">QVideoFrame</a> class makes use
of a QAbstractVideoBuffer internally to reference a buffer of video
data. Creating a subclass of QAbstractVideoBuffer will allow you to
construct video frames from preallocated or static buffers.</p>
<p>The contents of a buffer can be accessed by mapping the buffer
to memory using the <a href="qabstractvideobuffer.html#map">map</a>() function which returns a
pointer to memory containing the contents of the the video buffer.
The memory returned by <a href="qabstractvideobuffer.html#map">map</a>() is released by calling
the <a href="qabstractvideobuffer.html#unmap">unmap</a>()
function.</p>
<p>The <a href="qabstractvideobuffer.html#handle">handle</a>() of a
buffer may also be used to manipulate it's contents using type
specific APIs. The type of a buffer's handle is given by the
<a href="qabstractvideobuffer.html#handleType">handleType</a>()
function.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="HandleType-enum" />QAbstractVideoBuffer.HandleType</h3><p>Identifies the type of a video buffers handle.</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>QAbstractVideoBuffer.NoHandle</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The buffer has no handle, its data can only be
accessed by mapping the buffer.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractVideoBuffer.GLTextureHandle</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The handle of the buffer is an OpenGL texture
ID.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractVideoBuffer.XvShmImageHandle</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The handle contains pointer to shared memory
XVideo image.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractVideoBuffer.CoreImageHandle</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The handle contains pointer to Mac OS X
CIImage.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractVideoBuffer.QPixmapHandle</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The handle of the buffer is a <a href="qpixmap.html">QPixmap</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractVideoBuffer.UserHandle</tt></td>
<td class="topAlign"><tt>1000</tt></td>
<td class="topAlign">Start value for user defined handle
types.</td>
</tr>
</table>
<p><b>See also</b> <a href="qabstractvideobuffer.html#handleType">handleType</a>().</p>
<h3 class="fn"><a name="MapMode-enum" />QAbstractVideoBuffer.MapMode</h3><p>Enumerates how a video buffer's data is mapped to memory.</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>QAbstractVideoBuffer.NotMapped</tt></td>
<td class="topAlign"><tt>0x00</tt></td>
<td class="topAlign">The video buffer has is not mapped to
memory.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractVideoBuffer.ReadOnly</tt></td>
<td class="topAlign"><tt>0x01</tt></td>
<td class="topAlign">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.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractVideoBuffer.WriteOnly</tt></td>
<td class="topAlign"><tt>0x02</tt></td>
<td class="topAlign">The mapped memory is uninitialized when
mapped, and the content will be used to populate the video buffer
when unmapped.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractVideoBuffer.ReadWrite</tt></td>
<td class="topAlign"><tt>ReadOnly | WriteOnly</tt></td>
<td class="topAlign">The mapped memory is populated with data from
the video buffer, and the video buffer is repopulated with the
content of the mapped memory.</td>
</tr>
</table>
<p><b>See also</b> <a href="qabstractvideobuffer.html#mapMode">mapMode</a>() and <a href="qabstractvideobuffer.html#map">map</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractVideoBuffer" />QAbstractVideoBuffer.__init__ (<i>self</i>, <a href="qabstractvideobuffer.html#HandleType-enum">HandleType</a> <i>type</i>)</h3><p>Constructs an abstract video buffer of the given
<i>type</i>.</p>
<h3 class="fn"><a name="handle" />QVariant QAbstractVideoBuffer.handle (<i>self</i>)</h3><p>Returns a type specific handle to the data buffer.</p>
<p>The type of the handle is given by <a href="qabstractvideobuffer.html#handleType">handleType</a>()
function.</p>
<p><b>See also</b> <a href="qabstractvideobuffer.html#handleType">handleType</a>().</p>
<h3 class="fn"><a name="handleType" /><a href="qabstractvideobuffer.html#HandleType-enum">HandleType</a> QAbstractVideoBuffer.handleType (<i>self</i>)</h3><p>Returns the type of a video buffer's handle.</p>
<p><b>See also</b> <a href="qabstractvideobuffer.html#handle">handle</a>().</p>
<h3 class="fn"><a name="map" />(object, int <i>numBytes</i>, int <i>bytesPerLine</i>) QAbstractVideoBuffer.map (<i>self</i>, <a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> <i>mode</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Maps the contents of a video buffer to memory.</p>
<p>The map <i>mode</i> indicates whether the contents of the mapped
memory should be read from and/or written to the buffer. If the map
mode includes the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer.ReadOnly</a>
flag the mapped memory will be populated with the content of the
video buffer when mapped. If the map mode includes the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer.WriteOnly</a>
flag the content of the mapped memory will be persisted in the
buffer when unmapped.</p>
<p>When access to the data is no longer needed be sure to call the
<a href="qabstractvideobuffer.html#unmap">unmap</a>() function to
release the mapped memory.</p>
<p>Returns a pointer to the mapped memory region, or a null pointer
if the mapping failed. The size in bytes of the mapped memory
region is returned in <i>numBytes</i>, and the line stride in
<i>bytesPerLine</i>.</p>
<p>When access to the data is no longer needed be sure to <a href="qabstractvideobuffer.html#unmap">unmap</a>() the buffer.</p>
<p><b>Note:</b> Writing to memory that is mapped as read-only is
undefined, and may result in changes to shared data.</p>
<p><b>See also</b> <a href="qabstractvideobuffer.html#unmap">unmap</a>() and <a href="qabstractvideobuffer.html#mapMode">mapMode</a>().</p>
<h3 class="fn"><a name="mapMode" /><a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> QAbstractVideoBuffer.mapMode (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the mode a video buffer is mapped in.</p>
<p><b>See also</b> <a href="qabstractvideobuffer.html#map">map</a>().</p>
<h3 class="fn"><a name="unmap" />QAbstractVideoBuffer.unmap (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Releases the memory mapped by the <a href="qabstractvideobuffer.html#map">map</a>() function</p>
<p>If the <a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> included the
<a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer.WriteOnly</a>
flag this will persist the current content of the mapped memory to
the video frame.</p>
<p><b>See also</b> <a href="qabstractvideobuffer.html#map">map</a>().</p>
<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>
|