tutorial: hello-world: drop manual padding from code blocks

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2017-04-13 13:57:38 -07:00
parent 896429efe1
commit 014f850507

View file

@ -61,8 +61,8 @@ Internet, along with audio. Congratulations!
Let's review these lines of code and see what they do: Let's review these lines of code and see what they do:
``` c ``` c
/* Initialize GStreamer */ /* Initialize GStreamer */
gst_init (&argc, &argv); gst_init (&argc, &argv);
``` ```
This must always be your first GStreamer command. Among other things, This must always be your first GStreamer command. Among other things,
@ -80,8 +80,8 @@ benefit from the GStreamer standard command-line options (more on this
in [Basic tutorial 10: GStreamer tools]) in [Basic tutorial 10: GStreamer tools])
``` c ``` c
/* Build the pipeline */ /* Build the pipeline */
pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL); pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
``` ```
This line is the heart of this tutorial, and exemplifies **two** key This line is the heart of this tutorial, and exemplifies **two** key
@ -133,8 +133,8 @@ only thing we are doing in this example is exiting on error, so do not
expect much feedback. expect much feedback.
``` c ``` c
/* Start playing */ /* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING); gst_element_set_state (pipeline, GST_STATE_PLAYING);
``` ```
This line highlights another interesting concept: the state. Every This line highlights another interesting concept: the state. Every
@ -147,9 +147,9 @@ In this line, `gst_element_set_state()` is setting `pipeline` (our only
element, remember) to the PLAYING state, thus initiating playback. element, remember) to the PLAYING state, thus initiating playback.
``` c ``` c
/* Wait until error or EOS */ /* Wait until error or EOS */
bus = gst_element_get_bus (pipeline); bus = gst_element_get_bus (pipeline);
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS); gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
``` ```
These lines will wait until an error occurs or the end of the stream is These lines will wait until an error occurs or the end of the stream is
@ -171,12 +171,13 @@ Before terminating the application, though, there is a couple of things
we need to do to tidy up correctly after ourselves. we need to do to tidy up correctly after ourselves.
``` c ``` c
/* Free resources */ /* Free resources */
if (msg != NULL) if (msg != NULL)
gst_message_unref (msg); gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (bus);
gst_object_unref (pipeline); gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
``` ```
Always read the documentation of the functions you use, to know if you Always read the documentation of the functions you use, to know if you