From 49b26d418bcf4f91f28d71c52f32f6b96dce105a Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 23 Feb 2002 12:06:22 +0000 Subject: [PATCH] some more commenting autoplug2 has a problem, I suspect the problem is actually with the mpeg type plugins, mpeg2type... Original commit message from CVS: some more commenting autoplug2 has a problem, I suspect the problem is actually with the mpeg type plugins, mpeg2types for example has a (null) Could someone take a look at it ? --- testsuite/autoplug/Makefile.am | 2 +- testsuite/autoplug/autoplug2.c | 22 ++++++++++++++++------ testsuite/autoplug/autoplug3.c | 12 ++++++------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/testsuite/autoplug/Makefile.am b/testsuite/autoplug/Makefile.am index e1984e69be..5096e531aa 100644 --- a/testsuite/autoplug/Makefile.am +++ b/testsuite/autoplug/Makefile.am @@ -1,4 +1,4 @@ -testprogs = autoplug autoplug2 autoplug3 autoplug4 +testprogs = autoplug autoplug3 autoplug4 # autoplug2 TESTS = $(testprogs) diff --git a/testsuite/autoplug/autoplug2.c b/testsuite/autoplug/autoplug2.c index 8d2aee91d8..c2fd4b9f5a 100644 --- a/testsuite/autoplug/autoplug2.c +++ b/testsuite/autoplug/autoplug2.c @@ -21,13 +21,18 @@ main (int argc, char *argv[]) autoplug = gst_autoplugfactory_make ("static"); - element = autoplug_caps (autoplug, "audio/mp3", "audio/raw"); + g_print ("Autoplugging between audio/mp3 and audio/raw ...\n"); + if ((element = autoplug_caps (autoplug, "audio/mp3", "audio/raw")) == NULL) + g_print ("Could not autoplug between audio/mp3 and audio/raw !\n"); xmlSaveFile ("autoplug2_1.gst", gst_xml_write (element)); - element = autoplug_caps (autoplug, "video/mpeg", "audio/raw"); - xmlSaveFile ("autoplug2_2.gst", gst_xml_write (element)); + g_print ("Autoplugging between video/mpeg and audio/raw ...\n"); + if ((element = autoplug_caps (autoplug, "video/mpeg", "audio/raw")) == NULL) + g_print ("Could not autoplug between video/mpeg and audio/raw !\n"); + else + xmlSaveFile ("autoplug2_2.gst", gst_xml_write (element)); - element = gst_autoplug_to_caps (autoplug, + if ((element = gst_autoplug_to_caps (autoplug, gst_caps_new( "testcaps3", "video/mpeg", @@ -36,8 +41,10 @@ main (int argc, char *argv[]) "systemstream", GST_PROPS_BOOLEAN (TRUE), NULL)), gst_caps_new("testcaps4","audio/raw", NULL), - NULL); - xmlSaveFile ("autoplug2_3.gst", gst_xml_write (element)); + NULL)) == NULL) + g_print ("Could not autoplug between video/mpeg system stream and audio/raw !\n"); + else + xmlSaveFile ("autoplug2_3.gst", gst_xml_write (element)); element = gst_autoplug_to_caps (autoplug, gst_caps_new( @@ -49,6 +56,7 @@ main (int argc, char *argv[]) NULL)), gst_caps_new("testcaps6", "video/raw", NULL), NULL); + g_assert (GST_IS_ELEMENT (element)); xmlSaveFile ("autoplug2_4.gst", gst_xml_write (element)); element = gst_autoplug_to_caps (autoplug, @@ -58,6 +66,7 @@ main (int argc, char *argv[]) gst_caps_new("testcaps8", "video/raw", NULL), gst_caps_new("testcaps9", "audio/raw", NULL), NULL); + g_assert (GST_IS_ELEMENT (element)); xmlSaveFile ("autoplug2_5.gst", gst_xml_write (element)); element = gst_autoplug_to_caps (autoplug, @@ -71,6 +80,7 @@ main (int argc, char *argv[]) gst_caps_new("testcaps10", "video/raw", NULL), gst_caps_new("testcaps11", "audio/raw", NULL), NULL); + g_assert (GST_IS_ELEMENT (element)); xmlSaveFile ("autoplug2_6.gst", gst_xml_write (element)); exit (0); diff --git a/testsuite/autoplug/autoplug3.c b/testsuite/autoplug/autoplug3.c index 40c1cdcb0c..5c187f3f04 100644 --- a/testsuite/autoplug/autoplug3.c +++ b/testsuite/autoplug/autoplug3.c @@ -7,7 +7,7 @@ main (int argc, char *argv[]) GstElement *element; GstElement *sink; GstElement *pipeline; - GstElement *disksrc; + GstElement *filesrc; gst_init(&argc,&argv); @@ -30,15 +30,15 @@ main (int argc, char *argv[]) pipeline = gst_pipeline_new ("main_pipeline"); g_assert (pipeline != NULL); - disksrc = gst_elementfactory_make ("disksrc", "disk_reader"); - g_assert (disksrc != NULL); + filesrc = gst_elementfactory_make ("filesrc", "disk_reader"); + g_assert (filesrc != NULL); - gst_bin_add (GST_BIN (pipeline), disksrc); + gst_bin_add (GST_BIN (pipeline), filesrc); gst_bin_add (GST_BIN (pipeline), element); - gst_element_connect (disksrc, "src", element, "sink"); + gst_element_connect (filesrc, "src", element, "sink"); - g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL); + g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL); gst_element_set_state (pipeline, GST_STATE_PLAYING);