Esempio n. 1
0
void
g_omx_core_init (GOmxCore *core,
                 const gchar *library_name,
                 const gchar *component_name)
{
    core->imp = g_omx_request_imp (library_name);

    if (!core->imp)
    {
        core->omx_error = OMX_ErrorUndefined;
        return;
    }

    core->omx_error = core->imp->sym_table.get_handle (&core->omx_handle, (gchar *) component_name, core, &callbacks);
    core->omx_state = OMX_StateLoaded;
}
Esempio n. 2
0
void
g_omx_core_init (GOmxCore *core)
{
    gchar *library_name=NULL, *component_name=NULL, *component_role=NULL;

    if (core->omx_handle)
      return;

    g_object_get (core->object,
        "component-role", &component_role,
        "component-name", &component_name,
        "library-name", &library_name,
        NULL);

    GST_DEBUG_OBJECT (core->object, "loading: %s %s (%s)", component_name,
            component_role ? component_role : "", library_name);

    g_return_if_fail (component_name);
    g_return_if_fail (library_name);

    core->imp = g_omx_request_imp (library_name);

    if (!core->imp)
        return;

    #ifdef USE_STATIC
    core->omx_error = core->imp->sym_table.get_handle (&core->omx_handle,
                                                       (char *) component_name,
                                                       core,
                                                       &callbacks);
    #else
    core->omx_error = OMX_GetHandle (&core->omx_handle, (char *) component_name,
                                                       core,
                                                       &callbacks);
    #endif

    GST_DEBUG_OBJECT (core->object, "OMX_GetHandle(&%p) -> %s",
        core->omx_handle, g_omx_error_to_str (core->omx_error));

    g_return_if_fail (core->omx_handle);

    if (component_role)
    {
        OMX_PARAM_COMPONENTROLETYPE param;

        GST_DEBUG_OBJECT (core->object, "setting component role: %s",
                component_role);

        G_OMX_CORE_GET_PARAM (core,
                OMX_IndexParamStandardComponentRole, &param);

        strcpy((char*)param.cRole, component_role);

        G_OMX_CORE_SET_PARAM (core,
                OMX_IndexParamStandardComponentRole, &param);

        g_free (component_role);
    }

    g_free (component_name);
    g_free (library_name);

    if (!core->omx_error)
        core->omx_state = OMX_StateLoaded;
}