Пример #1
0
extern "C" int SyncFimgApi(void)
{
    FimgApi * fimgApi = createFimgApi();
    if (fimgApi == NULL) {
        PRINT("%s::createFimgApi() fail\n", __func__);
        return -1;
    }

    if (fimgApi->Sync() == false) {
        if (fimgApi != NULL)
            destroyFimgApi(fimgApi);

        return -1;
    }

    if (fimgApi != NULL)
        destroyFimgApi(fimgApi);

    return 0;
}
extern "C" int SyncFimgApi(void)
{
    pthread_mutex_lock(&s_g2d_lock);
    FimgApi * fimgApi = createFimgApi();
    if (fimgApi == NULL) {
        PRINT("%s::createFimgApi() fail\n", __func__);
        pthread_mutex_unlock(&s_g2d_lock);
        return -1;
    }

    if (fimgApi->Sync() == false) {
        if (fimgApi != NULL)
            destroyFimgApi(fimgApi);

        pthread_mutex_unlock(&s_g2d_lock);
        return -1;
    }

    if (fimgApi != NULL)
        destroyFimgApi(fimgApi);

    pthread_mutex_unlock(&s_g2d_lock);
    return 0;
}