Skip to content

Commit 7007467

Browse files
author
Austin Yuan
committed
Seperate 3rd party API (e.g. vaCreateSurfaceFromXXX) into a libva-tpi.so
and driver table memory is allocated by driver if driver wants to support it. Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
1 parent 03a6cbe commit 7007467

File tree

11 files changed

+277
-429
lines changed

11 files changed

+277
-429
lines changed

dummy_drv_video/dummy_drv_video.c

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,22 @@ VAStatus dummy_SetDisplayAttributes (
11071107
}
11081108

11091109

1110-
VAStatus dummy_CopySurfaceToBuffer(
1110+
VAStatus dummy_BufferInfo(
1111+
VADriverContextP ctx,
1112+
VAContextID context, /* in */
1113+
VABufferID buf_id, /* in */
1114+
VABufferType *type, /* out */
1115+
unsigned int *size, /* out */
1116+
unsigned int *num_elements /* out */
1117+
)
1118+
{
1119+
/* TODO */
1120+
return VA_STATUS_ERROR_UNIMPLEMENTED;
1121+
}
1122+
1123+
1124+
1125+
VAStatus dummy_LockSurface(
11111126
VADriverContextP ctx,
11121127
VASurfaceID surface,
11131128
unsigned int *fourcc, /* following are output argument */
@@ -1117,11 +1132,21 @@ VAStatus dummy_CopySurfaceToBuffer(
11171132
unsigned int *luma_offset,
11181133
unsigned int *chroma_u_offset,
11191134
unsigned int *chroma_v_offset,
1135+
unsigned int *buffer_name,
11201136
void **buffer
11211137
)
11221138
{
11231139
/* TODO */
1124-
return VA_STATUS_ERROR_UNKNOWN;
1140+
return VA_STATUS_ERROR_UNIMPLEMENTED;
1141+
}
1142+
1143+
VAStatus dummy_UnlockSurface(
1144+
VADriverContextP ctx,
1145+
VASurfaceID surface
1146+
)
1147+
{
1148+
/* TODO */
1149+
return VA_STATUS_ERROR_UNIMPLEMENTED;
11251150
}
11261151

11271152
VAStatus dummy_Terminate( VADriverContextP ctx )
@@ -1222,8 +1247,9 @@ VAStatus __vaDriverInit_0_31( VADriverContextP ctx )
12221247
ctx->vtable.vaQueryDisplayAttributes = dummy_QueryDisplayAttributes;
12231248
ctx->vtable.vaGetDisplayAttributes = dummy_GetDisplayAttributes;
12241249
ctx->vtable.vaSetDisplayAttributes = dummy_SetDisplayAttributes;
1225-
1226-
ctx->vtable.vaCopySurfaceToBuffer = dummy_CopySurfaceToBuffer;
1250+
ctx->vtable.vaLockSurface = dummy_LockSurface;
1251+
ctx->vtable.vaUnlockSurface = dummy_UnlockSurface;
1252+
ctx->vtable.vaBufferInfo = dummy_BufferInfo;
12271253

12281254
driver_data = (struct dummy_driver_data *) malloc( sizeof(*driver_data) );
12291255
ctx->pDriverData = (void *) driver_data;

va/Makefile.am

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ LDADD = \
2929

3030
lib_LTLIBRARIES = \
3131
libva.la \
32+
libva-tpi.la \
3233
libva-x11.la
3334

3435
libva_ladir = $(libdir)
3536
libva_la_LDFLAGS = $(LDADD) -no-undefined
3637
libva_la_LIBADD = $(LIBVA_LIBS) -ldl
3738

39+
libva_tpi_ladir = $(libdir)
40+
libva_tpi_la_LDFLAGS = $(LDADD) -no-undefined
41+
libva_tpi_la_LIBADD = $(libvacorelib) -ldl
42+
3843
libva_x11_la_SOURCES =
3944
libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(DRM_LIBS) $(XFIXES_LIBS)
4045
libva_x11_la_LDFLAGS = $(LDADD)
@@ -55,9 +60,10 @@ SUBDIRS += dummy
5560
endif
5661

5762
libva_la_SOURCES = va.c va_trace.c
63+
libva_tpi_la_SOURCES = va_tpi.c
5864

5965
libvaincludedir = ${includedir}/va
60-
libvainclude_HEADERS = va.h va_x11.h va_backend.h va_dummy.h va_version.h
66+
libvainclude_HEADERS = va.h va_tpi.h va_x11.h va_backend.h va_backend_tpi.h va_dummy.h va_version.h
6167

6268
DISTCLEANFILES = \
6369
va_version.h

0 commit comments

Comments
 (0)