Remove all references to playbin2
authorThibault Saunier <tsaunier@gnome.org>
Fri, 27 May 2016 18:19:02 +0000 (14:19 -0400)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 3 Jun 2016 13:42:18 +0000 (09:42 -0400)
39 files changed:
Android+tutorial+4+A+basic+media+player.markdown
Android+tutorial+5+A+Complete+media+player.markdown
Basic+Media+Player.markdown
Basic+tutorial+1+Hello+world.markdown
Basic+tutorial+10+GStreamer+tools.markdown
Basic+tutorial+11+Debugging+tools.markdown
Basic+tutorial+12+Streaming.markdown
Basic+tutorial+13+Playback+speed.markdown
Basic+tutorial+14+Handy+elements.markdown
Basic+tutorial+15+Clutter+integration.markdown
Basic+tutorial+16+Platform-specific+elements.markdown
Basic+tutorial+3+Dynamic+pipelines.markdown
Basic+tutorial+6+Media+formats+and+Pad+Capabilities.markdown
Basic+tutorial+8+Short-cutting+the+pipeline.markdown
Playback+tutorial+1+Playbin+usage.markdown [new file with mode: 0644]
Playback+tutorial+1+Playbin2+usage.markdown [deleted file]
Playback+tutorial+2+Subtitle+management.markdown
Playback+tutorial+3+Short-cutting+the+pipeline.markdown
Playback+tutorial+4+Progressive+streaming.markdown
Playback+tutorial+5+Color+Balance.markdown
Playback+tutorial+6+Audio+visualization.markdown
Playback+tutorial+7+Custom+playbin+sinks.markdown [new file with mode: 0644]
Playback+tutorial+7+Custom+playbin2+sinks.markdown [deleted file]
Playback+tutorial+8+Hardware-accelerated+video+decoding.markdown
Playback+tutorial+9+Digital+audio+pass-through.markdown
QtGStreamer+vs+C+GStreamer.markdown
TODO.markdown
Table+of+Concepts.markdown
attachments/2424843.c
attachments/2424846.c
attachments/2424848.c
attachments/2424850.c
attachments/2424874.c
attachments/2424879.c
attachments/2424881.c
attachments/2424883.c
gst-launch.markdown
iOS+tutorial+4+A+basic+media+player.markdown
sitemap.txt

index 042148dee0a1537edf3cc93c2ea4240fb5637520..45bf347b78b7989d44b2ab5bf2b59fe3b8f9bd34 100644 (file)
@@ -15,7 +15,7 @@ Android device. It shows:
 It also uses the knowledge gathered in the [Basic
 tutorials](Basic%2Btutorials.html) regarding:
 
-  - How to use `playbin2` to play any kind of media
+  - How to use `playbin` to play any kind of media
   - How to handle network resilience problems
 
 # Introduction
@@ -23,10 +23,10 @@ tutorials](Basic%2Btutorials.html) regarding:
 From the previous tutorials, we already have almost all necessary pieces
 to build a media player. The most complex part is assembling a pipeline
 which retrieves, decodes and displays the media, but we already know
-that the `playbin2` element can take care of all that for us. We only
+that the `playbin` element can take care of all that for us. We only
 need to replace the manual pipeline we used in [Android tutorial 3:
 Video](Android%2Btutorial%2B3%253A%2BVideo.html) with a single-element
-`playbin2` pipeline and we are good to go\!
+`playbin` pipeline and we are good to go\!
 
 However, we can do better than. We will add a [Seek
 Bar](http://developer.android.com/reference/android/widget/SeekBar.html),
@@ -303,7 +303,7 @@ public class Tutorial4 extends Activity implements SurfaceHolder.Callback, OnSee
 ### Supporting arbitrary media URIs
 
 The C code provides the `nativeSetUri()` method so we can indicate the
-URI of the media to play. Since `playbin2` will be taking care of
+URI of the media to play. Since `playbin` will be taking care of
 retrieving the media, we can use local or remote URIs indistinctly
 (`file://` or `http://`, for example). From Java, though, we want to
 keep track of whether the file is local or remote, because we will not
@@ -536,7 +536,7 @@ typedef struct _CustomData {
   gboolean is_live;             /* Live streams do not use buffering */
 } CustomData;
 
-/* playbin2 flags */
+/* playbin flags */
 typedef enum {
   GST_PLAY_FLAG_TEXT = (1 << 2)  /* We want subtitle output */
 } GstPlayFlags;
@@ -834,7 +834,7 @@ static void *app_function (void *userdata) {
   g_main_context_push_thread_default(data->context);
 
   /* Build pipeline */
-  data->pipeline = gst_parse_launch("playbin2", &error);
+  data->pipeline = gst_parse_launch("playbin", &error);
   if (error) {
     gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
     g_clear_error (&error);
@@ -925,7 +925,7 @@ static void gst_native_finalize (JNIEnv* env, jobject thiz) {
   GST_DEBUG ("Done finalizing");
 }
 
-/* Set playbin2's URI */
+/* Set playbin's URI */
 void gst_native_set_uri (JNIEnv* env, jobject thiz, jstring uri) {
   CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
   if (!data || !data->pipeline) return;
@@ -1090,14 +1090,14 @@ GStreamer with
 and
 [ReleaseStringUTFChars()](http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html#wp17294).
 
-`playbin2` will only care about URI changes in the READY to PAUSED state
+`playbin` will only care about URI changes in the READY to PAUSED state
 change, because the new URI might need a completely different playback
 pipeline (think about switching from a local Matroska file to a remote
 OGG file: this would require, at least, different source and demuxing
-elements). Thus, before passing the new URI to `playbin2` we set its
+elements). Thus, before passing the new URI to `playbin` we set its
 state to READY (if we were in PAUSED or PLAYING).
 
-`playbin2`’s URI is exposed as a common GObject property, so we simply
+`playbin`’s URI is exposed as a common GObject property, so we simply
 set it with `g_object_set()`.
 
 We then reset the clip duration, so it is re-queried later, and bring
@@ -1150,7 +1150,7 @@ static void check_media_size (CustomData *data) {
 ```
 
 We first retrieve the video sink element from the pipeline, using the
-`video-sink` property of `playbin2`, and then its sink Pad. The
+`video-sink` property of `playbin`, and then its sink Pad. The
 negotiated Caps of this Pad, which we recover using
 `gst_pad_get_negotiated_caps()`,  are the Caps of the decoded media.
 
@@ -1404,7 +1404,7 @@ in this tutorial the URI does not change, but it will in the next one).
 
 # Conclusion
 
-This tutorial has shown how to embed a `playbin2` pipeline into an
+This tutorial has shown how to embed a `playbin` pipeline into an
 Android application. This, effectively, turns such application into a
 basic media player, capable of streaming and decoding all the formats
 GStreamer understands. More particularly, it has shown:
index 5540c97eed10c24b0a2c83d49ec9fc781650b67a..2e76b9dbb2fd060e7d0144f245a79ac429ec2885 100644 (file)
@@ -74,7 +74,7 @@ allows you to choose a local media file, no matter what extension or
 MIME type it has.
 
 If a new media is selected, it is passed onto the native code (which
-will set the pipeline to READY, pass the URI onto `playbin2`, and bring
+will set the pipeline to READY, pass the URI onto `playbin`, and bring
 the pipeline back to the previous state). The current position is also
 reset, so the new clip does not start in the previous position.
 
index 51606a5bc6c742e47cb8290dc46f7e9d2e60028a..095170047a883f32770f47cebc01e33dfb2659ad 100644 (file)
@@ -408,7 +408,7 @@ void Player::setUri(const QString & uri)
         realUri = QUrl::fromLocalFile(realUri).toEncoded();
     }
     if (!m_pipeline) {
-        m_pipeline = QGst::ElementFactory::make("playbin2").dynamicCast<QGst::Pipeline>();
+        m_pipeline = QGst::ElementFactory::make("playbin").dynamicCast<QGst::Pipeline>();
         if (m_pipeline) {
             //let the video widget watch the pipeline for new video sinks
             watchPipeline(m_pipeline);
@@ -617,7 +617,7 @@ void Player::setUri(const QString & uri)
         realUri = QUrl::fromLocalFile(realUri).toEncoded();
     }
     if (!m_pipeline) {
-        m_pipeline = QGst::ElementFactory::make("playbin2").dynamicCast<QGst::Pipeline>();
+        m_pipeline = QGst::ElementFactory::make("playbin").dynamicCast<QGst::Pipeline>();
         if (m_pipeline) {
             //let the video widget watch the pipeline for new video sinks
             watchPipeline(m_pipeline);
@@ -637,7 +637,7 @@ void Player::setUri(const QString & uri)
 
 Here, we first ensure that the pipeline will receive a proper URI. If
 `Player::setUri()` is called with `/home/user/some/file.mp3`, the path
-is modified to `file:///home/user/some/file.mp3`. `playbin2` only
+is modified to `file:///home/user/some/file.mp3`. `playbin` only
 accepts complete URIs.
 
 The pipeline is created via `QGst::ElementFactory::make()`. The
@@ -704,7 +704,7 @@ void Player::handlePipelineStateChange(const QGst::StateChangedMessagePtr & scm)
 }
 ```
 
-Finally, we tell `playbin2` what to play by setting the `uri` property:
+Finally, we tell `playbin` what to play by setting the `uri` property:
 
 ``` lang=c
 m_pipeline->setProperty("uri", realUri);
index 3f79918f64bf56488761aefb82bea5e46b04aaaa..9e1562e1b7d40b903b09a96bc2f244a403a82137 100644 (file)
@@ -228,7 +228,7 @@ Let's recap a bit. Today we have learned:
   - How to quickly build a pipeline from a textual description using
     `gst_parse_launch()`.
 
-  - How to create an automatic playback pipeline using `playbin2`.
+  - How to create an automatic playback pipeline using `playbin`.
 
   - How to signal GStreamer to start playback using
     `gst_element_set_state()`.
index 21955960320b50d1c9aaa30cb2ba18bcd832e012..0907b20bb8c2a79ee8f571888de0df2d0b750068 100644 (file)
@@ -225,15 +225,15 @@ producing for a particular pipeline, run `gst-launch-1.0` as usual, with the
 
 #### Examples
 
-Play a media file using `playbin2` (as in [Basic tutorial 1: Hello
+Play a media file using `playbin` (as in [Basic tutorial 1: Hello
 world\!](Basic%2Btutorial%2B1%253A%2BHello%2Bworld%2521.html)):
 
 ```
-gst-launch-1.0 playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm
+gst-launch-1.0 playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm
 ```
 
 A fully operation playback pipeline, with audio and video (more or less
-the same pipeline that `playbin2` will create
+the same pipeline that `playbin` will create
 internally):
 
 ```
index 210f3233caf3e655c6a0eb25cbcce4f3a605103a..4e5c160a7b404aef09eff18cc73935b0e37fe362 100644 (file)
@@ -182,7 +182,7 @@ to output graph files. These are `.dot` files, readable with free
 programs like [GraphViz](http://www.graphviz.org), that describe the
 topology of your pipeline, along with the caps negotiated in each link.
 
-This is also very handy when using all-in-one elements like `playbin2`
+This is also very handy when using all-in-one elements like `playbin`
  or `uridecodebin`, which instantiate several elements inside them. Use
 the `.dot` files to learn what pipeline they have created inside (and
 learn a bit of GStreamer along the way).
@@ -197,11 +197,11 @@ within your application, you can use the
 `GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS()` macros to generate `.dot` files
 at your convenience.
 
-Here you have an example of the kind of pipelines that playbin2
-generates. It is very complex because `playbin2` can handle many
+Here you have an example of the kind of pipelines that playbin
+generates. It is very complex because `playbin` can handle many
 different cases: Your manual pipelines normally do not need to be this
 long. If your manual pipeline is starting to get very big, consider
-using `playbin2`.
+using `playbin`.
 
 ![](attachments/327830/2424840.png)
 
@@ -224,4 +224,4 @@ It has been a pleasure having you here, and see you soon\!
 ## Attachments:
 
 ![](images/icons/bullet_blue.gif)
-[playbin2.png](attachments/327830/2424840.png) (image/png)
+[playbin.png](attachments/327830/2424840.png) (image/png)
index 4be8025b96a0056ca1cf00c9f89c8fd67c524f06..7809a336df9995bbb418765a2c33d19fdaddd44f 100644 (file)
@@ -26,7 +26,7 @@ waiting.
 
 As it turns out, this solution is already implemented in GStreamer, but
 the previous tutorials have not been benefiting from it. Some elements,
-like the `queue2` and `multiqueue` found inside `playbin2`, are capable
+like the `queue2` and `multiqueue` found inside `playbin`, are capable
 of building this buffer and post bus messages regarding the buffer level
 (the state of the queue). An application wanting to have more network
 resilience, then, should listen to these messages and pause playback if
@@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
   memset (&data, 0, sizeof (data));
 
   /* Build the pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
   bus = gst_element_get_bus (pipeline);
 
   /* Start playing */
index 4e61c8e847ae39e067fe5e3da95fcc62237e97d4..be2b0279cb0a8fa5ae334596b86cd99daaa29134 100644 (file)
@@ -42,10 +42,10 @@ so Seek Events are used in this tutorial instead.
 
 To use these events, they are created and then passed onto the pipeline,
 where they propagate upstream until they reach an element that can
-handle them. If an event is passed onto a bin element like `playbin2`,
+handle them. If an event is passed onto a bin element like `playbin`,
 it will simply feed the event to all its sinks, which will result in
 multiple seeks being performed. The common approach is to retrieve one
-of `playbin2`’s sinks through the `video-sink` or
+of `playbin`’s sinks through the `video-sink` or
 `audio-sink` properties and feed the event directly into the sink.
 
 Frame stepping is a technique that allows playing a video frame by
@@ -181,7 +181,7 @@ int main(int argc, char *argv[]) {
     " 'Q' to quit\n");
 
   /* Build the pipeline */
-  data.pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  data.pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
 
   /* Add a keyboard watch so we get notified of keystrokes */
 #ifdef _WIN32
@@ -243,7 +243,7 @@ int main(int argc, char *argv[]) {
 # Walkthrough
 
 There is nothing new in the initialization code in the main function:  a
-`playbin2` pipeline is instantiated, an I/O watch is installed to track
+`playbin` pipeline is instantiated, an I/O watch is installed to track
 keystrokes and a GLib main loop is executed.
 
 Then, in the keyboard handler function:
@@ -336,7 +336,7 @@ if (data->video_sink == NULL) {
 
 As explained in the Introduction, to avoid performing multiple Seeks,
 the Event is sent to only one sink, in this case, the video sink. It is
-obtained from `playbin2` through the `video-sink` property. It is read
+obtained from `playbin` through the `video-sink` property. It is read
 at this time instead at initialization time because the actual sink may
 change depending on the media contents, and this won’t be known until
 the pipeline is PLAYING and some media has been read.
@@ -369,7 +369,7 @@ A new Step Event is created with `gst_event_new_step()`, whose
 parameters basically specify the amount to skip (1 frame in the example)
 and the new rate (which we do not change).
 
-The video sink is grabbed from `playbin2` in case we didn’t have it yet,
+The video sink is grabbed from `playbin` in case we didn’t have it yet,
 just like before.
 
 And with this we are done. When testing this tutorial, keep in mind that
@@ -379,7 +379,7 @@ backward playback is not optimal in many elements.
 <tbody>
 <tr class="odd">
 <td><img src="images/icons/emoticons/warning.png" width="16" height="16" /></td>
-<td><p>Changing the playback rate might only work with local files. If you cannot modify it, try changing the URI passed to <code>playbin2</code> in line 114 to a local URI, starting with <code>file:///</code></p></td>
+<td><p>Changing the playback rate might only work with local files. If you cannot modify it, try changing the URI passed to <code>playbin</code> in line 114 to a local URI, starting with <code>file:///</code></p></td>
 </tr>
 </tbody>
 </table>
index 66f3784c30ed967787dc3b54d29bbde457ce9fde..a2c346fd9978d031e6e548301cf0598674752377 100644 (file)
@@ -4,7 +4,7 @@
 
 This tutorial gives a list of handy GStreamer elements that are worth
 knowing. They range from powerful all-in-one elements that allow you to
-build complex pipelines easily (like `playbin2`), to little helper
+build complex pipelines easily (like `playbin`), to little helper
 elements which are extremely useful when debugging.
 
 For simplicity, the following examples are given using the
@@ -19,7 +19,7 @@ These are Bin elements which you treat as a single element and they take
 care of instantiating all the necessary internal pipeline to accomplish
 their task.
 
-### `playbin2`
+### `playbin`
 
 This element has been extensively used throughout the tutorials. It
 manages all aspects of media playback, from source to display, passing
@@ -263,7 +263,7 @@ tutorial 12: Streaming](Basic%2Btutorial%2B12%253A%2BStreaming.html).
 As a rule of thumb, prefer `queue2` over `queue` whenever network
 buffering is a concern to you. See [Basic tutorial 12:
 Streaming](Basic%2Btutorial%2B12%253A%2BStreaming.html) for an example
-(`queue2` is hidden inside `playbin2`).
+(`queue2` is hidden inside `playbin`).
 
 ### `multiqueue`
 
index 052be24178ac18bf33a80e9d96ba28f8db28092a..186f4d9de9e2e464025704af8c85cabca3b10af7 100644 (file)
@@ -94,7 +94,7 @@ int main(int argc, char *argv[]) {
   g_signal_connect (texture, "size-change", G_CALLBACK (size_change), NULL);
 
   /* Build the GStreamer pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
 
   /* Instantiate the Clutter sink */
   sink = gst_element_factory_make ("autocluttersink", NULL);
@@ -226,7 +226,7 @@ This texture is everything GStreamer needs to know about Clutter.
 g_object_set (pipeline, "video-sink", sink, NULL);
 ```
 
-Finally, tell `playbin2` to use the sink we created instead of the
+Finally, tell `playbin` to use the sink we created instead of the
 default one.
 
 Then the GStreamer pipeline and the Clutter timeline are started and the
index 177b4582f67c569d816c232ddd491d5c62d05869..1eface4c3949a075519a29f3fdccb95e9597a751 100644 (file)
@@ -6,7 +6,7 @@ Even though GStreamer is a multiplatform framework, not all the elements
 are available on all platforms. For example, the audio and video sinks
 depend heavily on the underlying windowing system, and a different one
 needs to be selected depending on the platform. You normally do not need
-to worry about this when using elements like `playbin2` or
+to worry about this when using elements like `playbin` or
 `autovideosink`, but, for those cases when you need to use one of the
 sinks that are only available on specific platforms, this tutorial hints
 you some of their peculiarities.
@@ -185,14 +185,14 @@ This is the only audio sink available to GStreamer on iOS.
 
 Source element to read iOS assets, this is, documents stored in the
 Library (like photos, music and videos). It can be instantiated
-automatically by `playbin2` when URIs use the
+automatically by `playbin` when URIs use the
 `assets-library://` scheme.
 
 ### `iosavassetsrc`
 
 Source element to read and decode iOS audiovisual assets, this is,
 documents stored in the Library (like photos, music and videos). It can
-be instantiated automatically by `playbin2` when URIs use the
+be instantiated automatically by `playbin` when URIs use the
 `ipod-library://` scheme. Decoding is performed by the system, so
 dedicated hardware will be used if available.
 
@@ -200,7 +200,7 @@ dedicated hardware will be used if available.
 
 This tutorial has shown a few specific details about some GStreamer
 elements which are not available on all platforms. You do not have to
-worry about them when using multiplatform elements like `playbin2` or
+worry about them when using multiplatform elements like `playbin` or
 `autovideosink`, but it is good to know their personal quirks if
 instancing them manually.
 
index 27332095e1cac7bc798353853b36f2b80d29d399..1a6a31f61e8e400e60e869383f6efc385f80c1b7 100644 (file)
@@ -494,10 +494,10 @@ are already printing on screen the type of the video pads.
 
 You should now see (and hear) the same movie as in [Basic tutorial 1:
 Hello world!](Basic+tutorial+1+Hello+world.markdown). In
-that tutorial you used `playbin2`, which is a handy element that
+that tutorial you used `playbin`, which is a handy element that
 automatically takes care of all the demuxing and pad linking for you.
 Most of the [Playback tutorials](Playback+tutorials.markdown) are devoted
-to `playbin2`.
+to `playbin`.
 
 ## Conclusion
 
@@ -515,7 +515,7 @@ You can now continue with the basic tutorials and learn about performing
 seeks and time-related queries in [Basic tutorial 4: Time
 management](Basic+tutorial+4+Time+management.markdown) or move
 to the [Playback tutorials](Playback+tutorials.markdown), and gain more
-insight about the `playbin2` element.
+insight about the `playbin` element.
 
 Remember that attached to this page you should find the complete source
 code of the tutorial and any accessory files needed to build it.
index c6b5815788dc0c33fcc8d2fe0996ca01e1e51d77..4af875bc4b487a937fd6a9df5fa841d84b58a4b8 100644 (file)
@@ -41,7 +41,7 @@ understand each other). This is the main goal of Capabilities.
 
 As an application developer, you will usually build pipelines by linking
 elements together (to a lesser extent if you use all-in-all elements
-like `playbin2`). In this case, you need to know the *Pad Caps* (as they
+like `playbin`). In this case, you need to know the *Pad Caps* (as they
 are familiarly referred to) of your elements, or, at least, know what
 they are when GStreamer refuses to link two elements with a negotiation
 error.
index 60bb686c4155a07169084e7bdbccaeca519a044a..68715334681b1321cba9beab8bfd08445b8095f1 100644 (file)
@@ -14,7 +14,7 @@ any time, in a variety of ways. This tutorial shows:
 
 [Playback tutorial 3: Short-cutting the
 pipeline](Playback+tutorial+3+Short-cutting+the+pipeline.markdown) explains
-how to achieve the same goals in a playbin2-based pipeline.
+how to achieve the same goals in a playbin-based pipeline.
 
 ## Introduction
 
@@ -499,8 +499,8 @@ gst_buffer_unref (buffer);
 
 Once we have the buffer ready, we pass it to `appsrc` with the
 `push-buffer` action signal (see information box at the end of [Playback
-tutorial 1: Playbin2
-usage](Playback+tutorial+1+Playbin2+usage.markdown)), and then
+tutorial 1: Playbin
+usage](Playback+tutorial+1+Playbin+usage.markdown)), and then
 `gst_buffer_unref()` it since we no longer need it.
 
 ``` lang=c
@@ -538,7 +538,7 @@ This tutorial has shown how applications can:
   - Retrieve data from a pipeline using the `appsink` element.
   - Manipulate this data by accessing the `GstBuffer`.
 
-In a playbin2-based pipeline, the same goals are achieved in a slightly
+In a playbin-based pipeline, the same goals are achieved in a slightly
 different way. [Playback tutorial 3: Short-cutting the
 pipeline](Playback+tutorial+3+Short-cutting+the+pipeline.markdown) shows
 how to do it.
diff --git a/Playback+tutorial+1+Playbin+usage.markdown b/Playback+tutorial+1+Playbin+usage.markdown
new file mode 100644 (file)
index 0000000..88a9893
--- /dev/null
@@ -0,0 +1,642 @@
+# Playback tutorial 1: Playbin usage
+
+# Goal
+
+We have already worked with the `playbin` element, which is capable of
+building a complete playback pipeline without much work on our side.
+This tutorial shows how to further customize `playbin` in case its
+default values do not suit our particular needs.
+
+We will learn:
+
+  - How to find out how many streams a file contains, and how to switch
+    among them.
+
+  - How to gather information regarding each stream.
+
+As a side note, even though its name is `playbin`, you can pronounce it
+“playbin”, since the original `playbin` element is deprecated and nobody
+should be using it.
+
+# Introduction
+
+More often than not, multiple audio, video and subtitle streams can be
+found embedded in a single file. The most common case are regular
+movies, which contain one video and one audio stream (Stereo or 5.1
+audio tracks are considered a single stream). It is also increasingly
+common to find movies with one video and multiple audio streams, to
+account for different languages. In this case, the user selects one
+audio stream, and the application will only play that one, ignoring the
+others.
+
+To be able to select the appropriate stream, the user needs to know
+certain information about them, for example, their language. This
+information is embedded in the streams in the form of “metadata”
+(annexed data), and this tutorial shows how to retrieve it.
+
+Subtitles can also be embedded in a file, along with audio and video,
+but they are dealt with in more detail in [Playback tutorial 2: Subtitle
+management](Playback%2Btutorial%2B2%253A%2BSubtitle%2Bmanagement.html).
+Finally, multiple video streams can also be found in a single file, for
+example, in DVD with multiple angles of the same scene, but they are
+somewhat rare.
+
+> ![](images/icons/emoticons/information.png) Embedding multiple streams
+> inside a single file is called “multiplexing” or “muxing”, and such file
+> is then known as a “container”. Common container formats are Matroska
+> (.mkv), Quicktime (.qt, .mov, .mp4), Ogg (.ogg) or Webm (.webm).
+>
+>
+> Retrieving the individual streams from within the container is called
+> “demultiplexing” or “demuxing”.
+
+The following code recovers the amount of streams in the file, their
+associated metadata, and allows switching the audio stream while the
+media is playing.
+
+# The multilingual player
+
+Copy this code into a text file named `playback-tutorial-1.c` (or find
+it in the SDK installation).
+
+**playback-tutorial-1.c**
+
+``` lang=c
+#include <gst/gst.h>
+
+/* Structure to contain all our information, so we can pass it around */
+typedef struct _CustomData {
+  GstElement *playbin;  /* Our one and only element */
+
+  gint n_video;          /* Number of embedded video streams */
+  gint n_audio;          /* Number of embedded audio streams */
+  gint n_text;           /* Number of embedded subtitle streams */
+
+  gint current_video;    /* Currently playing video stream */
+  gint current_audio;    /* Currently playing audio stream */
+  gint current_text;     /* Currently playing subtitle stream */
+
+  GMainLoop *main_loop;  /* GLib's Main Loop */
+} CustomData;
+
+/* playbin flags */
+typedef enum {
+  GST_PLAY_FLAG_VIDEO         = (1 << 0), /* We want video output */
+  GST_PLAY_FLAG_AUDIO         = (1 << 1), /* We want audio output */
+  GST_PLAY_FLAG_TEXT          = (1 << 2)  /* We want subtitle output */
+} GstPlayFlags;
+
+/* Forward definition for the message and keyboard processing functions */
+static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data);
+static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data);
+
+int main(int argc, char *argv[]) {
+  CustomData data;
+  GstBus *bus;
+  GstStateChangeReturn ret;
+  gint flags;
+  GIOChannel *io_stdin;
+
+  /* Initialize GStreamer */
+  gst_init (&argc, &argv);
+
+  /* Create the elements */
+  data.playbin = gst_element_factory_make ("playbin", "playbin");
+
+  if (!data.playbin) {
+    g_printerr ("Not all elements could be created.\n");
+    return -1;
+  }
+
+  /* Set the URI to play */
+  g_object_set (data.playbin, "uri", "http://docs.gstreamer.com/media/sintel_cropped_multilingual.webm", NULL);
+
+  /* Set flags to show Audio and Video but ignore Subtitles */
+  g_object_get (data.playbin, "flags", &flags, NULL);
+  flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO;
+  flags &= ~GST_PLAY_FLAG_TEXT;
+  g_object_set (data.playbin, "flags", flags, NULL);
+
+  /* Set connection speed. This will affect some internal decisions of playbin */
+  g_object_set (data.playbin, "connection-speed", 56, NULL);
+
+  /* Add a bus watch, so we get notified when a message arrives */
+  bus = gst_element_get_bus (data.playbin);
+  gst_bus_add_watch (bus, (GstBusFunc)handle_message, &data);
+
+  /* Add a keyboard watch so we get notified of keystrokes */
+#ifdef _WIN32
+  io_stdin = g_io_channel_win32_new_fd (fileno (stdin));
+#else
+  io_stdin = g_io_channel_unix_new (fileno (stdin));
+#endif
+  g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc)handle_keyboard, &data);
+
+  /* Start playing */
+  ret = gst_element_set_state (data.playbin, GST_STATE_PLAYING);
+  if (ret == GST_STATE_CHANGE_FAILURE) {
+    g_printerr ("Unable to set the pipeline to the playing state.\n");
+    gst_object_unref (data.playbin);
+    return -1;
+  }
+
+  /* Create a GLib Main Loop and set it to run */
+  data.main_loop = g_main_loop_new (NULL, FALSE);
+  g_main_loop_run (data.main_loop);
+
+  /* Free resources */
+  g_main_loop_unref (data.main_loop);
+  g_io_channel_unref (io_stdin);
+  gst_object_unref (bus);
+  gst_element_set_state (data.playbin, GST_STATE_NULL);
+  gst_object_unref (data.playbin);
+  return 0;
+}
+
+/* Extract some metadata from the streams and print it on the screen */
+static void analyze_streams (CustomData *data) {
+  gint i;
+  GstTagList *tags;
+  gchar *str;
+  guint rate;
+
+  /* Read some properties */
+  g_object_get (data->playbin, "n-video", &data->n_video, NULL);
+  g_object_get (data->playbin, "n-audio", &data->n_audio, NULL);
+  g_object_get (data->playbin, "n-text", &data->n_text, NULL);
+
+  g_print ("%d video stream(s), %d audio stream(s), %d text stream(s)\n",
+    data->n_video, data->n_audio, data->n_text);
+
+  g_print ("\n");
+  for (i = 0; i < data->n_video; i++) {
+    tags = NULL;
+    /* Retrieve the stream's video tags */
+    g_signal_emit_by_name (data->playbin, "get-video-tags", i, &tags);
+    if (tags) {
+      g_print ("video stream %d:\n", i);
+      gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str);
+      g_print ("  codec: %s\n", str ? str : "unknown");
+      g_free (str);
+      gst_tag_list_free (tags);
+    }
+  }
+
+  g_print ("\n");
+  for (i = 0; i < data->n_audio; i++) {
+    tags = NULL;
+    /* Retrieve the stream's audio tags */
+    g_signal_emit_by_name (data->playbin, "get-audio-tags", i, &tags);
+    if (tags) {
+      g_print ("audio stream %d:\n", i);
+      if (gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &str)) {
+        g_print ("  codec: %s\n", str);
+        g_free (str);
+      }
+      if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) {
+        g_print ("  language: %s\n", str);
+        g_free (str);
+      }
+      if (gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &rate)) {
+        g_print ("  bitrate: %d\n", rate);
+      }
+      gst_tag_list_free (tags);
+    }
+  }
+
+  g_print ("\n");
+  for (i = 0; i < data->n_text; i++) {
+    tags = NULL;
+    /* Retrieve the stream's subtitle tags */
+    g_signal_emit_by_name (data->playbin, "get-text-tags", i, &tags);
+    if (tags) {
+      g_print ("subtitle stream %d:\n", i);
+      if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) {
+        g_print ("  language: %s\n", str);
+        g_free (str);
+      }
+      gst_tag_list_free (tags);
+    }
+  }
+
+  g_object_get (data->playbin, "current-video", &data->current_video, NULL);
+  g_object_get (data->playbin, "current-audio", &data->current_audio, NULL);
+  g_object_get (data->playbin, "current-text", &data->current_text, NULL);
+
+  g_print ("\n");
+  g_print ("Currently playing video stream %d, audio stream %d and text stream %d\n",
+    data->current_video, data->current_audio, data->current_text);
+  g_print ("Type any number and hit ENTER to select a different audio stream\n");
+}
+
+/* Process messages from GStreamer */
+static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data) {
+  GError *err;
+  gchar *debug_info;
+
+  switch (GST_MESSAGE_TYPE (msg)) {
+    case GST_MESSAGE_ERROR:
+      gst_message_parse_error (msg, &err, &debug_info);
+      g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME (msg->src), err->message);
+      g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
+      g_clear_error (&err);
+      g_free (debug_info);
+      g_main_loop_quit (data->main_loop);
+      break;
+    case GST_MESSAGE_EOS:
+      g_print ("End-Of-Stream reached.\n");
+      g_main_loop_quit (data->main_loop);
+      break;
+    case GST_MESSAGE_STATE_CHANGED: {
+      GstState old_state, new_state, pending_state;
+      gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);
+      if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->playbin)) {
+        if (new_state == GST_STATE_PLAYING) {
+          /* Once we are in the playing state, analyze the streams */
+          analyze_streams (data);
+        }
+      }
+    } break;
+  }
+
+  /* We want to keep receiving messages */
+  return TRUE;
+}
+
+/* Process keyboard input */
+static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data) {
+  gchar *str = NULL;
+
+  if (g_io_channel_read_line (source, &str, NULL, NULL, NULL) == G_IO_STATUS_NORMAL) {
+    int index = atoi (str);
+    if (index < 0 || index >= data->n_audio) {
+      g_printerr ("Index out of bounds\n");
+    } else {
+      /* If the input was a valid audio stream index, set the current audio stream */
+      g_print ("Setting current audio stream to %d\n", index);
+      g_object_set (data->playbin, "current-audio", index, NULL);
+    }
+  }
+  g_free (str);
+  return TRUE;
+}
+```
+
+> ![](images/icons/emoticons/information.png) If you need help to compile this code, refer to the **Building the
+> tutorials** section for your platform: [Mac](Installing+on+Mac+OS+X.markdown) or [Windows](Installing+on+Windows)
+> or use this specific command on Linux:
+> ```gcc playback-tutorial-1.c -o playback-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0` ```
+
+If you need help to run this code, refer to the **Running the
+tutorials** section for your platform:
+[Mac OS X](Installing+on+Mac+OS+X.markdown#building-the-tutorials),
+[Windows](Installing+on+Windows.markdown#running-the-tutorials), for
+[iOS](Installing+for+iOS+development.markdown#building-the-tutorials) or for
+[android](Installing+for+Android+development.markdown#building-the-tutorials).
+
+This tutorial opens a window and displays a movie, with accompanying
+audio. The media is fetched from the Internet, so the window might take
+a few seconds to appear, depending on your connection speed. The number
+of audio streams is shown in the terminal, and the user can switch from
+one to another by entering a number and pressing enter. A small delay is
+to be expected.
+
+</p>
+
+<p>
+
+Bear in mind that there is no latency management (buffering), so on slow
+connections, the movie might stop after a few seconds. See
+how <a href="http://docs.gstreamer.com/display/GstSDK/Tutorial+12%3A+Live+streaming">Tutorial
+12: Live streaming</a> solves this issue.
+
+</p>
+
+<p>
+
+</p>
+
+<p>
+
+Required libraries: <code>gstreamer-0.10</code>
+
+</p>
+
+</td>
+
+</tr>
+
+</tbody>
+
+</table>
+
+# Walkthrough
+
+``` lang=c
+/* Structure to contain all our information, so we can pass it around */
+typedef struct _CustomData {
+  GstElement *playbin;  /* Our one and only element */
+
+  gint n_video;          /* Number of embedded video streams */
+  gint n_audio;          /* Number of embedded audio streams */
+  gint n_text;           /* Number of embedded subtitle streams */
+
+  gint current_video;    /* Currently playing video stream */
+  gint current_audio;    /* Currently playing audio stream */
+  gint current_text;     /* Currently playing subtitle stream */
+
+  GMainLoop *main_loop;  /* GLib's Main Loop */
+} CustomData;
+```
+
+We start, as usual, putting all our variables in a structure, so we can
+pass it around to functions. For this tutorial, we need the amount of
+streams of each type, and the currently playing one. Also, we are going
+to use a different mechanism to wait for messages that allows
+interactivity, so we need a GLib's main loop object.
+
+``` lang=c
+/* playbin flags */
+typedef enum {
+  GST_PLAY_FLAG_VIDEO         = (1 << 0), /* We want video output */
+  GST_PLAY_FLAG_AUDIO         = (1 << 1), /* We want audio output */
+  GST_PLAY_FLAG_TEXT          = (1 << 2)  /* We want subtitle output */
+} GstPlayFlags;
+```
+
+Later we are going to set some of `playbin`'s flags. We would like to
+have a handy enum that allows manipulating these flags easily, but since
+`playbin` is a plug-in and not a part of the GStreamer core, this enum
+is not available to us. The “trick” is simply to declare this enum in
+our code, as it appears in the `playbin` documentation: `GstPlayFlags`.
+GObject allows introspection, so the possible values for these flags can
+be retrieved at runtime without using this trick, but in a far more
+cumbersome
+way.
+
+``` lang=c
+/* Forward definition for the message and keyboard processing functions */
+static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data);
+static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data);
+```
+
+Forward declarations for the two callbacks we will be using.
+`handle_message` for the GStreamer messages, as we have already seen,
+and `handle_keyboard` for key strokes, since this tutorial is
+introducing a limited amount of interactivity.
+
+We skip over the creation of the pipeline, the instantiation of
+`playbin` and pointing it to our test media through the `uri`
+property. `playbin` is in itself a pipeline, and in this case it is
+the only element in the pipeline, so we skip completely the creation of
+the pipeline, and use directly the  `playbin` element.
+
+We focus on some of the other properties of `playbin`, though:
+
+``` lang=c
+/* Set flags to show Audio and Video but ignore Subtitles */
+g_object_get (data.playbin, "flags", &flags, NULL);
+flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO;
+flags &= ~GST_PLAY_FLAG_TEXT;
+g_object_set (data.playbin, "flags", flags, NULL);
+```
+
+`playbin`'s behavior can be changed through its `flags` property, which
+can have any combination of `GstPlayFlags`. The most interesting values
+are:
+
+|                           |                                                                                                                                    |
+|---------------------------|------------------------------------------------------------------------------------------------------------------------------------|
+| GST_PLAY_FLAG_VIDEO       | Enable video rendering. If this flag is not set, there will be no video output.                                                    |
+| GST_PLAY_FLAG_AUDIO       | Enable audio rendering. If this flag is not set, there will be no audio output.                                                    |
+| GST_PLAY_FLAG_TEXT        | Enable subtitle rendering. If this flag is not set, subtitles will not be shown in the video output.                               |
+| GST_PLAY_FLAG_VIS         | Enable rendering of visualisations when there is no video stream. Playback tutorial 6: Audio visualization goes into more details. |
+| GST_PLAY_FLAG_DOWNLOAD    | See Basic tutorial 12: Streaming  and Playback tutorial 4: Progressive streaming.                                                  |
+| GST_PLAY_FLAG_BUFFERING   | See Basic tutorial 12: Streaming  and Playback tutorial 4: Progressive streaming.                                                  |
+| GST_PLAY_FLAG_DEINTERLACE | If the video content was interlaced, this flag instructs playbin to deinterlace it before displaying it.                          |
+
+In our case, for demonstration purposes, we are enabling audio and video
+and disabling subtitles, leaving the rest of flags to their default
+values (this is why we read the current value of the flags with
+`g_object_get()` before overwriting it with
+`g_object_set()`).
+
+``` lang=c
+/* Set connection speed. This will affect some internal decisions of playbin */
+g_object_set (data.playbin, "connection-speed", 56, NULL);
+```
+
+This property is not really useful in this example.
+`connection-speed` informs `playbin` of the maximum speed of our
+network connection, so, in case multiple versions of the requested media
+are available in the server, `playbin` chooses the most
+appropriate. This is mostly used in combination with streaming
+protocols like `mms` or `rtsp`.
+
+We have set all these properties one by one, but we could have all of
+them with a single call to
+`g_object_set()`:
+
+``` lang=c
+g_object_set (data.playbin, "uri", "http://docs.gstreamer.com/media/sintel_cropped_multilingual.webm", "flags", flags, "connection-speed", 56, NULL);
+```
+
+This is why `g_object_set()` requires a NULL as the last parameter.
+
+``` lang=c
+  /* Add a keyboard watch so we get notified of keystrokes */
+#ifdef _WIN32
+  io_stdin = g_io_channel_win32_new_fd (fileno (stdin));
+#else
+  io_stdin = g_io_channel_unix_new (fileno (stdin));
+#endif
+  g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc)handle_keyboard, &data);
+```
+
+These lines connect a callback function to the standard input (the
+keyboard). The mechanism shown here is specific to GLib, and not really
+related to GStreamer, so there is no point in going into much depth.
+Applications normally have their own way of handling user input, and
+GStreamer has little to do with it besides the Navigation interface
+discussed briefly in [Tutorial 17: DVD
+playback](http://docs.gstreamer.com/display/GstSDK/Tutorial+17%3A+DVD+playback).
+
+``` lang=c
+/* Create a GLib Main Loop and set it to run */
+data.main_loop = g_main_loop_new (NULL, FALSE);
+g_main_loop_run (data.main_loop);
+```
+
+To allow interactivity, we will no longer poll the GStreamer bus
+manually. Instead, we create a `GMainLoop`(GLib main loop) and set it
+running with `g_main_loop_run()`. This function blocks and will not
+return until `g_main_loop_quit()` is issued. In the meantime, it will
+call the callbacks we have registered at the appropriate
+times: `handle_message` when a message appears on the bus, and
+`handle_keyboard` when the user presses any key.
+
+There is nothing new in handle\_message, except that when the pipeline
+moves to the PLAYING state, it will call the `analyze_streams` function:
+
+``` lang=c
+/* Extract some metadata from the streams and print it on the screen */
+static void analyze_streams (CustomData *data) {
+  gint i;
+  GstTagList *tags;
+  gchar *str;
+  guint rate;
+
+  /* Read some properties */
+  g_object_get (data->playbin, "n-video", &data->n_video, NULL);
+  g_object_get (data->playbin, "n-audio", &data->n_audio, NULL);
+  g_object_get (data->playbin, "n-text", &data->n_text, NULL);
+```
+
+As the comment says, this function just gathers information from the
+media and prints it on the screen. The number of video, audio and
+subtitle streams is directly available through the `n-video`,
+`n-audio` and `n-text` properties.
+
+``` lang=c
+for (i = 0; i < data->n_video; i++) {
+  tags = NULL;
+  /* Retrieve the stream's video tags */
+  g_signal_emit_by_name (data->playbin, "get-video-tags", i, &tags);
+  if (tags) {
+    g_print ("video stream %d:\n", i);
+    gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str);
+    g_print ("  codec: %s\n", str ? str : "unknown");
+    g_free (str);
+    gst_tag_list_free (tags);
+  }
+}
+```
+
+Now, for each stream, we want to retrieve its metadata. Metadata is
+stored as tags in a `GstTagList` structure, which is a list of data
+pieces identified by a name. The `GstTagList` associated with a stream
+can be recovered with `g_signal_emit_by_name()`, and then individual
+tags are extracted with the `gst_tag_list_get_*` functions
+like `gst_tag_list_get_string()` for
+example.
+
+<table>
+
+<tbody>
+
+<tr class="odd">
+
+<td>
+
+<img src="images/icons/emoticons/information.png" width="16" height="16" />
+
+</td>
+
+<td>
+
+<p>
+
+This rather unintuitive way of retrieving the tag list is called an
+Action Signal. Action signals are emitted by the application to a
+specific element, which then performs an action and returns a result.
+They behave like a dynamic function call, in which methods of a class
+are identified by their name (the signal's name) instead of their memory
+address. These signals are listed In the documentation along with the
+regular signals, and are tagged “Action”. See <code>playbin</code>, for
+example.
+
+</p>
+
+</td>
+
+</tr>
+
+</tbody>
+
+</table>
+
+`playbin` defines 3 action signals to retrieve
+metadata: `get-video-tags`, `get-audio-tags` and `get-text-tags`.  The
+name if the tags is standardized, and the list can be found in the
+`GstTagList` documentation. In this example we are interested in the
+`GST_TAG_LANGUAGE_CODE` of the streams and their
+`GST_TAG_*_CODEC` (audio, video or
+text).
+
+``` lang=c
+g_object_get (data->playbin, "current-video", &data->current_video, NULL);
+g_object_get (data->playbin, "current-audio", &data->current_audio, NULL);
+g_object_get (data->playbin, "current-text", &data->current_text, NULL);
+```
+
+Once we have extracted all the metadata we want, we get the streams that
+are currently selected through 3 more properties of `playbin`:
+`current-video`, `current-audio` and `current-text`. 
+
+It is interesting to always check the currently selected streams and
+never make any assumption. Multiple internal conditions can make
+`playbin` behave differently in different executions. Also, the order
+in which the streams are listed can change from one run to another, so
+checking the metadata to identify one particular stream becomes crucial.
+
+``` lang=c
+/* Process keyboard input */
+static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data) {
+  gchar *str = NULL;
+
+  if (g_io_channel_read_line (source, &str, NULL, NULL, NULL) == G_IO_STATUS_NORMAL) {
+    int index = atoi (str);
+    if (index < 0 || index >= data->n_audio) {
+      g_printerr ("Index out of bounds\n");
+    } else {
+      /* If the input was a valid audio stream index, set the current audio stream */
+      g_print ("Setting current audio stream to %d\n", index);
+      g_object_set (data->playbin, "current-audio", index, NULL);
+    }
+  }
+  g_free (str);
+  return TRUE;
+}
+```
+
+Finally, we allow the user to switch the running audio stream. This very
+basic function just reads a string from the standard input (the
+keyboard), interprets it as a number, and tries to set the
+`current-audio` property of `playbin` (which previously we have only
+read).
+
+Bear in mind that the switch is not immediate. Some of the previously
+decoded audio will still be flowing through the pipeline, while the new
+stream becomes active and is decoded. The delay depends on the
+particular multiplexing of the streams in the container, and the length
+`playbin` has selected for its internal queues (which depends on the
+network conditions).
+
+If you execute the tutorial, you will be able to switch from one
+language to another while the movie is running by pressing 0, 1 or 2
+(and ENTER). This concludes this tutorial.
+
+# Conclusion
+
+This tutorial has shown:
+
+  - A few more of `playbin`'s properties: `flags`, `connection-speed`,
+    `n-video`, `n-audio`, `n-text`, `current-video`, `current-audio` and
+    `current-text`.
+
+  - How to retrieve the list of tags associated with a stream
+    with `g_signal_emit_by_name()`.
+
+  - How to retrieve a particular tag from the list with
+    `gst_tag_list_get_string()`or `gst_tag_list_get_uint()`
+
+  - How to switch the current audio simply by writing to the
+    `current-audio` property.
+
+The next playback tutorial shows how to handle subtitles, either
+embedded in the container or in an external file.
+
+Remember that attached to this page you should find the complete source
+code of the tutorial and any accessory files needed to build it.
+
+It has been a pleasure having you here, and see you soon\!
diff --git a/Playback+tutorial+1+Playbin2+usage.markdown b/Playback+tutorial+1+Playbin2+usage.markdown
deleted file mode 100644 (file)
index 797b687..0000000
+++ /dev/null
@@ -1,642 +0,0 @@
-# Playback tutorial 1: Playbin usage
-
-# Goal
-
-We have already worked with the `playbin2` element, which is capable of
-building a complete playback pipeline without much work on our side.
-This tutorial shows how to further customize `playbin2` in case its
-default values do not suit our particular needs.
-
-We will learn:
-
-  - How to find out how many streams a file contains, and how to switch
-    among them.
-
-  - How to gather information regarding each stream.
-
-As a side note, even though its name is `playbin2`, you can pronounce it
-“playbin”, since the original `playbin` element is deprecated and nobody
-should be using it.
-
-# Introduction
-
-More often than not, multiple audio, video and subtitle streams can be
-found embedded in a single file. The most common case are regular
-movies, which contain one video and one audio stream (Stereo or 5.1
-audio tracks are considered a single stream). It is also increasingly
-common to find movies with one video and multiple audio streams, to
-account for different languages. In this case, the user selects one
-audio stream, and the application will only play that one, ignoring the
-others.
-
-To be able to select the appropriate stream, the user needs to know
-certain information about them, for example, their language. This
-information is embedded in the streams in the form of “metadata”
-(annexed data), and this tutorial shows how to retrieve it.
-
-Subtitles can also be embedded in a file, along with audio and video,
-but they are dealt with in more detail in [Playback tutorial 2: Subtitle
-management](Playback%2Btutorial%2B2%253A%2BSubtitle%2Bmanagement.html).
-Finally, multiple video streams can also be found in a single file, for
-example, in DVD with multiple angles of the same scene, but they are
-somewhat rare.
-
-> ![](images/icons/emoticons/information.png) Embedding multiple streams
-> inside a single file is called “multiplexing” or “muxing”, and such file
-> is then known as a “container”. Common container formats are Matroska
-> (.mkv), Quicktime (.qt, .mov, .mp4), Ogg (.ogg) or Webm (.webm).
->
->
-> Retrieving the individual streams from within the container is called
-> “demultiplexing” or “demuxing”.
-
-The following code recovers the amount of streams in the file, their
-associated metadata, and allows switching the audio stream while the
-media is playing.
-
-# The multilingual player
-
-Copy this code into a text file named `playback-tutorial-1.c` (or find
-it in the SDK installation).
-
-**playback-tutorial-1.c**
-
-``` lang=c
-#include <gst/gst.h>
-
-/* Structure to contain all our information, so we can pass it around */
-typedef struct _CustomData {
-  GstElement *playbin2;  /* Our one and only element */
-
-  gint n_video;          /* Number of embedded video streams */
-  gint n_audio;          /* Number of embedded audio streams */
-  gint n_text;           /* Number of embedded subtitle streams */
-
-  gint current_video;    /* Currently playing video stream */
-  gint current_audio;    /* Currently playing audio stream */
-  gint current_text;     /* Currently playing subtitle stream */
-
-  GMainLoop *main_loop;  /* GLib's Main Loop */
-} CustomData;
-
-/* playbin2 flags */
-typedef enum {
-  GST_PLAY_FLAG_VIDEO         = (1 << 0), /* We want video output */
-  GST_PLAY_FLAG_AUDIO         = (1 << 1), /* We want audio output */
-  GST_PLAY_FLAG_TEXT          = (1 << 2)  /* We want subtitle output */
-} GstPlayFlags;
-
-/* Forward definition for the message and keyboard processing functions */
-static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data);
-static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data);
-
-int main(int argc, char *argv[]) {
-  CustomData data;
-  GstBus *bus;
-  GstStateChangeReturn ret;
-  gint flags;
-  GIOChannel *io_stdin;
-
-  /* Initialize GStreamer */
-  gst_init (&argc, &argv);
-
-  /* Create the elements */
-  data.playbin2 = gst_element_factory_make ("playbin2", "playbin2");
-
-  if (!data.playbin2) {
-    g_printerr ("Not all elements could be created.\n");
-    return -1;
-  }
-
-  /* Set the URI to play */
-  g_object_set (data.playbin2, "uri", "http://docs.gstreamer.com/media/sintel_cropped_multilingual.webm", NULL);
-
-  /* Set flags to show Audio and Video but ignore Subtitles */
-  g_object_get (data.playbin2, "flags", &flags, NULL);
-  flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO;
-  flags &= ~GST_PLAY_FLAG_TEXT;
-  g_object_set (data.playbin2, "flags", flags, NULL);
-
-  /* Set connection speed. This will affect some internal decisions of playbin2 */
-  g_object_set (data.playbin2, "connection-speed", 56, NULL);
-
-  /* Add a bus watch, so we get notified when a message arrives */
-  bus = gst_element_get_bus (data.playbin2);
-  gst_bus_add_watch (bus, (GstBusFunc)handle_message, &data);
-
-  /* Add a keyboard watch so we get notified of keystrokes */
-#ifdef _WIN32
-  io_stdin = g_io_channel_win32_new_fd (fileno (stdin));
-#else
-  io_stdin = g_io_channel_unix_new (fileno (stdin));
-#endif
-  g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc)handle_keyboard, &data);
-
-  /* Start playing */
-  ret = gst_element_set_state (data.playbin2, GST_STATE_PLAYING);
-  if (ret == GST_STATE_CHANGE_FAILURE) {
-    g_printerr ("Unable to set the pipeline to the playing state.\n");
-    gst_object_unref (data.playbin2);
-    return -1;
-  }
-
-  /* Create a GLib Main Loop and set it to run */
-  data.main_loop = g_main_loop_new (NULL, FALSE);
-  g_main_loop_run (data.main_loop);
-
-  /* Free resources */
-  g_main_loop_unref (data.main_loop);
-  g_io_channel_unref (io_stdin);
-  gst_object_unref (bus);
-  gst_element_set_state (data.playbin2, GST_STATE_NULL);
-  gst_object_unref (data.playbin2);
-  return 0;
-}
-
-/* Extract some metadata from the streams and print it on the screen */
-static void analyze_streams (CustomData *data) {
-  gint i;
-  GstTagList *tags;
-  gchar *str;
-  guint rate;
-
-  /* Read some properties */
-  g_object_get (data->playbin2, "n-video", &data->n_video, NULL);
-  g_object_get (data->playbin2, "n-audio", &data->n_audio, NULL);
-  g_object_get (data->playbin2, "n-text", &data->n_text, NULL);
-
-  g_print ("%d video stream(s), %d audio stream(s), %d text stream(s)\n",
-    data->n_video, data->n_audio, data->n_text);
-
-  g_print ("\n");
-  for (i = 0; i < data->n_video; i++) {
-    tags = NULL;
-    /* Retrieve the stream's video tags */
-    g_signal_emit_by_name (data->playbin2, "get-video-tags", i, &tags);
-    if (tags) {
-      g_print ("video stream %d:\n", i);
-      gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str);
-      g_print ("  codec: %s\n", str ? str : "unknown");
-      g_free (str);
-      gst_tag_list_free (tags);
-    }
-  }
-
-  g_print ("\n");
-  for (i = 0; i < data->n_audio; i++) {
-    tags = NULL;
-    /* Retrieve the stream's audio tags */
-    g_signal_emit_by_name (data->playbin2, "get-audio-tags", i, &tags);
-    if (tags) {
-      g_print ("audio stream %d:\n", i);
-      if (gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &str)) {
-        g_print ("  codec: %s\n", str);
-        g_free (str);
-      }
-      if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) {
-        g_print ("  language: %s\n", str);
-        g_free (str);
-      }
-      if (gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &rate)) {
-        g_print ("  bitrate: %d\n", rate);
-      }
-      gst_tag_list_free (tags);
-    }
-  }
-
-  g_print ("\n");
-  for (i = 0; i < data->n_text; i++) {
-    tags = NULL;
-    /* Retrieve the stream's subtitle tags */
-    g_signal_emit_by_name (data->playbin2, "get-text-tags", i, &tags);
-    if (tags) {
-      g_print ("subtitle stream %d:\n", i);
-      if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) {
-        g_print ("  language: %s\n", str);
-        g_free (str);
-      }
-      gst_tag_list_free (tags);
-    }
-  }
-
-  g_object_get (data->playbin2, "current-video", &data->current_video, NULL);
-  g_object_get (data->playbin2, "current-audio", &data->current_audio, NULL);
-  g_object_get (data->playbin2, "current-text", &data->current_text, NULL);
-
-  g_print ("\n");
-  g_print ("Currently playing video stream %d, audio stream %d and text stream %d\n",
-    data->current_video, data->current_audio, data->current_text);
-  g_print ("Type any number and hit ENTER to select a different audio stream\n");
-}
-
-/* Process messages from GStreamer */
-static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data) {
-  GError *err;
-  gchar *debug_info;
-
-  switch (GST_MESSAGE_TYPE (msg)) {
-    case GST_MESSAGE_ERROR:
-      gst_message_parse_error (msg, &err, &debug_info);
-      g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME (msg->src), err->message);
-      g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
-      g_clear_error (&err);
-      g_free (debug_info);
-      g_main_loop_quit (data->main_loop);
-      break;
-    case GST_MESSAGE_EOS:
-      g_print ("End-Of-Stream reached.\n");
-      g_main_loop_quit (data->main_loop);
-      break;
-    case GST_MESSAGE_STATE_CHANGED: {
-      GstState old_state, new_state, pending_state;
-      gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);
-      if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->playbin2)) {
-        if (new_state == GST_STATE_PLAYING) {
-          /* Once we are in the playing state, analyze the streams */
-          analyze_streams (data);
-        }
-      }
-    } break;
-  }
-
-  /* We want to keep receiving messages */
-  return TRUE;
-}
-
-/* Process keyboard input */
-static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data) {
-  gchar *str = NULL;
-
-  if (g_io_channel_read_line (source, &str, NULL, NULL, NULL) == G_IO_STATUS_NORMAL) {
-    int index = atoi (str);
-    if (index < 0 || index >= data->n_audio) {
-      g_printerr ("Index out of bounds\n");
-    } else {
-      /* If the input was a valid audio stream index, set the current audio stream */
-      g_print ("Setting current audio stream to %d\n", index);
-      g_object_set (data->playbin2, "current-audio", index, NULL);
-    }
-  }
-  g_free (str);
-  return TRUE;
-}
-```
-
-> ![](images/icons/emoticons/information.png) If you need help to compile this code, refer to the **Building the
-> tutorials** section for your platform: [Mac](Installing+on+Mac+OS+X.markdown) or [Windows](Installing+on+Windows)
-> or use this specific command on Linux:
-> ```gcc playback-tutorial-1.c -o playback-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0` ```
-
-If you need help to run this code, refer to the **Running the
-tutorials** section for your platform:
-[Mac OS X](Installing+on+Mac+OS+X.markdown#building-the-tutorials),
-[Windows](Installing+on+Windows.markdown#running-the-tutorials), for
-[iOS](Installing+for+iOS+development.markdown#building-the-tutorials) or for
-[android](Installing+for+Android+development.markdown#building-the-tutorials).
-
-This tutorial opens a window and displays a movie, with accompanying
-audio. The media is fetched from the Internet, so the window might take
-a few seconds to appear, depending on your connection speed. The number
-of audio streams is shown in the terminal, and the user can switch from
-one to another by entering a number and pressing enter. A small delay is
-to be expected.
-
-</p>
-
-<p>
-
-Bear in mind that there is no latency management (buffering), so on slow
-connections, the movie might stop after a few seconds. See
-how <a href="http://docs.gstreamer.com/display/GstSDK/Tutorial+12%3A+Live+streaming">Tutorial
-12: Live streaming</a> solves this issue.
-
-</p>
-
-<p>
-
-</p>
-
-<p>
-
-Required libraries: <code>gstreamer-0.10</code>
-
-</p>
-
-</td>
-
-</tr>
-
-</tbody>
-
-</table>
-
-# Walkthrough
-
-``` lang=c
-/* Structure to contain all our information, so we can pass it around */
-typedef struct _CustomData {
-  GstElement *playbin2;  /* Our one and only element */
-
-  gint n_video;          /* Number of embedded video streams */
-  gint n_audio;          /* Number of embedded audio streams */
-  gint n_text;           /* Number of embedded subtitle streams */
-
-  gint current_video;    /* Currently playing video stream */
-  gint current_audio;    /* Currently playing audio stream */
-  gint current_text;     /* Currently playing subtitle stream */
-
-  GMainLoop *main_loop;  /* GLib's Main Loop */
-} CustomData;
-```
-
-We start, as usual, putting all our variables in a structure, so we can
-pass it around to functions. For this tutorial, we need the amount of
-streams of each type, and the currently playing one. Also, we are going
-to use a different mechanism to wait for messages that allows
-interactivity, so we need a GLib's main loop object.
-
-``` lang=c
-/* playbin2 flags */
-typedef enum {
-  GST_PLAY_FLAG_VIDEO         = (1 << 0), /* We want video output */
-  GST_PLAY_FLAG_AUDIO         = (1 << 1), /* We want audio output */
-  GST_PLAY_FLAG_TEXT          = (1 << 2)  /* We want subtitle output */
-} GstPlayFlags;
-```
-
-Later we are going to set some of `playbin2`'s flags. We would like to
-have a handy enum that allows manipulating these flags easily, but since
-`playbin2` is a plug-in and not a part of the GStreamer core, this enum
-is not available to us. The “trick” is simply to declare this enum in
-our code, as it appears in the `playbin2` documentation: `GstPlayFlags`.
-GObject allows introspection, so the possible values for these flags can
-be retrieved at runtime without using this trick, but in a far more
-cumbersome
-way.
-
-``` lang=c
-/* Forward definition for the message and keyboard processing functions */
-static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data);
-static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data);
-```
-
-Forward declarations for the two callbacks we will be using.
-`handle_message` for the GStreamer messages, as we have already seen,
-and `handle_keyboard` for key strokes, since this tutorial is
-introducing a limited amount of interactivity.
-
-We skip over the creation of the pipeline, the instantiation of
-`playbin2` and pointing it to our test media through the `uri`
-property. `playbin2` is in itself a pipeline, and in this case it is
-the only element in the pipeline, so we skip completely the creation of
-the pipeline, and use directly the  `playbin2` element.
-
-We focus on some of the other properties of `playbin2`, though:
-
-``` lang=c
-/* Set flags to show Audio and Video but ignore Subtitles */
-g_object_get (data.playbin2, "flags", &flags, NULL);
-flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO;
-flags &= ~GST_PLAY_FLAG_TEXT;
-g_object_set (data.playbin2, "flags", flags, NULL);
-```
-
-`playbin2`'s behavior can be changed through its `flags` property, which
-can have any combination of `GstPlayFlags`. The most interesting values
-are:
-
-|                           |                                                                                                                                    |
-|---------------------------|------------------------------------------------------------------------------------------------------------------------------------|
-| GST_PLAY_FLAG_VIDEO       | Enable video rendering. If this flag is not set, there will be no video output.                                                    |
-| GST_PLAY_FLAG_AUDIO       | Enable audio rendering. If this flag is not set, there will be no audio output.                                                    |
-| GST_PLAY_FLAG_TEXT        | Enable subtitle rendering. If this flag is not set, subtitles will not be shown in the video output.                               |
-| GST_PLAY_FLAG_VIS         | Enable rendering of visualisations when there is no video stream. Playback tutorial 6: Audio visualization goes into more details. |
-| GST_PLAY_FLAG_DOWNLOAD    | See Basic tutorial 12: Streaming  and Playback tutorial 4: Progressive streaming.                                                  |
-| GST_PLAY_FLAG_BUFFERING   | See Basic tutorial 12: Streaming  and Playback tutorial 4: Progressive streaming.                                                  |
-| GST_PLAY_FLAG_DEINTERLACE | If the video content was interlaced, this flag instructs playbin2 to deinterlace it before displaying it.                          |
-
-In our case, for demonstration purposes, we are enabling audio and video
-and disabling subtitles, leaving the rest of flags to their default
-values (this is why we read the current value of the flags with
-`g_object_get()` before overwriting it with
-`g_object_set()`).
-
-``` lang=c
-/* Set connection speed. This will affect some internal decisions of playbin2 */
-g_object_set (data.playbin2, "connection-speed", 56, NULL);
-```
-
-This property is not really useful in this example.
-`connection-speed` informs `playbin2` of the maximum speed of our
-network connection, so, in case multiple versions of the requested media
-are available in the server, `playbin2` chooses the most
-appropriate. This is mostly used in combination with streaming
-protocols like `mms` or `rtsp`.
-
-We have set all these properties one by one, but we could have all of
-them with a single call to
-`g_object_set()`:
-
-``` lang=c
-g_object_set (data.playbin2, "uri", "http://docs.gstreamer.com/media/sintel_cropped_multilingual.webm", "flags", flags, "connection-speed", 56, NULL);
-```
-
-This is why `g_object_set()` requires a NULL as the last parameter.
-
-``` lang=c
-  /* Add a keyboard watch so we get notified of keystrokes */
-#ifdef _WIN32
-  io_stdin = g_io_channel_win32_new_fd (fileno (stdin));
-#else
-  io_stdin = g_io_channel_unix_new (fileno (stdin));
-#endif
-  g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc)handle_keyboard, &data);
-```
-
-These lines connect a callback function to the standard input (the
-keyboard). The mechanism shown here is specific to GLib, and not really
-related to GStreamer, so there is no point in going into much depth.
-Applications normally have their own way of handling user input, and
-GStreamer has little to do with it besides the Navigation interface
-discussed briefly in [Tutorial 17: DVD
-playback](http://docs.gstreamer.com/display/GstSDK/Tutorial+17%3A+DVD+playback).
-
-``` lang=c
-/* Create a GLib Main Loop and set it to run */
-data.main_loop = g_main_loop_new (NULL, FALSE);
-g_main_loop_run (data.main_loop);
-```
-
-To allow interactivity, we will no longer poll the GStreamer bus
-manually. Instead, we create a `GMainLoop`(GLib main loop) and set it
-running with `g_main_loop_run()`. This function blocks and will not
-return until `g_main_loop_quit()` is issued. In the meantime, it will
-call the callbacks we have registered at the appropriate
-times: `handle_message` when a message appears on the bus, and
-`handle_keyboard` when the user presses any key.
-
-There is nothing new in handle\_message, except that when the pipeline
-moves to the PLAYING state, it will call the `analyze_streams` function:
-
-``` lang=c
-/* Extract some metadata from the streams and print it on the screen */
-static void analyze_streams (CustomData *data) {
-  gint i;
-  GstTagList *tags;
-  gchar *str;
-  guint rate;
-
-  /* Read some properties */
-  g_object_get (data->playbin2, "n-video", &data->n_video, NULL);
-  g_object_get (data->playbin2, "n-audio", &data->n_audio, NULL);
-  g_object_get (data->playbin2, "n-text", &data->n_text, NULL);
-```
-
-As the comment says, this function just gathers information from the
-media and prints it on the screen. The number of video, audio and
-subtitle streams is directly available through the `n-video`,
-`n-audio` and `n-text` properties.
-
-``` lang=c
-for (i = 0; i < data->n_video; i++) {
-  tags = NULL;
-  /* Retrieve the stream's video tags */
-  g_signal_emit_by_name (data->playbin2, "get-video-tags", i, &tags);
-  if (tags) {
-    g_print ("video stream %d:\n", i);
-    gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str);
-    g_print ("  codec: %s\n", str ? str : "unknown");
-    g_free (str);
-    gst_tag_list_free (tags);
-  }
-}
-```
-
-Now, for each stream, we want to retrieve its metadata. Metadata is
-stored as tags in a `GstTagList` structure, which is a list of data
-pieces identified by a name. The `GstTagList` associated with a stream
-can be recovered with `g_signal_emit_by_name()`, and then individual
-tags are extracted with the `gst_tag_list_get_*` functions
-like `gst_tag_list_get_string()` for
-example.
-
-<table>
-
-<tbody>
-
-<tr class="odd">
-
-<td>
-
-<img src="images/icons/emoticons/information.png" width="16" height="16" />
-
-</td>
-
-<td>
-
-<p>
-
-This rather unintuitive way of retrieving the tag list is called an
-Action Signal. Action signals are emitted by the application to a
-specific element, which then performs an action and returns a result.
-They behave like a dynamic function call, in which methods of a class
-are identified by their name (the signal's name) instead of their memory
-address. These signals are listed In the documentation along with the
-regular signals, and are tagged “Action”. See <code>playbin2</code>, for
-example.
-
-</p>
-
-</td>
-
-</tr>
-
-</tbody>
-
-</table>
-
-`playbin2` defines 3 action signals to retrieve
-metadata: `get-video-tags`, `get-audio-tags` and `get-text-tags`.  The
-name if the tags is standardized, and the list can be found in the
-`GstTagList` documentation. In this example we are interested in the
-`GST_TAG_LANGUAGE_CODE` of the streams and their
-`GST_TAG_*_CODEC` (audio, video or
-text).
-
-``` lang=c
-g_object_get (data->playbin2, "current-video", &data->current_video, NULL);
-g_object_get (data->playbin2, "current-audio", &data->current_audio, NULL);
-g_object_get (data->playbin2, "current-text", &data->current_text, NULL);
-```
-
-Once we have extracted all the metadata we want, we get the streams that
-are currently selected through 3 more properties of `playbin2`:
-`current-video`, `current-audio` and `current-text`. 
-
-It is interesting to always check the currently selected streams and
-never make any assumption. Multiple internal conditions can make
-`playbin2` behave differently in different executions. Also, the order
-in which the streams are listed can change from one run to another, so
-checking the metadata to identify one particular stream becomes crucial.
-
-``` lang=c
-/* Process keyboard input */
-static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data) {
-  gchar *str = NULL;
-
-  if (g_io_channel_read_line (source, &str, NULL, NULL, NULL) == G_IO_STATUS_NORMAL) {
-    int index = atoi (str);
-    if (index < 0 || index >= data->n_audio) {
-      g_printerr ("Index out of bounds\n");
-    } else {
-      /* If the input was a valid audio stream index, set the current audio stream */
-      g_print ("Setting current audio stream to %d\n", index);
-      g_object_set (data->playbin2, "current-audio", index, NULL);
-    }
-  }
-  g_free (str);
-  return TRUE;
-}
-```
-
-Finally, we allow the user to switch the running audio stream. This very
-basic function just reads a string from the standard input (the
-keyboard), interprets it as a number, and tries to set the
-`current-audio` property of `playbin2` (which previously we have only
-read).
-
-Bear in mind that the switch is not immediate. Some of the previously
-decoded audio will still be flowing through the pipeline, while the new
-stream becomes active and is decoded. The delay depends on the
-particular multiplexing of the streams in the container, and the length
-`playbin2` has selected for its internal queues (which depends on the
-network conditions).
-
-If you execute the tutorial, you will be able to switch from one
-language to another while the movie is running by pressing 0, 1 or 2
-(and ENTER). This concludes this tutorial.
-
-# Conclusion
-
-This tutorial has shown:
-
-  - A few more of `playbin2`'s properties: `flags`, `connection-speed`,
-    `n-video`, `n-audio`, `n-text`, `current-video`, `current-audio` and
-    `current-text`.
-
-  - How to retrieve the list of tags associated with a stream
-    with `g_signal_emit_by_name()`.
-
-  - How to retrieve a particular tag from the list with
-    `gst_tag_list_get_string()`or `gst_tag_list_get_uint()`
-
-  - How to switch the current audio simply by writing to the
-    `current-audio` property.
-
-The next playback tutorial shows how to handle subtitles, either
-embedded in the container or in an external file.
-
-Remember that attached to this page you should find the complete source
-code of the tutorial and any accessory files needed to build it.
-
-It has been a pleasure having you here, and see you soon\!
index 69c8480e366f6b8ce16da641bcdc9e4778a5d6f3..59a10815cc79373dc949b5ea8b12b86cf7b28717 100644 (file)
@@ -17,16 +17,16 @@ This will allow us to learn:
 We already know (from the previous tutorial) that container files can
 hold multiple audio and video streams, and that we can very easily
 choose among them by changing the `current-audio` or
-`current-video` `playbin2` property. Switching subtitles is just as
+`current-video` `playbin` property. Switching subtitles is just as
 easy.
 
 It is worth noting that, just like it happens with audio and video,
-`playbin2` takes care of choosing the right decoder for the subtitles,
+`playbin` takes care of choosing the right decoder for the subtitles,
 and that the plugin structure of GStreamer allows adding support for new
 formats as easily as copying a file. Everything is invisible to the
 application developer.
 
-Besides subtitles embedded in the container, `playbin2` offers the
+Besides subtitles embedded in the container, `playbin` offers the
 possibility to add an extra subtitle stream from an external URI.
 
 This tutorial opens a file which already contains 5 subtitle streams,
@@ -44,7 +44,7 @@ it in the SDK installation).
 
 /* Structure to contain all our information, so we can pass it around */
 typedef struct _CustomData {
-  GstElement *playbin2;  /* Our one and only element */
+  GstElement *playbin;  /* Our one and only element */
 
   gint n_video;          /* Number of embedded video streams */
   gint n_audio;          /* Number of embedded audio streams */
@@ -57,7 +57,7 @@ typedef struct _CustomData {
   GMainLoop *main_loop;  /* GLib's Main Loop */
 } CustomData;
 
-/* playbin2 flags */
+/* playbin flags */
 typedef enum {
   GST_PLAY_FLAG_VIDEO         = (1 << 0), /* We want video output */
   GST_PLAY_FLAG_AUDIO         = (1 << 1), /* We want audio output */
@@ -79,27 +79,27 @@ int main(int argc, char *argv[]) {
   gst_init (&argc, &argv);
 
   /* Create the elements */
-  data.playbin2 = gst_element_factory_make ("playbin2", "playbin2");
+  data.playbin = gst_element_factory_make ("playbin", "playbin");
 
-  if (!data.playbin2) {
+  if (!data.playbin) {
     g_printerr ("Not all elements could be created.\n");
     return -1;
   }
 
   /* Set the URI to play */
-  g_object_set (data.playbin2, "uri", "http://docs.gstreamer.com/media/sintel_trailer-480p.ogv", NULL);
+  g_object_set (data.playbin, "uri", "http://docs.gstreamer.com/media/sintel_trailer-480p.ogv", NULL);
 
   /* Set the subtitle URI to play and some font description */
-  g_object_set (data.playbin2, "suburi", "http://docs.gstreamer.com/media/sintel_trailer_gr.srt", NULL);
-  g_object_set (data.playbin2, "subtitle-font-desc", "Sans, 18", NULL);
+  g_object_set (data.playbin, "suburi", "http://docs.gstreamer.com/media/sintel_trailer_gr.srt", NULL);
+  g_object_set (data.playbin, "subtitle-font-desc", "Sans, 18", NULL);
 
   /* Set flags to show Audio, Video and Subtitles */
-  g_object_get (data.playbin2, "flags", &flags, NULL);
+  g_object_get (data.playbin, "flags", &flags, NULL);
   flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_TEXT;
-  g_object_set (data.playbin2, "flags", flags, NULL);
+  g_object_set (data.playbin, "flags", flags, NULL);
 
   /* Add a bus watch, so we get notified when a message arrives */
-  bus = gst_element_get_bus (data.playbin2);
+  bus = gst_element_get_bus (data.playbin);
   gst_bus_add_watch (bus, (GstBusFunc)handle_message, &data);
 
   /* Add a keyboard watch so we get notified of keystrokes */
@@ -111,10 +111,10 @@ int main(int argc, char *argv[]) {
   g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc)handle_keyboard, &data);
 
   /* Start playing */
-  ret = gst_element_set_state (data.playbin2, GST_STATE_PLAYING);
+  ret = gst_element_set_state (data.playbin, GST_STATE_PLAYING);
   if (ret == GST_STATE_CHANGE_FAILURE) {
     g_printerr ("Unable to set the pipeline to the playing state.\n");
-    gst_object_unref (data.playbin2);
+    gst_object_unref (data.playbin);
     return -1;
   }
 
@@ -126,8 +126,8 @@ int main(int argc, char *argv[]) {
   g_main_loop_unref (data.main_loop);
   g_io_channel_unref (io_stdin);
   gst_object_unref (bus);
-  gst_element_set_state (data.playbin2, GST_STATE_NULL);
-  gst_object_unref (data.playbin2);
+  gst_element_set_state (data.playbin, GST_STATE_NULL);
+  gst_object_unref (data.playbin);
   return 0;
 }
 
@@ -139,9 +139,9 @@ static void analyze_streams (CustomData *data) {
   guint rate;
 
   /* Read some properties */
-  g_object_get (data->playbin2, "n-video", &data->n_video, NULL);
-  g_object_get (data->playbin2, "n-audio", &data->n_audio, NULL);
-  g_object_get (data->playbin2, "n-text", &data->n_text, NULL);
+  g_object_get (data->playbin, "n-video", &data->n_video, NULL);
+  g_object_get (data->playbin, "n-audio", &data->n_audio, NULL);
+  g_object_get (data->playbin, "n-text", &data->n_text, NULL);
 
   g_print ("%d video stream(s), %d audio stream(s), %d text stream(s)\n",
     data->n_video, data->n_audio, data->n_text);
@@ -150,7 +150,7 @@ static void analyze_streams (CustomData *data) {
   for (i = 0; i < data->n_video; i++) {
     tags = NULL;
     /* Retrieve the stream's video tags */
-    g_signal_emit_by_name (data->playbin2, "get-video-tags", i, &tags);
+    g_signal_emit_by_name (data->playbin, "get-video-tags", i, &tags);
     if (tags) {
       g_print ("video stream %d:\n", i);
       gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str);
@@ -164,7 +164,7 @@ static void analyze_streams (CustomData *data) {
   for (i = 0; i < data->n_audio; i++) {
     tags = NULL;
     /* Retrieve the stream's audio tags */
-    g_signal_emit_by_name (data->playbin2, "get-audio-tags", i, &tags);
+    g_signal_emit_by_name (data->playbin, "get-audio-tags", i, &tags);
     if (tags) {
       g_print ("audio stream %d:\n", i);
       if (gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &str)) {
@@ -187,7 +187,7 @@ static void analyze_streams (CustomData *data) {
     tags = NULL;
     /* Retrieve the stream's subtitle tags */
     g_print ("subtitle stream %d:\n", i);
-    g_signal_emit_by_name (data->playbin2, "get-text-tags", i, &tags);
+    g_signal_emit_by_name (data->playbin, "get-text-tags", i, &tags);
     if (tags) {
       if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) {
         g_print ("  language: %s\n", str);
@@ -199,9 +199,9 @@ static void analyze_streams (CustomData *data) {
     }
   }
 
-  g_object_get (data->playbin2, "current-video", &data->current_video, NULL);
-  g_object_get (data->playbin2, "current-audio", &data->current_audio, NULL);
-  g_object_get (data->playbin2, "current-text", &data->current_text, NULL);
+  g_object_get (data->playbin, "current-video", &data->current_video, NULL);
+  g_object_get (data->playbin, "current-audio", &data->current_audio, NULL);
+  g_object_get (data->playbin, "current-text", &data->current_text, NULL);
 
   g_print ("\n");
   g_print ("Currently playing video stream %d, audio stream %d and subtitle stream %d\n",
@@ -230,7 +230,7 @@ static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data)
     case GST_MESSAGE_STATE_CHANGED: {
       GstState old_state, new_state, pending_state;
       gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);
-      if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->playbin2)) {
+      if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->playbin)) {
         if (new_state == GST_STATE_PLAYING) {
           /* Once we are in the playing state, analyze the streams */
           analyze_streams (data);
@@ -254,7 +254,7 @@ static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomDa
     } else {
       /* If the input was a valid subtitle stream index, set the current subtitle stream */
       g_print ("Setting current subtitle stream to %d\n", index);
-      g_object_set (data->playbin2, "current-text", index, NULL);
+      g_object_set (data->playbin, "current-text", index, NULL);
     }
   }
   g_free (str);
@@ -291,18 +291,18 @@ static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomDa
 
 # Walkthrough
 
-This tutorial is copied from [Playback tutorial 1: Playbin2
-usage](Playback%2Btutorial%2B1%253A%2BPlaybin2%2Busage.html) with some
+This tutorial is copied from [Playback tutorial 1: Playbin
+usage](Playback%2Btutorial%2B1%253A%2BPlaybin%2Busage.html) with some
 changes, so let's review only the changes.
 
 ``` lang=c
 /* Set the subtitle URI to play and some font description */
-g_object_set (data.playbin2, "suburi", "http://docs.gstreamer.com/media/sintel_trailer_gr.srt", NULL);
-g_object_set (data.playbin2, "subtitle-font-desc", "Sans, 18", NULL);
+g_object_set (data.playbin, "suburi", "http://docs.gstreamer.com/media/sintel_trailer_gr.srt", NULL);
+g_object_set (data.playbin, "subtitle-font-desc", "Sans, 18", NULL);
 ```
 
 After setting the media URI, we set the `suburi` property, which points
-`playbin2` to a file containing a subtitle stream. In this case, the
+`playbin` to a file containing a subtitle stream. In this case, the
 media file already contains multiple subtitle streams, so the one
 provided in the `suburi` is added to the list, and will be the currently
 selected one.
@@ -351,15 +351,15 @@ Extra-Expanded, Ultra-Expanded
 
 ``` lang=c
 /* Set flags to show Audio, Video and Subtitles */
-g_object_get (data.playbin2, "flags", &flags, NULL);
+g_object_get (data.playbin, "flags", &flags, NULL);
 flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_TEXT;
-g_object_set (data.playbin2, "flags", flags, NULL);
+g_object_set (data.playbin, "flags", flags, NULL);
 ```
 
 We set the `flags` property to allow Audio, Video and Text (Subtitles).
 
-The rest of the tutorial is the same as [Playback tutorial 1: Playbin2
-usage](Playback%2Btutorial%2B1%253A%2BPlaybin2%2Busage.html), except
+The rest of the tutorial is the same as [Playback tutorial 1: Playbin
+usage](Playback%2Btutorial%2B1%253A%2BPlaybin%2Busage.html), except
 that the keyboard input changes the `current-text` property instead of
 the `current-audio`. As before, keep in mind that stream changes are not
 immediate, since there is a lot of information flowing through the
@@ -368,11 +368,11 @@ up.
 
 # Conclusion
 
-This tutorial showed how to handle subtitles from `playbin2`, whether
+This tutorial showed how to handle subtitles from `playbin`, whether
 they are embedded in the container or in a different file:
 
   - Subtitles are chosen using the `current-tex`t and `n-tex`t
-    properties of `playbin2`.
+    properties of `playbin`.
 
   - External subtitle files can be selected using the `suburi` property.
 
index a2424b1e2b42d3d8e84ac6764f559ff0a88a6cae..839279275bad3edbc2bebe3c860475722d768e06 100644 (file)
@@ -6,16 +6,16 @@
 pipeline](Basic%2Btutorial%2B8%253A%2BShort-cutting%2Bthe%2Bpipeline.html) showed
 how an application can manually extract or inject data into a pipeline
 by using two special elements called `appsrc` and `appsink`.
-`playbin2` allows using these elements too, but the method to connect
-them is different. To connect an `appsink` to `playbin2` see [Playback
-tutorial 7: Custom playbin2
-sinks](Playback%2Btutorial%2B7%253A%2BCustom%2Bplaybin2%2Bsinks.html).
+`playbin` allows using these elements too, but the method to connect
+them is different. To connect an `appsink` to `playbin` see [Playback
+tutorial 7: Custom playbin
+sinks](Playback%2Btutorial%2B7%253A%2BCustom%2Bplaybin%2Bsinks.html).
 This tutorial shows:
 
-  - How to connect `appsrc` with `playbin2`
+  - How to connect `appsrc` with `playbin`
   - How to configure the `appsrc`
 
-# A playbin2 waveform generator
+# A playbin waveform generator
 
 Copy this code into a text file named `playback-tutorial-3.c`.
 
@@ -130,7 +130,7 @@ static void error_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
   g_main_loop_quit (data->main_loop);
 }
 
-/* This function is called when playbin2 has created the appsrc element, so we have
+/* This function is called when playbin has created the appsrc element, so we have
  * a chance to configure it. */
 static void source_setup (GstElement *pipeline, GstElement *source, CustomData *data) {
   gchar *audio_caps_text;
@@ -161,8 +161,8 @@ int main(int argc, char *argv[]) {
   /* Initialize GStreamer */
   gst_init (&argc, &argv);
 
-  /* Create the playbin2 element */
-  data.pipeline = gst_parse_launch ("playbin2 uri=appsrc://", NULL);
+  /* Create the playbin element */
+  data.pipeline = gst_parse_launch ("playbin uri=appsrc://", NULL);
   g_signal_connect (data.pipeline, "source-setup", G_CALLBACK (source_setup), &data);
 
   /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
@@ -186,14 +186,14 @@ int main(int argc, char *argv[]) {
 ```
 
 To use an `appsrc` as the source for the pipeline, simply instantiate a
-`playbin2` and set its URI to `appsrc://`
+`playbin` and set its URI to `appsrc://`
 
 ``` lang=c
-/* Create the playbin2 element */
-data.pipeline = gst_parse_launch ("playbin2 uri=appsrc://", NULL);
+/* Create the playbin element */
+data.pipeline = gst_parse_launch ("playbin uri=appsrc://", NULL);
 ```
 
-`playbin2` will create an internal `appsrc` element and fire the
+`playbin` will create an internal `appsrc` element and fire the
 `source-setup` signal to allow the application to configure
 it:
 
@@ -202,12 +202,12 @@ g_signal_connect (data.pipeline, "source-setup", G_CALLBACK (source_setup), &dat
 ```
 
 In particular, it is important to set the caps property of `appsrc`,
-since, once the signal handler returns, `playbin2` will instantiate the
+since, once the signal handler returns, `playbin` will instantiate the
 next element in the pipeline according to these
 caps:
 
 ``` lang=c
-/* This function is called when playbin2 has created the appsrc element, so we have
+/* This function is called when playbin has created the appsrc element, so we have
  * a chance to configure it. */
 static void source_setup (GstElement *pipeline, GstElement *source, CustomData *data) {
   gchar *audio_caps_text;
@@ -236,22 +236,22 @@ pushing data. See [Basic tutorial 8: Short-cutting the
 pipeline](Basic%2Btutorial%2B8%253A%2BShort-cutting%2Bthe%2Bpipeline.html)
 for more details.
 
-From this point onwards, `playbin2` takes care of the rest of the
+From this point onwards, `playbin` takes care of the rest of the
 pipeline, and the application only needs to worry about generating more
 data when told so.
 
-To learn how data can be extracted from `playbin2` using the
-`appsink` element, see [Playback tutorial 7: Custom playbin2
-sinks](Playback%2Btutorial%2B7%253A%2BCustom%2Bplaybin2%2Bsinks.html).
+To learn how data can be extracted from `playbin` using the
+`appsink` element, see [Playback tutorial 7: Custom playbin
+sinks](Playback%2Btutorial%2B7%253A%2BCustom%2Bplaybin%2Bsinks.html).
 
 # Conclusion
 
 This tutorial applies the concepts shown in [Basic tutorial 8:
 Short-cutting the
 pipeline](Basic%2Btutorial%2B8%253A%2BShort-cutting%2Bthe%2Bpipeline.html) to
-`playbin2`. In particular, it has shown:
+`playbin`. In particular, it has shown:
 
-  - How to connect `appsrc` with `playbin2` using the special
+  - How to connect `appsrc` with `playbin` using the special
     URI `appsrc://`
   - How to configure the `appsrc` using the `source-setup` signal
 
index 4a24b24d1de84b52022fbfd8d945739dd31b65b2..ef0abb1fbc3989f7fa6a2446e6b0fadb7cccbd1a 100644 (file)
@@ -30,7 +30,7 @@ downloaded data stored locally for this contingency. A graphical widget
 is also normally used to show how much of the file has already been
 downloaded.
 
-`playbin2` offers similar functionalities through the `DOWNLOAD` flag
+`playbin` offers similar functionalities through the `DOWNLOAD` flag
 which stores the media in a local temporary file for faster playback of
 already-downloaded chunks.
 
@@ -58,7 +58,7 @@ Copy this code into a text file named `playback-tutorial-4.c`.
 
 #define GRAPH_LENGTH 80
 
-/* playbin2 flags */
+/* playbin flags */
 typedef enum {
   GST_PLAY_FLAG_DOWNLOAD      = (1 << 7) /* Enable progressive download (on selected formats) */
 } GstPlayFlags;
@@ -182,7 +182,7 @@ int main(int argc, char *argv[]) {
   data.buffering_level = 100;
 
   /* Build the pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
   bus = gst_element_get_bus (pipeline);
 
   /* Set the download flag */
@@ -265,7 +265,7 @@ flags |= GST_PLAY_FLAG_DOWNLOAD;
 g_object_set (pipeline, "flags", flags, NULL);
 ```
 
-By setting this flag, `playbin2` instructs its internal queue (a
+By setting this flag, `playbin` instructs its internal queue (a
 `queue2` element, actually) to store all downloaded
 data.
 
@@ -274,7 +274,7 @@ g_signal_connect (pipeline, "deep-notify::temp-location", G_CALLBACK (got_locati
 ```
 
 `deep-notify` signals are emitted by `GstObject` elements (like
-`playbin2`) when the properties of any of their children elements
+`playbin`) when the properties of any of their children elements
 change. In this case we want to know when the `temp-location` property
 changes, indicating that the `queue2` has decided where to store the
 downloaded
@@ -340,7 +340,7 @@ static gboolean refresh_ui (CustomData *data) {
 
 The first thing we do in `refresh_ui` is construct a new Buffering
 `GstQuery` with `gst_query_new_buffering()` and pass it to the pipeline
-(`playbin2`) with `gst_element_query()`. In [Basic tutorial 4: Time
+(`playbin`) with `gst_element_query()`. In [Basic tutorial 4: Time
 management](Basic%2Btutorial%2B4%253A%2BTime%2Bmanagement.html) we have
 already seen how to perform simple queries like Position and Duration
 using specific methods. More complex queries, like Buffering, need to
@@ -428,12 +428,12 @@ file.
 This tutorial has shown:
 
   - How to enable progressive downloading with the
-    `GST_PLAY_FLAG_DOWNLOAD` `playbin2` flag
+    `GST_PLAY_FLAG_DOWNLOAD` `playbin` flag
   - How to know what has been downloaded using a Buffering `GstQuery`
   - How to know where it has been downloaded with the
     `deep-notify::temp-location` signal
   - How to limit the size of the temporary file with
-    the `ring-buffer-max-size` property of `playbin2`.
+    the `ring-buffer-max-size` property of `playbin`.
 
 It has been a pleasure having you here, and see you soon\!
 
index 097056dc74f588db0a1c9782094b85f94c06dc21..0889c194b8d8d80e33b0218d45097cd38db88448 100644 (file)
@@ -17,10 +17,10 @@ already explained the concept of GObject interfaces: applications use
 them to find out if certain functionality is available, regardless of
 the actual element which implements it.
 
-`playbin2` implements the Color Balance interface (`gstcolorbalance`),
+`playbin` implements the Color Balance interface (`gstcolorbalance`),
 which allows access to the color balance settings. If any of the
-elements in the `playbin2` pipeline support this interface,
-`playbin2` simply forwards it to the application, otherwise, a
+elements in the `playbin` pipeline support this interface,
+`playbin` simply forwards it to the application, otherwise, a
 colorbalance element is inserted in the pipeline.
 
 This interface allows querying for the available color balance channels
@@ -158,7 +158,7 @@ int main(int argc, char *argv[]) {
     " 'Q' to quit\n");
 
   /* Build the pipeline */
-  data.pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  data.pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
 
   /* Add a keyboard watch so we get notified of keystrokes */
 #ifdef _WIN32
@@ -219,7 +219,7 @@ int main(int argc, char *argv[]) {
 
 # Walkthrough
 
-The `main()` function is fairly simple. A `playbin2` pipeline is
+The `main()` function is fairly simple. A `playbin` pipeline is
 instantiated and set to run, and a keyboard watch is installed so
 keystrokes can be monitored.
 
index 7b40bcfca7cfda8feec01590ed174bc296c2a5aa..de850a6c89a484b837c26f9679e9c2ccc0294ac4 100644 (file)
@@ -11,18 +11,18 @@ player, for example. This tutorial shows:
 
 # Introduction
 
-Enabling audio visualization in `playbin2` is actually very easy. Just
-set the appropriate `playbin2` flag and, when an audio-only stream is
+Enabling audio visualization in `playbin` is actually very easy. Just
+set the appropriate `playbin` flag and, when an audio-only stream is
 found, it will instantiate the necessary elements to create and display
 the visualization.
 
 If you want to specify the actual element that you want to use to
 generate the visualization, you instantiate it yourself and then tell
-`playbin2` about it through the `vis-plugin` property.
+`playbin` about it through the `vis-plugin` property.
 
 This tutorial searches the GStreamer registry for all the elements of
 the Visualization class, tries to select `goom` (or another one if it is
-not available) and passes it to `playbin2`.
+not available) and passes it to `playbin`.
 
 # A fancy music player
 
@@ -42,7 +42,7 @@ Copy this code into a text file named `playback-tutorial-6.c`.
 ``` lang=c
 #include <gst/gst.h>
 
-/* playbin2 flags */
+/* playbin flags */
 typedef enum {
   GST_PLAY_FLAG_VIS           = (1 << 3) /* Enable rendering of visualizations when there is no video stream. */
 } GstPlayFlags;
@@ -103,14 +103,14 @@ int main(int argc, char *argv[]) {
     return -1;
 
   /* Build the pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://radio.hbr1.com:19800/ambient.ogg", NULL);
+  pipeline = gst_parse_launch ("playbin uri=http://radio.hbr1.com:19800/ambient.ogg", NULL);
 
   /* Set the visualization flag */
   g_object_get (pipeline, "flags", &flags, NULL);
   flags |= GST_PLAY_FLAG_VIS;
   g_object_set (pipeline, "flags", flags, NULL);
 
-  /* set vis plugin for playbin2 */
+  /* set vis plugin for playbin */
   g_object_set (pipeline, "vis-plugin", vis_plugin, NULL);
 
   /* Start playing */
@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
 
 # Walkthrough
 
-First off, we indicate `playbin2` that we want an audio visualization by
+First off, we indicate `playbin` that we want an audio visualization by
 setting the `GST_PLAY_FLAG_VIS` flag. If the media already contains
 video, this flag has no effect.
 
@@ -168,10 +168,10 @@ flags |= GST_PLAY_FLAG_VIS;
 g_object_set (pipeline, "flags", flags, NULL);
 ```
 
-If no visualization plugin is enforced by the user, `playbin2` will use
+If no visualization plugin is enforced by the user, `playbin` will use
 `goom` (audio visualization will be disabled if `goom` is not
 available). The rest of the tutorial shows how to find out the available
-visualization elements and enforce one to `playbin2`.
+visualization elements and enforce one to `playbin`.
 
 ``` lang=c
 /* Get a list of all visualization plugins */
@@ -243,10 +243,10 @@ if (!vis_plugin)
 ```
 
 The selected factory is used to instantiate an actual `GstElement` which
-is then passed to `playbin2` through the `vis-plugin` property:
+is then passed to `playbin` through the `vis-plugin` property:
 
 ``` lang=c
-/* set vis plugin for playbin2 */
+/* set vis plugin for playbin */
 g_object_set (pipeline, "vis-plugin", vis_plugin, NULL);
 ```
 
@@ -256,10 +256,10 @@ And we are done.
 
 This tutorial has shown:
 
-  - How to enable Audio Visualization in `playbin2` with the
+  - How to enable Audio Visualization in `playbin` with the
     `GST_PLAY_FLAG_VIS` flag
   - How to enforce one particular visualization element with the
-    `vis-plugin` `playbin2` property 
+    `vis-plugin` `playbin` property 
 
 It has been a pleasure having you here, and see you soon\!
 
diff --git a/Playback+tutorial+7+Custom+playbin+sinks.markdown b/Playback+tutorial+7+Custom+playbin+sinks.markdown
new file mode 100644 (file)
index 0000000..bd1c154
--- /dev/null
@@ -0,0 +1,241 @@
+# Playback tutorial 7: Custom playbin sinks
+
+# Goal
+
+`playbin` can be further customized by manually selecting its audio and
+video sinks. This allows applications to rely on `playbin` to retrieve
+and decode the media and then manage the final render/display
+themselves. This tutorial shows:
+
+  - How to replace the sinks selected by `playbin`.
+  - How to use a complex pipeline as a sink.
+
+# Introduction
+
+Two properties of `playbin` allow selecting the desired audio and video
+sinks: `audio-sink` and `video-sink` (respectively). The application
+only needs to instantiate the appropriate `GstElement` and pass it to
+`playbin` through these properties.
+
+This method, though, only allows using a single Element as sink. If a
+more complex pipeline is required, for example, an equalizer plus an
+audio sink, it needs to be wrapped in a Bin, so it looks to
+`playbin` as if it was a single Element.
+
+A Bin (`GstBin`) is a container that encapsulates partial pipelines so
+they can be managed as single elements. As an example, the
+`GstPipeline` we have been using in all tutorials is a type of
+`GstBin`, which does not interact with external Elements. Elements
+inside a Bin connect to external elements through Ghost Pads
+(`GstGhostPad`), this is, Pads on the surface of the Bin which simply
+forward data from an external Pad to a given Pad on an internal Element.
+
+![](attachments/1441842/2424880.png)
+
+**Figure 1:** A Bin with two Elements and one Ghost Pad.
+
+`GstBin`s are also a type of `GstElement`, so they can be used wherever
+an Element is required, in particular, as sinks for `playbin` (and they
+are then known as **sink-bins**).
+
+# An equalized player
+
+Copy this code into a text file named `playback-tutorial-7.c`.
+
+<table>
+<tbody>
+<tr class="odd">
+<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
+<td><p>This tutorial is included in the SDK since release 2012.7. If you cannot find it in the downloaded code, please install the latest release of the GStreamer SDK.</p></td>
+</tr>
+</tbody>
+</table>
+
+**playback-tutorial7.c**
+
+``` lang=c
+#include <gst/gst.h>
+
+int main(int argc, char *argv[]) {
+  GstElement *pipeline, *bin, *equalizer, *convert, *sink;
+  GstPad *pad, *ghost_pad;
+  GstBus *bus;
+  GstMessage *msg;
+
+  /* Initialize GStreamer */
+  gst_init (&argc, &argv);
+
+  /* Build the pipeline */
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+
+  /* Create the elements inside the sink bin */
+  equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");
+  convert = gst_element_factory_make ("audioconvert", "convert");
+  sink = gst_element_factory_make ("autoaudiosink", "audio_sink");
+  if (!equalizer || !convert || !sink) {
+    g_printerr ("Not all elements could be created.\n");
+    return -1;
+  }
+
+  /* Create the sink bin, add the elements and link them */
+  bin = gst_bin_new ("audio_sink_bin");
+  gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);
+  gst_element_link_many (equalizer, convert, sink, NULL);
+  pad = gst_element_get_static_pad (equalizer, "sink");
+  ghost_pad = gst_ghost_pad_new ("sink", pad);
+  gst_pad_set_active (ghost_pad, TRUE);
+  gst_element_add_pad (bin, ghost_pad);
+  gst_object_unref (pad);
+
+  /* Configure the equalizer */
+  g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);
+  g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);
+
+  /* Set playbin's audio sink to be our sink bin */
+  g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
+
+  /* Start playing */
+  gst_element_set_state (pipeline, GST_STATE_PLAYING);
+
+  /* Wait until error or EOS */
+  bus = gst_element_get_bus (pipeline);
+  msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
+
+  /* Free resources */
+  if (msg != NULL)
+    gst_message_unref (msg);
+  gst_object_unref (bus);
+  gst_element_set_state (pipeline, GST_STATE_NULL);
+  gst_object_unref (pipeline);
+  return 0;
+}
+```
+
+<table>
+<tbody>
+<tr class="odd">
+<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
+<td><div id="expander-1371267928" class="expand-container">
+<div id="expander-control-1371267928" class="expand-control">
+<span class="expand-control-icon"><img src="images/icons/grey_arrow_down.gif" class="expand-control-image" /></span><span class="expand-control-text">Need help? (Click to expand)</span>
+</div>
+<div id="expander-content-1371267928" class="expand-content">
+<p>If you need help to compile this code, refer to the <strong>Building the tutorials</strong> section for your platform: <a href="Installing%2Bon%2BLinux.html#InstallingonLinux-Build">Linux</a>, <a href="Installing%2Bon%2BMac%2BOS%2BX.html#InstallingonMacOSX-Build">Mac OS X</a> or <a href="Installing%2Bon%2BWindows.html#InstallingonWindows-Build">Windows</a>, or use this specific command on Linux:</p>
+<div class="panel" style="border-width: 1px;">
+<div class="panelContent">
+<p><code>gcc playback-tutorial-7.c -o playback-tutorial-7 `pkg-config --cflags --libs gstreamer-0.10`</code></p>
+</div>
+</div>
+<p>If you need help to run this code, refer to the <strong>Running the tutorials</strong> section for your platform: <a href="Installing%2Bon%2BLinux.html#InstallingonLinux-Run">Linux</a>, <a href="Installing%2Bon%2BMac%2BOS%2BX.html#InstallingonMacOSX-Run">Mac OS X</a> or <a href="Installing%2Bon%2BWindows.html#InstallingonWindows-Run">Windows</a></p>
+<p><span>This tutorial opens a window and displays a movie, with accompanying audio. The media is fetched from the Internet, so the window might take a few seconds to appear, depending on your connection speed. The higher frequency bands have been attenuated, so the movie sound should have a more powerful bass component.</span></p>
+<p>Required libraries: <code>gstreamer-0.10</code></p>
+</div>
+</div></td>
+</tr>
+</tbody>
+</table>
+
+# Walkthrough
+
+``` lang=c
+/* Create the elements inside the sink bin */
+equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");
+convert = gst_element_factory_make ("audioconvert", "convert");
+sink = gst_element_factory_make ("autoaudiosink", "audio_sink");
+if (!equalizer || !convert || !sink) {
+  g_printerr ("Not all elements could be created.\n");
+  return -1;
+}
+```
+
+All the Elements that compose our sink-bin are instantiated. We use an
+`equalizer-3bands` and an `autoaudiosink`, with an `audioconvert` in
+between, because we are not sure of the capabilities of the audio sink
+(since they are hardware-dependant).
+
+``` lang=c
+/* Create the sink bin, add the elements and link them */
+bin = gst_bin_new ("audio_sink_bin");
+gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);
+gst_element_link_many (equalizer, convert, sink, NULL);
+```
+
+This adds the new Elements to the Bin and links them just as we would do
+if this was a pipeline.
+
+``` lang=c
+pad = gst_element_get_static_pad (equalizer, "sink");
+ghost_pad = gst_ghost_pad_new ("sink", pad);
+gst_pad_set_active (ghost_pad, TRUE);
+gst_element_add_pad (bin, ghost_pad);
+gst_object_unref (pad);
+```
+
+Now we need to create a Ghost Pad so this partial pipeline inside the
+Bin can be connected to the outside. This Ghost Pad will be connected to
+a Pad in one of the internal Elements (the sink pad of the equalizer),
+so we retrieve this Pad with `gst_element_get_static_pad()`. Remember
+from [Basic tutorial 7: Multithreading and Pad
+Availability](Basic%2Btutorial%2B7%253A%2BMultithreading%2Band%2BPad%2BAvailability.html) that
+if this was a Request Pad instead of an Always Pad, we would need to use
+`gst_element_request_pad()`.
+
+The Ghost Pad is created with `gst_ghost_pad_new()` (pointing to the
+inner Pad we just acquired), and activated with `gst_pad_set_active()`.
+It is then added to the Bin with `gst_element_add_pad()`, transferring
+ownership of the Ghost Pad to the bin, so we do not have to worry about
+releasing it.
+
+Finally, the sink Pad we obtained from the equalizer needs to be release
+with `gst_object_unref()`.
+
+At this point, we have a functional sink-bin, which we can use as the
+audio sink in `playbin`. We just need to instruct `playbin` to use it:
+
+``` lang=c
+/* Set playbin's audio sink to be our sink bin */
+g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
+```
+
+It is as simple as setting the `audio-sink` property on `playbin` to
+the newly created sink.
+
+``` lang=c
+/* Configure the equalizer */
+g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);
+g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);
+```
+
+The only bit remaining is to configure the equalizer. For this example,
+the two higher frequency bands are set to the maximum attenuation so the
+bass is boosted. Play a bit with the values to feel the difference (Look
+at the documentation for the `equalizer-3bands` element for the allowed
+range of values).
+
+# Exercise
+
+Build a video bin instead of an audio bin, using one of the many
+interesting video filters GStreamer offers, like `solarize`,
+`vertigotv` or any of the Elements in the `effectv` plugin. Remember to
+use the color space conversion element `ffmpegcolorspace` if your
+pipeline fails to link due to incompatible caps.
+
+# Conclusion
+
+This tutorial has shown:
+
+  - How to set your own sinks to `playbin` using the audio-sink and
+    video-sink properties.
+  - How to wrap a piece of pipeline into a `GstBin` so it can be used as
+    a **sink-bin** by `playbin`.
+
+It has been a pleasure having you here, and see you soon\!
+
+## Attachments:
+
+![](images/icons/bullet_blue.gif)
+[bin-element-ghost.png](attachments/1441842/2424880.png) (image/png)
+![](images/icons/bullet_blue.gif)
+[playback-tutorial-7.c](attachments/1441842/2424881.c) (text/plain)
+![](images/icons/bullet_blue.gif)
+[vs2010.zip](attachments/1441842/2424882.zip) (application/zip)
diff --git a/Playback+tutorial+7+Custom+playbin2+sinks.markdown b/Playback+tutorial+7+Custom+playbin2+sinks.markdown
deleted file mode 100644 (file)
index 9705c49..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-# Playback tutorial 7: Custom playbin2 sinks
-
-# Goal
-
-`playbin2` can be further customized by manually selecting its audio and
-video sinks. This allows applications to rely on `playbin2` to retrieve
-and decode the media and then manage the final render/display
-themselves. This tutorial shows:
-
-  - How to replace the sinks selected by `playbin2`.
-  - How to use a complex pipeline as a sink.
-
-# Introduction
-
-Two properties of `playbin2` allow selecting the desired audio and video
-sinks: `audio-sink` and `video-sink` (respectively). The application
-only needs to instantiate the appropriate `GstElement` and pass it to
-`playbin2` through these properties.
-
-This method, though, only allows using a single Element as sink. If a
-more complex pipeline is required, for example, an equalizer plus an
-audio sink, it needs to be wrapped in a Bin, so it looks to
-`playbin2` as if it was a single Element.
-
-A Bin (`GstBin`) is a container that encapsulates partial pipelines so
-they can be managed as single elements. As an example, the
-`GstPipeline` we have been using in all tutorials is a type of
-`GstBin`, which does not interact with external Elements. Elements
-inside a Bin connect to external elements through Ghost Pads
-(`GstGhostPad`), this is, Pads on the surface of the Bin which simply
-forward data from an external Pad to a given Pad on an internal Element.
-
-![](attachments/1441842/2424880.png)
-
-**Figure 1:** A Bin with two Elements and one Ghost Pad.
-
-`GstBin`s are also a type of `GstElement`, so they can be used wherever
-an Element is required, in particular, as sinks for `playbin2` (and they
-are then known as **sink-bins**).
-
-# An equalized player
-
-Copy this code into a text file named `playback-tutorial-7.c`.
-
-<table>
-<tbody>
-<tr class="odd">
-<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
-<td><p>This tutorial is included in the SDK since release 2012.7. If you cannot find it in the downloaded code, please install the latest release of the GStreamer SDK.</p></td>
-</tr>
-</tbody>
-</table>
-
-**playback-tutorial7.c**
-
-``` lang=c
-#include <gst/gst.h>
-
-int main(int argc, char *argv[]) {
-  GstElement *pipeline, *bin, *equalizer, *convert, *sink;
-  GstPad *pad, *ghost_pad;
-  GstBus *bus;
-  GstMessage *msg;
-
-  /* Initialize GStreamer */
-  gst_init (&argc, &argv);
-
-  /* Build the pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
-
-  /* Create the elements inside the sink bin */
-  equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");
-  convert = gst_element_factory_make ("audioconvert", "convert");
-  sink = gst_element_factory_make ("autoaudiosink", "audio_sink");
-  if (!equalizer || !convert || !sink) {
-    g_printerr ("Not all elements could be created.\n");
-    return -1;
-  }
-
-  /* Create the sink bin, add the elements and link them */
-  bin = gst_bin_new ("audio_sink_bin");
-  gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);
-  gst_element_link_many (equalizer, convert, sink, NULL);
-  pad = gst_element_get_static_pad (equalizer, "sink");
-  ghost_pad = gst_ghost_pad_new ("sink", pad);
-  gst_pad_set_active (ghost_pad, TRUE);
-  gst_element_add_pad (bin, ghost_pad);
-  gst_object_unref (pad);
-
-  /* Configure the equalizer */
-  g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);
-  g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);
-
-  /* Set playbin2's audio sink to be our sink bin */
-  g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
-
-  /* Start playing */
-  gst_element_set_state (pipeline, GST_STATE_PLAYING);
-
-  /* Wait until error or EOS */
-  bus = gst_element_get_bus (pipeline);
-  msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
-
-  /* Free resources */
-  if (msg != NULL)
-    gst_message_unref (msg);
-  gst_object_unref (bus);
-  gst_element_set_state (pipeline, GST_STATE_NULL);
-  gst_object_unref (pipeline);
-  return 0;
-}
-```
-
-<table>
-<tbody>
-<tr class="odd">
-<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
-<td><div id="expander-1371267928" class="expand-container">
-<div id="expander-control-1371267928" class="expand-control">
-<span class="expand-control-icon"><img src="images/icons/grey_arrow_down.gif" class="expand-control-image" /></span><span class="expand-control-text">Need help? (Click to expand)</span>
-</div>
-<div id="expander-content-1371267928" class="expand-content">
-<p>If you need help to compile this code, refer to the <strong>Building the tutorials</strong> section for your platform: <a href="Installing%2Bon%2BLinux.html#InstallingonLinux-Build">Linux</a>, <a href="Installing%2Bon%2BMac%2BOS%2BX.html#InstallingonMacOSX-Build">Mac OS X</a> or <a href="Installing%2Bon%2BWindows.html#InstallingonWindows-Build">Windows</a>, or use this specific command on Linux:</p>
-<div class="panel" style="border-width: 1px;">
-<div class="panelContent">
-<p><code>gcc playback-tutorial-7.c -o playback-tutorial-7 `pkg-config --cflags --libs gstreamer-0.10`</code></p>
-</div>
-</div>
-<p>If you need help to run this code, refer to the <strong>Running the tutorials</strong> section for your platform: <a href="Installing%2Bon%2BLinux.html#InstallingonLinux-Run">Linux</a>, <a href="Installing%2Bon%2BMac%2BOS%2BX.html#InstallingonMacOSX-Run">Mac OS X</a> or <a href="Installing%2Bon%2BWindows.html#InstallingonWindows-Run">Windows</a></p>
-<p><span>This tutorial opens a window and displays a movie, with accompanying audio. The media is fetched from the Internet, so the window might take a few seconds to appear, depending on your connection speed. The higher frequency bands have been attenuated, so the movie sound should have a more powerful bass component.</span></p>
-<p>Required libraries: <code>gstreamer-0.10</code></p>
-</div>
-</div></td>
-</tr>
-</tbody>
-</table>
-
-# Walkthrough
-
-``` lang=c
-/* Create the elements inside the sink bin */
-equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");
-convert = gst_element_factory_make ("audioconvert", "convert");
-sink = gst_element_factory_make ("autoaudiosink", "audio_sink");
-if (!equalizer || !convert || !sink) {
-  g_printerr ("Not all elements could be created.\n");
-  return -1;
-}
-```
-
-All the Elements that compose our sink-bin are instantiated. We use an
-`equalizer-3bands` and an `autoaudiosink`, with an `audioconvert` in
-between, because we are not sure of the capabilities of the audio sink
-(since they are hardware-dependant).
-
-``` lang=c
-/* Create the sink bin, add the elements and link them */
-bin = gst_bin_new ("audio_sink_bin");
-gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);
-gst_element_link_many (equalizer, convert, sink, NULL);
-```
-
-This adds the new Elements to the Bin and links them just as we would do
-if this was a pipeline.
-
-``` lang=c
-pad = gst_element_get_static_pad (equalizer, "sink");
-ghost_pad = gst_ghost_pad_new ("sink", pad);
-gst_pad_set_active (ghost_pad, TRUE);
-gst_element_add_pad (bin, ghost_pad);
-gst_object_unref (pad);
-```
-
-Now we need to create a Ghost Pad so this partial pipeline inside the
-Bin can be connected to the outside. This Ghost Pad will be connected to
-a Pad in one of the internal Elements (the sink pad of the equalizer),
-so we retrieve this Pad with `gst_element_get_static_pad()`. Remember
-from [Basic tutorial 7: Multithreading and Pad
-Availability](Basic%2Btutorial%2B7%253A%2BMultithreading%2Band%2BPad%2BAvailability.html) that
-if this was a Request Pad instead of an Always Pad, we would need to use
-`gst_element_request_pad()`.
-
-The Ghost Pad is created with `gst_ghost_pad_new()` (pointing to the
-inner Pad we just acquired), and activated with `gst_pad_set_active()`.
-It is then added to the Bin with `gst_element_add_pad()`, transferring
-ownership of the Ghost Pad to the bin, so we do not have to worry about
-releasing it.
-
-Finally, the sink Pad we obtained from the equalizer needs to be release
-with `gst_object_unref()`.
-
-At this point, we have a functional sink-bin, which we can use as the
-audio sink in `playbin2`. We just need to instruct `playbin2` to use it:
-
-``` lang=c
-/* Set playbin2's audio sink to be our sink bin */
-g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
-```
-
-It is as simple as setting the `audio-sink` property on `playbin2` to
-the newly created sink.
-
-``` lang=c
-/* Configure the equalizer */
-g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);
-g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);
-```
-
-The only bit remaining is to configure the equalizer. For this example,
-the two higher frequency bands are set to the maximum attenuation so the
-bass is boosted. Play a bit with the values to feel the difference (Look
-at the documentation for the `equalizer-3bands` element for the allowed
-range of values).
-
-# Exercise
-
-Build a video bin instead of an audio bin, using one of the many
-interesting video filters GStreamer offers, like `solarize`,
-`vertigotv` or any of the Elements in the `effectv` plugin. Remember to
-use the color space conversion element `ffmpegcolorspace` if your
-pipeline fails to link due to incompatible caps.
-
-# Conclusion
-
-This tutorial has shown:
-
-  - How to set your own sinks to `playbin2` using the audio-sink and
-    video-sink properties.
-  - How to wrap a piece of pipeline into a `GstBin` so it can be used as
-    a **sink-bin** by `playbin2`.
-
-It has been a pleasure having you here, and see you soon\!
-
-## Attachments:
-
-![](images/icons/bullet_blue.gif)
-[bin-element-ghost.png](attachments/1441842/2424880.png) (image/png)
-![](images/icons/bullet_blue.gif)
-[playback-tutorial-7.c](attachments/1441842/2424881.c) (text/plain)
-![](images/icons/bullet_blue.gif)
-[vs2010.zip](attachments/1441842/2424882.zip) (application/zip)
index 148b766ab9f5e22a28aea02794fbf5aae617de5a..43bcd92a203fe1146d291b6e7dc1920356eb0026 100644 (file)
@@ -154,18 +154,18 @@ after a VAAPI decoder, a VAAPI sink is the only element that fits.
 
 This all means that, if a particular hardware acceleration API is
 present in the system, and the corresponding GStreamer plugin is also
-available, auto-plugging elements like `playbin2` are free to use
+available, auto-plugging elements like `playbin` are free to use
 hardware acceleration to build their pipelines; the application does not
 need to do anything special to enable it. Almost:
 
-When `playbin2` has to choose among different equally valid elements,
+When `playbin` has to choose among different equally valid elements,
 like conventional software decoding (through `vp8dec`, for example) or
 hardware accelerated decoding (through `vaapidecode`, for example), it
 uses their *rank* to decide. The rank is a property of each element that
-indicates its priority; `playbin2` will simply select the element that
+indicates its priority; `playbin` will simply select the element that
 is able to build a complete pipeline and has the highest rank.
 
-So, whether `playbin2` will use hardware acceleration or not will depend
+So, whether `playbin` will use hardware acceleration or not will depend
 on the relative ranks of all elements capable of dealing with that media
 type. Therefore, the easiest way to make sure hardware acceleration is
 enabled or disabled is by changing the rank of the associated element,
@@ -263,7 +263,7 @@ these plugins.
   - Can interface directly with Clutter (See [Basic tutorial 15: Clutter
     integration](Basic%2Btutorial%2B15%253A%2BClutter%2Bintegration.html)),
     so frames do not need to leave the GPU.
-  - Compatible with `playbin2`.
+  - Compatible with `playbin`.
 
 ### gst-omx
 
@@ -330,7 +330,7 @@ these plugins.
   - Can interface directly with Clutter (See [Basic tutorial 15: Clutter
     integration](Basic%2Btutorial%2B15%253A%2BClutter%2Bintegration.html)),
     so frames do not need to leave the GPU.
-  - Compatible with `playbin2`.
+  - Compatible with `playbin`.
 
 # Conclusion
 
index 79229c491527a351a4788d35b29af954a16d3b96..53adea9bc472c4234b33535ad33f406922feec1d 100644 (file)
@@ -39,7 +39,7 @@ data. For example, these elements typically accept `audio/x-raw-int` or
 system, they may also accept `audio/mpeg`, `audio/x-ac3`,
 `audio/x-eac3` or `audio/x-dts`.
 
-Then, when `playbin2` builds the decoding pipeline, it realizes that the
+Then, when `playbin` builds the decoding pipeline, it realizes that the
 audio sink can be directly connected to the encoded data (typically
 coming out of a demuxer), so there is no need for a decoder. This
 process is automatic and does not need any action from the application.
@@ -78,8 +78,8 @@ enabled, but, unfortunately, this option is not available in all audio
 drivers.
 
 Another solution involves, using a custom sinkbin (see [Playback
-tutorial 7: Custom playbin2
-sinks](Playback%2Btutorial%2B7%253A%2BCustom%2Bplaybin2%2Bsinks.html))
+tutorial 7: Custom playbin
+sinks](Playback%2Btutorial%2B7%253A%2BCustom%2Bplaybin%2Bsinks.html))
 which includes a `capsfilter` element (see [Basic tutorial 14: Handy
 elements](Basic%2Btutorial%2B14%253A%2BHandy%2Belements.html)) and an
 audio sink. The caps that the external decoder supports are then set in
@@ -97,7 +97,7 @@ only supports raw audio, and will ignore any compressed format.
 This tutorial has shown a bit of how GStreamer deals with digital audio.
 In particular, it has shown that:
 
-  - Applications using `playbin2` do not need to do anything special to
+  - Applications using `playbin` do not need to do anything special to
     enable digital audio output: it is managed from the audio control
     panel of the operating system.
 
index a62188fc9ac66c61c49b62be90db0b196918bd99..74ae6a60febd66921ab1018fed83fb47cb87d102 100644 (file)
@@ -103,6 +103,6 @@ QtGStreamer provides access to the underlying C objects, in case you
 need them. This is accessible with a simple cast:
 
 ``` lang=c
-ElementPtr qgstElement = QGst::ElementFactory::make("playbin2");
+ElementPtr qgstElement = QGst::ElementFactory::make("playbin");
 GstElement* gstElement = GST_ELEMENT(qgstElement);
 ```
index a8d2cd55d02f5ce48769dacca60cbef2399faa17..f4c72cd7638d17d650267b34a4e9b8cd0d4fa22e 100644 (file)
@@ -21,13 +21,13 @@ Pages to review:
    - Basic+tutorial+15+Clutter+integration.markdown
    - Basic+tutorial+16+Platform-specific+elements.markdown
  - Playback+tutorials.markdown
-   - Playback+tutorial+1+Playbin2+usage.markdown
+   - Playback+tutorial+1+Playbin+usage.markdown
    - Playback+tutorial+2+Subtitle+management.markdown
    - Playback+tutorial+3+Short-cutting+the+pipeline.markdown
    - Playback+tutorial+4+Progressive+streaming.markdown
    - Playback+tutorial+5+Color+Balance.markdown
    - Playback+tutorial+6+Audio+visualization.markdown
-   - Playback+tutorial+7+Custom+playbin2+sinks.markdown
+   - Playback+tutorial+7+Custom+playbin+sinks.markdown
    - Playback+tutorial+8+Hardware-accelerated+video+decoding.markdown
    - Playback+tutorial+9+Digital+audio+pass-through.markdown
  - Android+tutorials.markdown
index c4c9520846bf5257e3f5d8f4493120ef6a19c6e7..a7e1786be8484a9f56db8409e5f72f1a05dac1d4 100644 (file)
@@ -29,7 +29,7 @@ concepts is discussed.
 -   Tools: [Basic tutorial 10: GStreamer tools]
 -   Threads: [Basic tutorial 7: Multithreading and Pad Availability]
 
-  [Playback tutorial 1: Playbin usage]: Playback+tutorial+1+Playbin2+usage.markdown
+  [Playback tutorial 1: Playbin usage]: Playback+tutorial+1+Playbin+usage.markdown
   [Basic tutorial 8: Short-cutting the pipeline]: Basic+tutorial+8+Short-cutting+the+pipeline.markdown
   [Basic tutorial 2: GStreamer concepts]: Basic+tutorial+2+GStreamer+concepts.markdown
   [Basic tutorial 6: Media formats and Pad Capabilities]: Basic+tutorial+6+Media+formats+and+Pad+Capabilities.markdown
index a1f0808be9be36adfc0668996670d85a10f3e02b..63615ad09c10fa3c5e99f7a31fd6f7a46c7cc9e0 100644 (file)
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
   memset (&data, 0, sizeof (data));\r
   \r
   /* Build the pipeline */\r
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);\r
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);\r
   bus = gst_element_get_bus (pipeline);\r
   \r
   /* Start playing */\r
index a5829d6eeb64e234e7f9c20fe3d4265df216bbda..6123fb131e41e35c3d6d72f2dd850625c856725f 100644 (file)
@@ -3,7 +3,7 @@
   
 #define GRAPH_LENGTH 80
   
-/* playbin2 flags */
+/* playbin flags */
 typedef enum {
   GST_PLAY_FLAG_DOWNLOAD      = (1 << 7) /* Enable progressive download (on selected formats) */
 } GstPlayFlags;
@@ -127,7 +127,7 @@ int main(int argc, char *argv[]) {
   data.buffering_level = 100;
   
   /* Build the pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
   bus = gst_element_get_bus (pipeline);
   
   /* Set the download flag */
index de6d40fdf5eb2b671eaae91597804d0e57c97909..0ab3771b753210e4ffce45cc105189af63c3a5fa 100644 (file)
@@ -97,7 +97,7 @@ static void error_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
   g_main_loop_quit (data->main_loop);
 }
   
-/* This function is called when playbin2 has created the appsrc element, so we have
+/* This function is called when playbin has created the appsrc element, so we have
  * a chance to configure it. */
 static void source_setup (GstElement *pipeline, GstElement *source, CustomData *data) {
   gchar *audio_caps_text;
@@ -128,8 +128,8 @@ int main(int argc, char *argv[]) {
   /* Initialize GStreamer */
   gst_init (&argc, &argv);
   
-  /* Create the playbin2 element */
-  data.pipeline = gst_parse_launch ("playbin2 uri=appsrc://", NULL);
+  /* Create the playbin element */
+  data.pipeline = gst_parse_launch ("playbin uri=appsrc://", NULL);
   g_signal_connect (data.pipeline, "source-setup", G_CALLBACK (source_setup), &data);
   
   /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
index de6d40fdf5eb2b671eaae91597804d0e57c97909..0ab3771b753210e4ffce45cc105189af63c3a5fa 100644 (file)
@@ -97,7 +97,7 @@ static void error_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
   g_main_loop_quit (data->main_loop);
 }
   
-/* This function is called when playbin2 has created the appsrc element, so we have
+/* This function is called when playbin has created the appsrc element, so we have
  * a chance to configure it. */
 static void source_setup (GstElement *pipeline, GstElement *source, CustomData *data) {
   gchar *audio_caps_text;
@@ -128,8 +128,8 @@ int main(int argc, char *argv[]) {
   /* Initialize GStreamer */
   gst_init (&argc, &argv);
   
-  /* Create the playbin2 element */
-  data.pipeline = gst_parse_launch ("playbin2 uri=appsrc://", NULL);
+  /* Create the playbin element */
+  data.pipeline = gst_parse_launch ("playbin uri=appsrc://", NULL);
   g_signal_connect (data.pipeline, "source-setup", G_CALLBACK (source_setup), &data);
   
   /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
index a09f6ab089b6a45cc1d27672734ad49f549b9549..7603c359bbdb1a65a7b53a378dccd0f19f334f40 100644 (file)
@@ -113,7 +113,7 @@ int main(int argc, char *argv[]) {
     " 'Q' to quit\n");
   
   /* Build the pipeline */
-  data.pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  data.pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
   
   /* Add a keyboard watch so we get notified of keystrokes */
 #ifdef _WIN32
index 31a3a42862828fb8b412af6b8211a7a8eaaeef2f..9ffdbc4926a8abbbfc24cc6f944ae25cb55ecb3e 100644 (file)
@@ -1,6 +1,6 @@
 #include <gst/gst.h>
   
-/* playbin2 flags */
+/* playbin flags */
 typedef enum {
   GST_PLAY_FLAG_VIS           = (1 << 3) /* Enable rendering of visualizations when there is no video stream. */
 } GstPlayFlags;
@@ -61,14 +61,14 @@ int main(int argc, char *argv[]) {
     return -1;
   
   /* Build the pipeline */
-  pipeline = gst_parse_launch ("playbin2 uri=http://radio.hbr1.com:19800/ambient.ogg", NULL);
+  pipeline = gst_parse_launch ("playbin uri=http://radio.hbr1.com:19800/ambient.ogg", NULL);
   
   /* Set the visualization flag */
   g_object_get (pipeline, "flags", &flags, NULL);
   flags |= GST_PLAY_FLAG_VIS;
   g_object_set (pipeline, "flags", flags, NULL);
   
-  /* set vis plugin for playbin2 */
+  /* set vis plugin for playbin */
   g_object_set (pipeline, "vis-plugin", vis_plugin, NULL);
   
   /* Start playing */
index 2ccd06940eb468f1c14ed093be02a7f144a3295f..fb0d00de576430cf2ecfab0f1b18c82bbe34567f 100644 (file)
@@ -10,7 +10,7 @@ int main(int argc, char *argv[]) {
   gst_init (&argc, &argv);\r
   \r
   /* Build the pipeline */\r
-  pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);\r
+  pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);\r
   \r
   /* Create the elements inside the sink bin */\r
   equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");\r
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
   g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);\r
   g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);\r
   \r
-  /* Set playbin2's audio sink to be our sink bin */\r
+  /* Set playbin's audio sink to be our sink bin */\r
   g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);\r
   \r
   /* Start playing */\r
index 86732a2a61db38e32162e33e149388fe0af23f13..4241f6248226a5a687d3e98f2be0b1ec0e509dcc 100644 (file)
@@ -111,8 +111,8 @@ int main(int argc, char *argv[]) {
     " 'Q' to quit\n");
   
   /* Build the pipeline */
-//  data.pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
-  data.pipeline = gst_parse_launch ("playbin2 uri=file:///f:/media/sintel/sintel_trailer-480p.webm", NULL);
+//  data.pipeline = gst_parse_launch ("playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
+  data.pipeline = gst_parse_launch ("playbin uri=file:///f:/media/sintel/sintel_trailer-480p.webm", NULL);
   
   /* Add a keyboard watch so we get notified of keystrokes */
 #ifdef _WIN32
index 33caac4b19835356f28e2666e711f87bb65422d3..36e2feecc5243de7231ec7f5ff778c6118c43dfe 100644 (file)
@@ -274,9 +274,9 @@ element (here: textoverlay) has multiple sink or source pads.
 ffmpegcolorspace \! overlay.video\_sink filesrc location=movie.srt \!
 subparse \! overlay.text\_sink**
 
-Play an AVI movie with an external text subtitle stream using playbin2
+Play an AVI movie with an external text subtitle stream using playbin
 
-**gst-launch-1.0 playbin2 uri=<file:///path/to/movie.avi>
+**gst-launch-1.0 playbin uri=<file:///path/to/movie.avi>
 suburi=<file:///path/to/movie.srt>**
 
 **Network streaming**
index 0302e9718e264192b952c80651fd9e8b9461511c..55cac27a991c734f432e8b4013be2c904089a0c3 100644 (file)
@@ -15,7 +15,7 @@ iOS device. It shows:
 It also uses the knowledge gathered in the [Basic
 tutorials](Basic%2Btutorials.html) regarding:
 
-  - How to use `playbin2` to play any kind of media
+  - How to use `playbin` to play any kind of media
   - How to handle network resilience problems
 
 # Introduction
@@ -23,10 +23,10 @@ tutorials](Basic%2Btutorials.html) regarding:
 From the previous tutorials, we already have almost all necessary pieces
 to build a media player. The most complex part is assembling a pipeline
 which retrieves, decodes and displays the media, but we already know
-that the `playbin2` element can take care of all that for us. We only
+that the `playbin` element can take care of all that for us. We only
 need to replace the manual pipeline we used in [iOS tutorial 3:
 Video](iOS%2Btutorial%2B3%253A%2BVideo.html) with a
-single-element `playbin2` pipeline and we are good to go\!
+single-element `playbin` pipeline and we are good to go\!
 
 However, we can do better than. We will add a [Time
 Slider](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UISlider_Class/Reference/Reference.html),
@@ -301,7 +301,7 @@ this view is collapsed by default. Click here to expand…
 Supporting arbitrary media URIs
 
 The `GStreamerBackend`  provides the `setUri()` method so we can
-indicate the URI of the media to play. Since `playbin2` will be taking
+indicate the URI of the media to play. Since `playbin` will be taking
 care of retrieving the media, we can use local or remote URIs
 indistinctly (`file://` or `http://`, for example). From the UI code,
 though, we want to keep track of whether the file is local or remote,
@@ -839,7 +839,7 @@ static void state_changed_cb (GstBus *bus, GstMessage *msg, GStreamerBackend *se
     g_main_context_push_thread_default(context);
 
     /* Build pipeline */
-    pipeline = gst_parse_launch("playbin2", &error);
+    pipeline = gst_parse_launch("playbin", &error);
     if (error) {
         gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
         g_clear_error (&error);
@@ -921,7 +921,7 @@ one):
 We first need to obtain a plain `char *` from within the `NSString *` we
 get, using the `UTF8String` method.
 
-`playbin2`’s URI is exposed as a common GObject property, so we simply
+`playbin`’s URI is exposed as a common GObject property, so we simply
 set it with `g_object_set()`.
 
 ### Reporting media size
@@ -971,7 +971,7 @@ static void check_media_size (GStreamerBackend *self) {
 ```
 
 We first retrieve the video sink element from the pipeline, using
-the `video-sink` property of `playbin2`, and then its sink Pad. The
+the `video-sink` property of `playbin`, and then its sink Pad. The
 negotiated Caps of this Pad, which we recover using
 `gst_pad_get_negotiated_caps()`,  are the Caps of the decoded media.
 
@@ -1214,7 +1214,7 @@ the pipeline to the `target_state`.
 
 ### Conclusion
 
-This tutorial has shown how to embed a `playbin2` pipeline into an iOS
+This tutorial has shown how to embed a `playbin` pipeline into an iOS
 application. This, effectively, turns such application into a basic
 media player, capable of streaming and decoding all the formats
 GStreamer understands. More particularly, it has shown:
index db665dded8b7f8fe58b1030546891a91c7ccbeb6..4e415b7a2cb7040ad1ec084ed3797ae2001b4669 100644 (file)
@@ -24,13 +24,13 @@ Home.markdown
                        Basic+tutorial+15+Clutter+integration.markdown
                        Basic+tutorial+16+Platform-specific+elements.markdown
                Playback+tutorials.markdown
-                       Playback+tutorial+1+Playbin2+usage.markdown
+                       Playback+tutorial+1+Playbin+usage.markdown
                        Playback+tutorial+2+Subtitle+management.markdown
                        Playback+tutorial+3+Short-cutting+the+pipeline.markdown
                        Playback+tutorial+4+Progressive+streaming.markdown
                        Playback+tutorial+5+Color+Balance.markdown
                        Playback+tutorial+6+Audio+visualization.markdown
-                       Playback+tutorial+7+Custom+playbin2+sinks.markdown
+                       Playback+tutorial+7+Custom+playbin+sinks.markdown
                        Playback+tutorial+8+Hardware-accelerated+video+decoding.markdown
                        Playback+tutorial+9+Digital+audio+pass-through.markdown
                Android+tutorials.markdown