[Gstreamer-openmax] [PATCH v2] Initial support for configuration file
Felipe Contreras
felipe.contreras at gmail.com
Tue Mar 2 16:35:44 PST 2010
On Wed, Mar 3, 2010 at 2:15 AM, Felipe Contreras
<felipe.contreras at nokia.com> wrote:
> diff --git a/omx/gstomx.c b/omx/gstomx.c
[...]
> +static GstStructure *element_table = NULL;
> +
> +const gchar *default_config = NULL;
Note that the default_config is NULL, but will be updated by a
subsequent patch to use the extern one.
[...]
> +/* TODO: we can cache table w/ gst_plugin_{get,set}_cache_data..
> + */
> +static GstStructure *
> +get_element_table (void)
> +{
> + static volatile gsize gonce_data = 0;
> + if (g_once_init_enter (&gonce_data))
> + {
> + gchar *path;
> + gchar *config, *s;
> + GstStructure *element;
> +
> + path = g_strdup (g_getenv ("OMX_REGISTRY"));
> + if (!path)
> + {
> + path = g_build_filename (g_get_user_config_dir (),
> + "gst-openmax.conf", NULL);
> + }
> +
> + if (!g_file_get_contents (path, &config, NULL, NULL))
> + {
> + g_warning ("could not find config file '%s'.. using defaults!", path);
> + config = (gchar *) default_config;
Note that here I'm not creating a file with the default_config.
I think it's a bad idea; the conf file wouldn't be human readable, and
in case gst-omx is updated with a new default_config it will not be
used because the old one is already stored.
[...]
Cheers.
--
Felipe Contreras
More information about the Gstreamer-openmax
mailing list