gstreamer/testsuite/autoplug/autoplug3.c
Thomas Vander Stichele 49b26d418b some more commenting autoplug2 has a problem, I suspect the problem is actually with the mpeg type plugins, mpeg2type...
Original commit message from CVS:
some more commenting
autoplug2 has a problem, I suspect the problem is actually with the
mpeg type plugins, mpeg2types for example has a (null)
Could someone take a look at it ?
2002-02-23 12:06:22 +00:00

50 lines
1.1 KiB
C

#include <gst/gst.h>
int
main (int argc, char *argv[])
{
GstAutoplug *autoplug;
GstElement *element;
GstElement *sink;
GstElement *pipeline;
GstElement *filesrc;
gst_init(&argc,&argv);
sink = gst_elementfactory_make ("osssink", "osssink");
g_assert (sink != NULL);
autoplug = gst_autoplugfactory_make ("staticrender");
g_assert (autoplug != NULL);
element = gst_autoplug_to_renderers (autoplug,
gst_caps_new (
"mp3caps",
"audio/mp3",
NULL
),
sink,
NULL);
g_assert (element != NULL);
pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline != NULL);
filesrc = gst_elementfactory_make ("filesrc", "disk_reader");
g_assert (filesrc != NULL);
gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), element);
gst_element_connect (filesrc, "src", element, "sink");
g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
exit (0);
}