&gstreamer-tree-index;
</chapter>
+ <!-- this seems to be broken with current gtk-doc and the xml toolchain
<index id="index"/>
+ -->
</book>
it can be used. You should pass a pointer to the main argc and argv variables so that GStreamer can
process its own command line options, as shown in the following example.
+<example>
+<title>Initializing the gstreamer libarary</title>
<programlisting>
int
main (int argc, char *argv[])
...
}
</programlisting>
+</example>
</para>
<para>
It's allowed to pass two NULL pointers to gst_init() in case you don't want to pass the command
<para>
You can also use a popt table to initialize your own parameters as shown in the next code
fragment:
+<example>
+<title>Initializing own parameters when initializing gstreamer</title>
<programlisting>
static gboolean stats = FALSE;
...
...
}
</programlisting>
+</example>
</para>
<para>
Use gst_version() to query the library version at runtime or use the GST_VERSION_* macros
created one will typically allocate memory for it and set the size of the
buffer data. The following example creates a buffer that can hold a given
video frame with a given width, height and bits per plane.
-<programlisting>
+<example>
+<title>Creating a buffer for a video frame</title>
+ <programlisting>
GstBuffer *buffer;
gint size, width, height, bpp;
GST_BUFFER_SIZE (buffer) = size;
GST_BUFFER_DATA (buffer) = g_alloc (size);
...
-</programlisting>
+ </programlisting>
+</example>
</para>
<para>
Alternatively, use gst_buffer_new_and_alloc()
a seek method and optional flags are OR-ed together. The seek event is then
inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().
- <informalexample>
- Following example illustrates how to insert a seek event (1 second in the stream)
- in a pipeline.
-
+Following example illustrates how to insert a seek event (1 second in the stream)
+in a pipeline.
+<example>
+<title>Insertion of a seek event into a pipeline</title>
<programlisting>
gboolean res;
GstEvent *event;
g_warning ("seek failed");
}
</programlisting>
- </informalexample>
+</example>
</para>
@GST_SEEK_METHOD_CUR: Seek to an relative position