Skip to content

Commit

Permalink
Add vdpau_CreateSurfaces2 function (Issue #5 - thanks all)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtknight authored and Andrew Matteson committed Apr 15, 2020
1 parent 60e296c commit dabc009
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/vdpau_driver_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,19 @@ struct VA_DRIVER_VTABLE {
void **buffer
);
#endif

VAStatus
(*vaCreateSurfaces2)(
VADriverContextP ctx,
unsigned int format,
unsigned int width,
unsigned int height,
VASurfaceID *surfaces,
unsigned int num_surfaces,
VASurfaceAttrib *attrib_list,
unsigned int num_attribs
);

};

/* Driver context */
Expand Down Expand Up @@ -662,7 +675,7 @@ static VAStatus FUNC(Initialize)(VA_DRIVER_CONTEXT_P ctx)
vtable->vaDbgCopySurfaceToBuffer = vdpau_DbgCopySurfaceToBuffer;
#endif
#endif

vtable->vaCreateSurfaces2 = vdpau_CreateSurfaces2;
#if VA_INIT_GLX
VA_DRIVER_VTABLE_GLX_P const glx_vtable = FUNC(GetVTableGLX)(ctx);
if (!glx_vtable)
Expand Down
15 changes: 15 additions & 0 deletions src/vdpau_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,21 @@ vdpau_CreateSurfaces(
}
return va_status;
}
// vaCreateSurfaces2
VAStatus
vdpau_CreateSurfaces2(
VADriverContextP ctx,
unsigned int format,
unsigned int width,
unsigned int height,
VASurfaceID *surfaces,
unsigned int num_surfaces,
VASurfaceAttrib *attrib_list,
unsigned int num_attribs
)
{
return vdpau_CreateSurfaces(ctx, width, height, format, num_surfaces, surfaces);
}

// vaDestroyContext
VAStatus vdpau_DestroyContext(VADriverContextP ctx, VAContextID context)
Expand Down
13 changes: 13 additions & 0 deletions src/vdpau_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,19 @@ vdpau_CreateSurfaces(
VASurfaceID *surfaces
) attribute_hidden;

// vaCreateSurfaces2
VAStatus
vdpau_CreateSurfaces2(
VADriverContextP ctx,
unsigned int format,
unsigned int width,
unsigned int height,
VASurfaceID *surfaces,
unsigned int num_surfaces,
VASurfaceAttrib *attrib_list,
unsigned int num_attribs
) attribute_hidden;

// vaDestroySurfaces
VAStatus
vdpau_DestroySurfaces(
Expand Down

0 comments on commit dabc009

Please sign in to comment.