diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2001-03-03 19:09:10 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2001-03-03 19:09:10 +0000 |
commit | 33f74711fb39a8437ab6edbed033239bf1b56ab7 (patch) | |
tree | 35100f229c42a0c45682b47d83248ebb6fa3fb17 | |
parent | 3987dbee2255b301c3200e1323be14d16a42f819 (diff) |
Added a test program for the autopluggersBRANCH-AUTOPLUG2-20010306-FREEZE
Original commit message from CVS:
Added a test program for the autopluggers
-rw-r--r-- | tests/.gitignore | 3 | ||||
-rw-r--r-- | tests/autoplug3.c | 100 |
2 files changed, 102 insertions, 1 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index d6d3214f5c..fc4f7a1ff4 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -6,7 +6,7 @@ Makefile.in .deps .libs *.xml - +*.gst init loadall simplefake @@ -25,3 +25,4 @@ load padfactory tee autoplug2 +autoplug3 diff --git a/tests/autoplug3.c b/tests/autoplug3.c new file mode 100644 index 0000000000..7d2c3ee2ea --- /dev/null +++ b/tests/autoplug3.c @@ -0,0 +1,100 @@ +#include <gst/gst.h> + +int +main (int argc, char *argv[]) +{ + GstElement *element; + GstElement *sink1, *sink2; + GstAutoplug *autoplug; + + gst_init(&argc,&argv); + + sink1 = gst_elementfactory_make ("videosink", "videosink"); + sink2 = gst_elementfactory_make ("audiosink", "audiosink"); + + autoplug = gst_autoplugfactory_make ("staticrender"); + + element = gst_autoplug_to_renderers (autoplug, + g_list_append (NULL, gst_caps_new ("mp3caps", "audio/mp3")), sink2, NULL); + xmlSaveFile ("autoplug3_1.gst", gst_xml_write (element)); + + element = gst_autoplug_to_renderers (autoplug, + g_list_append (NULL, gst_caps_new ("mpeg1caps", "video/mpeg")), sink1, NULL); + if (element) { + xmlSaveFile ("autoplug3_2.gst", gst_xml_write (element)); + } + + element = gst_autoplug_to_caps (autoplug, + g_list_append (NULL, gst_caps_new_with_props( + "testcaps3", + "video/mpeg", + gst_props_new ( + "mpegversion", GST_PROPS_INT (1), + "systemstream", GST_PROPS_BOOLEAN (TRUE), + NULL))), + g_list_append (NULL, gst_caps_new("testcaps4","audio/raw")), + NULL); + if (element) { + xmlSaveFile ("autoplug3_3.gst", gst_xml_write (element)); + } + + element = gst_autoplug_to_caps (autoplug, + g_list_append (NULL, gst_caps_new_with_props( + "testcaps5", + "video/mpeg", + gst_props_new ( + "mpegversion", GST_PROPS_INT (1), + "systemstream", GST_PROPS_BOOLEAN (FALSE), + NULL))), + g_list_append (NULL, gst_caps_new("testcaps6", "video/raw")), + NULL); + if (element) { + xmlSaveFile ("autoplug3_4.gst", gst_xml_write (element)); + } + + element = gst_autoplug_to_caps (autoplug, + g_list_append (NULL, gst_caps_new( + "testcaps7", + "video/avi")), + g_list_append (NULL, gst_caps_new("testcaps8", "video/raw")), + g_list_append (NULL, gst_caps_new("testcaps9", "audio/raw")), + NULL); + if (element) { + xmlSaveFile ("autoplug3_5.gst", gst_xml_write (element)); + } + + element = gst_autoplug_to_caps (autoplug, + g_list_append (NULL, gst_caps_new_with_props( + "testcaps10", + "video/mpeg", + gst_props_new ( + "mpegversion", GST_PROPS_INT (1), + "systemstream", GST_PROPS_BOOLEAN (TRUE), + NULL))), + g_list_append (NULL, gst_caps_new("testcaps10", "video/raw")), + g_list_append (NULL, gst_caps_new("testcaps11", "audio/raw")), + NULL); + if (element) { + xmlSaveFile ("autoplug3_6.gst", gst_xml_write (element)); + } + + sink1 = gst_elementfactory_make ("videosink", "videosink"); + sink2 = gst_elementfactory_make ("audiosink", "audiosink"); + + element = gst_autoplug_to_renderers (autoplug, + g_list_append (NULL, gst_caps_new_with_props( + "testcaps10", + "video/mpeg", + gst_props_new ( + "mpegversion", GST_PROPS_INT (1), + "systemstream", GST_PROPS_BOOLEAN (TRUE), + NULL))), + sink1, + sink2, + NULL); + if (element) { + xmlSaveFile ("autoplug3_7.gst", gst_xml_write (element)); + } + + exit (0); +} |