Added a little tee test program.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 19 Jan 2001 00:07:40 +0000 (00:07 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 19 Jan 2001 00:07:40 +0000 (00:07 +0000)
Original commit message from CVS:
Added a little tee test program.

tests/.gitignore
tests/Makefile.am
tests/eos/Makefile.am
tests/tee.c [new file with mode: 0644]

index 9af6a43..8d0cd0b 100644 (file)
@@ -23,3 +23,4 @@ case4
 markup
 load
 padfactory
+tee
index c6b3a4f..f116e17 100644 (file)
@@ -1,7 +1,7 @@
-SUBDIRS = sched eos
+SUBDIRS = sched eos 
 
 noinst_PROGRAMS = init loadall simplefake states caps queue registry \
-paranoia rip mp3encode autoplug props case4 markup load 
+paranoia rip mp3encode autoplug props case4 markup load tee
 
 # we have nothing but apps here, we can do this safely
 LIBS += $(GST_LIBS)
index 0c0d7ab..7a6a621 100644 (file)
@@ -1,4 +1,4 @@
-noinst_PROGRAMS = case1
+noinst_PROGRAMS = case1 case2 case3
 
 # jsut apps here, this is safe
 LIBS += $(GST_LIBS)
diff --git a/tests/tee.c b/tests/tee.c
new file mode 100644 (file)
index 0000000..c6c4b86
--- /dev/null
@@ -0,0 +1,36 @@
+#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");
+
+  templ = gst_padtemplate_create ("src%d", GST_PAD_SRC, GST_PAD_REQUEST, templ->caps);
+  pad = gst_element_request_pad (element, templ);
+  g_print ("new pad %s\n", gst_pad_get_name (pad));
+
+  parent = xmlNewChild (doc->xmlRootNode, NULL, "Padtemplate", NULL);
+
+  gst_padtemplate_save_thyself (pad->padtemplate, parent);
+
+  xmlDocDump(stdout, doc);
+  
+  return 0;
+}