Note how we use the pull mode method of pushing new buffers into
appsrc although appsrc is running in push mode.
</para>
- <programlisting><!-- example-begin appsrc.c -->
-#include <gst/gst.h>
+ <programlisting>
+<!-- example-begin appsrc.c -->
+<![CDATA[
+#include <gst/gst.h>
static GMainLoop *loop;
timestamp += GST_BUFFER_DURATION (buffer);
- g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
+ g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
if (ret != GST_FLOW_OK) {
/* something wrong, stop pushing */
GstElement *pipeline, *appsrc, *conv, *videosink;
/* init GStreamer */
- gst_init (&argc, &argv);
+ gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
/* setup pipeline */
g_main_loop_unref (loop);
return 0;
-}
- <!-- example-end appsrc.c --></programlisting>
+ }
+]]>
+<!-- example-end appsrc.c -->
+ </programlisting>
</sect3>
</sect2>
</para>
<programlisting>
+<![CDATA[
/*
* Here, you would write the actual plugin code.
*/
...
}
+]]>
</programlisting>
</sect1>
</chapter>