gstreamer/tests/autoplug2.c
Wim Taymans b38d9a945b A rather large patch:
Original commit message from CVS:
A rather large patch:
- changed the API for the padtemplates:
- remove the factories (array of pointers) for the padtemplates,
properties and caps. The static array was a nice idea but converting
all the property values to a gpointer was not a good idea.
float properties were not possible, and casting a gint to a pointer
is not very portable. The new API just uses the _padtemplate_new,
_caps_new and _props_new functions to create the templates.
This has the added benefit that the API is now uniform for static
and dynamic templates and that the code can be made cleaner.
- lots of cleanups in the way the capabilities are constructed (va_list)
- lots of updates for all the plugins (new API)
- docs updates (new API)
- removed the videoraw docs.
2001-04-14 18:56:37 +00:00

78 lines
2.1 KiB
C

#include <gst/gst.h>
static GstElement*
autoplug_caps (GstAutoplug *autoplug, gchar *mime1, gchar *mime2)
{
GstCaps *caps1, *caps2;
caps1 = gst_caps_new ("tescaps1", mime1, NULL);
caps2 = gst_caps_new ("tescaps2", mime2, NULL);
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,
gst_caps_new(
"testcaps3",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
NULL)),
gst_caps_new("testcaps4","audio/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_3.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
gst_caps_new(
"testcaps5",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (FALSE),
NULL)),
gst_caps_new("testcaps6", "video/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_4.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
gst_caps_new(
"testcaps7",
"video/avi", NULL),
gst_caps_new("testcaps8", "video/raw", NULL),
gst_caps_new("testcaps9", "audio/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_5.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
gst_caps_new(
"testcaps10",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
NULL)),
gst_caps_new("testcaps10", "video/raw", NULL),
gst_caps_new("testcaps11", "audio/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_6.gst", gst_xml_write (element));
exit (0);
exit (0);
}