summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2009-08-28 17:33:21 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2009-08-28 17:33:21 +0800
commita7dbd4e05ab1f30d7f020ff0b25d8f1948924f91 (patch)
tree05aac000089bf8d980998d1c046a300fcc421bb7
parentfb431c22c4aeb593da780faf4f29573e00b01674 (diff)
parent2822d025263d516bd619c8bbe1d17ff4c1bd1af2 (diff)
Merge branch 'master-fd.o'
Conflicts: Makefile.am configure.ac dummy_drv_video/dummy_drv_video.c i965_drv_video/Makefile.am i965_drv_video/i965_drv_video.c src/Makefile.am src/va.c src/va.h src/va_backend.h src/x11/va_x11.c test/test_12.c Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
-rw-r--r--.gitignore29
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac15
-rw-r--r--dummy_drv_video/dummy_drv_video.c54
-rw-r--r--i965_drv_video/Makefile.am2
-rw-r--r--i965_drv_video/i965_drv_video.c49
-rw-r--r--libva_display.pc.in11
-rw-r--r--src/Makefile.am12
-rw-r--r--src/va.c69
-rw-r--r--src/va.h283
-rw-r--r--src/va_backend.h31
-rw-r--r--src/x11/va_x11.c21
-rw-r--r--test/test_12.c2
13 files changed, 220 insertions, 367 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9b033
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,29 @@
+*~
+*.o
+*.lo
+*.la
+*.orig
+*.rej
+*.loT
+*.bin
+.deps
+.libs
+install-sh
+libtool
+ltmain.sh
+missing
+Makefile
+Makefile.in
+config.h
+config.h.in
+stamp-h1
+aclocal.m4
+autom4te.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+fw/msvdx_bin
+fw/msvdx_fw.bin
diff --git a/Makefile.am b/Makefile.am
index cd0ee58..f2defab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,11 +31,16 @@ SUBDIRS += i965_drv_video
endif
pcfiles = \
- libva.pc
+ libva.pc \
+ libva-$(LIBVA_DISPLAY).pc
+
+# libva-<display>.pc - for display-specific dependencies
+libva-$(LIBVA_DISPLAY).pc: libva_display.pc
+ @cp $< $@
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = $(pcfiles)
-EXTRA_DIST = libva.pc.in
+EXTRA_DIST = libva.pc.in libva_display.pc.in
CLEANFILES = $(pcfiles)
diff --git a/configure.ac b/configure.ac
index 6e9f95c..b37a438 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,8 +22,8 @@
# libva package version number, (as distinct from shared library version)
m4_define([libva_major_version], [0])
-m4_define([libva_minor_version], [30])
-m4_define([libva_micro_version], [4])
+m4_define([libva_minor_version], [31])
+m4_define([libva_micro_version], [0])
m4_define([libva_version],
[libva_major_version.libva_minor_version.libva_micro_version])
@@ -32,9 +32,9 @@ m4_define([libva_version],
m4_define([libva_sds_version], [2])
# if the library source code has changed, increment revision
-m4_define([libva_lt_revision], [1])
+m4_define([libva_lt_revision], [0])
# if any interface was added/removed/changed, then inc current, reset revision
-m4_define([libva_lt_current], [0])
+m4_define([libva_lt_current], [1])
# if any interface was added since last public release, then increment age
# if any interface was removed since last public release, then set age to 0
m4_define([libva_lt_age], [0])
@@ -114,8 +114,12 @@ AC_SUBST(LIBVA_LIBS)
pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir)
-libvabackendlib=libva.la
+LIBVA_DISPLAY=x11
+libvacorelib=libva.la
+libvabackendlib=libva-$LIBVA_DISPLAY.la
+AC_SUBST([libvacorelib])
AC_SUBST([libvabackendlib])
+AC_SUBST(LIBVA_DISPLAY)
AC_OUTPUT([
Makefile
@@ -130,5 +134,6 @@ AC_OUTPUT([
i965_drv_video/shaders/render/Makefile
test/Makefile
libva.pc
+ libva_display.pc
])
diff --git a/dummy_drv_video/dummy_drv_video.c b/dummy_drv_video/dummy_drv_video.c
index 1eb51a0..1a9d7c1 100644
--- a/dummy_drv_video/dummy_drv_video.c
+++ b/dummy_drv_video/dummy_drv_video.c
@@ -502,25 +502,8 @@ VAStatus dummy_GetImage(
return VA_STATUS_SUCCESS;
}
-VAStatus dummy_PutImage(
- VADriverContextP ctx,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
- unsigned int width,
- unsigned int height,
- int dest_x,
- int dest_y
-)
-{
- INIT_DRIVER_DATA
-
- /* TODO */
- return VA_STATUS_SUCCESS;
-}
-VAStatus dummy_PutImage2(
+VAStatus dummy_PutImage(
VADriverContextP ctx,
VASurfaceID surface,
VAImageID image,
@@ -631,31 +614,8 @@ VAStatus dummy_SetSubpictureGlobalAlpha(
return VA_STATUS_SUCCESS;
}
-VAStatus dummy_AssociateSubpicture(
- VADriverContextP ctx,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x, /* upper left offset in subpicture */
- short src_y,
- short dest_x, /* upper left offset in surface */
- short dest_y,
- unsigned short width,
- unsigned short height,
- /*
- * whether to enable chroma-keying or global-alpha
- * see VA_SUBPICTURE_XXX values
- */
- unsigned int flags
-)
-{
- INIT_DRIVER_DATA
-
- /* TODO */
- return VA_STATUS_SUCCESS;
-}
-VAStatus dummy_AssociateSubpicture2(
+VAStatus dummy_AssociateSubpicture(
VADriverContextP ctx,
VASubpictureID subpicture,
VASurfaceID *target_surfaces,
@@ -1045,24 +1005,16 @@ VAStatus dummy_EndPicture(
VAStatus dummy_SyncSurface(
VADriverContextP ctx,
- VAContextID context,
VASurfaceID render_target
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
- object_context_p obj_context;
object_surface_p obj_surface;
- obj_context = CONTEXT(context);
- ASSERT(obj_context);
-
obj_surface = SURFACE(render_target);
ASSERT(obj_surface);
- /* Assume that this shouldn't be called before vaEndPicture() */
- ASSERT( obj_context->current_render_target != obj_surface->base.id );
-
return vaStatus;
}
@@ -1258,7 +1210,6 @@ VAStatus __vaDriverInit_0_30( VADriverContextP ctx )
ctx->vtable.vaSetImagePalette = dummy_SetImagePalette;
ctx->vtable.vaGetImage = dummy_GetImage;
ctx->vtable.vaPutImage = dummy_PutImage;
- ctx->vtable.vaPutImage2 = dummy_PutImage2;
ctx->vtable.vaQuerySubpictureFormats = dummy_QuerySubpictureFormats;
ctx->vtable.vaCreateSubpicture = dummy_CreateSubpicture;
ctx->vtable.vaDestroySubpicture = dummy_DestroySubpicture;
@@ -1266,7 +1217,6 @@ VAStatus __vaDriverInit_0_30( VADriverContextP ctx )
ctx->vtable.vaSetSubpictureChromakey = dummy_SetSubpictureChromakey;
ctx->vtable.vaSetSubpictureGlobalAlpha = dummy_SetSubpictureGlobalAlpha;
ctx->vtable.vaAssociateSubpicture = dummy_AssociateSubpicture;
- ctx->vtable.vaAssociateSubpicture2 = dummy_AssociateSubpicture2;
ctx->vtable.vaDeassociateSubpicture = dummy_DeassociateSubpicture;
ctx->vtable.vaQueryDisplayAttributes = dummy_QueryDisplayAttributes;
ctx->vtable.vaGetDisplayAttributes = dummy_GetDisplayAttributes;
diff --git a/i965_drv_video/Makefile.am b/i965_drv_video/Makefile.am
index c0117c9..42dd515 100644
--- a/i965_drv_video/Makefile.am
+++ b/i965_drv_video/Makefile.am
@@ -27,7 +27,7 @@ AM_CFLAGS = -Wall -I$(top_srcdir)/src -I$(top_srcdir)/src/x11 @DRM_CFLAGS@ -DIN_
i965_drv_video_la_LTLIBRARIES = i965_drv_video.la
i965_drv_video_ladir = @LIBVA_DRIVERS_PATH@
i965_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined @DRM_LIBS@ -ldrm_intel
-i965_drv_video_la_LIBADD = ../src/libva.la -lpthread
+i965_drv_video_la_LIBADD = ../src/libva-x11.la -lpthread
i965_drv_video_la_SOURCES = \
object_heap.c \
diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c
index 538a628..caf7f62 100644
--- a/i965_drv_video/i965_drv_video.c
+++ b/i965_drv_video/i965_drv_video.c
@@ -350,7 +350,7 @@ i965_QueryImageFormats(VADriverContextP ctx,
}
VAStatus
-i965_PutImage2(VADriverContextP ctx,
+i965_PutImage(VADriverContextP ctx,
VASurfaceID surface,
VAImageID image,
int src_x,
@@ -480,8 +480,12 @@ i965_AssociateSubpicture(VADriverContextP ctx,
int num_surfaces,
short src_x, /* upper left offset in subpicture */
short src_y,
+ unsigned short src_width,
+ unsigned short src_height,
short dest_x, /* upper left offset in surface */
short dest_y,
+ unsigned short dest_width,
+ unsigned short dest_height,
unsigned short width,
unsigned short height,
/*
@@ -510,27 +514,6 @@ i965_AssociateSubpicture(VADriverContextP ctx,
return VA_STATUS_SUCCESS;
}
-VAStatus
-i965_AssociateSubpicture2(VADriverContextP ctx,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x, /* upper left offset in subpicture */
- short src_y,
- unsigned short src_width,
- unsigned short src_height,
- short dest_x, /* upper left offset in surface */
- short dest_y,
- unsigned short dest_width,
- unsigned short dest_height,
- /*
- * whether to enable chroma-keying or global-alpha
- * see VA_SUBPICTURE_XXX values
- */
- unsigned int flags)
-{
- return VA_STATUS_SUCCESS;
-}
VAStatus
i965_DeassociateSubpicture(VADriverContextP ctx,
@@ -1012,19 +995,13 @@ i965_EndPicture(VADriverContextP ctx, VAContextID context)
VAStatus
i965_SyncSurface(VADriverContextP ctx,
- VAContextID context,
VASurfaceID render_target)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- struct object_context *obj_context = CONTEXT(context);
struct object_surface *obj_surface = SURFACE(render_target);
- assert(obj_context);
assert(obj_surface);
- /* Assume that this shouldn't be called before vaEndPicture() */
- assert(obj_context->decode_state.current_render_target != render_target);
-
return VA_STATUS_SUCCESS;
}
@@ -1226,20 +1203,6 @@ i965_GetImage(VADriverContextP ctx,
}
VAStatus
-i965_PutImage(VADriverContextP ctx,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
- unsigned int width,
- unsigned int height,
- int dest_x,
- int dest_y)
-{
- return VA_STATUS_SUCCESS;
-}
-
-VAStatus
i965_PutSurface(VADriverContextP ctx,
VASurfaceID surface,
Drawable draw, /* X Drawable */
@@ -1394,7 +1357,6 @@ __vaDriverInit_0_30( VADriverContextP ctx )
ctx->vtable.vaSetImagePalette = i965_SetImagePalette;
ctx->vtable.vaGetImage = i965_GetImage;
ctx->vtable.vaPutImage = i965_PutImage;
- ctx->vtable.vaPutImage2 = i965_PutImage2;
ctx->vtable.vaQuerySubpictureFormats = i965_QuerySubpictureFormats;
ctx->vtable.vaCreateSubpicture = i965_CreateSubpicture;
ctx->vtable.vaDestroySubpicture = i965_DestroySubpicture;
@@ -1403,7 +1365,6 @@ __vaDriverInit_0_30( VADriverContextP ctx )
ctx->vtable.vaSetSubpictureChromakey = i965_SetSubpictureChromakey;
ctx->vtable.vaSetSubpictureGlobalAlpha = i965_SetSubpictureGlobalAlpha;
ctx->vtable.vaAssociateSubpicture = i965_AssociateSubpicture;
- ctx->vtable.vaAssociateSubpicture2 = i965_AssociateSubpicture2;
ctx->vtable.vaDeassociateSubpicture = i965_DeassociateSubpicture;
ctx->vtable.vaQueryDisplayAttributes = i965_QueryDisplayAttributes;
ctx->vtable.vaGetDisplayAttributes = i965_GetDisplayAttributes;
diff --git a/libva_display.pc.in b/libva_display.pc.in
new file mode 100644
index 0000000..c9c5cd6
--- /dev/null
+++ b/libva_display.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+display=@LIBVA_DISPLAY@
+
+Name: libva-${display}
+Description: Userspace Video Acceleration (VA) ${display} interface
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lva-${display}
+Cflags: -I${includedir}
diff --git a/src/Makefile.am b/src/Makefile.am
index 5fac8b5..3849e8f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,10 +28,18 @@ INCLUDES = \
LDADD = \
$(LIBVA_LT_LDFLAGS)
-libva_la_LTLIBRARIES = libva.la
+lib_LTLIBRARIES = \
+ libva.la \
+ libva-x11.la
+
libva_ladir = $(libdir)
libva_la_LDFLAGS = $(LDADD) -no-undefined
-libva_la_LIBADD = $(LIBVA_LIBS) -ldl -lX11 -lXext x11/libva_x11.la -ldrm -lXfixes
+libva_la_LIBADD = $(LIBVA_LIBS) -ldl
+
+libva_x11_la_SOURCES =
+libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(DRM_LIBS) $(XFIXES_LIBS)
+libva_x11_la_LDFLAGS = $(LDADD)
+libva_x11_la_DEPENDENCIES = $(libvacorelib)
SUBDIRS = x11
diff --git a/src/va.c b/src/va.c
index b409c7c..dbfcd31 100644
--- a/src/va.c
+++ b/src/va.c
@@ -56,7 +56,11 @@
static int va_debug_trace = 0;
-int vaDisplayIsValid(VADisplay dpy);
+static int vaDisplayIsValid(VADisplay dpy)
+{
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ return pDisplayContext && pDisplayContext->vaIsValid(pDisplayContext);
+}
static void va_errorMessage(const char *msg, ...)
{
@@ -217,7 +221,6 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
CHECK_VTABLE(vaStatus, ctx, SetImagePalette);
CHECK_VTABLE(vaStatus, ctx, GetImage);
CHECK_VTABLE(vaStatus, ctx, PutImage);
- CHECK_VTABLE(vaStatus, ctx, PutImage2);
CHECK_VTABLE(vaStatus, ctx, QuerySubpictureFormats);
CHECK_VTABLE(vaStatus, ctx, CreateSubpicture);
CHECK_VTABLE(vaStatus, ctx, DestroySubpicture);
@@ -225,7 +228,6 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
CHECK_VTABLE(vaStatus, ctx, SetSubpictureChromakey);
CHECK_VTABLE(vaStatus, ctx, SetSubpictureGlobalAlpha);
CHECK_VTABLE(vaStatus, ctx, AssociateSubpicture);
- CHECK_VTABLE(vaStatus, ctx, AssociateSubpicture2);
CHECK_VTABLE(vaStatus, ctx, DeassociateSubpicture);
CHECK_VTABLE(vaStatus, ctx, QueryDisplayAttributes);
CHECK_VTABLE(vaStatus, ctx, GetDisplayAttributes);
@@ -707,7 +709,6 @@ VAStatus vaEndPicture (
VAStatus vaSyncSurface (
VADisplay dpy,
- VAContextID context,
VASurfaceID render_target
)
{
@@ -716,7 +717,7 @@ VAStatus vaSyncSurface (
ctx = CTX(dpy);
TRACE(vaSyncSurface);
- return ctx->vtable.vaSyncSurface( ctx, context, render_target );
+ return ctx->vtable.vaSyncSurface( ctx, render_target );
}
VAStatus vaQuerySurfaceStatus (
@@ -871,30 +872,6 @@ VAStatus vaPutImage (
VAImageID image,
int src_x,
int src_y,
- unsigned int width,
- unsigned int height,
- int dest_x,
- int dest_y
-)
-{
- VADriverContextP ctx;
- CHECK_DISPLAY(dpy);
- ctx = CTX(dpy);
-
- TRACE(vaPutImage);
- return ctx->vtable.vaPutImage ( ctx, surface, image, src_x, src_y, width, height, dest_x, dest_y );
-}
-
-/*
- * Similar to vaPutImage but with additional destination width
- * and height arguments to enable scaling
- */
-VAStatus vaPutImage2 (
- VADisplay dpy,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
unsigned int src_width,
unsigned int src_height,
int dest_x,
@@ -907,8 +884,8 @@ VAStatus vaPutImage2 (
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- TRACE(vaPutImage2);
- return ctx->vtable.vaPutImage2 ( ctx, surface, image, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height );
+ TRACE(vaPutImage);
+ return ctx->vtable.vaPutImage ( ctx, surface, image, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height );
}
/*
@@ -1092,32 +1069,6 @@ VAStatus vaAssociateSubpicture (
int num_surfaces,
short src_x, /* upper left offset in subpicture */
short src_y,
- short dest_x, /* upper left offset in surface */
- short dest_y,
- unsigned short width,
- unsigned short height,
- /*
- * whether to enable chroma-keying or global-alpha
- * see VA_SUBPICTURE_XXX values
- */
- unsigned int flags
-)
-{
- VADriverContextP ctx;
- CHECK_DISPLAY(dpy);
- ctx = CTX(dpy);
-
- TRACE(vaAssociateSubpicture);
- return ctx->vtable.vaAssociateSubpicture ( ctx, subpicture, target_surfaces, num_surfaces, src_x, src_y, dest_x, dest_y, width, height, flags );
-}
-
-VAStatus vaAssociateSubpicture2 (
- VADisplay dpy,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x, /* upper left offset in subpicture */
- short src_y,
unsigned short src_width,
unsigned short src_height,
short dest_x, /* upper left offset in surface */
@@ -1135,8 +1086,8 @@ VAStatus vaAssociateSubpicture2 (
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- TRACE(vaAssociateSubpicture2);
- return ctx->vtable.vaAssociateSubpicture2 ( ctx, subpicture, target_surfaces, num_surfaces, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height, flags );
+ TRACE(vaAssociateSubpicture);
+ return ctx->vtable.vaAssociateSubpicture ( ctx, subpicture, target_surfaces, num_surfaces, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height, flags );
}
/*
diff --git a/src/va.h b/src/va.h
index a52895c..874049f 100644
--- a/src/va.h
+++ b/src/va.h
@@ -125,6 +125,7 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
#define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
#define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
+#define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/*
@@ -572,7 +573,7 @@ typedef struct _VAMacroblockParameterBufferMPEG2
unsigned int field_motion_type : 2;
unsigned int dct_type : 1;
} bits;
- unsigned char value;
+ unsigned int value;
} macroblock_modes;
unsigned char motion_vertical_field_select;
/*
@@ -626,18 +627,18 @@ typedef struct _VAPictureParameterBufferMPEG4
VASurfaceID backward_reference_picture;
union {
struct {
- unsigned char short_video_header : 1;
- unsigned char chroma_format : 2;
- unsigned char interlaced : 1;
- unsigned char obmc_disable : 1;
- unsigned char sprite_enable : 2;
- unsigned char sprite_warping_accuracy : 2;
- unsigned char quant_type : 1;
- unsigned char quarter_sample : 1;
- unsigned char data_partitioned : 1;
- unsigned char reversible_vlc : 1;
+ unsigned int short_video_header : 1;
+ unsigned int chroma_format : 2;
+ unsigned int interlaced : 1;
+ unsigned int obmc_disable : 1;
+ unsigned int sprite_enable : 2;
+ unsigned int sprite_warping_accuracy : 2;
+ unsigned int quant_type : 1;
+ unsigned int quarter_sample : 1;
+ unsigned int data_partitioned : 1;
+ unsigned int reversible_vlc : 1;
} bits;
- unsigned short value;
+ unsigned int value;
} vol_fields;
unsigned char no_of_sprite_warping_points;
short sprite_trajectory_du[3];
@@ -645,14 +646,14 @@ typedef struct _VAPictureParameterBufferMPEG4
unsigned char quant_precision;
union {
struct {
- unsigned char vop_coding_type : 2;
- unsigned char backward_reference_vop_coding_type : 2;
- unsigned char vop_rounding_type : 1;
- unsigned char intra_dc_vlc_thr : 3;
- unsigned char top_field_first : 1;
- unsigned char alternate_vertical_scan_flag : 1;
+ unsigned int vop_coding_type : 2;
+ unsigned int backward_reference_vop_coding_type : 2;
+ unsigned int vop_rounding_type : 1;
+ unsigned int intra_dc_vlc_thr : 3;
+ unsigned int top_field_first : 1;
+ unsigned int alternate_vertical_scan_flag : 1;
} bits;
- unsigned short value;
+ unsigned int value;
} vop_fields;
unsigned char vop_fcode_forward;
unsigned char vop_fcode_backward;
@@ -722,28 +723,41 @@ typedef struct _VAPictureParameterBufferVC1
/* sequence layer for AP or meta data for SP and MP */
union {
struct {
- unsigned char interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
- unsigned char syncmarker : 1;/* METADATA::SYNCMARKER */
- unsigned char overlap : 1;/* METADATA::OVERLAP */
+ unsigned int pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
+ unsigned int interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
+ unsigned int tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
+ unsigned int finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
+ unsigned int psf : 1; /* SEQUENCE_LAYER::PSF */
+ unsigned int multires : 1; /* METADATA::MULTIRES */
+ unsigned int overlap : 1; /* METADATA::OVERLAP */
+ unsigned int syncmarker : 1; /* METADATA::SYNCMARKER */
+ unsigned int rangered : 1; /* METADATA::RANGERED */
+ unsigned int max_b_frames : 3; /* METADATA::MAXBFRAMES */
} bits;
- unsigned char value;
+ unsigned int value;
} sequence_fields;
unsigned short coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
unsigned short coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
- unsigned char closed_entry; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
- unsigned char broken_link; /* ENTRY_POINT_LAYER::BROKEN_LINK */
- unsigned char loopfilter; /* ENTRY_POINT_LAYER::LOOPFILTER */
+ union {
+ struct {
+ unsigned int broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
+ unsigned int closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
+ unsigned int panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
+ unsigned int loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
+ } bits;
+ unsigned int value;
+ } entrypoint_fields;
unsigned char conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
unsigned char fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
union {
struct {
- unsigned char luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
- unsigned char luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
- unsigned char chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
- unsigned char chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
+ unsigned int luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
+ unsigned int luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
+ unsigned int chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
+ unsigned int chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
} bits;
- unsigned char value;
+ unsigned int value;
} range_mapping_fields;
unsigned char b_picture_fraction; /* PICTURE_LAYER::BFRACTION */
@@ -757,88 +771,88 @@ typedef struct _VAPictureParameterBufferVC1
unsigned char luma_shift; /* PICTURE_LAYER::LUMSHIFT */
union {
struct {
- unsigned char picture_type : 2; /* PICTURE_LAYER::PTYPE */
- unsigned char frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
- unsigned char top_field_first : 1; /* PICTURE_LAYER::TFF */
- unsigned char is_first_field : 1; /* set to 1 if it is the first field */
- unsigned char intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
+ unsigned int picture_type : 3; /* PICTURE_LAYER::PTYPE */
+ unsigned int frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
+ unsigned int top_field_first : 1; /* PICTURE_LAYER::TFF */
+ unsigned int is_first_field : 1; /* set to 1 if it is the first field */
+ unsigned int intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
} bits;
- unsigned char value;
+ unsigned int value;
} picture_fields;
union {
struct {
- unsigned char mv_type_mb : 1; /* PICTURE::MVTYPEMB */
- unsigned char direct_mb : 1; /* PICTURE::DIRECTMB */
- unsigned char skip_mb : 1; /* PICTURE::SKIPMB */
- unsigned char field_tx : 1; /* PICTURE::FIELDTX */
- unsigned char forward_mb : 1; /* PICTURE::FORWARDMB */
- unsigned char ac_pred : 1; /* PICTURE::ACPRED */
- unsigned char overflags : 1; /* PICTURE::OVERFLAGS */
+ unsigned int mv_type_mb : 1; /* PICTURE::MVTYPEMB */
+ unsigned int direct_mb : 1; /* PICTURE::DIRECTMB */
+ unsigned int skip_mb : 1; /* PICTURE::SKIPMB */
+ unsigned int field_tx : 1; /* PICTURE::FIELDTX */
+ unsigned int forward_mb : 1; /* PICTURE::FORWARDMB */
+ unsigned int ac_pred : 1; /* PICTURE::ACPRED */
+ unsigned int overflags : 1; /* PICTURE::OVERFLAGS */
} flags;
- unsigned char value;
+ unsigned int value;
} raw_coding;
union {
struct {
- unsigned char bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
- unsigned char bp_direct_mb : 1; /* PICTURE::DIRECTMB */
- unsigned char bp_skip_mb : 1; /* PICTURE::SKIPMB */
- unsigned char bp_field_tx : 1; /* PICTURE::FIELDTX */
- unsigned char bp_forward_mb : 1; /* PICTURE::FORWARDMB */
- unsigned char bp_ac_pred : 1; /* PICTURE::ACPRED */
- unsigned char bp_overflags : 1; /* PICTURE::OVERFLAGS */
+ unsigned int bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
+ unsigned int bp_direct_mb : 1; /* PICTURE::DIRECTMB */
+ unsigned int bp_skip_mb : 1; /* PICTURE::SKIPMB */
+ unsigned int bp_field_tx : 1; /* PICTURE::FIELDTX */
+ unsigned int bp_forward_mb : 1; /* PICTURE::FORWARDMB */
+ unsigned int bp_ac_pred : 1; /* PICTURE::ACPRED */
+ unsigned int bp_overflags : 1; /* PICTURE::OVERFLAGS */
} flags;
- unsigned char value;
+ unsigned int value;
} bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
union {
struct {
- unsigned char reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
- unsigned char reference_distance : 5;/* PICTURE_LAYER::REFDIST */
- unsigned char num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
- unsigned char reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
+ unsigned int reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
+ unsigned int reference_distance : 5;/* PICTURE_LAYER::REFDIST */
+ unsigned int num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
+ unsigned int reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
} bits;
- unsigned short value;
+ unsigned int value;
} reference_fields;
union {
struct {
- unsigned char mv_mode : 3; /* PICTURE_LAYER::MVMODE */
- unsigned char mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
- unsigned char mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
- unsigned char two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
- unsigned char four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
- unsigned char four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
- unsigned char extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
- unsigned char extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
- unsigned char extended_dmv_flag : 1; /* ENTRY_POCHAR_LAYER::EXTENDED_DMV */
- unsigned char extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
+ unsigned int mv_mode : 3; /* PICTURE_LAYER::MVMODE */
+ unsigned int mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
+ unsigned int mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
+ unsigned int two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
+ unsigned int four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
+ unsigned int four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
+ unsigned int extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
+ unsigned int extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
+ unsigned int extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
+ unsigned int extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
} bits;
unsigned int value;
} mv_fields;
union {
struct {
- unsigned char dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
- unsigned char quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
- unsigned char half_qp : 1; /* PICTURE_LAYER::HALFQP */
- unsigned char pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
- unsigned char pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
- unsigned char dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
- unsigned char dq_profile : 2; /* VOPDQUANT::DQPROFILE */
- unsigned char dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
- unsigned char dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
- unsigned char dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
- unsigned char alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
+ unsigned int dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
+ unsigned int quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
+ unsigned int half_qp : 1; /* PICTURE_LAYER::HALFQP */
+ unsigned int pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
+ unsigned int pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
+ unsigned int dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
+ unsigned int dq_profile : 2; /* VOPDQUANT::DQPROFILE */
+ unsigned int dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
+ unsigned int dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
+ unsigned int dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
+ unsigned int alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
} bits;
- unsigned long value;
+ unsigned int value;
} pic_quantizer_fields;
union {
struct {
- unsigned char variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
- unsigned char mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
- unsigned char frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
- unsigned char transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
- unsigned char transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
- unsigned char intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
+ unsigned int variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
+ unsigned int mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
+ unsigned int frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
+ unsigned int transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
+ unsigned int transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
+ unsigned int intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
} bits;
- unsigned short value;
+ unsigned int value;
} transform_fields;
} VAPictureParameterBufferVC1;
@@ -882,6 +896,7 @@ This is simplely a buffer containing raw bit-stream bytes
typedef struct _VAPictureH264
{
VASurfaceID picture_id;
+ unsigned int frame_idx;
unsigned int flags;
unsigned int TopFieldOrderCnt;
unsigned int BottomFieldOrderCnt;
@@ -909,30 +924,41 @@ typedef struct _VAPictureParameterBufferH264
unsigned char num_ref_frames;
union {
struct {
- unsigned char chroma_format_idc : 2;
- unsigned char residual_colour_transform_flag : 1;
- unsigned char frame_mbs_only_flag : 1;
- unsigned char mb_adaptive_frame_field_flag : 1;
- unsigned char direct_8x8_inference_flag : 1;
- unsigned char MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
+ unsigned int chroma_format_idc : 2;
+ unsigned int residual_colour_transform_flag : 1;
+ unsigned int gaps_in_frame_num_value_allowed_flag : 1;
+ unsigned int frame_mbs_only_flag : 1;
+ unsigned int mb_adaptive_frame_field_flag : 1;
+ unsigned int direct_8x8_inference_flag : 1;
+ unsigned int MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
+ unsigned int log2_max_frame_num_minus4 : 4;
+ unsigned int pic_order_cnt_type : 2;
+ unsigned int log2_max_pic_order_cnt_lsb_minus4 : 4;
+ unsigned int delta_pic_order_always_zero_flag : 1;
} bits;
- unsigned char value;
+ unsigned int value;
} seq_fields;
unsigned char num_slice_groups_minus1;
unsigned char slice_group_map_type;
+ unsigned short slice_group_change_rate_minus1;
signed char pic_init_qp_minus26;
+ signed char pic_init_qs_minus26;
signed char chroma_qp_index_offset;
signed char second_chroma_qp_index_offset;
union {
struct {
- unsigned char entropy_coding_mode_flag : 1;
- unsigned char weighted_pred_flag : 1;
- unsigned char weighted_bipred_idc : 2;
- unsigned char transform_8x8_mode_flag : 1;
- unsigned char field_pic_flag : 1;
- unsigned char constrained_intra_pred_flag : 1;
+ unsigned int entropy_coding_mode_flag : 1;
+ unsigned int weighted_pred_flag : 1;
+ unsigned int weighted_bipred_idc : 2;
+ unsigned int transform_8x8_mode_flag : 1;
+ unsigned int field_pic_flag : 1;
+ unsigned int constrained_intra_pred_flag : 1;
+ unsigned int pic_order_present_flag : 1;
+ unsigned int deblocking_filter_control_present_flag : 1;
+ unsigned int redundant_pic_cnt_present_flag : 1;
+ unsigned int reference_pic_flag : 1; /* nal_ref_idc != 0 */
} bits;
- unsigned char value;
+ unsigned int value;
} pic_fields;
unsigned short frame_num;
} VAPictureParameterBufferH264;
@@ -1006,10 +1032,10 @@ typedef struct _VAEncSliceParameterBuffer
unsigned int slice_height; /* slice height measured in MB */
union {
struct {
- unsigned char is_intra : 1;
- unsigned char disable_deblocking_filter_idc : 2;
+ unsigned int is_intra : 1;
+ unsigned int disable_deblocking_filter_idc : 2;
} bits;
- unsigned char value;
+ unsigned int value;
} slice_flags;
} VAEncSliceParameterBuffer;
@@ -1218,18 +1244,17 @@ Synchronization
*/
VAStatus vaSyncSurface (
VADisplay dpy,
- VAContextID context,
VASurfaceID render_target
);
typedef enum
{
- VASurfaceRendering = 0, /* Rendering in progress */
- VASurfaceDisplaying = 1, /* Displaying in progress (not safe to render into it) */
+ VASurfaceRendering = 1, /* Rendering in progress */
+ VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
/* this status is useful if surface is used as the source */
/* of an overlay */
- VASurfaceReady = 2, /* not being rendered or displayed */
- VASurfaceSkipped = 4 /* Indicate a skipped frame during encode */
+ VASurfaceReady = 4, /* not being rendered or displayed */
+ VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
} VASurfaceStatus;
/*
@@ -1394,8 +1419,6 @@ VAStatus vaGetImage (
* Image must be in a format supported by the implementation
* Returns a VA_STATUS_ERROR_SURFACE_BUSY if the surface
* shouldn't be rendered into when this is called
- * The source and destionation width and height are the same and
- * no scaling is performed with this operation.
*/
VAStatus vaPutImage (
VADisplay dpy,
@@ -1403,22 +1426,6 @@ VAStatus vaPutImage (
VAImageID image,
int src_x,
int src_y,
- unsigned int width,
- unsigned int height,
- int dest_x,
- int dest_y
-);
-
-/*
- * Similar to vaPutImage but with additional destination width
- * and height arguments to enable scaling
- */
-VAStatus vaPutImage2 (
- VADisplay dpy,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
unsigned int src_width,
unsigned int src_height,
int dest_x,
@@ -1567,28 +1574,6 @@ VAStatus vaAssociateSubpicture (
int num_surfaces,
short src_x, /* upper left offset in subpicture */
short src_y,
- short dest_x, /* upper left offset in surface */
- short dest_y,
- unsigned short width,
- unsigned short height,
- /*
- * whether to enable chroma-keying or global-alpha
- * see VA_SUBPICTURE_XXX values
- */
- unsigned int flags
-);
-
-/*
- * Similar to vaAssociateSubpicture but with additional destination width
- * and height to enable scaling
- */
-VAStatus vaAssociateSubpicture2 (
- VADisplay dpy,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x, /* upper left offset in subpicture */
- short src_y,
unsigned short src_width,
unsigned short src_height,
short dest_x, /* upper left offset in surface */
diff --git a/src/va_backend.h b/src/va_backend.h
index 619dd99..6f858f5 100644
--- a/src/va_backend.h
+++ b/src/va_backend.h
@@ -175,7 +175,6 @@ struct VADriverVTable
VAStatus (*vaSyncSurface) (
VADriverContextP ctx,
- VAContextID context,
VASurfaceID render_target
);
@@ -254,18 +253,6 @@ struct VADriverVTable
VAImageID image,
int src_x,
int src_y,
- unsigned int width,
- unsigned int height,
- int dest_x,
- int dest_y
- );
-
- VAStatus (*vaPutImage2) (
- VADriverContextP ctx,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
unsigned int src_width,
unsigned int src_height,
int dest_x,
@@ -319,24 +306,6 @@ struct VADriverVTable
int num_surfaces,
short src_x, /* upper left offset in subpicture */
short src_y,
- short dest_x, /* upper left offset in surface */
- short dest_y,
- unsigned short width,
- unsigned short height,
- /*
- * whether to enable chroma-keying or global-alpha
- * see VA_SUBPICTURE_XXX values
- */
- unsigned int flags
- );
-
- VAStatus (*vaAssociateSubpicture2) (
- VADriverContextP ctx,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x, /* upper left offset in subpicture */
- short src_y,
unsigned short src_width,
unsigned short src_height,
short dest_x, /* upper left offset in surface */
diff --git a/src/x11/va_x11.c b/src/x11/va_x11.c
index ec0bbc8..9de904e 100644
--- a/src/x11/va_x11.c
+++ b/src/x11/va_x11.c
@@ -205,27 +205,6 @@ static VAStatus va_DisplayContextGetDriverName (
return vaStatus;
}
-int vaDisplayIsValid(VADisplay dpy)
-{
- VADisplayContextP tmp=NULL;
- VADisplayContextP pDisplayContext = pDisplayContexts;
-
- while (pDisplayContext)
- {
- if (pDisplayContext == (VADisplayContextP)dpy)
- {
- tmp = (VADisplay)pDisplayContext;
- break;
- }
- pDisplayContext = pDisplayContext->pNext;
- }
-
- if (!tmp)
- return 0;
-
- return tmp->vaIsValid(pDisplayContext);
-}
-
VADisplay vaGetDisplay (
Display *native_dpy /* implementation specific */
diff --git a/test/test_12.c b/test/test_12.c
index 3c82476..c9e4db9 100644
--- a/test/test_12.c
+++ b/test/test_12.c
@@ -222,7 +222,7 @@ void test()
va_status = vaEndPicture(va_dpy,vaContext);
ASSERT( VA_STATUS_SUCCESS == va_status );
- va_status = vaSyncSurface(va_dpy, vaContext, vaSurface);
+ va_status = vaSyncSurface(va_dpy, vaSurface);
ASSERT( VA_STATUS_SUCCESS == va_status );
win = XCreateSimpleWindow(dpy, RootWindow(dpy, 0), 0, 0,