[RFC] Adding grl_init (gint argc, gchar *argv[])



Hi all!

While working on the proposed new metadata key system, and also in
serialize/unserialize task, I noticed that almost initializations are
done when GrlPluginRegistry is created (which is done when user calls
for first time grl_plugin_registry_get_instance()).

This means that if user tries to execute some functions *before* running
grl_plugin_registry_get_instance(), they will fail.

This has the following implications, so far:

- Default metadata keys are inserted in the system when creating the
registry; if user tries to use GRL_METADATA_KEY_FOO before invoking
grl_plugin_registry_get_instance(), they will be NULL.

- grl_media_unserialize() relies on gtype system to do its job. In fact,
it requires that GrlMediaFoo are registered in glib type system. And
this is not done until user invokes (directly or indirectly)
grl_media_foo_get_type(). Roughly speaking, if the user has not created
previously a GrlMediaFoo media, grl_media_unserialize() will fail.

So the proposal is to add a grl_init() function, in the same spirit as
gst_init(), which would initialize all required stuff, so future calls
to Grilo framework would success. Most of initializations done in
grl_plugin_registry_init() would be moved to this grl_init().

Another benefit of having this grl_init() is all applications using it
could receive also command-line parameters that would affect Grilo
applications (again, in the same spirit as Gstreamer).

As an example, I was thinking about a --grl-plugin-dir parameter to
specify in command-line the set of plugins to use.


What do you think?

	J.A.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]