static void d3d9_pic_context_destroy(struct picture_context_t *opaque) { struct va_pic_context *pic_ctx = (struct va_pic_context*)opaque; if (pic_ctx->va_surface) { ReleasePictureSys(&pic_ctx->picsys); va_surface_Release(pic_ctx->va_surface); free(pic_ctx); } }
static struct va_pic_context* NewSurfacePicContext(vlc_va_t *va, int surface_index) { directx_sys_t *dx_sys = &va->sys->dx_sys; struct va_pic_context *pic_ctx = CreatePicContext(dx_sys->hw_surface[surface_index]); if (unlikely(pic_ctx==NULL)) return NULL; /* all the resources are acquired during surfaces init, and a second time in * CreatePicContext(), undo one of them otherwise we need an extra release * when the pool is emptied */ ReleasePictureSys(&pic_ctx->picsys); return pic_ctx; }
static void d3d9_pic_context_destroy(struct picture_context_t *ctx) { struct va_pic_context *pic_ctx = (struct va_pic_context*)ctx; ReleasePictureSys(&pic_ctx->picsys); free(pic_ctx); }