~ubuntu-branches/ubuntu/karmic/gst-plugins-base0.10/karmic-updates

« back to all changes in this revision

Viewing changes to docs/plugins/html/gst-plugins-base-plugins-playbin.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-10-05 18:10:19 UTC
  • mfrom: (14.3.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091005181019-vcb3daxz031og2sh
Tags: 0.10.25-1
* New upstream release, 'Standard disclaimers apply':
  + debian/libgstreamer-plugins-base.symbols:
    - Updated for the new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
<a name="gst-plugins-base-plugins-playbin.object-hierarchy"></a><h2>Object Hierarchy</h2>
55
55
<pre class="synopsis">
56
56
  <a
57
 
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
 
57
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
58
58
>GObject</a>
59
59
   +----<a
60
 
href="../gstreamer-0.10/GstObject.html"
 
60
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstObject.html"
61
61
>GstObject</a>
62
62
         +----<a
63
 
href="../gstreamer-0.10/GstElement.html"
 
63
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
64
64
>GstElement</a>
65
65
               +----<a
66
 
href="../gstreamer-0.10/GstBin.html"
 
66
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstBin.html"
67
67
>GstBin</a>
68
68
                     +----<a
69
 
href="../gstreamer-0.10/GstPipeline.html"
 
69
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPipeline.html"
70
70
>GstPipeline</a>
71
71
                           +----<a class="link" href="GstPlayBaseBin.html" title="GstPlayBaseBin">GstPlayBaseBin</a>
72
72
                                 +----GstPlayBin
77
77
<p>
78
78
GstPlayBin implements
79
79
 <a
80
 
href="../gstreamer-0.10/GstChildProxy.html"
 
80
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstChildProxy.html"
81
81
>GstChildProxy</a>.</p>
82
82
</div>
83
83
<div class="refsect1" lang="en">
84
84
<a name="gst-plugins-base-plugins-playbin.properties"></a><h2>Properties</h2>
85
85
<pre class="synopsis">
86
86
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--audio-sink" title='The "audio-sink" property'>audio-sink</a>"               <a
87
 
href="../gstreamer-0.10/GstElement.html"
 
87
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
88
88
>GstElement</a>*           : Read / Write
89
89
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--frame" title='The "frame" property'>frame</a>"                    <a
90
 
href="../gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"
 
90
href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"
91
91
>GstBuffer</a>*            : Read
92
92
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--subtitle-font-desc" title='The "subtitle-font-desc" property'>subtitle-font-desc</a>"       <a
93
 
href="../glib/glib-Basic-Types.html#gchar"
 
93
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
94
94
>gchar</a>*                : Write
95
95
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--video-sink" title='The "video-sink" property'>video-sink</a>"               <a
96
 
href="../gstreamer-0.10/GstElement.html"
 
96
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
97
97
>GstElement</a>*           : Read / Write
98
98
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--vis-plugin" title='The "vis-plugin" property'>vis-plugin</a>"               <a
99
 
href="../gstreamer-0.10/GstElement.html"
 
99
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
100
100
>GstElement</a>*           : Read / Write
101
101
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--volume" title='The "volume" property'>volume</a>"                   <a
102
 
href="../glib/glib-Basic-Types.html#gdouble"
 
102
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"
103
103
>gdouble</a>               : Read / Write
104
104
  "<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--connection-speed" title='The "connection-speed" property'>connection-speed</a>"         <a
105
 
href="../glib/glib-Basic-Types.html#guint"
 
105
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
106
106
>guint</a>                 : Read / Write
107
107
</pre>
108
108
</div>
147
147
<p>
148
148
</p>
149
149
<div class="refsect2" lang="en">
150
 
<a name="id3135630"></a><h3>Usage</h3>
 
150
<a name="id2621601"></a><h3>Usage</h3>
151
151
<p>
152
152
A playbin element can be created just like any other element using
153
153
<a
154
 
href="../gstreamer-0.10/GstElementFactory.html#gst-element-factory-make"
 
154
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElementFactory.html#gst-element-factory-make"
155
155
><code class="function">gst_element_factory_make()</code></a>. The file/URI to play should be set via the <span class="type">"uri"</span>
156
156
property. This must be an absolute URI, relative file paths are not allowed.
157
157
Example URIs are file:///home/joe/movie.avi or http://www.joedoe.com/foo.ogg
158
158
</p>
159
159
<p>
160
160
Playbin is a <a
161
 
href="../gstreamer-0.10/GstPipeline.html"
 
161
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPipeline.html"
162
162
><span class="type">GstPipeline</span></a>. It will notify the application of everything
163
163
that's happening (errors, end of stream, tags found, state changes, etc.)
164
164
by posting messages on its <a
165
 
href="../gstreamer-0.10/GstBus.html"
 
165
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstBus.html"
166
166
><span class="type">GstBus</span></a>. The application needs to watch the
167
167
bus.
168
168
</p>
169
169
<p>
170
170
Playback can be initiated by setting the element to PLAYING state using
171
171
<a
172
 
href="../gstreamer-0.10/GstElement.html#gst-element-set-state"
 
172
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-set-state"
173
173
><code class="function">gst_element_set_state()</code></a>. Note that the state change will take place in
174
174
the background in a separate thread, when the function returns playback
175
175
is probably not happening yet and any errors might not have occured yet.
185
185
</p>
186
186
<p>
187
187
Seeking can be done using <a
188
 
href="../gstreamer-0.10/GstElement.html#gst-element-seek-simple"
 
188
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-seek-simple"
189
189
><code class="function">gst_element_seek_simple()</code></a> or <a
190
 
href="../gstreamer-0.10/GstElement.html#gst-element-seek"
 
190
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-seek"
191
191
><code class="function">gst_element_seek()</code></a>
192
192
on the playbin element. Again, the seek will not be executed
193
193
instantaneously, but will be done in a background thread. When the seek
194
194
call returns the seek will most likely still be in process. An application
195
195
may wait for the seek to finish (or fail) using <a
196
 
href="../gstreamer-0.10/GstElement.html#gst-element-get-state"
 
196
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-get-state"
197
197
><code class="function">gst_element_get_state()</code></a> with
198
198
-1 as the timeout, but this will block the user interface and is not
199
199
recommended at all.
201
201
<p>
202
202
Applications may query the current position and duration of the stream
203
203
via <a
204
 
href="../gstreamer-0.10/GstElement.html#gst-element-query-position"
 
204
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-query-position"
205
205
><code class="function">gst_element_query_position()</code></a> and <a
206
 
href="../gstreamer-0.10/GstElement.html#gst-element-query-duration"
 
206
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-query-duration"
207
207
><code class="function">gst_element_query_duration()</code></a> and
208
208
setting the format passed to GST_FORMAT_TIME. If the query was successful,
209
209
the duration or position will have been returned in units of nanoseconds.
213
213
</p>
214
214
<hr>
215
215
<div class="refsect2" lang="en">
216
 
<a name="id3135779"></a><h3>Advanced Usage: specifying the audio and video sink</h3>
 
216
<a name="id2621750"></a><h3>Advanced Usage: specifying the audio and video sink</h3>
217
217
<p>
218
218
By default, if no audio sink or video sink has been specified via the
219
219
<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--audio-sink" title='The "audio-sink" property'><span class="type">"audio-sink"</span></a> or <a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--video-sink" title='The "video-sink" property'><span class="type">"video-sink"</span></a> property, playbin will use
227
227
If the application wants more control over how audio or video should be
228
228
output, it may create the audio/video sink elements itself (for example
229
229
using <a
230
 
href="../gstreamer-0.10/GstElementFactory.html#gst-element-factory-make"
 
230
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElementFactory.html#gst-element-factory-make"
231
231
><code class="function">gst_element_factory_make()</code></a>) and provide them to playbin using the
232
232
<a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--audio-sink" title='The "audio-sink" property'><span class="type">"audio-sink"</span></a> or <a class="link" href="gst-plugins-base-plugins-playbin.html#GstPlayBin--video-sink" title='The "video-sink" property'><span class="type">"video-sink"</span></a> property.
233
233
</p>
242
242
possible to create container elements that look like a sink to playbin,
243
243
but in reality contain a number of custom elements linked together. This
244
244
can be achieved by creating a <a
245
 
href="../gstreamer-0.10/GstBin.html"
 
245
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstBin.html"
246
246
><span class="type">GstBin</span></a> and putting elements in there and
247
247
linking them, and then creating a sink <a
248
 
href="../gstreamer-0.10/GstGhostPad.html"
 
248
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstGhostPad.html"
249
249
><span class="type">GstGhostPad</span></a> for the bin and pointing
250
250
it to the sink pad of the first element within the bin. This can be used
251
251
for a number of purposes, for example to force output to a particular
261
261
</p>
262
262
<hr>
263
263
<div class="refsect2" lang="en">
264
 
<a name="id3135882"></a><h3>Retrieving Tags and Other Meta Data</h3>
 
264
<a name="id2621852"></a><h3>Retrieving Tags and Other Meta Data</h3>
265
265
<p>
266
266
Most of the common meta data (artist, title, etc.) can be retrieved by
267
267
watching for TAG messages on the pipeline's bus (see above).
272
272
using the  <a class="link" href="GstPlayBaseBin.html#GstPlayBaseBin--stream-info" title='The "stream-info" property'><span class="type">"stream-info"</span></a> property, which will return a GList of
273
273
stream info objects, one for each stream. These are opaque objects that can
274
274
only be accessed via the standard GObject property interface, ie. <a
275
 
href="../gobject/gobject-The-Base-Object-Type.html#g-object-get"
 
275
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-get"
276
276
><code class="function">g_object_get()</code></a>.
277
277
Each stream info object has the following properties:
278
278
</p>
289
289
Stream information from the <a class="link" href="GstPlayBaseBin.html#GstPlayBaseBin--stream-info" title='The "stream-info" property'><span class="type">"stream-info"</span></a> property is best queried once
290
290
playbin has changed into PAUSED or PLAYING state (which can be detected
291
291
via a state-changed message on the <a
292
 
href="../gstreamer-0.10/GstBus.html"
 
292
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstBus.html"
293
293
><span class="type">GstBus</span></a> where old_state=READY and
294
294
new_state=PAUSED), since before that the list might not be complete yet or
295
295
not contain all available information (like language-codes).
299
299
</p>
300
300
<hr>
301
301
<div class="refsect2" lang="en">
302
 
<a name="id3139068"></a><h3>Buffering</h3>
 
302
<a name="id2625038"></a><h3>Buffering</h3>
303
303
Playbin handles buffering automatically for the most part, but applications
304
304
need to handle parts of the buffering process as well. Whenever playbin is
305
305
buffering, it will post BUFFERING messages on the bus with a percentage
328
328
</p>
329
329
<hr>
330
330
<div class="refsect2" lang="en">
331
 
<a name="id3139100"></a><h3>Embedding the video window in your application</h3>
 
331
<a name="id2625070"></a><h3>Embedding the video window in your application</h3>
332
332
By default, playbin (or rather the video sinks used) will create their own
333
333
window. Applications will usually want to force output to a window of their
334
334
own, however. This can be done using the <a
335
 
href="../gst-plugins-base-libs-0.10/gst-plugins-base-libs-gstxoverlay.html#GstXOverlay"
 
335
href="/usr/share/gtk-doc/html/gst-plugins-base-libs-0.10/gst-plugins-base-libs-gstxoverlay.html#GstXOverlay"
336
336
><span class="type">GstXOverlay</span></a> interface, which most
337
337
video sinks implement. See the documentation there for more details.
338
338
</div>
340
340
</p>
341
341
<hr>
342
342
<div class="refsect2" lang="en">
343
 
<a name="id3139120"></a><h3>Specifying which CD/DVD device to use</h3>
 
343
<a name="id2625090"></a><h3>Specifying which CD/DVD device to use</h3>
344
344
The device to use for CDs/DVDs needs to be set on the source element
345
345
playbin creates before it is opened. The only way to do this at the moment
346
346
is to connect to playbin's "notify::source" signal, which will be emitted
354
354
</p>
355
355
<hr>
356
356
<div class="refsect2" lang="en">
357
 
<a name="id3139136"></a><h3>Examples</h3>
 
357
<a name="id2625106"></a><h3>Examples</h3>
358
358
<div class="informalexample"><pre class="programlisting">
359
359
gst-launch -v playbin uri=file:///path/to/somefile.avi
360
360
</pre></div> This will play back the given AVI video file, given that the video and
374
374
<div class="refsynopsisdiv">
375
375
<h2>Synopsis</h2>
376
376
<div class="refsect2" lang="en">
377
 
<a name="id3139182"></a><h3>Element Information</h3>
 
377
<a name="id2625150"></a><h3>Element Information</h3>
378
378
<div class="variablelist"><table border="0">
379
379
<col align="left" valign="top">
380
380
<tbody>
397
397
</div>
398
398
<hr>
399
399
<div class="refsect2" lang="en">
400
 
<a name="id3139245"></a><h3>Element Pads</h3>
 
400
<a name="id2625213"></a><h3>Element Pads</h3>
401
401
</div>
402
402
</div>
403
403
<div class="refsynopsisdiv">
404
404
<h2>Synopsis</h2>
405
405
<div class="refsect2" lang="en">
406
 
<a name="id3139258"></a><h3>Element Information</h3>
 
406
<a name="id2625227"></a><h3>Element Information</h3>
407
407
<div class="variablelist"><table border="0">
408
408
<col align="left" valign="top">
409
409
<tbody>
426
426
</div>
427
427
<hr>
428
428
<div class="refsect2" lang="en">
429
 
<a name="id3139321"></a><h3>Element Pads</h3>
 
429
<a name="id2625290"></a><h3>Element Pads</h3>
430
430
</div>
431
431
</div>
432
432
<p>
448
448
<div class="refsect2" lang="en">
449
449
<a name="GstPlayBin--audio-sink"></a><h3>The <code class="literal">"audio-sink"</code> property</h3>
450
450
<pre class="programlisting">  "audio-sink"               <a
451
 
href="../gstreamer-0.10/GstElement.html"
 
451
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
452
452
>GstElement</a>*           : Read / Write</pre>
453
453
<p>the audio output element to use (NULL = default sink).</p>
454
454
</div>
456
456
<div class="refsect2" lang="en">
457
457
<a name="GstPlayBin--frame"></a><h3>The <code class="literal">"frame"</code> property</h3>
458
458
<pre class="programlisting">  "frame"                    <a
459
 
href="../gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"
 
459
href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"
460
460
>GstBuffer</a>*            : Read</pre>
461
461
<p>The last frame (NULL = no video available).</p>
462
462
</div>
464
464
<div class="refsect2" lang="en">
465
465
<a name="GstPlayBin--subtitle-font-desc"></a><h3>The <code class="literal">"subtitle-font-desc"</code> property</h3>
466
466
<pre class="programlisting">  "subtitle-font-desc"       <a
467
 
href="../glib/glib-Basic-Types.html#gchar"
 
467
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
468
468
>gchar</a>*                : Write</pre>
469
469
<p>Pango font description of font to be used for subtitle rendering.</p>
470
470
<p>Default value: NULL</p>
473
473
<div class="refsect2" lang="en">
474
474
<a name="GstPlayBin--video-sink"></a><h3>The <code class="literal">"video-sink"</code> property</h3>
475
475
<pre class="programlisting">  "video-sink"               <a
476
 
href="../gstreamer-0.10/GstElement.html"
 
476
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
477
477
>GstElement</a>*           : Read / Write</pre>
478
478
<p>the video output element to use (NULL = default sink).</p>
479
479
</div>
481
481
<div class="refsect2" lang="en">
482
482
<a name="GstPlayBin--vis-plugin"></a><h3>The <code class="literal">"vis-plugin"</code> property</h3>
483
483
<pre class="programlisting">  "vis-plugin"               <a
484
 
href="../gstreamer-0.10/GstElement.html"
 
484
href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"
485
485
>GstElement</a>*           : Read / Write</pre>
486
486
<p>the visualization element to use (NULL = none).</p>
487
487
</div>
489
489
<div class="refsect2" lang="en">
490
490
<a name="GstPlayBin--volume"></a><h3>The <code class="literal">"volume"</code> property</h3>
491
491
<pre class="programlisting">  "volume"                   <a
492
 
href="../glib/glib-Basic-Types.html#gdouble"
 
492
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"
493
493
>gdouble</a>               : Read / Write</pre>
494
494
<p>
495
495
Get or set the current audio stream volume. 1.0 means 100%,
503
503
<div class="refsect2" lang="en">
504
504
<a name="GstPlayBin--connection-speed"></a><h3>The <code class="literal">"connection-speed"</code> property</h3>
505
505
<pre class="programlisting">  "connection-speed"         <a
506
 
href="../glib/glib-Basic-Types.html#guint"
 
506
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
507
507
>guint</a>                 : Read / Write</pre>
508
508
<p>Network connection speed in kbps (0 = unknown).</p>
509
509
<p>Default value: 0</p>