FREE(ctx);
}
-static struct pipe_surface *
-vl_context_create_surface(struct pipe_video_context *context,
- struct pipe_resource *resource,
- const struct pipe_surface *templ)
-{
- struct vl_context *ctx = (struct vl_context*)context;
-
- assert(ctx);
-
- return ctx->pipe->create_surface(ctx->pipe, resource, templ);
-}
-
static struct pipe_sampler_view *
vl_context_create_sampler_view(struct pipe_video_context *context,
struct pipe_resource *resource,
ctx->base.screen = pipe->screen;
ctx->base.destroy = vl_context_destroy;
- ctx->base.create_surface = vl_context_create_surface;
ctx->base.create_sampler_view = vl_context_create_sampler_view;
ctx->base.clear_sampler = vl_context_clear_sampler;
ctx->base.upload_sampler = vl_context_upload_sampler;
*/
void (*destroy)(struct pipe_video_context *context);
- /**
- * create a surface of a texture
- */
- struct pipe_surface *(*create_surface)(struct pipe_video_context *context,
- struct pipe_resource *resource,
- const struct pipe_surface *templ);
-
/**
* sampler view handling, used for subpictures for example
*/
#include <util/u_debug.h>
#include <util/u_memory.h>
+#include <util/u_sampler.h>
#include "vdpau_private.h"
uint32_t width, uint32_t height,
VdpOutputSurface *surface)
{
+ struct pipe_context *pipe;
struct pipe_video_context *context;
struct pipe_resource res_tmpl, *res;
struct pipe_sampler_view sv_templ;
if (!dev)
return VDP_STATUS_INVALID_HANDLE;
+ pipe = dev->context->pipe;
context = dev->context->vpipe;
- if (!context)
+ if (!pipe || !context)
return VDP_STATUS_INVALID_HANDLE;
vlsurface = CALLOC(1, sizeof(vlVdpOutputSurface));
// as long as we don't have a background picture we don't want an alpha channel
sv_templ.swizzle_a = PIPE_SWIZZLE_ONE;
- vlsurface->sampler_view = context->create_sampler_view(context, res, &sv_templ);
+ vlsurface->sampler_view = pipe->create_sampler_view(pipe, res, &sv_templ);
if (!vlsurface->sampler_view) {
FREE(dev);
return VDP_STATUS_ERROR;
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = res->format;
surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
- vlsurface->surface = context->create_surface(context, res, &surf_templ);
+ vlsurface->surface = pipe->create_surface(pipe, res, &surf_templ);
if (!vlsurface->surface) {
FREE(dev);
return VDP_STATUS_ERROR;
memset(&surf_template, 0, sizeof(surf_template));
surf_template.format = front_tex->format;
surf_template.usage = PIPE_BIND_RENDER_TARGET;
- front_surf = vctx->vpipe->create_surface(vctx->vpipe, front_tex, &surf_template);
+ front_surf = vctx->pipe->create_surface(vctx->pipe, front_tex, &surf_template);
}
pipe_resource_reference(&front_tex, NULL);
Xfree(dri2_front);
memset(&surf_template, 0, sizeof(surf_template));
surf_template.format = templat.format;
surf_template.usage = PIPE_BIND_RENDER_TARGET;
- xsp_screen->drawable_surface = vctx->vpipe->create_surface(vctx->vpipe, drawable_tex,
- &surf_template);
+ xsp_screen->drawable_surface = vctx->pipe->create_surface(vctx->pipe, drawable_tex,
+ &surf_template);
pipe_resource_reference(&drawable_tex, NULL);
if (!xsp_screen->drawable_surface)
struct vl_context*
vl_video_create(struct vl_screen *vscreen)
{
- struct pipe_video_context *pipe;
+ struct pipe_context *pipe;
struct pipe_video_context *vpipe;
struct vl_context *vctx;