[Gstreamer-openmax] [PATCH] a small bit of refactoring to gstomx_util, to allow for more flexibility of when the OMX component and port is instantiated

Rob Clark rob at ti.com
Thu Nov 5 18:33:33 PST 2009


On Nov 5, 2009, at 3:21 PM, Stefan Kost wrote:

> Rob Clark schrieb:
>> Signed-off-by: Rob Clark <rob at ti.com>
>> ---
>> omx/gstomx_base_filter.c |   24 ++------
>> omx/gstomx_base_sink.c   |   21 ++------
>> omx/gstomx_base_src.c    |   22 ++------
>> omx/gstomx_util.c        |  133 ++++++++++++++++++++++++++++++++++ 
>> +-----------
>> omx/gstomx_util.h        |   12 +++--
>> 5 files changed, 123 insertions(+), 89 deletions(-)
>>
>
>> void
>> -g_omx_core_init (GOmxCore *core,
>> -                 const gchar *library_name,
>> -                 const gchar *component_name)
>> +g_omx_core_init (GOmxCore *core)
>> {
>> +    gchar *library_name=NULL, *component_name=NULL;
>> +
>> +    if (core->omx_handle)
>> +      return;
>> +
>> +    GST_DEBUG_OBJECT (core->object, "loading: %s (%s)",  
>> component_name, library_name);
>> +
>> +    g_object_get (core->object,
>> +        "component-name", &component_name,
>> +        "library-name", &library_name,
>> +        NULL);
>> +
>> +    g_return_if_fail (component_name);
>> +    g_return_if_fail (library_name);
>> +
>>     core->imp = request_imp (library_name);
>>
>
> just use g_assert here, if that is never supposed to fail.  
> g_return_if_fail is
> to handle external wrong api usage (things that you can't control),  
> and g_assert
> is for own mistakes. People who are using stable releases of a  
> software would
> turn the assert off. When they ship their product and its well  
> tested, they
> could turn the g_return_if_fail off too (if there are not going to  
> be other
> users of the library).
>

agreed.. should be g_assert since this is never supposed to fail..  
when I re-submit, I'll change this.

BR,
-R





More information about the Gstreamer-openmax mailing list