Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6 from halleyzhao/master
Browse files Browse the repository at this point in the history
add vaLockSurface/vaUnlockSurface support
  • Loading branch information
seanvk committed Apr 9, 2014
2 parents f71c3ad + 1fe0520 commit b794787
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/wrapper_drv_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,50 @@ vawr_SetDisplayAttributes(VADriverContextP ctx,

}

VAStatus vawr_LockSurface(VADriverContextP ctx,
VASurfaceID surface,
unsigned int *fourcc, /* following are output argument */
unsigned int *luma_stride,
unsigned int *chroma_u_stride,
unsigned int *chroma_v_stride,
unsigned int *luma_offset,
unsigned int *chroma_u_offset,
unsigned int *chroma_v_offset,
unsigned int *buffer_name,
void **buffer)
{
VAStatus vaStatus;
struct vawr_driver_data *vawr = GET_VAWRDATA(ctx);
VASurfaceID vawr_render_target;
vawr_surface_lookup_t *surface_lookup;

GET_SURFACEID(vawr, surface_lookup, surface, vawr_render_target);

RESTORE_DRVDATA(ctx, vawr);
CALL_DRVVTABLE(vawr, vaStatus, vaLockSurface(ctx, vawr_render_target, fourcc, luma_stride, chroma_u_stride, chroma_v_stride, luma_offset, chroma_u_offset, chroma_v_offset, buffer_name, buffer));
RESTORE_VAWRDATA(ctx, vawr);

return vaStatus;
}


VAStatus vawr_UnlockSurface(VADriverContextP ctx,
VASurfaceID surface)
{
VAStatus vaStatus;
struct vawr_driver_data *vawr = GET_VAWRDATA(ctx);
VASurfaceID vawr_render_target;
vawr_surface_lookup_t *surface_lookup;

GET_SURFACEID(vawr, surface_lookup, surface, vawr_render_target);

RESTORE_DRVDATA(ctx, vawr);
CALL_DRVVTABLE(vawr, vaStatus, vaUnlockSurface( ctx, vawr_render_target));
RESTORE_VAWRDATA(ctx, vawr);

return vaStatus;
}

VAStatus DLL_EXPORT
__vaDriverInit_0_32(VADriverContextP ctx);

Expand Down Expand Up @@ -1180,6 +1224,8 @@ __vaDriverInit_0_32( VADriverContextP ctx )
vtable->vaQueryDisplayAttributes = vawr_QueryDisplayAttributes;
vtable->vaGetDisplayAttributes = vawr_GetDisplayAttributes;
vtable->vaSetDisplayAttributes = vawr_SetDisplayAttributes;
vtable->vaLockSurface = vawr_LockSurface;
vtable->vaUnlockSurface= vawr_UnlockSurface;
}

/* Store wrapper's private driver data*/
Expand Down

0 comments on commit b794787

Please sign in to comment.