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 ?
This commit is contained in:
Thomas Vander Stichele 2002-02-23 12:06:22 +00:00
parent f93e629e67
commit 49b26d418b
3 changed files with 23 additions and 13 deletions

View file

@ -1,4 +1,4 @@
testprogs = autoplug autoplug2 autoplug3 autoplug4 testprogs = autoplug autoplug3 autoplug4 # autoplug2
TESTS = $(testprogs) TESTS = $(testprogs)

View file

@ -21,13 +21,18 @@ main (int argc, char *argv[])
autoplug = gst_autoplugfactory_make ("static"); 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)); xmlSaveFile ("autoplug2_1.gst", gst_xml_write (element));
element = autoplug_caps (autoplug, "video/mpeg", "audio/raw"); g_print ("Autoplugging between video/mpeg and audio/raw ...\n");
xmlSaveFile ("autoplug2_2.gst", gst_xml_write (element)); 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( gst_caps_new(
"testcaps3", "testcaps3",
"video/mpeg", "video/mpeg",
@ -36,8 +41,10 @@ main (int argc, char *argv[])
"systemstream", GST_PROPS_BOOLEAN (TRUE), "systemstream", GST_PROPS_BOOLEAN (TRUE),
NULL)), NULL)),
gst_caps_new("testcaps4","audio/raw", NULL), gst_caps_new("testcaps4","audio/raw", NULL),
NULL); NULL)) == NULL)
xmlSaveFile ("autoplug2_3.gst", gst_xml_write (element)); 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, element = gst_autoplug_to_caps (autoplug,
gst_caps_new( gst_caps_new(
@ -49,6 +56,7 @@ main (int argc, char *argv[])
NULL)), NULL)),
gst_caps_new("testcaps6", "video/raw", NULL), gst_caps_new("testcaps6", "video/raw", NULL),
NULL); NULL);
g_assert (GST_IS_ELEMENT (element));
xmlSaveFile ("autoplug2_4.gst", gst_xml_write (element)); xmlSaveFile ("autoplug2_4.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug, 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("testcaps8", "video/raw", NULL),
gst_caps_new("testcaps9", "audio/raw", NULL), gst_caps_new("testcaps9", "audio/raw", NULL),
NULL); NULL);
g_assert (GST_IS_ELEMENT (element));
xmlSaveFile ("autoplug2_5.gst", gst_xml_write (element)); xmlSaveFile ("autoplug2_5.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug, 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("testcaps10", "video/raw", NULL),
gst_caps_new("testcaps11", "audio/raw", NULL), gst_caps_new("testcaps11", "audio/raw", NULL),
NULL); NULL);
g_assert (GST_IS_ELEMENT (element));
xmlSaveFile ("autoplug2_6.gst", gst_xml_write (element)); xmlSaveFile ("autoplug2_6.gst", gst_xml_write (element));
exit (0); exit (0);

View file

@ -7,7 +7,7 @@ main (int argc, char *argv[])
GstElement *element; GstElement *element;
GstElement *sink; GstElement *sink;
GstElement *pipeline; GstElement *pipeline;
GstElement *disksrc; GstElement *filesrc;
gst_init(&argc,&argv); gst_init(&argc,&argv);
@ -30,15 +30,15 @@ main (int argc, char *argv[])
pipeline = gst_pipeline_new ("main_pipeline"); pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline != NULL); g_assert (pipeline != NULL);
disksrc = gst_elementfactory_make ("disksrc", "disk_reader"); filesrc = gst_elementfactory_make ("filesrc", "disk_reader");
g_assert (disksrc != NULL); 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_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); gst_element_set_state (pipeline, GST_STATE_PLAYING);