From: Xavi Artigas Date: Tue, 26 Jun 2012 11:25:16 +0000 (+0200) Subject: Prefer GOOM over other visuals. X-Git-Tag: 1.19.3~489^2~562^2~177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4ca0d8c0c90643e5a5f8b0793e11763b8d0148a;p=platform%2Fupstream%2Fgstreamer.git Prefer GOOM over other visuals. Radio station that does not use chained-ogg files. --- diff --git a/gst-sdk/tutorials/playback-tutorial-6.c b/gst-sdk/tutorials/playback-tutorial-6.c index 59e14053..31a3a42 100644 --- a/gst-sdk/tutorials/playback-tutorial-6.c +++ b/gst-sdk/tutorials/playback-tutorial-6.c @@ -2,7 +2,7 @@ /* playbin2 flags */ typedef enum { - GST_PLAY_FLAG_VIS = (1 << 3) /* Enable rendering of visualisations when there is no video stream. */ + GST_PLAY_FLAG_VIS = (1 << 3) /* Enable rendering of visualizations when there is no video stream. */ } GstPlayFlags; /* Return TRUE if this is a Visualization element */ @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { GstBus *bus; GstMessage *msg; GList *list, *walk; - GstElementFactory *factory = NULL; + GstElementFactory *selected_factory = NULL; guint flags; /* Initialize GStreamer */ @@ -36,27 +36,32 @@ int main(int argc, char *argv[]) { g_print("Available visualization plugins:\n"); for (walk = list; walk != NULL; walk = g_list_next (walk)) { const gchar *name; + GstElementFactory *factory; factory = GST_ELEMENT_FACTORY (walk->data); name = gst_element_factory_get_longname (factory); - g_print(" %s\n", name); + + if (selected_factory == NULL || g_str_has_prefix (name, "GOOM")) { + selected_factory = factory; + } } /* Don't use the factory if it's still empty */ /* e.g. no visualization plugins found */ - if (!factory) { + if (!selected_factory) { g_print ("No visualization plugins found!\n"); return -1; } - /* We now have factory pointing to the last Visualization plugin found */ - vis_plugin = gst_element_factory_create (factory, NULL); + /* We have now selected a factory for the visualization element */ + g_print ("Selected '%s'\n", gst_element_factory_get_longname (selected_factory)); + vis_plugin = gst_element_factory_create (selected_factory, NULL); if (!vis_plugin) return -1; /* Build the pipeline */ - pipeline = gst_parse_launch ("playbin2 uri=http://radio.goha.ru:8000/grindfm.ogg", NULL); + pipeline = gst_parse_launch ("playbin2 uri=http://radio.hbr1.com:19800/ambient.ogg", NULL); /* Set the visualization flag */ g_object_get (pipeline, "flags", &flags, NULL);