summaryrefslogtreecommitdiff
path: root/lib/libXvMC/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-03-10 17:04:01 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-03-10 17:04:01 +0000
commit887896c05dc239f2db148387d5ee005181b4541b (patch)
treec5ffda9e970c5e71a639a4ac319d3b1e780c9963 /lib/libXvMC/src
parent3fcad687a5f519f16625355fe02f731d99dc9896 (diff)
Upate to libXvMC 1.0.7
Diffstat (limited to 'lib/libXvMC/src')
-rw-r--r--lib/libXvMC/src/Makefile.am32
-rw-r--r--lib/libXvMC/src/Makefile.in92
-rw-r--r--lib/libXvMC/src/XvMC.c82
-rw-r--r--lib/libXvMC/src/XvMCWrapper.c781
4 files changed, 78 insertions, 909 deletions
diff --git a/lib/libXvMC/src/Makefile.am b/lib/libXvMC/src/Makefile.am
index 741e7c550..05284fe0f 100644
--- a/lib/libXvMC/src/Makefile.am
+++ b/lib/libXvMC/src/Makefile.am
@@ -1,34 +1,16 @@
-lib_LTLIBRARIES = libXvMC.la libXvMCW.la
+lib_LTLIBRARIES = libXvMC.la
-libXvMC_la_SOURCES = \
- XvMC.c \
- XvMClibint.h
-
-libXvMCW_la_SOURCES = \
- XvMCWrapper.c
-
-AM_CFLAGS = $(CWARNFLAGS) @XVMC_CFLAGS@
-AM_CPPFLAGS = -I$(top_srcdir)/include @MALLOC_ZERO_CFLAGS@
-
-libXvMC_la_LIBADD = @XVMC_LIBS@
-libXvMC_la_CFLAGS = $(AM_CFLAGS)
-
-libXvMCW_la_LIBADD = @XVMC_LIBS@
-libXvMCW_la_CFLAGS = \
- $(AM_CFLAGS) \
- -DXVMC_CONFIGDIR=$(sysconfdir)/X11 \
- -DXVMC_SOVERSION=\".1.0\" \
- -DXV_SOVERSION=\".1.0\"
+AM_CPPFLAGS = -I$(top_srcdir)/include $(MALLOC_ZERO_CFLAGS)
+AM_CFLAGS = $(CWARNFLAGS) $(XVMC_CFLAGS)
+libXvMC_la_SOURCES = XvMC.c XvMClibint.h
+libXvMC_la_LIBADD = $(XVMC_LIBS)
libXvMC_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-libXvMCW_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-
if LINT
-ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS)
lint:
- $(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_SOURCES) $(XVMC_LIBS)
- $(LINT) $(ALL_LINT_FLAGS) $(libXvMCW_la_CFLAGS) $(libXvMCW_la_SOURCES) $(XVMC_LIBS)
+ $(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_SOURCES) $(AM_CFLAGS) $(XVMC_LIBS)
endif LINT
diff --git a/lib/libXvMC/src/Makefile.in b/lib/libXvMC/src/Makefile.in
index cfa92b586..7f1ec42a6 100644
--- a/lib/libXvMC/src/Makefile.in
+++ b/lib/libXvMC/src/Makefile.in
@@ -23,9 +23,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
+install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
+install_sh_PROGRAM = ${SHELL} $(install_sh) -c
+install_sh_SCRIPT = ${SHELL} $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@@ -54,12 +54,10 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
-libXvMC_la_DEPENDENCIES =
-am_libXvMC_la_OBJECTS = libXvMC_la-XvMC.lo
+am__DEPENDENCIES_1 =
+libXvMC_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_libXvMC_la_OBJECTS = XvMC.lo
libXvMC_la_OBJECTS = $(am_libXvMC_la_OBJECTS)
-libXvMCW_la_DEPENDENCIES =
-am_libXvMCW_la_OBJECTS = libXvMCW_la-XvMCWrapper.lo
-libXvMCW_la_OBJECTS = $(am_libXvMCW_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -71,8 +69,8 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libXvMC_la_SOURCES) $(libXvMCW_la_SOURCES)
-DIST_SOURCES = $(libXvMC_la_SOURCES) $(libXvMCW_la_SOURCES)
+SOURCES = $(libXvMC_la_SOURCES)
+DIST_SOURCES = $(libXvMC_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -90,6 +88,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -97,24 +96,20 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
@@ -123,6 +118,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -133,6 +129,7 @@ LINT = @LINT@
LINT_FALSE = @LINT_FALSE@
LINT_FLAGS = @LINT_FLAGS@
LINT_TRUE = @LINT_TRUE@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -140,11 +137,16 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MALLOC_ZERO_CFLAGS = @MALLOC_ZERO_CFLAGS@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -157,6 +159,7 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XMALLOC_ZERO_CFLAGS = @XMALLOC_ZERO_CFLAGS@
@@ -164,13 +167,11 @@ XORG_MAN_PAGE = @XORG_MAN_PAGE@
XTMALLOC_ZERO_CFLAGS = @XTMALLOC_ZERO_CFLAGS@
XVMC_CFLAGS = @XVMC_CFLAGS@
XVMC_LIBS = @XVMC_LIBS@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -211,28 +212,13 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-lib_LTLIBRARIES = libXvMC.la libXvMCW.la
-libXvMC_la_SOURCES = \
- XvMC.c \
- XvMClibint.h
-
-libXvMCW_la_SOURCES = \
- XvMCWrapper.c
-
-AM_CFLAGS = $(CWARNFLAGS) @XVMC_CFLAGS@
-AM_CPPFLAGS = -I$(top_srcdir)/include @MALLOC_ZERO_CFLAGS@
-libXvMC_la_LIBADD = @XVMC_LIBS@
-libXvMC_la_CFLAGS = $(AM_CFLAGS)
-libXvMCW_la_LIBADD = @XVMC_LIBS@
-libXvMCW_la_CFLAGS = \
- $(AM_CFLAGS) \
- -DXVMC_CONFIGDIR=$(sysconfdir)/X11 \
- -DXVMC_SOVERSION=\".1.0\" \
- -DXV_SOVERSION=\".1.0\"
-
+lib_LTLIBRARIES = libXvMC.la
+AM_CPPFLAGS = -I$(top_srcdir)/include $(MALLOC_ZERO_CFLAGS)
+AM_CFLAGS = $(CWARNFLAGS) $(XVMC_CFLAGS)
+libXvMC_la_SOURCES = XvMC.c XvMClibint.h
+libXvMC_la_LIBADD = $(XVMC_LIBS)
libXvMC_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-libXvMCW_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
@LINT_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS)
all: all-am
@@ -297,8 +283,6 @@ clean-libLTLIBRARIES:
done
libXvMC.la: $(libXvMC_la_OBJECTS) $(libXvMC_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libXvMC_la_LDFLAGS) $(libXvMC_la_OBJECTS) $(libXvMC_la_LIBADD) $(LIBS)
-libXvMCW.la: $(libXvMCW_la_OBJECTS) $(libXvMCW_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(libXvMCW_la_LDFLAGS) $(libXvMCW_la_OBJECTS) $(libXvMCW_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -306,8 +290,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXvMCW_la-XvMCWrapper.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXvMC_la-XvMC.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XvMC.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -330,20 +313,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-libXvMC_la-XvMC.lo: XvMC.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libXvMC_la_CFLAGS) $(CFLAGS) -MT libXvMC_la-XvMC.lo -MD -MP -MF "$(DEPDIR)/libXvMC_la-XvMC.Tpo" -c -o libXvMC_la-XvMC.lo `test -f 'XvMC.c' || echo '$(srcdir)/'`XvMC.c; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libXvMC_la-XvMC.Tpo" "$(DEPDIR)/libXvMC_la-XvMC.Plo"; else rm -f "$(DEPDIR)/libXvMC_la-XvMC.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='XvMC.c' object='libXvMC_la-XvMC.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libXvMC_la_CFLAGS) $(CFLAGS) -c -o libXvMC_la-XvMC.lo `test -f 'XvMC.c' || echo '$(srcdir)/'`XvMC.c
-
-libXvMCW_la-XvMCWrapper.lo: XvMCWrapper.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libXvMCW_la_CFLAGS) $(CFLAGS) -MT libXvMCW_la-XvMCWrapper.lo -MD -MP -MF "$(DEPDIR)/libXvMCW_la-XvMCWrapper.Tpo" -c -o libXvMCW_la-XvMCWrapper.lo `test -f 'XvMCWrapper.c' || echo '$(srcdir)/'`XvMCWrapper.c; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libXvMCW_la-XvMCWrapper.Tpo" "$(DEPDIR)/libXvMCW_la-XvMCWrapper.Plo"; else rm -f "$(DEPDIR)/libXvMCW_la-XvMCWrapper.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='XvMCWrapper.c' object='libXvMCW_la-XvMCWrapper.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libXvMCW_la_CFLAGS) $(CFLAGS) -c -o libXvMCW_la-XvMCWrapper.lo `test -f 'XvMCWrapper.c' || echo '$(srcdir)/'`XvMCWrapper.c
-
mostlyclean-libtool:
-rm -f *.lo
@@ -526,8 +495,7 @@ uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
@LINT_TRUE@lint:
-@LINT_TRUE@ $(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_SOURCES) $(XVMC_LIBS)
-@LINT_TRUE@ $(LINT) $(ALL_LINT_FLAGS) $(libXvMCW_la_CFLAGS) $(libXvMCW_la_SOURCES) $(XVMC_LIBS)
+@LINT_TRUE@ $(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_SOURCES) $(AM_CFLAGS) $(XVMC_LIBS)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/lib/libXvMC/src/XvMC.c b/lib/libXvMC/src/XvMC.c
index 3bf5a43d8..5a4cf0ddc 100644
--- a/lib/libXvMC/src/XvMC.c
+++ b/lib/libXvMC/src/XvMC.c
@@ -3,7 +3,7 @@
#endif
#include <stdio.h>
#include "XvMClibint.h"
-#ifdef HAS_SHM
+#ifdef HAVE_SHMAT
#ifndef Lynx
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -11,7 +11,7 @@
#include <ipc.h>
#include <shm.h>
#endif /* Lynx */
-#endif /* HAS_SHM */
+#endif /* HAVE_SHMAT */
#include <unistd.h>
#include <sys/time.h>
#include <X11/extensions/Xext.h>
@@ -19,9 +19,9 @@
static XExtensionInfo _xvmc_info_data;
static XExtensionInfo *xvmc_info = &_xvmc_info_data;
-static char *xvmc_extension_name = XvMCName;
+static const char *xvmc_extension_name = XvMCName;
-static char *xvmc_error_list[] =
+static const char *xvmc_error_list[] =
{
"BadContext",
"BadSurface",
@@ -100,7 +100,7 @@ XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num)
*num = 0;
XvMCCheckExtension (dpy, info, NULL);
-
+
LockDisplay (dpy);
XvMCGetReq (ListSurfaceTypes, req);
req->port = port;
@@ -111,7 +111,7 @@ XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num)
}
if(rep.num > 0) {
- surface_info =
+ surface_info =
(XvMCSurfaceInfo*)Xmalloc(rep.num * sizeof(XvMCSurfaceInfo));
if(surface_info) {
@@ -126,9 +126,9 @@ XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num)
surface_info[i].chroma_format = sinfo.chroma_format;
surface_info[i].max_width = sinfo.max_width;
surface_info[i].max_height = sinfo.max_height;
- surface_info[i].subpicture_max_width =
+ surface_info[i].subpicture_max_width =
sinfo.subpicture_max_width;
- surface_info[i].subpicture_max_height =
+ surface_info[i].subpicture_max_height =
sinfo.subpicture_max_height;
surface_info[i].mc_type = sinfo.mc_type;
surface_info[i].flags = sinfo.flags;
@@ -172,7 +172,7 @@ XvImageFormatValues * XvMCListSubpictureTypes (
}
if(rep.num > 0) {
- ret =
+ ret =
(XvImageFormatValues*)Xmalloc(rep.num * sizeof(XvImageFormatValues));
if(ret) {
@@ -183,19 +183,19 @@ XvImageFormatValues * XvMCListSubpictureTypes (
for(i = 0; i < rep.num; i++) {
_XRead(dpy, (char*)(&Info), sz_xvImageFormatInfo);
- ret[i].id = Info.id;
- ret[i].type = Info.type;
- ret[i].byte_order = Info.byte_order;
+ ret[i].id = Info.id;
+ ret[i].type = Info.type;
+ ret[i].byte_order = Info.byte_order;
memcpy(&(ret[i].guid[0]), &(Info.guid[0]), 16);
- ret[i].bits_per_pixel = Info.bpp;
- ret[i].format = Info.format;
- ret[i].num_planes = Info.num_planes;
- ret[i].depth = Info.depth;
- ret[i].red_mask = Info.red_mask;
- ret[i].green_mask = Info.green_mask;
- ret[i].blue_mask = Info.blue_mask;
- ret[i].y_sample_bits = Info.y_sample_bits;
- ret[i].u_sample_bits = Info.u_sample_bits;
+ ret[i].bits_per_pixel = Info.bpp;
+ ret[i].format = Info.format;
+ ret[i].num_planes = Info.num_planes;
+ ret[i].depth = Info.depth;
+ ret[i].red_mask = Info.red_mask;
+ ret[i].green_mask = Info.green_mask;
+ ret[i].blue_mask = Info.blue_mask;
+ ret[i].y_sample_bits = Info.y_sample_bits;
+ ret[i].u_sample_bits = Info.u_sample_bits;
ret[i].v_sample_bits = Info.v_sample_bits;
ret[i].horz_y_period = Info.horz_y_period;
ret[i].horz_u_period = Info.horz_u_period;
@@ -212,18 +212,18 @@ XvImageFormatValues * XvMCListSubpictureTypes (
UnlockDisplay (dpy);
SyncHandle ();
- return ret;
+ return ret;
}
-/******************************************************************
+/******************************************************************
These are intended as a protocol interface to be used by direct
rendering libraries. They are not intended to be client viewable
functions. These will stay in place until we have a mechanism in
place similar to that of OpenGL with an libXvMCcore library.
-*******************************************************************/
-
-/*
+*******************************************************************/
+
+/*
_xvmc_create_context -
Pass in the context with the surface_type_id, width, height,
@@ -234,7 +234,7 @@ XvImageFormatValues * XvMCListSubpictureTypes (
an array of priv_count CARD32s. This data is allocated by
this function. If returned, the caller is responsible for
freeing it! Generally, such information is only returned if
- an XVMC_DIRECT context was specified.
+ an XVMC_DIRECT context was specified.
*/
@@ -309,14 +309,14 @@ Status _xvmc_destroy_context (
_xvmc_create_surface -
Pass the context and this function will fill out all the
- information in the surface.
+ information in the surface.
The server may return implementation-specific information
back in the priv_data. The size of that information will
an array of priv_count CARD32s. This data is allocated by
this function. If returned, the caller is responsible for
freeing it! Generally, such information is returned only if
the context was a direct context.
-
+
*/
Status _xvmc_create_surface (
@@ -469,15 +469,15 @@ Status _xvmc_destroy_subpicture(
LockDisplay (dpy);
XvMCGetReq (DestroySubpicture, req);
- req->subpicture_id = subpicture->subpicture_id;
+ req->subpicture_id = subpicture->subpicture_id;
UnlockDisplay (dpy);
SyncHandle ();
return Success;
}
Status XvMCGetDRInfo(Display *dpy, XvPortID port,
- char **name, char **busID,
- int *major, int *minor,
+ char **name, char **busID,
+ int *major, int *minor,
int *patchLevel,
int *isLocal)
{
@@ -487,7 +487,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
char *tmpBuf = NULL;
CARD32 magic;
-#ifdef HAS_SHM
+#ifdef HAVE_SHMAT
volatile CARD32 *shMem;
struct timezone here;
struct timeval now;
@@ -503,7 +503,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
req->port = port;
magic = 0;
req->magic = 0;
-#ifdef HAS_SHM
+#ifdef HAVE_SHMAT
req->shmKey = shmget(IPC_PRIVATE, 1024, IPC_CREAT | 0600);
/*
@@ -514,11 +514,11 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
* any complicated data on those pages. Thats the explanation of this
* otherwise stupid-looking pattern algorithm.
*/
-
+
if (req->shmKey >= 0) {
shMem = (CARD32 *) shmat(req->shmKey, NULL, 0);
shmctl( req->shmKey, IPC_RMID, NULL);
- if ( shMem ) {
+ if ( shMem ) {
register volatile CARD32 *shMemC = shMem;
register int i;
@@ -528,7 +528,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
req->magic = magic;
i = 1024 / sizeof(CARD32);
while(i--) {
- *shMemC++ = magic;
+ *shMemC++ = magic;
magic = ~magic;
}
} else {
@@ -541,14 +541,14 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
UnlockDisplay (dpy);
SyncHandle ();
-#ifdef HAS_SHM
+#ifdef HAVE_SHMAT
if ( req->shmKey >= 0) {
shmdt( (const void *) shMem );
- }
+ }
#endif
return -1;
}
-#ifdef HAS_SHM
+#ifdef HAVE_SHMAT
shmdt( (const void *) shMem );
#endif
@@ -567,7 +567,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
}
} else {
XFree(tmpBuf);
- }
+ }
}
if (*name && *busID && tmpBuf) {
diff --git a/lib/libXvMC/src/XvMCWrapper.c b/lib/libXvMC/src/XvMCWrapper.c
deleted file mode 100644
index d3800e7ec..000000000
--- a/lib/libXvMC/src/XvMCWrapper.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/*****************************************************************************
- * XvMC Wrapper including the Nonstandard VLD extension.
- *
- * Copyright (c) 2004 The Unichrome project. All rights reserved.
- *
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHOR(S) OR COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Thomas Hellström (2004)
- */
-
-/*
- * BUGS: The wrapper really should maintain one symbol table per port. This
- * could possibly be impemented, To do that, the port-independent symbols need to be lifted out,
- * and one would have to create a number of mapping tables:
- *
- * port -> symbol table
- * context -> port
- * surface -> port
- * subpicture -> port
- *
- * and reference the right table when needed.
- * This needs to be done only if there is a player that wants to access two displays with different
- * hardware simultaneously. Not likely as of today.
- */
-
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
-#include <X11/Xlib.h>
-#include <X11/extensions/XvMC.h>
-#include <X11/extensions/XvMClib.h>
-#include <X11/extensions/vldXvMC.h>
-#include <dlfcn.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-
-typedef Bool (*XvMCQueryExtensionP) (Display *, int *, int *);
-typedef Status (*XvMCQueryVersionP) (Display *, int *,int *);
-typedef XvMCSurfaceInfo * (*XvMCListSurfaceTypesP)(Display *, XvPortID, int *);
-typedef Status (* XvMCCreateContextP) (Display *,XvPortID,int ,int ,int ,int ,XvMCContext * );
-typedef Status (*XvMCDestroyContextP) (Display *, XvMCContext * );
-typedef Status (*XvMCCreateSurfaceP)(Display *,XvMCContext *,XvMCSurface *);
-typedef Status (*XvMCDestroySurfaceP)(Display *, XvMCSurface *);
-typedef XvImageFormatValues * (*XvMCListSubpictureTypesP) (Display *,XvPortID ,int ,int *);
-typedef Status (*XvMCPutSurfaceP)(Display *,XvMCSurface *,Drawable ,short , short , unsigned short ,
- unsigned short ,short ,short ,unsigned short ,unsigned short ,int );
-typedef Status (*XvMCHideSurfaceP)(Display *, XvMCSurface *);
-typedef Status (*XvMCCreateSubpictureP) (Display *, XvMCContext *, XvMCSubpicture *,
- unsigned short, unsigned short,int);
-typedef Status (*XvMCClearSubpictureP) (Display *,XvMCSubpicture *,short,short,unsigned short,unsigned short,
- unsigned int);
-typedef Status (*XvMCCompositeSubpictureP) (Display *, XvMCSubpicture *,XvImage *,short,short,
- unsigned short, unsigned short,short,short);
-typedef Status (*XvMCDestroySubpictureP) (Display *, XvMCSubpicture *);
-typedef Status (*XvMCSetSubpicturePaletteP) (Display *, XvMCSubpicture *, unsigned char *);
-typedef Status (*XvMCBlendSubpictureP) (Display *d,XvMCSurface *,XvMCSubpicture *,short,
- short,unsigned short,unsigned short,short,short,
- unsigned short,unsigned short);
-typedef Status (*XvMCBlendSubpicture2P) (Display *,XvMCSurface *,XvMCSurface *,
- XvMCSubpicture *,short,short,unsigned short,
- unsigned short,short,short,unsigned short,
- unsigned short);
-typedef Status (*XvMCSyncSurfaceP) (Display *, XvMCSurface *);
-typedef Status (*XvMCFlushSurfaceP) (Display *, XvMCSurface *);
-typedef Status (*XvMCGetSurfaceStatusP) (Display *, XvMCSurface *, int *);
-typedef Status (*XvMCRenderSurfaceP) (Display *,XvMCContext *,unsigned int,XvMCSurface *,
- XvMCSurface *,XvMCSurface *,unsigned int,unsigned int,
- unsigned int,XvMCMacroBlockArray *,XvMCBlockArray *);
-typedef Status (*XvMCSyncSubpictureP) (Display *, XvMCSubpicture *);
-typedef Status (*XvMCFlushSubpictureP) (Display *, XvMCSubpicture *);
-typedef Status (*XvMCGetSubpictureStatusP) (Display *, XvMCSubpicture *, int *);
-typedef Status (*XvMCCreateBlocksP) (Display *, XvMCContext *,unsigned int,XvMCBlockArray *);
-typedef Status (*XvMCDestroyBlocksP) (Display *,XvMCBlockArray *);
-typedef Status (*XvMCCreateMacroBlocksP) (Display *,XvMCContext *,unsigned int,
- XvMCMacroBlockArray *);
-typedef Status (*XvMCDestroyMacroBlocksP) (Display *,XvMCMacroBlockArray *);
-typedef XvAttribute *(*XvMCQueryAttributesP) (Display *,XvMCContext *,int *);
-typedef Status (*XvMCSetAttributeP) (Display *,XvMCContext *, Atom, int);
-typedef Status (*XvMCGetAttributeP) (Display *,XvMCContext *, Atom, int *);
-
-/*
- * Nonstandard VLD acceleration level:
- */
-
-typedef Status (*XvMCBeginSurfaceP) (Display *,XvMCContext *,XvMCSurface *,
- XvMCSurface *,XvMCSurface *f,const XvMCMpegControl *);
-typedef Status (*XvMCLoadQMatrixP) (Display *, XvMCContext *,const XvMCQMatrix *);
-typedef Status (*XvMCPutSliceP)(Display *,XvMCContext *, char *,int);
-typedef Status (*XvMCPutSlice2P)(Display *,XvMCContext *, char *,int, unsigned);
-typedef Status (*XvMCGetDRInfoP)(Display *, XvPortID, char **, char **, int *, int *,
- int *, int *);
-
-
-typedef struct {
- XvMCQueryExtensionP XvMCQueryExtension;
- XvMCQueryVersionP XvMCQueryVersion;
- XvMCListSurfaceTypesP XvMCListSurfaceTypes;
- XvMCCreateContextP XvMCCreateContext;
- XvMCDestroyContextP XvMCDestroyContext;
- XvMCCreateSurfaceP XvMCCreateSurface;
- XvMCDestroySurfaceP XvMCDestroySurface;
- XvMCListSubpictureTypesP XvMCListSubpictureTypes;
- XvMCPutSurfaceP XvMCPutSurface;
- XvMCHideSurfaceP XvMCHideSurface;
- XvMCCreateSubpictureP XvMCCreateSubpicture;
- XvMCClearSubpictureP XvMCClearSubpicture;
- XvMCCompositeSubpictureP XvMCCompositeSubpicture;
- XvMCDestroySubpictureP XvMCDestroySubpicture;
- XvMCSetSubpicturePaletteP XvMCSetSubpicturePalette;
- XvMCBlendSubpictureP XvMCBlendSubpicture;
- XvMCBlendSubpicture2P XvMCBlendSubpicture2;
- XvMCSyncSurfaceP XvMCSyncSurface;
- XvMCFlushSurfaceP XvMCFlushSurface;
- XvMCGetSurfaceStatusP XvMCGetSurfaceStatus;
- XvMCRenderSurfaceP XvMCRenderSurface;
- XvMCSyncSubpictureP XvMCSyncSubpicture;
- XvMCFlushSubpictureP XvMCFlushSubpicture;
- XvMCGetSubpictureStatusP XvMCGetSubpictureStatus;
- XvMCCreateBlocksP XvMCCreateBlocks;
- XvMCDestroyBlocksP XvMCDestroyBlocks;
- XvMCCreateMacroBlocksP XvMCCreateMacroBlocks;
- XvMCDestroyMacroBlocksP XvMCDestroyMacroBlocks;
- XvMCQueryAttributesP XvMCQueryAttributes;
- XvMCSetAttributeP XvMCSetAttribute;
- XvMCGetAttributeP XvMCGetAttribute;
-
- /*
- * Nonstandard VLD acceleration level:
- */
-
- XvMCBeginSurfaceP XvMCBeginSurface;
- XvMCLoadQMatrixP XvMCLoadQMatrix;
- XvMCPutSliceP XvMCPutSlice;
- XvMCPutSlice2P XvMCPutSlice2;
-
- /*
- * Driver name function.
- */
-
- XvMCGetDRInfoP XvMCGetDRInfo;
-
- int preInitialised;
- int initialised;
- int vldextension;
-} XvMCWrapper;
-
-static XvMCWrapper xW;
-static int wrapperInit = 0;
-static int wrapperPreInit = 0;
-static void *xvhandle;
-static void *handle2;
-
-#define BUFLEN 200
-
-#define STRS(ARG) STR(ARG)
-#define STR(ARG) #ARG
-
-#define XW_RSYM(base,handle,handle2,pointer, retval) \
- do { \
- register char *err; \
- base.pointer = (pointer##P) dlsym((handle),#pointer); \
- if ((err = dlerror()) != NULL) { \
- if (!handle2) { \
- fprintf(stderr,"%s\n",err); return retval; \
- } \
- base.pointer = (pointer##P) dlsym((handle2),#pointer); \
- if ((err = dlerror()) != NULL) { \
- fprintf(stderr,"%s\n",err); return retval; \
- } \
- } \
- } while (0);
-
-#define XW_RSYM2(base,handle,handle2,pointer) \
- base.pointer = (pointer##P) dlsym((handle),#pointer); \
- if (dlerror() != NULL) { \
- base.pointer = (pointer##P) dlsym((handle2),#pointer); \
- if (dlerror() != NULL) return; \
- }
-
-
-/*
- * Try to dlopen a shared library, versionless first.
- */
-
-
-static void *dlopenversion(const char *lib, const char *version, int flag)
-{
- void *ret;
- int curLen,verLen;
- char *curName;
- const char *tail;
-
-
- curLen = strlen(lib) + (verLen = strlen(version)) + 1;
- curName = (char *) malloc(curLen * sizeof(char));
- strncpy( curName, lib, curLen);
- if (verLen > 1) {
- if (NULL != (tail = strstr(version+1,"."))) {
- strncat( curName, version, tail - version);
- } else {
- strncat( curName, version, verLen);
- }
- }
- ret = dlopen(curName, flag);
- free(curName);
- return ret;
-}
-
-static int preInitW(Display *dpy)
-{
-
- /*
- * Resolve functions that are not hw driver specific.
- */
-
- void *handleZ = NULL;
-
- wrapperPreInit = 1;
- xW.preInitialised = 0;
- xW.initialised = 0;
- xvhandle = dlopenversion("libXv.so", XV_SOVERSION, RTLD_LAZY | RTLD_GLOBAL);
- if (!xvhandle) {
- fprintf(stderr,"XvMCWrapper: Warning! Could not open shared "
- "library \"libXv.so" XV_SOVERSION "\"\nThis may cause relocation "
- "errors later.\nError was: \"%s\".\n",dlerror());
- }
- handle2 = dlopenversion("libXvMC.so", XVMC_SOVERSION, RTLD_LAZY | RTLD_GLOBAL);
- if (!handle2) {
- fprintf(stderr,"XvMCWrapper: Could not load XvMC "
- "library \"libXvMC.so" XVMC_SOVERSION "\". Failing\n");
- fprintf(stderr,"%s\n",dlerror());
- return 1;
- }
- XW_RSYM(xW, handle2, handleZ, XvMCQueryExtension, 1);
- XW_RSYM(xW, handle2, handleZ, XvMCQueryVersion, 1);
- xW.preInitialised = 1;
- return 0;
-}
-
-static void initW(Display *dpy, XvPortID port)
-{
- char nameBuffer[BUFLEN];
- void *handle;
- int tmp;
- char *clientName = NULL;
- char *err;
- FILE *configFile;
- int nameLen = 0;
- int major,minor,patchLevel,isLocal;
- char *busID = NULL;
-
- wrapperInit = 1;
- xW.initialised = 0;
-
- if (!wrapperPreInit)
- if (preInitW( dpy )) return;
-
- /*
- * Will the DDX tell us the client driver name?
- */
-
- xW.XvMCGetDRInfo = (XvMCGetDRInfoP)
- dlsym(handle2,"XvMCGetDRInfo");
-
- if ((err = dlerror()) == NULL) {
- if (0 == xW.XvMCGetDRInfo( dpy, port, &clientName, &busID, &major,
- &minor,&patchLevel, &isLocal)) {
- nameLen = strlen(clientName);
- XFree(busID);
- if (!isLocal) {
- fprintf(stderr,"XvMCWrapper: X server is not local. Cannot run XvMC.\n");
- XFree(clientName);
- return;
- }
- } else {
- clientName = NULL;
- }
- }
-
- if (clientName && (nameLen < BUFLEN-7) && (nameLen > 0)) {
- nameLen += 3;
- strncpy(nameBuffer,"lib",BUFLEN-1);
- strncpy(nameBuffer+3, clientName, BUFLEN-4);
- strncpy(nameBuffer + nameLen, ".so", BUFLEN-nameLen-1);
- nameBuffer[BUFLEN-1] = 0;
- XFree(clientName);
- handle = dlopenversion(nameBuffer, XVMC_SOVERSION,RTLD_LAZY);
- } else {
- /*
- * No. Try to obtain it from the config file.
- */
-
- if (clientName) XFree(clientName);
-
- configFile = fopen(STRS(XVMC_CONFIGDIR) "/XvMCConfig","r");
-
- xW.initialised = 0;
- xW.vldextension = 0;
-
- if (NULL == configFile) {
- fprintf(stderr,"XvMCWrapper: Could not open config file \"%s\".\n",
- STRS(XVMC_CONFIGDIR) "/XvMCConfig");
- perror("XvMCWrapper");
- return;
- }
-
- if (NULL == fgets(nameBuffer, BUFLEN, configFile)) {
- fclose(configFile);
- fprintf(stderr,"XvMCWrapper: Could not read XvMC library name.\n");
- perror("XvMCWrapper");
- return;
- }
-
- fclose(configFile);
- if ((tmp = strlen(nameBuffer)) == 0) {
- fprintf(stderr,"XvMCWrapper: Zero length XvMC library name.\n");
- fprintf(stderr,"%s\n",dlerror());
- return;
- }
-
- /*
- * Skip trailing newlines and garbage.
- */
-
- while (iscntrl(nameBuffer[tmp-1])) {
- nameBuffer[tmp-1] = 0;
- if (--tmp == 0) {
- fprintf(stderr,"XvMCWrapper: Zero length XvMC library name.\n");
- return;
- }
- }
- handle = dlopen(nameBuffer,RTLD_LAZY);
- }
- if (!handle) {
- fprintf(stderr,"XvMCWrapper: Could not load hardware specific XvMC "
- "library \"%s\".\n",nameBuffer);
- fprintf(stderr,"%s\n",dlerror());
- return;
- }
-
- XW_RSYM(xW, handle, handle2, XvMCListSurfaceTypes,);
- XW_RSYM(xW, handle, handle2, XvMCCreateContext,);
- XW_RSYM(xW, handle, handle2, XvMCDestroyContext,);
- XW_RSYM(xW, handle, handle2, XvMCCreateSurface,);
- XW_RSYM(xW, handle, handle2, XvMCDestroySurface,);
- XW_RSYM(xW, handle, handle2, XvMCListSubpictureTypes,);
- XW_RSYM(xW, handle, handle2, XvMCHideSurface,);
- XW_RSYM(xW, handle, handle2, XvMCCreateSubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCClearSubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCCompositeSubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCDestroySubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCSetSubpicturePalette,);
- XW_RSYM(xW, handle, handle2, XvMCBlendSubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCBlendSubpicture2,);
- XW_RSYM(xW, handle, handle2, XvMCPutSurface,);
- XW_RSYM(xW, handle, handle2, XvMCSyncSurface,);
- XW_RSYM(xW, handle, handle2, XvMCFlushSurface,);
- XW_RSYM(xW, handle, handle2, XvMCGetSurfaceStatus,);
- XW_RSYM(xW, handle, handle2, XvMCRenderSurface,);
- XW_RSYM(xW, handle, handle2, XvMCSyncSubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCFlushSubpicture,);
- XW_RSYM(xW, handle, handle2, XvMCGetSubpictureStatus,);
- XW_RSYM(xW, handle, handle2, XvMCCreateBlocks,);
- XW_RSYM(xW, handle, handle2, XvMCDestroyBlocks,);
- XW_RSYM(xW, handle, handle2, XvMCCreateMacroBlocks,);
- XW_RSYM(xW, handle, handle2, XvMCDestroyMacroBlocks,);
- XW_RSYM(xW, handle, handle2, XvMCQueryAttributes,);
- XW_RSYM(xW, handle, handle2, XvMCSetAttribute,);
- XW_RSYM(xW, handle, handle2, XvMCGetAttribute,);
- xW.initialised = 1;
- XW_RSYM2(xW, handle, handle2, XvMCBeginSurface);
- XW_RSYM(xW, handle, handle2, XvMCLoadQMatrix,);
- XW_RSYM(xW, handle, handle2, XvMCPutSlice,);
- XW_RSYM(xW, handle, handle2, XvMCPutSlice2,);
- xW.vldextension = 1;
-}
-
-
-Bool XvMCQueryExtension (Display *display, int *eventBase, int *errBase)
-{
- if (!wrapperPreInit) preInitW( display );
- if (!xW.preInitialised) return 0;
- return (*xW.XvMCQueryExtension)(display, eventBase, errBase);
-}
-
-Status XvMCQueryVersion (Display *display, int *major_versionp,
- int *minor_versionp)
-{
- if (!wrapperPreInit) preInitW( display );
- if (!xW.preInitialised) return 0;
- return (*xW.XvMCQueryVersion)(display, major_versionp, minor_versionp);
-}
-
-
-XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num)
-{
- if (!wrapperInit) initW( dpy, port);
- if (!xW.initialised) return NULL;
- return (*xW.XvMCListSurfaceTypes)(dpy, port, num);
-}
-
-Status XvMCCreateContext (
- Display *display,
- XvPortID port,
- int surface_type_id,
- int width,
- int height,
- int flags,
- XvMCContext * context
- )
-{
- if (!wrapperInit) initW(display, port);
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCCreateContext)(display, port, surface_type_id,
- width, height, flags, context);
-}
-
-Status XvMCDestroyContext (Display *display, XvMCContext * context)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCDestroyContext)(display, context);
-}
-
-Status
-XvMCCreateSurface(
- Display *display,
- XvMCContext * context,
- XvMCSurface * surface
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCCreateSurface)(display, context, surface);
-}
-
-Status XvMCDestroySurface(Display *display, XvMCSurface *surface)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCDestroySurface)(display, surface);
-}
-
-
-XvImageFormatValues * XvMCListSubpictureTypes (
- Display * display,
- XvPortID port,
- int surface_type_id,
- int *count_return
- )
-{
- if (!xW.initialised) return NULL;
- return (*xW.XvMCListSubpictureTypes)(display, port, surface_type_id,
- count_return);
-}
-
-
-Status
-XvMCPutSurface(
- Display *display,
- XvMCSurface *surface,
- Drawable draw,
- short srcx,
- short srcy,
- unsigned short srcw,
- unsigned short srch,
- short destx,
- short desty,
- unsigned short destw,
- unsigned short desth,
- int flags
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCPutSurface)(display, surface, draw, srcx, srcy, srcw, srch,
- destx, desty, destw, desth, flags);
-}
-
-Status XvMCHideSurface(Display *display, XvMCSurface *surface)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCHideSurface)(display, surface);
-}
-
-
-Status
-XvMCCreateSubpicture (
- Display *display,
- XvMCContext *context,
- XvMCSubpicture *subpicture,
- unsigned short width,
- unsigned short height,
- int xvimage_id
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCCreateSubpicture)(display, context, subpicture, width, height,
- xvimage_id);
-}
-
-
-Status
-XvMCClearSubpicture (
- Display *display,
- XvMCSubpicture *subpicture,
- short x,
- short y,
- unsigned short width,
- unsigned short height,
- unsigned int color
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCClearSubpicture)(display, subpicture, x, y, width, height, color);
-}
-
-
-Status
-XvMCCompositeSubpicture (
- Display *display,
- XvMCSubpicture *subpicture,
- XvImage *image,
- short srcx,
- short srcy,
- unsigned short width,
- unsigned short height,
- short dstx,
- short dsty
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCCompositeSubpicture)(display, subpicture, image, srcx, srcy,
- width, height, dstx, dsty);
-}
-
-Status
-XvMCDestroySubpicture (Display *display, XvMCSubpicture *subpicture)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCDestroySubpicture)(display, subpicture);
-}
-
-Status
-XvMCSetSubpicturePalette (
- Display *display,
- XvMCSubpicture *subpicture,
- unsigned char *palette
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCSetSubpicturePalette)(display, subpicture, palette);
-}
-
-
-Status
-XvMCBlendSubpicture (
- Display *display,
- XvMCSurface *target_surface,
- XvMCSubpicture *subpicture,
- short subx,
- short suby,
- unsigned short subw,
- unsigned short subh,
- short surfx,
- short surfy,
- unsigned short surfw,
- unsigned short surfh
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCBlendSubpicture)(display, target_surface, subpicture,
- subx, suby, subw, subh, surfx, surfy,
- surfw, surfh);
-}
-
-Status
-XvMCBlendSubpicture2 (
- Display *display,
- XvMCSurface *source_surface,
- XvMCSurface *target_surface,
- XvMCSubpicture *subpicture,
- short subx,
- short suby,
- unsigned short subw,
- unsigned short subh,
- short surfx,
- short surfy,
- unsigned short surfw,
- unsigned short surfh
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCBlendSubpicture2)(display, source_surface, target_surface, subpicture,
- subx, suby, subw, subh, surfx, surfy, surfw, surfh);
-}
-
-
-Status XvMCSyncSurface (Display *display, XvMCSurface *surface)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCSyncSurface)(display, surface);
-}
-
-Status XvMCFlushSurface (Display *display, XvMCSurface *surface)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCFlushSurface)(display, surface);
-}
-
-Status XvMCGetSurfaceStatus (Display *display, XvMCSurface *surface, int *stat)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCGetSurfaceStatus)(display, surface, stat);
-}
-
-Status XvMCRenderSurface (
- Display *display,
- XvMCContext *context,
- unsigned int picture_structure,
- XvMCSurface *target_surface,
- XvMCSurface *past_surface,
- XvMCSurface *future_surface,
- unsigned int flags,
- unsigned int num_macroblocks,
- unsigned int first_macroblock,
- XvMCMacroBlockArray *macroblock_array,
- XvMCBlockArray *blocks
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCRenderSurface)(display, context, picture_structure, target_surface,
- past_surface, future_surface, flags, num_macroblocks,
- first_macroblock, macroblock_array, blocks);
-}
-
-Status XvMCSyncSubpicture (Display *display, XvMCSubpicture *subpicture)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCSyncSubpicture)(display, subpicture);
-}
-
-Status XvMCFlushSubpicture (Display *display, XvMCSubpicture *subpicture)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCFlushSubpicture)(display, subpicture);
-}
-Status
-XvMCGetSubpictureStatus (Display *display, XvMCSubpicture *subpic, int *stat)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCGetSubpictureStatus)(display, subpic, stat);
-}
-
-Status XvMCCreateBlocks (
- Display *display,
- XvMCContext *context,
- unsigned int num_blocks,
- XvMCBlockArray *block
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCCreateBlocks)(display, context, num_blocks, block);
-}
-
-
-Status XvMCDestroyBlocks (Display *display,XvMCBlockArray *block)
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCDestroyBlocks)(display, block);
-}
-
-Status XvMCCreateMacroBlocks (
- Display *display,
- XvMCContext *context,
- unsigned int num_blocks,
- XvMCMacroBlockArray *blocks
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCCreateMacroBlocks)(display, context, num_blocks, blocks);
-}
-
-
-Status XvMCDestroyMacroBlocks (
- Display *display,
- XvMCMacroBlockArray *block
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCDestroyMacroBlocks)(display, block);
-}
-
-
-XvAttribute *
-XvMCQueryAttributes (
- Display *display,
- XvMCContext *context,
- int *number
- )
-{
- if (!xW.initialised) return NULL;
- return (*xW.XvMCQueryAttributes)(display, context, number);
-}
-
-
-Status
-XvMCSetAttribute (
- Display *display,
- XvMCContext *context,
- Atom attribute,
- int value
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCSetAttribute)(display, context, attribute, value);
-}
-
-
-Status
-XvMCGetAttribute (
- Display *display,
- XvMCContext *context,
- Atom attribute,
- int *value
- )
-{
- if (!xW.initialised) return BadValue;
- return (*xW.XvMCGetAttribute)(display, context, attribute, value);
-}
-
-
-Status XvMCBeginSurface(Display *display,
- XvMCContext *context,
- XvMCSurface *target_surface,
- XvMCSurface *past_surface,
- XvMCSurface *future_surface,
- const XvMCMpegControl *control)
-{
- if (!xW.vldextension) return BadValue;
- return (*xW.XvMCBeginSurface)(display, context, target_surface, past_surface, future_surface,
- control);
-}
-
-Status XvMCLoadQMatrix(Display *display, XvMCContext *context,
- const XvMCQMatrix *qmx)
-{
- if (!xW.vldextension) return BadValue;
- return (*xW.XvMCLoadQMatrix)(display, context, qmx);
-}
-
-Status XvMCPutSlice(Display *display,XvMCContext *context,
- char *slice, int nBytes)
-{
- if (!xW.vldextension) return BadValue;
- return (*xW.XvMCPutSlice)(display, context, slice, nBytes);
-}
-
-Status XvMCPutSlice2(Display *display,XvMCContext *context,
- char *slice, int nBytes, int sliceCode)
-{
- if (!xW.vldextension) return BadValue;
- return (*xW.XvMCPutSlice2)(display, context, slice, nBytes, sliceCode);
-}