Use gst_caps_to_string to print caps. Add max_iterations.

Original commit message from CVS:
Use gst_caps_to_string to print caps.  Add max_iterations.
This commit is contained in:
David Schleef 2003-09-14 11:08:50 +00:00
parent b3e15a8f71
commit b4993b3de2

View file

@ -12,17 +12,13 @@
**/ **/
gboolean FOUND = FALSE; gboolean FOUND = FALSE;
int iterations;
int max_iterations = 100;
void void
gst_caps_print (GstCaps *caps) gst_caps_print (GstCaps *caps)
{ {
while (caps) { g_print ("%s\n", gst_caps_to_string (caps));
g_print ("%s (%s)\n", caps->name, gst_caps_get_mime (caps));
if (caps->properties) {
g_print ("has properties\n");
}
caps = caps->next;
}
} }
void void
@ -61,7 +57,13 @@ main (int argc, char *argv[])
/* set to play */ /* set to play */
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
while (gst_bin_iterate (GST_BIN (pipeline)) && !FOUND) ; while (!FOUND){
gst_bin_iterate (GST_BIN (pipeline));
iterations++;
if(iterations >= max_iterations){
break;
}
}
if (!FOUND) { if (!FOUND) {
g_print ("No type found\n"); g_print ("No type found\n");
return 1; return 1;