mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-16 05:16:36 +00:00
b38d9a945b
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.
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
#include <gst/gst.h>
|
|
|
|
static void
|
|
new_object_added (GstAutoplug *autoplug, GstObject *object)
|
|
{
|
|
g_print ("added new object \"%s\"\n", gst_object_get_name (object));
|
|
}
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
GstElement *element;
|
|
GstElement *videosink, *osssink;
|
|
GstAutoplug *autoplugger;
|
|
GList *testcaps;
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
osssink = gst_elementfactory_make ("osssink", "osssink");
|
|
g_assert (osssink != NULL);
|
|
videosink = gst_elementfactory_make ("videosink", "videosink");
|
|
g_assert (videosink != NULL);
|
|
|
|
testcaps = g_list_append (NULL,
|
|
gst_caps_new ("test_caps",
|
|
"video/mpeg",
|
|
gst_props_new (
|
|
"mpegversion", GST_PROPS_INT (1),
|
|
"systemstream", GST_PROPS_BOOLEAN (TRUE),
|
|
NULL)));
|
|
|
|
autoplugger = gst_autoplugfactory_make ("static");
|
|
|
|
gtk_signal_connect (GTK_OBJECT (autoplugger), "new_object", new_object_added, NULL);
|
|
|
|
element = gst_autoplug_to_caps (autoplugger, testcaps,
|
|
gst_pad_get_caps (gst_element_get_pad (osssink, "sink")),
|
|
gst_pad_get_caps (gst_element_get_pad (videosink, "sink")),
|
|
NULL);
|
|
g_assert (element != NULL);
|
|
|
|
xmlDocDump (stdout, gst_xml_write (element));
|
|
|
|
exit (0);
|
|
}
|