struct pipe_context* create_pipe_context(Display *display)
{
struct xsp_pipe_winsys *xsp_winsys;
- struct pipe_screen *p_screen;
- struct pipe_context *p_context;
+ struct pipe_screen *screen;
+ struct pipe_context *pipe;
assert(display);
XDestroyImage(template);
}
- p_screen = softpipe_create_screen((struct pipe_winsys*)xsp_winsys);
- p_context = softpipe_create(p_screen, (struct pipe_winsys*)xsp_winsys, NULL);
+ screen = softpipe_create_screen((struct pipe_winsys*)xsp_winsys);
+ pipe = softpipe_create(screen, (struct pipe_winsys*)xsp_winsys, NULL);
- return p_context;
+ return pipe;
+}
+
+int destroy_pipe_context(struct pipe_context *pipe)
+{
+ struct pipe_screen *screen;
+ struct pipe_winsys *winsys;
+
+ assert(pipe);
+
+ screen = pipe->screen;
+ winsys = pipe->winsys;
+ pipe->destroy(pipe);
+ screen->destroy(screen);
+ free(winsys);
+
+ return 0;
}
Status XvMCDestroyContext(Display *display, XvMCContext *context)
{
- struct VL_CONTEXT *vl_ctx;
+ struct VL_CONTEXT *vl_ctx;
+ struct pipe_context *pipe;
assert(display);
assert(display == vl_ctx->display);
+ pipe = vl_ctx->pipe;
vlDestroyContext(vl_ctx);
+ destroy_pipe_context(pipe);
return Success;
}