static int camera_set_parameters(struct camera_device *device,
        const char *params)
{
    ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
            (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));

    if (!device)
        return -EINVAL;

    char *tmp = NULL;
    tmp = camera_fixup_setparams(CAMERA_ID(device), params);

#ifdef LOG_NDEBUG
    __android_log_write(ANDROID_LOG_VERBOSE, LOG_TAG, tmp);
#endif

    if (flipZsl) {
        camera_stop_preview(device);
    }
    int ret = VENDOR_CALL(device, set_parameters, tmp);
    if (flipZsl) {
        camera_start_preview(device);
        flipZsl = false;
    }
    return ret;
}
示例#2
0
static Eina_Bool _main_view_start_camera_preview (camera_h camera)
{
    camera_state_e cur_state = CAMERA_STATE_NONE;
    int result = camera_get_state(camera, &cur_state);
    if(CAMERA_ERROR_NONE == result)
    {
        if(cur_state != CAMERA_STATE_PREVIEW)
        {
            result = camera_start_preview(camera);
            if (CAMERA_ERROR_NONE == result)
            {
                camera_start_focusing(camera, TRUE);
                return EINA_TRUE;
            }
        }
    }
    else
    {
        ERR("Cannot get camera state. Error: %d", result);
    }

    return EINA_FALSE;
}