File: qabstractvideosurface.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (225 lines) | stat: -rw-r--r-- 20,228 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qabstractvideosurface.cpp -->
  <title>Qt 4.8: QAbstractVideoSurface Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtmultimedia.html">QtMultimedia</a></li>
<li>QAbstractVideoSurface</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QAbstractVideoSurface Class Reference</h1>
<!-- $$$QAbstractVideoSurface-brief -->
<p>The QAbstractVideoSurface class is a base class for video presentation surfaces. <a href="#details">More...</a></p>
<!-- @@@QAbstractVideoSurface -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QAbstractVideoSurface&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qabstractvideosurface-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#Error-enum">Error</a></b> { NoError, UnsupportedFormatError, IncorrectFormatError, StoppedError, ResourceError }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#QAbstractVideoSurface">QAbstractVideoSurface</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#dtor.QAbstractVideoSurface">~QAbstractVideoSurface</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Error </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#error">error</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#isActive">isActive</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#isFormatSupported">isFormatSupported</a></b> ( const QVideoSurfaceFormat &amp; <i>format</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVideoSurfaceFormat </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#nearestFormat">nearestFormat</a></b> ( const QVideoSurfaceFormat &amp; <i>format</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#present">present</a></b> ( const QVideoFrame &amp; <i>frame</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#start">start</a></b> ( const QVideoSurfaceFormat &amp; <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#stop">stop</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QList&lt;QVideoFrame::PixelFormat&gt; </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#supportedPixelFormats">supportedPixelFormats</a></b> ( QAbstractVideoBuffer::HandleType <i>type</i> = QAbstractVideoBuffer::NoHandle ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVideoSurfaceFormat </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#surfaceFormat">surfaceFormat</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#activeChanged">activeChanged</a></b> ( bool <i>active</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#supportedFormatsChanged">supportedFormatsChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#surfaceFormatChanged">surfaceFormatChanged</a></b> ( const QVideoSurfaceFormat &amp; <i>format</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideosurface.html#setError">setError</a></b> ( Error <i>error</i> )</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QAbstractVideoSurface-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAbstractVideoSurface class is a base class for video presentation surfaces.</p>
<p>The 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.</p>
<p>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.</p>
<p>A list of pixel formats a surface can present is given by the <a href="qabstractvideosurface.html#supportedPixelFormats">supportedPixelFormats</a>() function, and the <a href="qabstractvideosurface.html#isFormatSupported">isFormatSupported</a>() function will test if a video surface format is supported. If a format is not supported the <a href="qabstractvideosurface.html#nearestFormat">nearestFormat</a>() 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.</p>
<p>The <a href="qabstractvideosurface.html#start">start</a>() function takes a supported format and enables a video surface. Once started a surface will begin displaying the frames it receives in the <a href="qabstractvideosurface.html#present">present</a>() 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 <a href="qabstractvideosurface.html#stop">stop</a>() function will disable a surface and a release any video buffers it holds references to.</p>
</div>
<!-- @@@QAbstractVideoSurface -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Error$$$NoError$$$UnsupportedFormatError$$$IncorrectFormatError$$$StoppedError$$$ResourceError -->
<h3 class="fn"><a name="Error-enum"></a>enum QAbstractVideoSurface::<span class="name">Error</span></h3>
<p>This enum describes the errors that may be returned by the <a href="qabstractvideosurface.html#error">error</a>() function.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QAbstractVideoSurface::NoError</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">No error occurred.</td></tr>
<tr><td class="topAlign"><tt>QAbstractVideoSurface::UnsupportedFormatError</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">A video format was not supported.</td></tr>
<tr><td class="topAlign"><tt>QAbstractVideoSurface::IncorrectFormatError</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">A video frame was not compatible with the format of the surface.</td></tr>
<tr><td class="topAlign"><tt>QAbstractVideoSurface::StoppedError</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The surface has not been started.</td></tr>
<tr><td class="topAlign"><tt>QAbstractVideoSurface::ResourceError</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">The surface could not allocate some resource.</td></tr>
</table>
<!-- @@@Error -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAbstractVideoSurface[overload1]$$$QAbstractVideoSurfaceQObject* -->
<h3 class="fn"><a name="QAbstractVideoSurface"></a>QAbstractVideoSurface::<span class="name">QAbstractVideoSurface</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a video surface with the given <i>parent</i>.</p>
<!-- @@@QAbstractVideoSurface -->
<!-- $$$~QAbstractVideoSurface[overload1]$$$~QAbstractVideoSurface -->
<h3 class="fn"><a name="dtor.QAbstractVideoSurface"></a>QAbstractVideoSurface::<span class="name">~QAbstractVideoSurface</span> ()</h3>
<p>Destroys a video surface.</p>
<!-- @@@~QAbstractVideoSurface -->
<!-- $$$activeChanged[overload1]$$$activeChangedbool -->
<h3 class="fn"><a name="activeChanged"></a><span class="type">void</span> QAbstractVideoSurface::<span class="name">activeChanged</span> ( <span class="type">bool</span> <i>active</i> )<tt> [signal]</tt></h3>
<p>Signals that the <i>active</i> state of a video surface has changed.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#isActive">isActive</a>(), <a href="qabstractvideosurface.html#start">start</a>(), and <a href="qabstractvideosurface.html#stop">stop</a>().</p>
<!-- @@@activeChanged -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn"><a name="error"></a><span class="type"><a href="qabstractvideosurface.html#Error-enum">Error</a></span> QAbstractVideoSurface::<span class="name">error</span> () const</h3>
<p>Returns the last error that occurred.</p>
<p>If a surface fails to <a href="qabstractvideosurface.html#start">start</a>(), or stops unexpectedly this function can be called to discover what error occurred.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#setError">setError</a>().</p>
<!-- @@@error -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn"><a name="isActive"></a><span class="type">bool</span> QAbstractVideoSurface::<span class="name">isActive</span> () const</h3>
<p>Indicates whether a video surface has been started.</p>
<p>Returns true if the surface has been started, and false otherwise.</p>
<!-- @@@isActive -->
<!-- $$$isFormatSupported[overload1]$$$isFormatSupportedconstQVideoSurfaceFormat& -->
<h3 class="fn"><a name="isFormatSupported"></a><span class="type">bool</span> QAbstractVideoSurface::<span class="name">isFormatSupported</span> ( const <span class="type"><a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a></span> &amp; <i>format</i> ) const<tt> [virtual]</tt></h3>
<p>Tests a video surface <i>format</i> to determine if a surface can accept it.</p>
<p>Returns true if the format is supported by the surface, and false otherwise.</p>
<!-- @@@isFormatSupported -->
<!-- $$$nearestFormat[overload1]$$$nearestFormatconstQVideoSurfaceFormat& -->
<h3 class="fn"><a name="nearestFormat"></a><span class="type"><a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a></span> QAbstractVideoSurface::<span class="name">nearestFormat</span> ( const <span class="type"><a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a></span> &amp; <i>format</i> ) const<tt> [virtual]</tt></h3>
<p>Returns a supported video surface format that is similar to <i>format</i>.</p>
<p>A similar surface format is one that has the same <a href="qvideosurfaceformat.html#pixelFormat">pixel format</a> and <a href="qvideosurfaceformat.html#handleType">handle type</a> but differs in some of the other properties. For example if there are restrictions on the <a href="qvideosurfaceformat.html#frameSize">frame sizes</a> a video surface can accept it may suggest a format with a larger frame size and a <a href="qvideosurfaceformat.html#viewport">viewport</a> the size of the original frame size.</p>
<p>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.</p>
<!-- @@@nearestFormat -->
<!-- $$$present[overload1]$$$presentconstQVideoFrame& -->
<h3 class="fn"><a name="present"></a><span class="type">bool</span> QAbstractVideoSurface::<span class="name">present</span> ( const <span class="type"><a href="qvideoframe.html">QVideoFrame</a></span> &amp; <i>frame</i> )<tt> [pure virtual]</tt></h3>
<p>Presents a video <i>frame</i>.</p>
<p>Returns true if the frame was presented, and false if an error occurred.</p>
<p>Not all surfaces will block until the presentation of a frame has completed. Calling 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.</p>
<p>If present() fails for any other reason the surface will immediately enter the stopped state and an <a href="qabstractvideosurface.html#error">error</a>() value will be set.</p>
<p>A video surface must be in the started state for present() to succeed, and the format of the video frame must be compatible with the current video surface format.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#error">error</a>().</p>
<!-- @@@present -->
<!-- $$$setError[overload1]$$$setErrorError -->
<h3 class="fn"><a name="setError"></a><span class="type">void</span> QAbstractVideoSurface::<span class="name">setError</span> ( <span class="type"><a href="qabstractvideosurface.html#Error-enum">Error</a></span> <i>error</i> )<tt> [protected]</tt></h3>
<p>Sets the value of <a href="qabstractvideosurface.html#error">error</a>() to <i>error</i>.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#error">error</a>().</p>
<!-- @@@setError -->
<!-- $$$start[overload1]$$$startconstQVideoSurfaceFormat& -->
<h3 class="fn"><a name="start"></a><span class="type">bool</span> QAbstractVideoSurface::<span class="name">start</span> ( const <span class="type"><a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a></span> &amp; <i>format</i> )<tt> [virtual]</tt></h3>
<p>Starts a video surface presenting <i>format</i> frames.</p>
<p>Returns true if the surface was started, and false if an error occurred.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#isActive">isActive</a>() and <a href="qabstractvideosurface.html#stop">stop</a>().</p>
<!-- @@@start -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn"><a name="stop"></a><span class="type">void</span> QAbstractVideoSurface::<span class="name">stop</span> ()<tt> [virtual]</tt></h3>
<p>Stops a video surface presenting frames and releases any resources acquired in <a href="qabstractvideosurface.html#start">start</a>().</p>
<p><b>See also </b><a href="qabstractvideosurface.html#isActive">isActive</a>() and <a href="qabstractvideosurface.html#start">start</a>().</p>
<!-- @@@stop -->
<!-- $$$supportedFormatsChanged[overload1]$$$supportedFormatsChanged -->
<h3 class="fn"><a name="supportedFormatsChanged"></a><span class="type">void</span> QAbstractVideoSurface::<span class="name">supportedFormatsChanged</span> ()<tt> [signal]</tt></h3>
<p>Signals that the set of formats supported by a video surface has changed.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#supportedPixelFormats">supportedPixelFormats</a>() and <a href="qabstractvideosurface.html#isFormatSupported">isFormatSupported</a>().</p>
<!-- @@@supportedFormatsChanged -->
<!-- $$$supportedPixelFormats[overload1]$$$supportedPixelFormatsQAbstractVideoBuffer::HandleType -->
<h3 class="fn"><a name="supportedPixelFormats"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qvideoframe.html#PixelFormat-enum">QVideoFrame::PixelFormat</a></span>&gt; QAbstractVideoSurface::<span class="name">supportedPixelFormats</span> ( <span class="type"><a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer::HandleType</a></span> <i>type</i> = QAbstractVideoBuffer::NoHandle ) const<tt> [pure virtual]</tt></h3>
<p>Returns a list of pixel formats a video surface can present for a given handle <i>type</i>.</p>
<p>The pixel formats returned for the <a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer::NoHandle</a> type are valid for any buffer that can be mapped in read-only mode.</p>
<p>Types that are first in the list can be assumed to be faster to render.</p>
<!-- @@@supportedPixelFormats -->
<!-- $$$surfaceFormat[overload1]$$$surfaceFormat -->
<h3 class="fn"><a name="surfaceFormat"></a><span class="type"><a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a></span> QAbstractVideoSurface::<span class="name">surfaceFormat</span> () const</h3>
<p>Returns the format of a video surface.</p>
<!-- @@@surfaceFormat -->
<!-- $$$surfaceFormatChanged[overload1]$$$surfaceFormatChangedconstQVideoSurfaceFormat& -->
<h3 class="fn"><a name="surfaceFormatChanged"></a><span class="type">void</span> QAbstractVideoSurface::<span class="name">surfaceFormatChanged</span> ( const <span class="type"><a href="qvideosurfaceformat.html">QVideoSurfaceFormat</a></span> &amp; <i>format</i> )<tt> [signal]</tt></h3>
<p>Signals that the configured <i>format</i> of a video surface has changed.</p>
<p><b>See also </b><a href="qabstractvideosurface.html#surfaceFormat">surfaceFormat</a>() and <a href="qabstractvideosurface.html#start">start</a>().</p>
<!-- @@@surfaceFormatChanged -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>