当前位置: 首页>>代码示例>>C++>>正文


C++ CModule::GetLibraryName方法代码示例

本文整理汇总了C++中CModule::GetLibraryName方法的典型用法代码示例。如果您正苦于以下问题:C++ CModule::GetLibraryName方法的具体用法?C++ CModule::GetLibraryName怎么用?C++ CModule::GetLibraryName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CModule的用法示例。


在下文中一共展示了CModule::GetLibraryName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CModule

static struct list *construct_components(void)
{
    struct list *head = NULL, *preload_entry;
    ComponentHandlePtr component_handle;

    /* In Chromium OS, the OMX IL Client will call preload_components()
     * so that the preload_list is already populated. In non-chrome case,
     * we need to create the list here */
    if (!preload_list) {
       if (!create_preload_list()) {
          omx_verboseLog("error: Preload list cannot be populated");
       }
    }

    list_foreach(preload_list, preload_entry) {
        CModule *cmodule;
        struct list *entry;
        OMX_ERRORTYPE ret;

        component_handle = (ComponentHandlePtr) preload_entry->data;

        /* skip libraries starting with # */
        if (component_handle->comp_name[0] == '#')
            continue;

        cmodule = new CModule(component_handle->comp_name);
        if (!cmodule)
            continue;

        omx_verboseLog("found component library %s", component_handle->comp_name);

        ret = cmodule->Load(MODULE_NOW, component_handle->comp_handle);
        if (ret != OMX_ErrorNone)
            goto delete_cmodule;

        ret = cmodule->SetParser(component_handle->parser_handle);
        if (ret != OMX_ErrorNone)
            goto delete_cmodule;

        ret = cmodule->QueryComponentNameAndRoles();
        if (ret != OMX_ErrorNone)
            goto unload_cmodule;

        entry = list_alloc(cmodule);
        if (!entry)
            goto unload_cmodule;
        head = __list_add_tail(head, entry);

        omx_verboseLog("module %s:%s added to component list",
             cmodule->GetLibraryName(), cmodule->GetComponentName());

        continue;

    unload_cmodule:
        cmodule->Unload();
    delete_cmodule:
        delete cmodule;
    }
开发者ID:xuguangxin,项目名称:omxil_core,代码行数:58,代码来源:wrs_omxcore.cpp

示例2: strncpy

static struct list *construct_components(const char *config_file_name)
{
    FILE *config_file;
    char library_name[OMX_MAX_STRINGNAME_SIZE];
    char config_file_path[256];
    struct list *head = NULL;

    strncpy(config_file_path, "/etc/", 256);
    strncat(config_file_path, config_file_name, 256);
    config_file = fopen(config_file_path, "r");
    if (!config_file) {
        strncpy(config_file_path, "./", 256);
        strncat(config_file_path, config_file_name, 256);
        config_file = fopen(config_file_path, "r");
        if (!config_file) {
            ALOGE("not found file %s\n", config_file_name);
            return NULL;
        }
    }

    while (fscanf(config_file, "%s", library_name) > 0) {
        CModule *cmodule;
        struct list *entry;
        OMX_ERRORTYPE ret;

        library_name[OMX_MAX_STRINGNAME_SIZE-1] = '\0';

        /* skip libraries starting with # */
        if (library_name[0] == '#')
            continue;

        cmodule = new CModule(&library_name[0]);
        if (!cmodule)
            continue;

        ALOGI("found component library %s\n", library_name);

        ret = cmodule->Load(MODULE_LAZY);
        if (ret != OMX_ErrorNone)
            goto delete_cmodule;

        ret = cmodule->QueryComponentNameAndRoles();
        if (ret != OMX_ErrorNone)
            goto unload_cmodule;

        entry = list_alloc(cmodule);
        if (!entry)
            goto unload_cmodule;
        head = __list_add_tail(head, entry);

        cmodule->Unload();
        ALOGI("module %s:%s added to component list\n",
             cmodule->GetLibraryName(), cmodule->GetComponentName());

        continue;

    unload_cmodule:
        cmodule->Unload();
    delete_cmodule:
        delete cmodule;
    }

    fclose(config_file);
    return head;
}
开发者ID:edorewiel,项目名称:android_device_asus_a500cg-1,代码行数:65,代码来源:wrs_omxcore.cpp


注:本文中的CModule::GetLibraryName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。