VAStatus vlVaDestroyImage(VADriverContextP ctx, VAImageID image) { VAImage *vaimage; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; vaimage = handle_table_get(VL_VA_DRIVER(ctx)->htab, image); if (!vaimage) return VA_STATUS_ERROR_INVALID_IMAGE; handle_table_remove(VL_VA_DRIVER(ctx)->htab, image); FREE(vaimage); return vlVaDestroyBuffer(ctx, vaimage->buf); }
VAStatus vlVaDestroyImage(VADriverContextP ctx, VAImageID image) { vlVaDriver *drv; VAImage *vaimage; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; drv = VL_VA_DRIVER(ctx); pipe_mutex_lock(drv->mutex); vaimage = handle_table_get(drv->htab, image); if (!vaimage) { pipe_mutex_unlock(drv->mutex); return VA_STATUS_ERROR_INVALID_IMAGE; } handle_table_remove(VL_VA_DRIVER(ctx)->htab, image); pipe_mutex_unlock(drv->mutex); FREE(vaimage); return vlVaDestroyBuffer(ctx, vaimage->buf); }