> >> 1. Create a configuration registry
> >
> > How do I do this?
> >
> > config_reg = bg_cfg_registry_create();
> > // what do I load here if I want an encoder????
> > tmp_path =  bg_search_file_read("recorder", "config.xml");
> > bg_cfg_registry_load(config_reg, tmp_path);
> 
> You'll always load all kinds of plugins.
> 
> The "recorder" means, that we will try to load
> ~/.gmerlin/recorder/config.xml, it's basically the name of the
> application, which will translate into a directory under ~/.gmerlin.
> In this directory, applications can store all their private data. E.g.
> the GUI player saves the media tree here.


I just want to load plugins to encode video/audio.  How do I do that?
It is not obvious to me from the code.

I can see that bg_search_file_read  gets a file path.   But, I don't
know what is supposed to be in "config.xml" or why I even bother loading
it?

Do I even need to do this step?

> You can use any other path for this of course.
> 
> >> 2. Create a plugin registry
> >
> > I see I am supposed to do something like:
> >     section = bg_cfg_registry_find_section(config_reg, "plugins");
> >     plug_reg = bg_plugin_registry_create(section);
> >
> > what is a bg_cfg_section_t ?
> 
> A section is a like a "directory" in the config registry. It can contain
> parameters (name-value pairs) and subsections.
> In all my applications I have a section "plugins". It contains
> one subsection for each plugin.


what is a config registry?


> Passing the "plugins" section to the plugin registry has the advantage,

What is a plugin registry?  How does it get built?

> that the plugin registry will usually set the plugin parameters to the
> the last saved values when it loads a plugin. All you need to do is to
> store all parameters, you pass via set_parameter(), also in the
> section for the plugin. My gtk dialogs do this automatically.
> 
> Splitting the configuration registry into sections has the advantage, that
> it's less painful to find unique names for parameters if you have a large
> number of plugins. parameter names must only be unique within their
> section.

Where do I find the encoders registry?

> > What are all these steps?   I can't find any doku or simple source code
> > on it and I have been looking for days now.
> 
> If you have an idea to improve the documentation or provide some simple
> examples, go ahead. Of course clarifying patches for Doxygen comments
> are *highly* welcome.

I will try to cobble together a simple tutorial or something if that
helps.   But, first I need to understand what  these things do.  I
cannot find any sort of overview anywhere.  Can you explain a little
more, or point me to where I can read about it?


> Once you created a plugin registry, you can get the available encoders
> with:
> 
> const bg_plugin_info_t * info;
> 
> int num =
> bg_plugin_registry_get_num_plugins(plugin_reg,
>                                    BG_PLUGIN_ENCODER_AUDIO |
>                                    BG_PLUGIN_ENCODER_VIDEO |
>                                    BG_PLUGIN_ENCODER,
>                                    BG_PLUGIN_FILE);
> 
> for(i = 0; i < num; i++)
>   {
>   info = bg_plugin_find_by_index(plugin_reg, i,
>                                  BG_PLUGIN_ENCODER_AUDIO |
>                                  BG_PLUGIN_ENCODER_VIDEO |
>                                  BG_PLUGIN_ENCODER,
>                                  BG_PLUGIN_FILE);
>   }


This starts to make a little sense, but I am still blurry on how to make
the plugin_reg.

I assume from the bg_plugin_info_t, I can see if it is "ogg/theora" or
"x264", etc?  No?


> With this method you can query for any combination of plugin types.
> Only the last 2 arguments must be identical for 
> bg_plugin_registry_get_num_plugins() and bg_plugin_find_by_index().
> 
> > I can't get past steps 1 and 2.  I'm sure I'll have questions on the
> > rest soon.
> 
> No problem. Maybe telling others how to use this helps me finding ways to
> make it easier (or explain better).



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to