sync code with last improvements from OpenBSD
This commit is contained in:
commit
88965415ff
26235 changed files with 29195616 additions and 0 deletions
16
lib/libXvMC/src/Makefile.am
Normal file
16
lib/libXvMC/src/Makefile.am
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
||||
|
||||
if LINT
|
||||
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS)
|
||||
|
||||
lint:
|
||||
$(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_SOURCES) $(AM_CFLAGS) $(XVMC_LIBS)
|
||||
endif LINT
|
634
lib/libXvMC/src/Makefile.in
Normal file
634
lib/libXvMC/src/Makefile.in
Normal file
|
@ -0,0 +1,634 @@
|
|||
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
am__DEPENDENCIES_1 =
|
||||
libXvMC_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
am_libXvMC_la_OBJECTS = XvMC.lo
|
||||
libXvMC_la_OBJECTS = $(am_libXvMC_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libXvMC_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libXvMC_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libXvMC_la_SOURCES)
|
||||
DIST_SOURCES = $(libXvMC_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
|
||||
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
APP_MAN_DIR = @APP_MAN_DIR@
|
||||
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASE_CFLAGS = @BASE_CFLAGS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLOPEN_LIBS = @DLOPEN_LIBS@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_CMD = @INSTALL_CMD@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINT = @LINT@
|
||||
LINT_FLAGS = @LINT_FLAGS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
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@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRICT_CFLAGS = @STRICT_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XMALLOC_ZERO_CFLAGS = @XMALLOC_ZERO_CFLAGS@
|
||||
XORG_MAN_PAGE = @XORG_MAN_PAGE@
|
||||
XTMALLOC_ZERO_CFLAGS = @XTMALLOC_ZERO_CFLAGS@
|
||||
XVMC_CFLAGS = @XVMC_CFLAGS@
|
||||
XVMC_LIBS = @XVMC_LIBS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
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
|
||||
@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
|
||||
@LINT_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
libXvMC.la: $(libXvMC_la_OBJECTS) $(libXvMC_la_DEPENDENCIES) $(EXTRA_libXvMC_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libXvMC_la_LINK) -rpath $(libdir) $(libXvMC_la_OBJECTS) $(libXvMC_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XvMC.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-libLTLIBRARIES
|
||||
|
||||
|
||||
@LINT_TRUE@lint:
|
||||
@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:
|
616
lib/libXvMC/src/XvMC.c
Normal file
616
lib/libXvMC/src/XvMC.c
Normal file
|
@ -0,0 +1,616 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "XvMClibint.h"
|
||||
#ifdef HAVE_SHMAT
|
||||
#ifndef Lynx
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#else
|
||||
#include <ipc.h>
|
||||
#include <shm.h>
|
||||
#endif /* Lynx */
|
||||
#endif /* HAVE_SHMAT */
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <X11/extensions/Xext.h>
|
||||
#include <X11/extensions/extutil.h>
|
||||
#include <limits.h>
|
||||
|
||||
static XExtensionInfo _xvmc_info_data;
|
||||
static XExtensionInfo *xvmc_info = &_xvmc_info_data;
|
||||
static const char *xvmc_extension_name = XvMCName;
|
||||
|
||||
static const char *xvmc_error_list[] =
|
||||
{
|
||||
"BadContext",
|
||||
"BadSurface",
|
||||
"BadSubpicture"
|
||||
};
|
||||
|
||||
static XEXT_GENERATE_CLOSE_DISPLAY (xvmc_close_display, xvmc_info)
|
||||
|
||||
|
||||
static XEXT_GENERATE_ERROR_STRING (xvmc_error_string, xvmc_extension_name,
|
||||
XvMCNumErrors, xvmc_error_list)
|
||||
|
||||
|
||||
static XExtensionHooks xvmc_extension_hooks = {
|
||||
NULL, /* create_gc */
|
||||
NULL, /* copy_gc */
|
||||
NULL, /* flush_gc */
|
||||
NULL, /* free_gc */
|
||||
NULL, /* create_font */
|
||||
NULL, /* free_font */
|
||||
xvmc_close_display, /* close_display */
|
||||
NULL, /* wire_to_event */
|
||||
NULL, /* event_to_wire */
|
||||
NULL, /* error */
|
||||
xvmc_error_string /* error_string */
|
||||
};
|
||||
|
||||
static XEXT_GENERATE_FIND_DISPLAY (xvmc_find_display, xvmc_info,
|
||||
xvmc_extension_name,
|
||||
&xvmc_extension_hooks,
|
||||
XvMCNumEvents, NULL)
|
||||
|
||||
Bool XvMCQueryExtension (Display *dpy, int *event_basep, int *error_basep)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
|
||||
if (XextHasExtension(info)) {
|
||||
*event_basep = info->codes->first_event;
|
||||
*error_basep = info->codes->first_error;
|
||||
return True;
|
||||
} else {
|
||||
return False;
|
||||
}
|
||||
}
|
||||
|
||||
Status XvMCQueryVersion (Display *dpy, int *major, int *minor)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcQueryVersionReply rep;
|
||||
xvmcQueryVersionReq *req;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (QueryVersion, req);
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return BadImplementation;
|
||||
}
|
||||
*major = rep.major;
|
||||
*minor = rep.minor;
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcListSurfaceTypesReply rep;
|
||||
xvmcListSurfaceTypesReq *req;
|
||||
XvMCSurfaceInfo *surface_info = NULL;
|
||||
|
||||
*num = 0;
|
||||
|
||||
XvMCCheckExtension (dpy, info, NULL);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (ListSurfaceTypes, req);
|
||||
req->port = port;
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(rep.num > 0) {
|
||||
if (rep.num < (INT_MAX / sizeof(XvMCSurfaceInfo)))
|
||||
surface_info = Xmalloc(rep.num * sizeof(XvMCSurfaceInfo));
|
||||
|
||||
if(surface_info) {
|
||||
xvmcSurfaceInfo sinfo;
|
||||
CARD32 i;
|
||||
|
||||
*num = rep.num;
|
||||
|
||||
for(i = 0; i < rep.num; i++) {
|
||||
_XRead(dpy, (char*)&sinfo, sizeof(xvmcSurfaceInfo));
|
||||
surface_info[i].surface_type_id = sinfo.surface_type_id;
|
||||
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 =
|
||||
sinfo.subpicture_max_width;
|
||||
surface_info[i].subpicture_max_height =
|
||||
sinfo.subpicture_max_height;
|
||||
surface_info[i].mc_type = sinfo.mc_type;
|
||||
surface_info[i].flags = sinfo.flags;
|
||||
}
|
||||
} else
|
||||
_XEatDataWords(dpy, rep.length);
|
||||
}
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return surface_info;
|
||||
}
|
||||
|
||||
|
||||
XvImageFormatValues * XvMCListSubpictureTypes (
|
||||
Display * dpy,
|
||||
XvPortID port,
|
||||
int surface_type_id,
|
||||
int *count_return
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcListSubpictureTypesReply rep;
|
||||
xvmcListSubpictureTypesReq *req;
|
||||
XvImageFormatValues *ret = NULL;
|
||||
|
||||
|
||||
*count_return = 0;
|
||||
|
||||
XvMCCheckExtension (dpy, info, NULL);
|
||||
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (ListSubpictureTypes, req);
|
||||
req->port = port;
|
||||
req->surface_type_id = surface_type_id;
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(rep.num > 0) {
|
||||
if (rep.num < (INT_MAX / sizeof(XvImageFormatValues)))
|
||||
ret = Xmalloc(rep.num * sizeof(XvImageFormatValues));
|
||||
|
||||
if(ret) {
|
||||
xvImageFormatInfo Info;
|
||||
CARD32 i;
|
||||
|
||||
*count_return = rep.num;
|
||||
|
||||
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;
|
||||
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].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;
|
||||
ret[i].horz_v_period = Info.horz_v_period;
|
||||
ret[i].vert_y_period = Info.vert_y_period;
|
||||
ret[i].vert_u_period = Info.vert_u_period;
|
||||
ret[i].vert_v_period = Info.vert_v_period;
|
||||
memcpy(&(ret[i].component_order[0]), &(Info.comp_order[0]), 32);
|
||||
ret[i].scanline_order = Info.scanline_order;
|
||||
}
|
||||
} else
|
||||
_XEatDataWords(dpy, rep.length);
|
||||
}
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
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,
|
||||
port and flags filled out. This function will fill out the
|
||||
context_id and update the width, height and flags field.
|
||||
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 only returned if
|
||||
an XVMC_DIRECT context was specified.
|
||||
*/
|
||||
|
||||
|
||||
Status _xvmc_create_context (
|
||||
Display *dpy,
|
||||
XvMCContext *context,
|
||||
int *priv_count,
|
||||
CARD32 **priv_data
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcCreateContextReply rep;
|
||||
xvmcCreateContextReq *req;
|
||||
|
||||
*priv_count = 0;
|
||||
*priv_data = NULL;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (CreateContext, req);
|
||||
context->context_id = XAllocID(dpy);
|
||||
req->context_id = context->context_id;
|
||||
req->port = context->port;
|
||||
req->surface_type_id = context->surface_type_id;
|
||||
req->width = context->width;
|
||||
req->height = context->height;
|
||||
req->flags = context->flags;
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return BadImplementation;
|
||||
}
|
||||
context->width = rep.width_actual;
|
||||
context->height = rep.height_actual;
|
||||
context->flags = rep.flags_return;
|
||||
|
||||
if(rep.length) {
|
||||
if (rep.length < (INT_MAX >> 2))
|
||||
*priv_data = Xmalloc(rep.length << 2);
|
||||
if(*priv_data) {
|
||||
_XRead(dpy, (char*)(*priv_data), rep.length << 2);
|
||||
*priv_count = rep.length;
|
||||
} else
|
||||
_XEatDataWords(dpy, rep.length);
|
||||
}
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return Success;
|
||||
}
|
||||
|
||||
Status _xvmc_destroy_context (
|
||||
Display *dpy,
|
||||
XvMCContext *context
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcDestroyContextReq *req;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (DestroyContext, req);
|
||||
req->context_id = context->context_id;
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
_xvmc_create_surface -
|
||||
|
||||
Pass the context and this function will fill out all the
|
||||
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 (
|
||||
Display *dpy,
|
||||
XvMCContext *context,
|
||||
XvMCSurface *surface,
|
||||
int *priv_count,
|
||||
CARD32 **priv_data
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcCreateSurfaceReply rep;
|
||||
xvmcCreateSurfaceReq *req;
|
||||
|
||||
*priv_count = 0;
|
||||
*priv_data = NULL;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (CreateSurface, req);
|
||||
|
||||
surface->surface_id = XAllocID(dpy);
|
||||
surface->context_id = context->context_id;
|
||||
surface->surface_type_id = context->surface_type_id;
|
||||
surface->width = context->width;
|
||||
surface->height = context->height;
|
||||
|
||||
req->surface_id = surface->surface_id;
|
||||
req->context_id = surface->context_id;
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return BadImplementation;
|
||||
}
|
||||
|
||||
if(rep.length) {
|
||||
if (rep.length < (INT_MAX >> 2))
|
||||
*priv_data = Xmalloc(rep.length << 2);
|
||||
if(*priv_data) {
|
||||
_XRead(dpy, (char*)(*priv_data), rep.length << 2);
|
||||
*priv_count = rep.length;
|
||||
} else
|
||||
_XEatDataWords(dpy, rep.length);
|
||||
}
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return Success;
|
||||
}
|
||||
|
||||
Status _xvmc_destroy_surface (
|
||||
Display *dpy,
|
||||
XvMCSurface *surface
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcDestroySurfaceReq *req;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (DestroySurface, req);
|
||||
req->surface_id = surface->surface_id;
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
_xvmc_create_subpicture -
|
||||
|
||||
Pass the subpicture with the width, height and xvimage_id filled
|
||||
out and this function will fill out everything else in the
|
||||
subpicture as well as adjust the width and height if needed.
|
||||
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_subpicture (
|
||||
Display *dpy,
|
||||
XvMCContext *context,
|
||||
XvMCSubpicture *subpicture,
|
||||
int *priv_count,
|
||||
CARD32 **priv_data
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcCreateSubpictureReply rep;
|
||||
xvmcCreateSubpictureReq *req;
|
||||
|
||||
*priv_count = 0;
|
||||
*priv_data = NULL;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (CreateSubpicture, req);
|
||||
|
||||
subpicture->subpicture_id = XAllocID(dpy);
|
||||
subpicture->context_id = context->context_id;
|
||||
|
||||
req->subpicture_id = subpicture->subpicture_id;
|
||||
req->context_id = subpicture->context_id;
|
||||
req->xvimage_id = subpicture->xvimage_id;
|
||||
req->width = subpicture->width;
|
||||
req->height = subpicture->height;
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return BadImplementation;
|
||||
}
|
||||
|
||||
subpicture->width = rep.width_actual;
|
||||
subpicture->height = rep.height_actual;
|
||||
subpicture->num_palette_entries = rep.num_palette_entries;
|
||||
subpicture->entry_bytes = rep.entry_bytes;
|
||||
subpicture->component_order[0] = rep.component_order[0];
|
||||
subpicture->component_order[1] = rep.component_order[1];
|
||||
subpicture->component_order[2] = rep.component_order[2];
|
||||
subpicture->component_order[3] = rep.component_order[3];
|
||||
|
||||
if(rep.length) {
|
||||
if (rep.length < (INT_MAX >> 2))
|
||||
*priv_data = Xmalloc(rep.length << 2);
|
||||
if(*priv_data) {
|
||||
_XRead(dpy, (char*)(*priv_data), rep.length << 2);
|
||||
*priv_count = rep.length;
|
||||
} else
|
||||
_XEatDataWords(dpy, rep.length);
|
||||
}
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return Success;
|
||||
}
|
||||
|
||||
Status _xvmc_destroy_subpicture(
|
||||
Display *dpy,
|
||||
XvMCSubpicture *subpicture
|
||||
)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcDestroySubpictureReq *req;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (DestroySubpicture, req);
|
||||
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,
|
||||
int *patchLevel,
|
||||
int *isLocal)
|
||||
{
|
||||
XExtDisplayInfo *info = xvmc_find_display(dpy);
|
||||
xvmcGetDRInfoReply rep;
|
||||
xvmcGetDRInfoReq *req;
|
||||
CARD32 magic;
|
||||
|
||||
#ifdef HAVE_SHMAT
|
||||
int shmKey;
|
||||
volatile CARD32 *shMem;
|
||||
struct timezone here;
|
||||
struct timeval now;
|
||||
here.tz_minuteswest = 0;
|
||||
here.tz_dsttime = 0;
|
||||
#endif
|
||||
|
||||
*name = NULL;
|
||||
*busID = NULL;
|
||||
|
||||
XvMCCheckExtension (dpy, info, BadImplementation);
|
||||
|
||||
LockDisplay (dpy);
|
||||
XvMCGetReq (GetDRInfo, req);
|
||||
|
||||
req->port = port;
|
||||
magic = 0;
|
||||
req->magic = 0;
|
||||
#ifdef HAVE_SHMAT
|
||||
shmKey = shmget(IPC_PRIVATE, 1024, IPC_CREAT | 0600);
|
||||
req->shmKey = (CARD32) shmKey;
|
||||
|
||||
/*
|
||||
* We fill a shared memory page with a repetitive pattern. If the
|
||||
* X server can read this pattern, we probably have a local connection.
|
||||
* Note that we can trigger the remote X server to read any shared
|
||||
* page on the remote machine, so we shouldn't be able to guess and verify
|
||||
* any complicated data on those pages. That's the explanation of this
|
||||
* otherwise stupid-looking pattern algorithm.
|
||||
*/
|
||||
|
||||
if (shmKey >= 0) {
|
||||
shMem = (CARD32 *) shmat(shmKey, NULL, 0);
|
||||
shmctl(shmKey, IPC_RMID, NULL);
|
||||
if (shMem != (void *) -1) {
|
||||
|
||||
register volatile CARD32 *shMemC = shMem;
|
||||
register int i;
|
||||
|
||||
gettimeofday( &now, &here);
|
||||
magic = now.tv_usec & 0x000FFFFF;
|
||||
req->magic = magic;
|
||||
i = 1024 / sizeof(CARD32);
|
||||
while(i--) {
|
||||
*shMemC++ = magic;
|
||||
magic = ~magic;
|
||||
}
|
||||
} else {
|
||||
req->shmKey = -1;
|
||||
shmKey = -1;
|
||||
}
|
||||
}
|
||||
#else
|
||||
req->shmKey = 0;
|
||||
#endif
|
||||
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
#ifdef HAVE_SHMAT
|
||||
if (shmKey >= 0) {
|
||||
shmdt( (const void *) shMem );
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
#ifdef HAVE_SHMAT
|
||||
if (shmKey >= 0) {
|
||||
shmdt( (const void *) shMem );
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rep.length > 0) {
|
||||
unsigned long realSize = 0;
|
||||
char *tmpBuf = NULL;
|
||||
|
||||
if ((rep.length < (INT_MAX >> 2)) &&
|
||||
/* protect against overflow in strncpy below */
|
||||
(rep.nameLen + rep.busIDLen > rep.nameLen)) {
|
||||
realSize = rep.length << 2;
|
||||
if (realSize >= (rep.nameLen + rep.busIDLen)) {
|
||||
tmpBuf = Xmalloc(realSize);
|
||||
*name = Xmalloc(rep.nameLen);
|
||||
*busID = Xmalloc(rep.busIDLen);
|
||||
}
|
||||
}
|
||||
|
||||
if (*name && *busID && tmpBuf) {
|
||||
_XRead(dpy, tmpBuf, realSize);
|
||||
strncpy(*name,tmpBuf,rep.nameLen);
|
||||
(*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0';
|
||||
strncpy(*busID,tmpBuf+rep.nameLen,rep.busIDLen);
|
||||
(*busID)[rep.busIDLen == 0 ? 0 : rep.busIDLen - 1] = '\0';
|
||||
XFree(tmpBuf);
|
||||
} else {
|
||||
XFree(*name);
|
||||
*name = NULL;
|
||||
XFree(*busID);
|
||||
*busID = NULL;
|
||||
XFree(tmpBuf);
|
||||
|
||||
_XEatDataWords(dpy, rep.length);
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
return -1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
SyncHandle ();
|
||||
*major = rep.major;
|
||||
*minor = rep.minor;
|
||||
*patchLevel = rep.patchLevel;
|
||||
#ifdef HAVE_SHMAT
|
||||
if (shmKey >= 0)
|
||||
*isLocal = rep.isLocal;
|
||||
else
|
||||
#endif
|
||||
*isLocal = 1;
|
||||
return (rep.length > 0) ? Success : BadImplementation;
|
||||
}
|
||||
|
66
lib/libXvMC/src/XvMClibint.h
Normal file
66
lib/libXvMC/src/XvMClibint.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
#ifndef _XVMCLIBINT_H
|
||||
#define _XVMCLIBINT_H
|
||||
|
||||
#include <X11/Xlibint.h>
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
#include <X11/extensions/XvMCproto.h>
|
||||
#include <X11/extensions/XvMClib.h>
|
||||
|
||||
#define XvMCCheckExtension(dpy, i, val) \
|
||||
XextCheckExtension(dpy, i, xvmc_extension_name, val)
|
||||
|
||||
|
||||
#define XvMCGetReq(name, req) \
|
||||
WORD64ALIGN\
|
||||
if ((dpy->bufptr + sizeof(xvmc##name##Req)) > dpy->bufmax)\
|
||||
_XFlush(dpy);\
|
||||
req = (xvmc##name##Req *)(dpy->last_req = dpy->bufptr);\
|
||||
req->reqType = info->codes->major_opcode;\
|
||||
req->xvmcReqType = xvmc_##name; \
|
||||
req->length = sizeof(xvmc##name##Req)>>2;\
|
||||
dpy->bufptr += sizeof(xvmc##name##Req);\
|
||||
dpy->request++
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
Status _xvmc_create_context(
|
||||
Display * /* dpy */,
|
||||
XvMCContext * /* context */,
|
||||
int * /* priv_count */,
|
||||
CARD32 ** /* priv_data */
|
||||
);
|
||||
|
||||
Status _xvmc_destroy_context(
|
||||
Display * /* dpy */,
|
||||
XvMCContext * /* context */
|
||||
);
|
||||
|
||||
Status _xvmc_create_surface (
|
||||
Display * /* dpy */,
|
||||
XvMCContext * /* context */,
|
||||
XvMCSurface * /* surface */,
|
||||
int * /* priv_count */,
|
||||
CARD32 ** /* priv_data */
|
||||
);
|
||||
|
||||
Status _xvmc_destroy_surface (
|
||||
Display * /* dpy */,
|
||||
XvMCSurface * /* surface */
|
||||
);
|
||||
|
||||
Status _xvmc_create_subpicture (
|
||||
Display * /* dpy */,
|
||||
XvMCContext * /* context */,
|
||||
XvMCSubpicture * /* subpicture */,
|
||||
int * /* priv_count */,
|
||||
CARD32 ** /* priv_data */
|
||||
);
|
||||
|
||||
Status _xvmc_destroy_subpicture(
|
||||
Display * /* dpy */,
|
||||
XvMCSubpicture * /* subpicture */
|
||||
);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* XVMCLIBINT_H */
|
Loading…
Add table
Add a link
Reference in a new issue