[Gstreamer-openmax] [PATCH 2/2] add gst-openmax registry (config file)

Felipe Contreras felipe.contreras at nokia.com
Tue Mar 2 16:07:10 PST 2010


On Mon, Mar 01, 2010 at 12:36:13AM +0100, Rob Clark wrote:
> Configurable mapping between gst-openmax elements and OMX library-name
> and component-name via config file.  The config file may even create
> multiple different elements with unique names using the same
> gst-openmax class but different OMX library-name and/or
> component-name.
> 
> In the simple case, of one OMX component per gst-openmax class,
> specify the gst-openmax class as the 'type', and the 'library-name'
> and 'compnent-name' of the OMX component, and optionally the 'rank'
> (defaults to 0 or GST_RANK_NONE):
> 
> ----
> omx_h264dec,
>   type=GstOmxH264Dec,
>   library-name=libomxil-bellagio.so.0,
>   component-name=OMX.st.video_decoder.avc,
>   rank=256;
> ----
> 
> Or in the advanced case of multiple OMX components per gst-openmax
> class, specify the gst-openmax class as the 'parent-type' and a
> dynamically created sub-class for the 'type':
> 
> ----
> omx_mp3dec_ti,
>       parent-type=GstOmxMp3Dec,
>       type=GstOmxMp3DecTi
>       library-name=libOMX_Core.so.0,
>       component-name=OMX.TI.AUDIO.DECODE,
>       component-role=audio_decode.dsp.mp3,
>       rank=256;
> 
> omx_mp3dec_nokia,
>       parent-type=GstOmxMp3Dec,
>       type=GstOmxMp3DecNokia
>       library-name=libomxil_bellagio.so.0,
>       component-name=OMX.nokia.audio_decode.mp3,
>       rank=128;
> ----
> 
> by default, the config file is stored in
> $HOME/.config/gst-openmax.conf, although if none is found a default
> config will be created.
> ---
> Latest (and hopefully final) version of patch fixes small memory leak

I was about to commit this when I recalled to run 'make check', which is
broken by this commit. One modification lead to another and I ended up
making huge modifications. Please see the following patch (I'll call it
v2 because the previous ones were not versioned).

First, it's not necessary to make read-only the 'library-name' and
'component-name' properties. I acomplished this by moving both fienls
from the bases clases to GOmxCore, and then, in g_omx_core_init(), only
update them if they haven't been set before. This fixes 'make check'. I
have the patch if you are interested.

It might be possible to update 'make check' to use a temporary
configuration file instead, but I didn't want to go that way yet.

The problem with this approach is that the fields will not be updated
from the config file until g_omx_core_init() is called, so they'll not
show in gst-launch.

I solved this by calling g_omx_get_component_info() when the instance is
created and using the type of the class instead of the element name. For
some reason get_element_name() was returning NULL. I think it might be
possible to keep using the element name as the primary field, by using
the "element-name" qdata of the GType but I only though of it just now.

The resulting patch is much simpler.

This is the format of the config: (I'm not entirely happy with it)
---
GstOmxMpeg4Dec,
	name=omx_mpeg4dec,
	library-name=libOMX_Core,
	component-name=OMX.TI.Video.Decoder,
	rank=256;
---

Cheers.

-- 
Felipe Contreras




More information about the Gstreamer-openmax mailing list