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

Rob Clark rob at ti.com
Sun Nov 22 21:25:38 PST 2009


On Nov 14, 2009, at 7:19 AM, Felipe Contreras wrote:

> On Wed, Nov 4, 2009 at 4:25 AM, Rob Clark <rob at ti.com> wrote:
>> --- a/omx/gstomx_aacdec.c
>> +++ b/omx/gstomx_aacdec.c
>> @@ -144,13 +144,7 @@ settings_changed_cb (GOmxCore *core)
>>     {
>>         OMX_AUDIO_PARAM_PCMMODETYPE param;
>>
>> -        memset (&param, 0, sizeof (param));
>> -        param.nSize = sizeof (OMX_AUDIO_PARAM_PCMMODETYPE);
>> -        param.nVersion.s.nVersionMajor = 1;
>> -        param.nVersion.s.nVersionMinor = 1;
>
> I've actually thought on changing this to:
>
> OMX_AUDIO_PARAM_PCMMODETYPE param = {
> 	.nSize = sizeof(param),
> 	.nVersion = OMX_VERSION,
> };
>
>> -        param.nPortIndex = 1;
>> -        OMX_GetParameter (omx_base->gomx->omx_handle,  
>> OMX_IndexParamAudioPcm, &param);
>> +        G_OMX_PORT_GET_PARAM (omx_base->out_port,  
>> OMX_IndexParamAudioPcm, &param);
>
> I'd rather have an inline function instead.
>


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 ;-)


BR,
-R





More information about the Gstreamer-openmax mailing list