[Gstreamer-openmax] [PATCH] add some utility macros to get/set core and port configs/params

Felipe Contreras felipe.contreras at gmail.com
Wed Nov 25 09:21:06 PST 2009


On Mon, Nov 23, 2009 at 7:25 AM, Rob Clark <rob at ti.com> wrote:
> but an inline function could not figure out sizeof() properly.. so this
> would have to be passed as an additional parameter.  (although a combination
> of a macro calling an inline fxn could work)
>
> sometimes macro's are a necessary evil ;-)

Right, but in my opinion if you need a macro chances are you are doing
something wrong and the code becomes more convoluted.

I this particular case I think it makes sense to write a macro that wraps:
OMX_AUDIO_PARAM_PCMMODETYPE param = {
       .nSize = sizeof(param),
       .nVersion = OMX_VERSION,
};

But that's it. Then a separate inline function that does:
param.nPortIndex = 1;
OMX_GetParameter(omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, &param);

This way it would be possible to call OMX_SetParameter without
OMX_GetParameter (in case you are setting all the fields).

-- 
Felipe Contreras




More information about the Gstreamer-openmax mailing list