2000-12-19 13:44:23 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
static void
|
|
|
|
new_object_added (GstAutoplug *autoplug, GstObject *object)
|
2000-12-19 13:44:23 +00:00
|
|
|
{
|
2001-03-07 21:52:56 +00:00
|
|
|
g_print ("added new object \"%s\"\n", gst_object_get_name (object));
|
2000-12-19 13:44:23 +00:00
|
|
|
}
|
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
2000-12-19 13:44:23 +00:00
|
|
|
{
|
2001-03-07 21:52:56 +00:00
|
|
|
GstElement *element;
|
|
|
|
GstElement *videosink, *audiosink;
|
|
|
|
GstAutoplug *autoplugger;
|
|
|
|
GList *testcaps;
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
gst_init(&argc,&argv);
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
audiosink = gst_elementfactory_make ("audiosink", "audiosink");
|
|
|
|
g_assert (audiosink != NULL);
|
|
|
|
videosink = gst_elementfactory_make ("videosink", "videosink");
|
|
|
|
g_assert (videosink != NULL);
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
testcaps = g_list_append (NULL,
|
|
|
|
gst_caps_new_with_props ("test_caps",
|
|
|
|
"video/mpeg",
|
|
|
|
gst_props_new (
|
|
|
|
"mpegversion", GST_PROPS_INT (1),
|
|
|
|
"systemstream", GST_PROPS_BOOLEAN (TRUE),
|
|
|
|
NULL)));
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
autoplugger = gst_autoplugfactory_make ("static");
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (autoplugger), "new_object", new_object_added, NULL);
|
|
|
|
|
|
|
|
element = gst_autoplug_to_caps (autoplugger, testcaps,
|
2001-03-12 21:02:12 +00:00
|
|
|
gst_pad_get_caps (gst_element_get_pad (audiosink, "sink")),
|
|
|
|
gst_pad_get_caps (gst_element_get_pad (videosink, "sink")),
|
2001-03-07 21:52:56 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (element != NULL);
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
xmlDocDump (stdout, gst_xml_write (element));
|
2000-12-31 16:12:48 +00:00
|
|
|
|
|
|
|
exit (0);
|
2000-12-19 13:44:23 +00:00
|
|
|
}
|