mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
d20f0b4bae
Original commit message from CVS: Add gst_element_request_compatible_pad and remove gst_element_request_pad. Implemented something reasonable for gst_element_request_compatible_pad, but havn't tested much: it won't work for tee because the pad templates have no caps, and negotiation is not yet written, so it is assumed that the tee pads can't connect to anything.
37 lines
914 B
C
37 lines
914 B
C
#include <gst/gst.h>
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
GstElement *element, *mp3parse;
|
|
GstPadTemplate *templ;
|
|
GstPad *pad;
|
|
xmlDocPtr doc;
|
|
xmlNodePtr parent;
|
|
|
|
doc = xmlNewDoc ("1.0");
|
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
element = gst_elementfactory_make("tee","element");
|
|
mp3parse = gst_elementfactory_make("mp3parse","mp3parse");
|
|
|
|
pad = gst_element_request_pad_by_name (element, "src%d");
|
|
g_print ("new pad %s\n", gst_pad_get_name (pad));
|
|
|
|
templ = gst_element_get_padtemplate_by_name (mp3parse, "sink");
|
|
|
|
pad = gst_element_request_compatible_pad (element, templ);
|
|
g_print ("new pad %s\n", gst_pad_get_name (pad));
|
|
|
|
if (pad != NULL) {
|
|
parent = xmlNewChild (doc->xmlRootNode, NULL, "Padtemplate", NULL);
|
|
|
|
gst_padtemplate_save_thyself (pad->padtemplate, parent);
|
|
|
|
xmlDocDump(stdout, doc);
|
|
}
|
|
|
|
return 0;
|
|
}
|