mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
bc4619a44b
Original commit message from CVS: Added multiple caps to the pads Extended the padfactory for the multiple caps GstCaps now have a name so that future manipulations on them can be done by name Updated the plugins for the new caps list
63 lines
1.4 KiB
C
63 lines
1.4 KiB
C
#include <gst/gst.h>
|
|
|
|
static GList*
|
|
autoplug_caps (gchar *mime1, gchar *mime2)
|
|
{
|
|
GstCaps *caps1, *caps2;
|
|
|
|
caps1 = gst_caps_new ("tescaps1", mime1);
|
|
caps2 = gst_caps_new ("tescaps2", mime2);
|
|
|
|
return gst_autoplug_caps (caps1, caps2);
|
|
}
|
|
|
|
static void
|
|
dump_factories (GList *factories)
|
|
{
|
|
g_print ("dumping factories\n");
|
|
|
|
while (factories) {
|
|
GstElementFactory *factory = (GstElementFactory *)factories->data;
|
|
|
|
g_print ("factory: \"%s\"\n", factory->name);
|
|
|
|
factories = g_list_next (factories);
|
|
}
|
|
}
|
|
|
|
int main(int argc,char *argv[])
|
|
{
|
|
GList *factories;
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
factories = autoplug_caps ("audio/mp3", "audio/raw");
|
|
dump_factories (factories);
|
|
|
|
factories = autoplug_caps ("video/mpeg", "audio/raw");
|
|
dump_factories (factories);
|
|
|
|
factories = gst_autoplug_caps (
|
|
gst_caps_new_with_props(
|
|
"testcaps3",
|
|
"video/mpeg",
|
|
gst_props_new (
|
|
"mpegversion", GST_PROPS_INT (1),
|
|
"systemstream", GST_PROPS_BOOLEAN (TRUE),
|
|
NULL)),
|
|
gst_caps_new("testcaps4","audio/raw"));
|
|
dump_factories (factories);
|
|
|
|
factories = gst_autoplug_caps (
|
|
gst_caps_new_with_props(
|
|
"testcaps5",
|
|
"video/mpeg",
|
|
gst_props_new (
|
|
"mpegversion", GST_PROPS_INT (1),
|
|
"systemstream", GST_PROPS_BOOLEAN (FALSE),
|
|
NULL)),
|
|
gst_caps_new("testcaps6", "video/raw"));
|
|
dump_factories (factories);
|
|
|
|
exit (0);
|
|
}
|