mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
Prefer GOOM over other visuals.
Radio station that does not use chained-ogg files.
This commit is contained in:
parent
9e05d50a5f
commit
a4ca0d8c0c
1 changed files with 12 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/* playbin2 flags */
|
/* playbin2 flags */
|
||||||
typedef enum {
|
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;
|
} GstPlayFlags;
|
||||||
|
|
||||||
/* Return TRUE if this is a Visualization element */
|
/* Return TRUE if this is a Visualization element */
|
||||||
|
@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstMessage *msg;
|
GstMessage *msg;
|
||||||
GList *list, *walk;
|
GList *list, *walk;
|
||||||
GstElementFactory *factory = NULL;
|
GstElementFactory *selected_factory = NULL;
|
||||||
guint flags;
|
guint flags;
|
||||||
|
|
||||||
/* Initialize GStreamer */
|
/* Initialize GStreamer */
|
||||||
|
@ -36,27 +36,32 @@ int main(int argc, char *argv[]) {
|
||||||
g_print("Available visualization plugins:\n");
|
g_print("Available visualization plugins:\n");
|
||||||
for (walk = list; walk != NULL; walk = g_list_next (walk)) {
|
for (walk = list; walk != NULL; walk = g_list_next (walk)) {
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
|
GstElementFactory *factory;
|
||||||
|
|
||||||
factory = GST_ELEMENT_FACTORY (walk->data);
|
factory = GST_ELEMENT_FACTORY (walk->data);
|
||||||
name = gst_element_factory_get_longname (factory);
|
name = gst_element_factory_get_longname (factory);
|
||||||
|
|
||||||
g_print(" %s\n", name);
|
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 */
|
/* Don't use the factory if it's still empty */
|
||||||
/* e.g. no visualization plugins found */
|
/* e.g. no visualization plugins found */
|
||||||
if (!factory) {
|
if (!selected_factory) {
|
||||||
g_print ("No visualization plugins found!\n");
|
g_print ("No visualization plugins found!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We now have factory pointing to the last Visualization plugin found */
|
/* We have now selected a factory for the visualization element */
|
||||||
vis_plugin = gst_element_factory_create (factory, NULL);
|
g_print ("Selected '%s'\n", gst_element_factory_get_longname (selected_factory));
|
||||||
|
vis_plugin = gst_element_factory_create (selected_factory, NULL);
|
||||||
if (!vis_plugin)
|
if (!vis_plugin)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Build the pipeline */
|
/* 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 */
|
/* Set the visualization flag */
|
||||||
g_object_get (pipeline, "flags", &flags, NULL);
|
g_object_get (pipeline, "flags", &flags, NULL);
|
||||||
|
|
Loading…
Reference in a new issue