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;
|
2001-03-24 17:22:03 +00:00
|
|
|
GstElement *videosink, *osssink;
|
2001-03-07 21:52:56 +00:00
|
|
|
GstAutoplug *autoplugger;
|
2001-06-01 18:24:41 +00:00
|
|
|
GstCaps *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-24 17:22:03 +00:00
|
|
|
osssink = gst_elementfactory_make ("osssink", "osssink");
|
|
|
|
g_assert (osssink != NULL);
|
2001-03-07 21:52:56 +00:00
|
|
|
videosink = gst_elementfactory_make ("videosink", "videosink");
|
|
|
|
g_assert (videosink != NULL);
|
2000-12-19 13:44:23 +00:00
|
|
|
|
2001-06-01 18:24:41 +00:00
|
|
|
testcaps = gst_caps_new ("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-08-13 19:00:13 +00:00
|
|
|
g_signal_connect (G_OBJECT (autoplugger), "new_object", new_object_added, NULL);
|
2001-03-07 21:52:56 +00:00
|
|
|
|
|
|
|
element = gst_autoplug_to_caps (autoplugger, testcaps,
|
2001-03-24 17:22:03 +00:00
|
|
|
gst_pad_get_caps (gst_element_get_pad (osssink, "sink")),
|
2001-03-12 21:02:12 +00:00
|
|
|
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
|
|
|
}
|