gstreamer/tests/autoplug2.c
Wim Taymans 095226658a Merge the HEAD branch into AUTOPLUG2.
Original commit message from CVS:
Merge the HEAD branch into AUTOPLUG2.
More work on the negotiation process to allow for proxied negotiation
which is needed in the queue.
gst_pad_connect perform a negotiation and returns a gboolean indicating
successfull connection. The pads are disconnected when negotiation fails.
I'm not satisfied/sure about the implementation yet, needs some more
investigation.
2001-03-11 16:29:29 +00:00

79 lines
2.3 KiB
C

#include <gst/gst.h>
static GstElement*
autoplug_caps (GstAutoplug *autoplug, gchar *mime1, gchar *mime2)
{
GList *caps1, *caps2;
caps1 = g_list_append (NULL, gst_caps_new ("tescaps1", mime1));
caps2 = g_list_append (NULL, gst_caps_new ("tescaps2", mime2));
return gst_autoplug_to_caps (autoplug, caps1, caps2, NULL);
}
int
main (int argc, char *argv[])
{
GstElement *element;
GstAutoplug *autoplug;
gst_init(&argc,&argv);
autoplug = gst_autoplugfactory_make ("static");
element = autoplug_caps (autoplug, "audio/mp3", "audio/raw");
xmlSaveFile ("autoplug2_1.gst", gst_xml_write (element));
element = autoplug_caps (autoplug, "video/mpeg", "audio/raw");
xmlSaveFile ("autoplug2_2.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
g_list_append (NULL, gst_caps_new_with_props(
"testcaps3",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
NULL))),
g_list_append (NULL, gst_caps_new("testcaps4","audio/raw")),
NULL);
xmlSaveFile ("autoplug2_3.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
g_list_append (NULL, gst_caps_new_with_props(
"testcaps5",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (FALSE),
NULL))),
g_list_append (NULL, gst_caps_new("testcaps6", "video/raw")),
NULL);
xmlSaveFile ("autoplug2_4.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
g_list_append (NULL, gst_caps_new(
"testcaps7",
"video/avi")),
g_list_append (NULL, gst_caps_new("testcaps8", "video/raw")),
g_list_append (NULL, gst_caps_new("testcaps9", "audio/raw")),
NULL);
xmlSaveFile ("autoplug2_5.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
g_list_append (NULL, gst_caps_new_with_props(
"testcaps10",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
NULL))),
g_list_append (NULL, gst_caps_new("testcaps10", "video/raw")),
g_list_append (NULL, gst_caps_new("testcaps11", "audio/raw")),
NULL);
xmlSaveFile ("autoplug2_6.gst", gst_xml_write (element));
exit (0);
exit (0);
}