Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5361 → Rev 5362

/contrib/sdk/sources/vaapi/libva-1.4.1/dummy_drv_video/Makefile.am
0,0 → 1,33
# Copyright (c) 2007 Intel Corporation. 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, sub license, 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 (including the
# next paragraph) 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 NON-INFRINGEMENT.
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
 
AM_CPPFLAGS = -I$(top_srcdir)
 
if BUILD_DUMMY_DRIVER
dummy_drv_video_la_LTLIBRARIES = dummy_drv_video.la
dummy_drv_video_ladir = $(LIBVA_DRIVERS_PATH)
dummy_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined
dummy_drv_video_la_LIBADD =
dummy_drv_video_la_DEPENDENCIES =
dummy_drv_video_la_SOURCES = dummy_drv_video.c object_heap.c
noinst_HEADERS = dummy_drv_video.h object_heap.h
endif
/contrib/sdk/sources/vaapi/libva-1.4.1/dummy_drv_video/Makefile.in
0,0 → 1,706
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
 
# Copyright (C) 1994-2013 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@
 
# Copyright (c) 2007 Intel Corporation. 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, sub license, 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 (including the
# next paragraph) 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 NON-INFRINGEMENT.
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
 
 
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
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@
@BUILD_DUMMY_DRIVER_FALSE@dummy_drv_video_la_DEPENDENCIES =
subdir = dummy_drv_video
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(am__noinst_HEADERS_DIST)
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)$(dummy_drv_video_ladir)"
LTLIBRARIES = $(dummy_drv_video_la_LTLIBRARIES)
am__dummy_drv_video_la_SOURCES_DIST = dummy_drv_video.c object_heap.c
@BUILD_DUMMY_DRIVER_TRUE@am_dummy_drv_video_la_OBJECTS = \
@BUILD_DUMMY_DRIVER_TRUE@ dummy_drv_video.lo object_heap.lo
dummy_drv_video_la_OBJECTS = $(am_dummy_drv_video_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 =
dummy_drv_video_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(dummy_drv_video_la_LDFLAGS) \
$(LDFLAGS) -o $@
@BUILD_DUMMY_DRIVER_TRUE@am_dummy_drv_video_la_rpath = -rpath \
@BUILD_DUMMY_DRIVER_TRUE@ $(dummy_drv_video_ladir)
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 = $(dummy_drv_video_la_SOURCES)
DIST_SOURCES = $(am__dummy_drv_video_la_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__noinst_HEADERS_DIST = dummy_drv_video.h object_heap.h
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DRM_CFLAGS = @DRM_CFLAGS@
DRM_LIBS = @DRM_LIBS@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGL_CFLAGS = @EGL_CFLAGS@
EGL_LIBS = @EGL_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GLX_CFLAGS = @GLX_CFLAGS@
GLX_LIBS = @GLX_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBDRM_VERSION = @LIBDRM_VERSION@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVA_DRIVERS_PATH = @LIBVA_DRIVERS_PATH@
LIBVA_LT_LDFLAGS = @LIBVA_LT_LDFLAGS@
LIBVA_LT_VERSION = @LIBVA_LT_VERSION@
LIBVA_MAJOR_VERSION = @LIBVA_MAJOR_VERSION@
LIBVA_MICRO_VERSION = @LIBVA_MICRO_VERSION@
LIBVA_MINOR_VERSION = @LIBVA_MINOR_VERSION@
LIBVA_VERSION = @LIBVA_VERSION@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
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@
STRIP = @STRIP@
TODAY = @TODAY@
VA_API_MAJOR_VERSION = @VA_API_MAJOR_VERSION@
VA_API_MICRO_VERSION = @VA_API_MICRO_VERSION@
VA_API_MINOR_VERSION = @VA_API_MINOR_VERSION@
VA_API_VERSION = @VA_API_VERSION@
VERSION = @VERSION@
WAYLAND_API_VERSION = @WAYLAND_API_VERSION@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@
WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XFIXES_CFLAGS = @XFIXES_CFLAGS@
XFIXES_LIBS = @XFIXES_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_CXX = @ac_ct_CXX@
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@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
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@
wayland_protocoldir = @wayland_protocoldir@
wayland_scanner = @wayland_scanner@
AM_CPPFLAGS = -I$(top_srcdir)
@BUILD_DUMMY_DRIVER_TRUE@dummy_drv_video_la_LTLIBRARIES = dummy_drv_video.la
@BUILD_DUMMY_DRIVER_TRUE@dummy_drv_video_ladir = $(LIBVA_DRIVERS_PATH)
@BUILD_DUMMY_DRIVER_TRUE@dummy_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,--no-undefined
@BUILD_DUMMY_DRIVER_TRUE@dummy_drv_video_la_LIBADD =
@BUILD_DUMMY_DRIVER_TRUE@dummy_drv_video_la_DEPENDENCIES =
@BUILD_DUMMY_DRIVER_TRUE@dummy_drv_video_la_SOURCES = dummy_drv_video.c object_heap.c
@BUILD_DUMMY_DRIVER_TRUE@noinst_HEADERS = dummy_drv_video.h object_heap.h
all: all-am
 
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(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) --gnu dummy_drv_video/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu dummy_drv_video/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: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
 
install-dummy_drv_video_laLTLIBRARIES: $(dummy_drv_video_la_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(dummy_drv_video_la_LTLIBRARIES)'; test -n "$(dummy_drv_video_ladir)" || 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)$(dummy_drv_video_ladir)'"; \
$(MKDIR_P) "$(DESTDIR)$(dummy_drv_video_ladir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(dummy_drv_video_ladir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(dummy_drv_video_ladir)"; \
}
 
uninstall-dummy_drv_video_laLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(dummy_drv_video_la_LTLIBRARIES)'; test -n "$(dummy_drv_video_ladir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(dummy_drv_video_ladir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(dummy_drv_video_ladir)/$$f"; \
done
 
clean-dummy_drv_video_laLTLIBRARIES:
-test -z "$(dummy_drv_video_la_LTLIBRARIES)" || rm -f $(dummy_drv_video_la_LTLIBRARIES)
@list='$(dummy_drv_video_la_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}; \
}
 
dummy_drv_video.la: $(dummy_drv_video_la_OBJECTS) $(dummy_drv_video_la_DEPENDENCIES) $(EXTRA_dummy_drv_video_la_DEPENDENCIES)
$(AM_V_CCLD)$(dummy_drv_video_la_LINK) $(am_dummy_drv_video_la_rpath) $(dummy_drv_video_la_OBJECTS) $(dummy_drv_video_la_LIBADD) $(LIBS)
 
mostlyclean-compile:
-rm -f *.$(OBJEXT)
 
distclean-compile:
-rm -f *.tab.c
 
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_drv_video.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object_heap.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 -o $@ $<
 
.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 -o $@ `$(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: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
 
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
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-am
 
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
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: cscopelist-am
 
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
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) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(dummy_drv_video_ladir)"; 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-dummy_drv_video_laLTLIBRARIES clean-generic \
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-dummy_drv_video_laLTLIBRARIES
 
install-dvi: install-dvi-am
 
install-dvi-am:
 
install-exec-am:
 
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-dummy_drv_video_laLTLIBRARIES
 
.MAKE: install-am install-strip
 
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-dummy_drv_video_laLTLIBRARIES clean-generic \
clean-libtool cscopelist-am ctags ctags-am 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-dummy_drv_video_laLTLIBRARIES install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am 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 tags-am uninstall uninstall-am \
uninstall-dummy_drv_video_laLTLIBRARIES
 
 
# 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:
/contrib/sdk/sources/vaapi/libva-1.4.1/dummy_drv_video/dummy_drv_video.c
0,0 → 1,1232
/*
* Copyright (c) 2007 Intel Corporation. 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, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
*/
 
#include "config.h"
#include <va/va_backend.h>
 
#include "dummy_drv_video.h"
 
#include "assert.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
 
#define ASSERT assert
 
#define INIT_DRIVER_DATA struct dummy_driver_data * const driver_data = (struct dummy_driver_data *) ctx->pDriverData;
 
#define CONFIG(id) ((object_config_p) object_heap_lookup( &driver_data->config_heap, id ))
#define CONTEXT(id) ((object_context_p) object_heap_lookup( &driver_data->context_heap, id ))
#define SURFACE(id) ((object_surface_p) object_heap_lookup( &driver_data->surface_heap, id ))
#define BUFFER(id) ((object_buffer_p) object_heap_lookup( &driver_data->buffer_heap, id ))
 
#define CONFIG_ID_OFFSET 0x01000000
#define CONTEXT_ID_OFFSET 0x02000000
#define SURFACE_ID_OFFSET 0x04000000
#define BUFFER_ID_OFFSET 0x08000000
 
static void dummy__error_message(const char *msg, ...)
{
va_list args;
 
fprintf(stderr, "dummy_drv_video error: ");
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
}
 
static void dummy__information_message(const char *msg, ...)
{
va_list args;
 
fprintf(stderr, "dummy_drv_video: ");
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
}
 
VAStatus dummy_QueryConfigProfiles(
VADriverContextP ctx,
VAProfile *profile_list, /* out */
int *num_profiles /* out */
)
{
int i = 0;
 
profile_list[i++] = VAProfileMPEG2Simple;
profile_list[i++] = VAProfileMPEG2Main;
profile_list[i++] = VAProfileMPEG4Simple;
profile_list[i++] = VAProfileMPEG4AdvancedSimple;
profile_list[i++] = VAProfileMPEG4Main;
profile_list[i++] = VAProfileH264Baseline;
profile_list[i++] = VAProfileH264Main;
profile_list[i++] = VAProfileH264High;
profile_list[i++] = VAProfileVC1Simple;
profile_list[i++] = VAProfileVC1Main;
profile_list[i++] = VAProfileVC1Advanced;
 
/* If the assert fails then DUMMY_MAX_PROFILES needs to be bigger */
ASSERT(i <= DUMMY_MAX_PROFILES);
*num_profiles = i;
 
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_QueryConfigEntrypoints(
VADriverContextP ctx,
VAProfile profile,
VAEntrypoint *entrypoint_list, /* out */
int *num_entrypoints /* out */
)
{
switch (profile) {
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
*num_entrypoints = 2;
entrypoint_list[0] = VAEntrypointVLD;
entrypoint_list[1] = VAEntrypointMoComp;
break;
 
case VAProfileMPEG4Simple:
case VAProfileMPEG4AdvancedSimple:
case VAProfileMPEG4Main:
*num_entrypoints = 1;
entrypoint_list[0] = VAEntrypointVLD;
break;
 
case VAProfileH264Baseline:
case VAProfileH264Main:
case VAProfileH264High:
*num_entrypoints = 1;
entrypoint_list[0] = VAEntrypointVLD;
break;
 
case VAProfileVC1Simple:
case VAProfileVC1Main:
case VAProfileVC1Advanced:
*num_entrypoints = 1;
entrypoint_list[0] = VAEntrypointVLD;
break;
 
default:
*num_entrypoints = 0;
break;
}
 
/* If the assert fails then DUMMY_MAX_ENTRYPOINTS needs to be bigger */
ASSERT(*num_entrypoints <= DUMMY_MAX_ENTRYPOINTS);
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_GetConfigAttributes(
VADriverContextP ctx,
VAProfile profile,
VAEntrypoint entrypoint,
VAConfigAttrib *attrib_list, /* in/out */
int num_attribs
)
{
int i;
 
/* Other attributes don't seem to be defined */
/* What to do if we don't know the attribute? */
for (i = 0; i < num_attribs; i++)
{
switch (attrib_list[i].type)
{
case VAConfigAttribRTFormat:
attrib_list[i].value = VA_RT_FORMAT_YUV420;
break;
 
default:
/* Do nothing */
attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
break;
}
}
 
return VA_STATUS_SUCCESS;
}
 
static VAStatus dummy__update_attribute(object_config_p obj_config, VAConfigAttrib *attrib)
{
int i;
/* Check existing attrbiutes */
for(i = 0; obj_config->attrib_count < i; i++)
{
if (obj_config->attrib_list[i].type == attrib->type)
{
/* Update existing attribute */
obj_config->attrib_list[i].value = attrib->value;
return VA_STATUS_SUCCESS;
}
}
if (obj_config->attrib_count < DUMMY_MAX_CONFIG_ATTRIBUTES)
{
i = obj_config->attrib_count;
obj_config->attrib_list[i].type = attrib->type;
obj_config->attrib_list[i].value = attrib->value;
obj_config->attrib_count++;
return VA_STATUS_SUCCESS;
}
return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
}
 
VAStatus dummy_CreateConfig(
VADriverContextP ctx,
VAProfile profile,
VAEntrypoint entrypoint,
VAConfigAttrib *attrib_list,
int num_attribs,
VAConfigID *config_id /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus;
int configID;
object_config_p obj_config;
int i;
 
/* Validate profile & entrypoint */
switch (profile) {
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
if ((VAEntrypointVLD == entrypoint) ||
(VAEntrypointMoComp == entrypoint))
{
vaStatus = VA_STATUS_SUCCESS;
}
else
{
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
break;
 
case VAProfileMPEG4Simple:
case VAProfileMPEG4AdvancedSimple:
case VAProfileMPEG4Main:
if (VAEntrypointVLD == entrypoint)
{
vaStatus = VA_STATUS_SUCCESS;
}
else
{
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
break;
 
case VAProfileH264Baseline:
case VAProfileH264Main:
case VAProfileH264High:
if (VAEntrypointVLD == entrypoint)
{
vaStatus = VA_STATUS_SUCCESS;
}
else
{
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
break;
 
case VAProfileVC1Simple:
case VAProfileVC1Main:
case VAProfileVC1Advanced:
if (VAEntrypointVLD == entrypoint)
{
vaStatus = VA_STATUS_SUCCESS;
}
else
{
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
break;
 
default:
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
break;
}
 
if (VA_STATUS_SUCCESS != vaStatus)
{
return vaStatus;
}
 
configID = object_heap_allocate( &driver_data->config_heap );
obj_config = CONFIG(configID);
if (NULL == obj_config)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
return vaStatus;
}
 
obj_config->profile = profile;
obj_config->entrypoint = entrypoint;
obj_config->attrib_list[0].type = VAConfigAttribRTFormat;
obj_config->attrib_list[0].value = VA_RT_FORMAT_YUV420;
obj_config->attrib_count = 1;
 
for(i = 0; i < num_attribs; i++)
{
vaStatus = dummy__update_attribute(obj_config, &(attrib_list[i]));
if (VA_STATUS_SUCCESS != vaStatus)
{
break;
}
}
 
/* Error recovery */
if (VA_STATUS_SUCCESS != vaStatus)
{
object_heap_free( &driver_data->config_heap, (object_base_p) obj_config);
}
else
{
*config_id = configID;
}
 
return vaStatus;
}
 
VAStatus dummy_DestroyConfig(
VADriverContextP ctx,
VAConfigID config_id
)
{
INIT_DRIVER_DATA
VAStatus vaStatus;
object_config_p obj_config;
 
obj_config = CONFIG(config_id);
if (NULL == obj_config)
{
vaStatus = VA_STATUS_ERROR_INVALID_CONFIG;
return vaStatus;
}
 
object_heap_free( &driver_data->config_heap, (object_base_p) obj_config);
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_QueryConfigAttributes(
VADriverContextP ctx,
VAConfigID config_id,
VAProfile *profile, /* out */
VAEntrypoint *entrypoint, /* out */
VAConfigAttrib *attrib_list, /* out */
int *num_attribs /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_config_p obj_config;
int i;
 
obj_config = CONFIG(config_id);
ASSERT(obj_config);
 
*profile = obj_config->profile;
*entrypoint = obj_config->entrypoint;
*num_attribs = obj_config->attrib_count;
for(i = 0; i < obj_config->attrib_count; i++)
{
attrib_list[i] = obj_config->attrib_list[i];
}
 
return vaStatus;
}
 
VAStatus dummy_CreateSurfaces(
VADriverContextP ctx,
int width,
int height,
int format,
int num_surfaces,
VASurfaceID *surfaces /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
int i;
 
/* We only support one format */
if (VA_RT_FORMAT_YUV420 != format)
{
return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
}
 
for (i = 0; i < num_surfaces; i++)
{
int surfaceID = object_heap_allocate( &driver_data->surface_heap );
object_surface_p obj_surface = SURFACE(surfaceID);
if (NULL == obj_surface)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
break;
}
obj_surface->surface_id = surfaceID;
surfaces[i] = surfaceID;
}
 
/* Error recovery */
if (VA_STATUS_SUCCESS != vaStatus)
{
/* surfaces[i-1] was the last successful allocation */
for(; i--; )
{
object_surface_p obj_surface = SURFACE(surfaces[i]);
surfaces[i] = VA_INVALID_SURFACE;
ASSERT(obj_surface);
object_heap_free( &driver_data->surface_heap, (object_base_p) obj_surface);
}
}
 
return vaStatus;
}
 
VAStatus dummy_DestroySurfaces(
VADriverContextP ctx,
VASurfaceID *surface_list,
int num_surfaces
)
{
INIT_DRIVER_DATA
int i;
for(i = num_surfaces; i--; )
{
object_surface_p obj_surface = SURFACE(surface_list[i]);
ASSERT(obj_surface);
object_heap_free( &driver_data->surface_heap, (object_base_p) obj_surface);
}
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_QueryImageFormats(
VADriverContextP ctx,
VAImageFormat *format_list, /* out */
int *num_formats /* out */
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_CreateImage(
VADriverContextP ctx,
VAImageFormat *format,
int width,
int height,
VAImage *image /* out */
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_DeriveImage(
VADriverContextP ctx,
VASurfaceID surface,
VAImage *image /* out */
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_DestroyImage(
VADriverContextP ctx,
VAImageID image
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_SetImagePalette(
VADriverContextP ctx,
VAImageID image,
unsigned char *palette
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_GetImage(
VADriverContextP ctx,
VASurfaceID surface,
int x, /* coordinates of the upper left source pixel */
int y,
unsigned int width, /* width and height of the region */
unsigned int height,
VAImageID image
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
 
VAStatus dummy_PutImage(
VADriverContextP ctx,
VASurfaceID surface,
VAImageID image,
int src_x,
int src_y,
unsigned int src_width,
unsigned int src_height,
int dest_x,
int dest_y,
unsigned int dest_width,
unsigned int dest_height
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_QuerySubpictureFormats(
VADriverContextP ctx,
VAImageFormat *format_list, /* out */
unsigned int *flags, /* out */
unsigned int *num_formats /* out */
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_CreateSubpicture(
VADriverContextP ctx,
VAImageID image,
VASubpictureID *subpicture /* out */
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_DestroySubpicture(
VADriverContextP ctx,
VASubpictureID subpicture
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_SetSubpictureImage(
VADriverContextP ctx,
VASubpictureID subpicture,
VAImageID image
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_SetSubpicturePalette(
VADriverContextP ctx,
VASubpictureID subpicture,
/*
* pointer to an array holding the palette data. The size of the array is
* num_palette_entries * entry_bytes in size. The order of the components
* in the palette is described by the component_order in VASubpicture struct
*/
unsigned char *palette
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_SetSubpictureChromakey(
VADriverContextP ctx,
VASubpictureID subpicture,
unsigned int chromakey_min,
unsigned int chromakey_max,
unsigned int chromakey_mask
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_SetSubpictureGlobalAlpha(
VADriverContextP ctx,
VASubpictureID subpicture,
float global_alpha
)
{
/* TODO */
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,
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
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_DeassociateSubpicture(
VADriverContextP ctx,
VASubpictureID subpicture,
VASurfaceID *target_surfaces,
int num_surfaces
)
{
/* TODO */
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_CreateContext(
VADriverContextP ctx,
VAConfigID config_id,
int picture_width,
int picture_height,
int flag,
VASurfaceID *render_targets,
int num_render_targets,
VAContextID *context /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_config_p obj_config;
int i;
 
obj_config = CONFIG(config_id);
if (NULL == obj_config)
{
vaStatus = VA_STATUS_ERROR_INVALID_CONFIG;
return vaStatus;
}
 
/* Validate flag */
/* Validate picture dimensions */
 
int contextID = object_heap_allocate( &driver_data->context_heap );
object_context_p obj_context = CONTEXT(contextID);
if (NULL == obj_context)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
return vaStatus;
}
 
obj_context->context_id = contextID;
*context = contextID;
obj_context->current_render_target = -1;
obj_context->config_id = config_id;
obj_context->picture_width = picture_width;
obj_context->picture_height = picture_height;
obj_context->num_render_targets = num_render_targets;
obj_context->render_targets = (VASurfaceID *) malloc(num_render_targets * sizeof(VASurfaceID));
if (obj_context->render_targets == NULL)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
return vaStatus;
}
for(i = 0; i < num_render_targets; i++)
{
if (NULL == SURFACE(render_targets[i]))
{
vaStatus = VA_STATUS_ERROR_INVALID_SURFACE;
break;
}
obj_context->render_targets[i] = render_targets[i];
}
obj_context->flags = flag;
 
/* Error recovery */
if (VA_STATUS_SUCCESS != vaStatus)
{
obj_context->context_id = -1;
obj_context->config_id = -1;
free(obj_context->render_targets);
obj_context->render_targets = NULL;
obj_context->num_render_targets = 0;
obj_context->flags = 0;
object_heap_free( &driver_data->context_heap, (object_base_p) obj_context);
}
 
return vaStatus;
}
 
 
VAStatus dummy_DestroyContext(
VADriverContextP ctx,
VAContextID context
)
{
INIT_DRIVER_DATA
object_context_p obj_context = CONTEXT(context);
ASSERT(obj_context);
 
obj_context->context_id = -1;
obj_context->config_id = -1;
obj_context->picture_width = 0;
obj_context->picture_height = 0;
if (obj_context->render_targets)
{
free(obj_context->render_targets);
}
obj_context->render_targets = NULL;
obj_context->num_render_targets = 0;
obj_context->flags = 0;
 
obj_context->current_render_target = -1;
 
object_heap_free( &driver_data->context_heap, (object_base_p) obj_context);
 
return VA_STATUS_SUCCESS;
}
 
 
 
static VAStatus dummy__allocate_buffer(object_buffer_p obj_buffer, int size)
{
VAStatus vaStatus = VA_STATUS_SUCCESS;
 
obj_buffer->buffer_data = realloc(obj_buffer->buffer_data, size);
if (NULL == obj_buffer->buffer_data)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
}
return vaStatus;
}
 
VAStatus dummy_CreateBuffer(
VADriverContextP ctx,
VAContextID context, /* in */
VABufferType type, /* in */
unsigned int size, /* in */
unsigned int num_elements, /* in */
void *data, /* in */
VABufferID *buf_id /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
int bufferID;
object_buffer_p obj_buffer;
 
/* Validate type */
switch (type)
{
case VAPictureParameterBufferType:
case VAIQMatrixBufferType:
case VABitPlaneBufferType:
case VASliceGroupMapBufferType:
case VASliceParameterBufferType:
case VASliceDataBufferType:
case VAMacroblockParameterBufferType:
case VAResidualDataBufferType:
case VADeblockingParameterBufferType:
case VAImageBufferType:
/* Ok */
break;
default:
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE;
return vaStatus;
}
 
bufferID = object_heap_allocate( &driver_data->buffer_heap );
obj_buffer = BUFFER(bufferID);
if (NULL == obj_buffer)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
return vaStatus;
}
 
obj_buffer->buffer_data = NULL;
 
vaStatus = dummy__allocate_buffer(obj_buffer, size * num_elements);
if (VA_STATUS_SUCCESS == vaStatus)
{
obj_buffer->max_num_elements = num_elements;
obj_buffer->num_elements = num_elements;
if (data)
{
memcpy(obj_buffer->buffer_data, data, size * num_elements);
}
}
 
if (VA_STATUS_SUCCESS == vaStatus)
{
*buf_id = bufferID;
}
 
return vaStatus;
}
 
 
VAStatus dummy_BufferSetNumElements(
VADriverContextP ctx,
VABufferID buf_id, /* in */
unsigned int num_elements /* in */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_buffer_p obj_buffer = BUFFER(buf_id);
ASSERT(obj_buffer);
 
if ((num_elements < 0) || (num_elements > obj_buffer->max_num_elements))
{
vaStatus = VA_STATUS_ERROR_UNKNOWN;
}
if (VA_STATUS_SUCCESS == vaStatus)
{
obj_buffer->num_elements = num_elements;
}
 
return vaStatus;
}
 
VAStatus dummy_MapBuffer(
VADriverContextP ctx,
VABufferID buf_id, /* in */
void **pbuf /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
object_buffer_p obj_buffer = BUFFER(buf_id);
ASSERT(obj_buffer);
if (NULL == obj_buffer)
{
vaStatus = VA_STATUS_ERROR_INVALID_BUFFER;
return vaStatus;
}
 
if (NULL != obj_buffer->buffer_data)
{
*pbuf = obj_buffer->buffer_data;
vaStatus = VA_STATUS_SUCCESS;
}
return vaStatus;
}
 
VAStatus dummy_UnmapBuffer(
VADriverContextP ctx,
VABufferID buf_id /* in */
)
{
/* Do nothing */
return VA_STATUS_SUCCESS;
}
 
static void dummy__destroy_buffer(struct dummy_driver_data *driver_data, object_buffer_p obj_buffer)
{
if (NULL != obj_buffer->buffer_data)
{
free(obj_buffer->buffer_data);
obj_buffer->buffer_data = NULL;
}
 
object_heap_free( &driver_data->buffer_heap, (object_base_p) obj_buffer);
}
 
VAStatus dummy_DestroyBuffer(
VADriverContextP ctx,
VABufferID buffer_id
)
{
INIT_DRIVER_DATA
object_buffer_p obj_buffer = BUFFER(buffer_id);
ASSERT(obj_buffer);
 
dummy__destroy_buffer(driver_data, obj_buffer);
return VA_STATUS_SUCCESS;
}
 
VAStatus dummy_BeginPicture(
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);
 
obj_context->current_render_target = obj_surface->base.id;
 
return vaStatus;
}
 
VAStatus dummy_RenderPicture(
VADriverContextP ctx,
VAContextID context,
VABufferID *buffers,
int num_buffers
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_context_p obj_context;
object_surface_p obj_surface;
int i;
 
obj_context = CONTEXT(context);
ASSERT(obj_context);
 
obj_surface = SURFACE(obj_context->current_render_target);
ASSERT(obj_surface);
 
/* verify that we got valid buffer references */
for(i = 0; i < num_buffers; i++)
{
object_buffer_p obj_buffer = BUFFER(buffers[i]);
ASSERT(obj_buffer);
if (NULL == obj_buffer)
{
vaStatus = VA_STATUS_ERROR_INVALID_BUFFER;
break;
}
}
/* Release buffers */
for(i = 0; i < num_buffers; i++)
{
object_buffer_p obj_buffer = BUFFER(buffers[i]);
ASSERT(obj_buffer);
dummy__destroy_buffer(driver_data, obj_buffer);
}
 
return vaStatus;
}
 
VAStatus dummy_EndPicture(
VADriverContextP ctx,
VAContextID context
)
{
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(obj_context->current_render_target);
ASSERT(obj_surface);
 
// For now, assume that we are done with rendering right away
obj_context->current_render_target = -1;
 
return vaStatus;
}
 
 
VAStatus dummy_SyncSurface(
VADriverContextP ctx,
VASurfaceID render_target
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_surface_p obj_surface;
 
obj_surface = SURFACE(render_target);
ASSERT(obj_surface);
 
return vaStatus;
}
 
VAStatus dummy_QuerySurfaceStatus(
VADriverContextP ctx,
VASurfaceID render_target,
VASurfaceStatus *status /* out */
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
object_surface_p obj_surface;
 
obj_surface = SURFACE(render_target);
ASSERT(obj_surface);
 
*status = VASurfaceReady;
 
return vaStatus;
}
 
VAStatus dummy_PutSurface(
VADriverContextP ctx,
VASurfaceID surface,
void *draw, /* X Drawable */
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
VARectangle *cliprects, /* client supplied clip list */
unsigned int number_cliprects, /* number of clip rects in the clip list */
unsigned int flags /* de-interlacing flags */
)
{
/* TODO */
return VA_STATUS_ERROR_UNKNOWN;
}
 
/*
* Query display attributes
* The caller must provide a "attr_list" array that can hold at
* least vaMaxNumDisplayAttributes() entries. The actual number of attributes
* returned in "attr_list" is returned in "num_attributes".
*/
VAStatus dummy_QueryDisplayAttributes (
VADriverContextP ctx,
VADisplayAttribute *attr_list, /* out */
int *num_attributes /* out */
)
{
/* TODO */
return VA_STATUS_ERROR_UNKNOWN;
}
 
/*
* Get display attributes
* This function returns the current attribute values in "attr_list".
* Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can have their values retrieved.
*/
VAStatus dummy_GetDisplayAttributes (
VADriverContextP ctx,
VADisplayAttribute *attr_list, /* in/out */
int num_attributes
)
{
/* TODO */
return VA_STATUS_ERROR_UNKNOWN;
}
 
/*
* Set display attributes
* Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can be set. If the attribute is not settable or
* the value is out of range, the function returns VA_STATUS_ERROR_ATTR_NOT_SUPPORTED
*/
VAStatus dummy_SetDisplayAttributes (
VADriverContextP ctx,
VADisplayAttribute *attr_list,
int num_attributes
)
{
/* TODO */
return VA_STATUS_ERROR_UNKNOWN;
}
 
 
VAStatus dummy_BufferInfo(
VADriverContextP ctx,
VABufferID buf_id, /* in */
VABufferType *type, /* out */
unsigned int *size, /* out */
unsigned int *num_elements /* out */
)
{
/* TODO */
return VA_STATUS_ERROR_UNIMPLEMENTED;
}
 
 
VAStatus dummy_LockSurface(
VADriverContextP ctx,
VASurfaceID surface,
unsigned int *fourcc, /* following are output argument */
unsigned int *luma_stride,
unsigned int *chroma_u_stride,
unsigned int *chroma_v_stride,
unsigned int *luma_offset,
unsigned int *chroma_u_offset,
unsigned int *chroma_v_offset,
unsigned int *buffer_name,
void **buffer
)
{
/* TODO */
return VA_STATUS_ERROR_UNIMPLEMENTED;
}
 
VAStatus dummy_UnlockSurface(
VADriverContextP ctx,
VASurfaceID surface
)
{
/* TODO */
return VA_STATUS_ERROR_UNIMPLEMENTED;
}
 
VAStatus dummy_Terminate( VADriverContextP ctx )
{
INIT_DRIVER_DATA
object_buffer_p obj_buffer;
object_config_p obj_config;
object_heap_iterator iter;
 
/* Clean up left over buffers */
obj_buffer = (object_buffer_p) object_heap_first( &driver_data->buffer_heap, &iter);
while (obj_buffer)
{
dummy__information_message("vaTerminate: bufferID %08x still allocated, destroying\n", obj_buffer->base.id);
dummy__destroy_buffer(driver_data, obj_buffer);
obj_buffer = (object_buffer_p) object_heap_next( &driver_data->buffer_heap, &iter);
}
object_heap_destroy( &driver_data->buffer_heap );
 
/* TODO cleanup */
object_heap_destroy( &driver_data->surface_heap );
 
/* TODO cleanup */
object_heap_destroy( &driver_data->context_heap );
 
/* Clean up configIDs */
obj_config = (object_config_p) object_heap_first( &driver_data->config_heap, &iter);
while (obj_config)
{
object_heap_free( &driver_data->config_heap, (object_base_p) obj_config);
obj_config = (object_config_p) object_heap_next( &driver_data->config_heap, &iter);
}
object_heap_destroy( &driver_data->config_heap );
 
free(ctx->pDriverData);
ctx->pDriverData = NULL;
 
return VA_STATUS_SUCCESS;
}
 
VAStatus VA_DRIVER_INIT_FUNC( VADriverContextP ctx )
{
struct VADriverVTable * const vtable = ctx->vtable;
int result;
struct dummy_driver_data *driver_data;
 
ctx->version_major = VA_MAJOR_VERSION;
ctx->version_minor = VA_MINOR_VERSION;
ctx->max_profiles = DUMMY_MAX_PROFILES;
ctx->max_entrypoints = DUMMY_MAX_ENTRYPOINTS;
ctx->max_attributes = DUMMY_MAX_CONFIG_ATTRIBUTES;
ctx->max_image_formats = DUMMY_MAX_IMAGE_FORMATS;
ctx->max_subpic_formats = DUMMY_MAX_SUBPIC_FORMATS;
ctx->max_display_attributes = DUMMY_MAX_DISPLAY_ATTRIBUTES;
ctx->str_vendor = DUMMY_STR_VENDOR;
 
vtable->vaTerminate = dummy_Terminate;
vtable->vaQueryConfigEntrypoints = dummy_QueryConfigEntrypoints;
vtable->vaQueryConfigProfiles = dummy_QueryConfigProfiles;
vtable->vaQueryConfigEntrypoints = dummy_QueryConfigEntrypoints;
vtable->vaQueryConfigAttributes = dummy_QueryConfigAttributes;
vtable->vaCreateConfig = dummy_CreateConfig;
vtable->vaDestroyConfig = dummy_DestroyConfig;
vtable->vaGetConfigAttributes = dummy_GetConfigAttributes;
vtable->vaCreateSurfaces = dummy_CreateSurfaces;
vtable->vaDestroySurfaces = dummy_DestroySurfaces;
vtable->vaCreateContext = dummy_CreateContext;
vtable->vaDestroyContext = dummy_DestroyContext;
vtable->vaCreateBuffer = dummy_CreateBuffer;
vtable->vaBufferSetNumElements = dummy_BufferSetNumElements;
vtable->vaMapBuffer = dummy_MapBuffer;
vtable->vaUnmapBuffer = dummy_UnmapBuffer;
vtable->vaDestroyBuffer = dummy_DestroyBuffer;
vtable->vaBeginPicture = dummy_BeginPicture;
vtable->vaRenderPicture = dummy_RenderPicture;
vtable->vaEndPicture = dummy_EndPicture;
vtable->vaSyncSurface = dummy_SyncSurface;
vtable->vaQuerySurfaceStatus = dummy_QuerySurfaceStatus;
vtable->vaPutSurface = dummy_PutSurface;
vtable->vaQueryImageFormats = dummy_QueryImageFormats;
vtable->vaCreateImage = dummy_CreateImage;
vtable->vaDeriveImage = dummy_DeriveImage;
vtable->vaDestroyImage = dummy_DestroyImage;
vtable->vaSetImagePalette = dummy_SetImagePalette;
vtable->vaGetImage = dummy_GetImage;
vtable->vaPutImage = dummy_PutImage;
vtable->vaQuerySubpictureFormats = dummy_QuerySubpictureFormats;
vtable->vaCreateSubpicture = dummy_CreateSubpicture;
vtable->vaDestroySubpicture = dummy_DestroySubpicture;
vtable->vaSetSubpictureImage = dummy_SetSubpictureImage;
vtable->vaSetSubpictureChromakey = dummy_SetSubpictureChromakey;
vtable->vaSetSubpictureGlobalAlpha = dummy_SetSubpictureGlobalAlpha;
vtable->vaAssociateSubpicture = dummy_AssociateSubpicture;
vtable->vaDeassociateSubpicture = dummy_DeassociateSubpicture;
vtable->vaQueryDisplayAttributes = dummy_QueryDisplayAttributes;
vtable->vaGetDisplayAttributes = dummy_GetDisplayAttributes;
vtable->vaSetDisplayAttributes = dummy_SetDisplayAttributes;
vtable->vaLockSurface = dummy_LockSurface;
vtable->vaUnlockSurface = dummy_UnlockSurface;
vtable->vaBufferInfo = dummy_BufferInfo;
 
driver_data = (struct dummy_driver_data *) malloc( sizeof(*driver_data) );
ctx->pDriverData = (void *) driver_data;
 
result = object_heap_init( &driver_data->config_heap, sizeof(struct object_config), CONFIG_ID_OFFSET );
ASSERT( result == 0 );
 
result = object_heap_init( &driver_data->context_heap, sizeof(struct object_context), CONTEXT_ID_OFFSET );
ASSERT( result == 0 );
 
result = object_heap_init( &driver_data->surface_heap, sizeof(struct object_surface), SURFACE_ID_OFFSET );
ASSERT( result == 0 );
 
result = object_heap_init( &driver_data->buffer_heap, sizeof(struct object_buffer), BUFFER_ID_OFFSET );
ASSERT( result == 0 );
 
 
return VA_STATUS_SUCCESS;
}
 
/contrib/sdk/sources/vaapi/libva-1.4.1/dummy_drv_video/dummy_drv_video.h
0,0 → 1,83
/*
* Copyright (c) 2007 Intel Corporation. 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, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
*/
 
#ifndef _DUMMY_DRV_VIDEO_H_
#define _DUMMY_DRV_VIDEO_H_
 
#include <va/va.h>
#include "object_heap.h"
 
#define DUMMY_MAX_PROFILES 11
#define DUMMY_MAX_ENTRYPOINTS 5
#define DUMMY_MAX_CONFIG_ATTRIBUTES 10
#define DUMMY_MAX_IMAGE_FORMATS 10
#define DUMMY_MAX_SUBPIC_FORMATS 4
#define DUMMY_MAX_DISPLAY_ATTRIBUTES 4
#define DUMMY_STR_VENDOR "Dummy Driver 1.0"
 
struct dummy_driver_data {
struct object_heap config_heap;
struct object_heap context_heap;
struct object_heap surface_heap;
struct object_heap buffer_heap;
};
 
struct object_config {
struct object_base base;
VAProfile profile;
VAEntrypoint entrypoint;
VAConfigAttrib attrib_list[DUMMY_MAX_CONFIG_ATTRIBUTES];
int attrib_count;
};
 
struct object_context {
struct object_base base;
VAContextID context_id;
VAConfigID config_id;
VASurfaceID current_render_target;
int picture_width;
int picture_height;
int num_render_targets;
int flags;
VASurfaceID *render_targets;
};
 
struct object_surface {
struct object_base base;
VASurfaceID surface_id;
};
 
struct object_buffer {
struct object_base base;
void *buffer_data;
int max_num_elements;
int num_elements;
};
 
typedef struct object_config *object_config_p;
typedef struct object_context *object_context_p;
typedef struct object_surface *object_surface_p;
typedef struct object_buffer *object_buffer_p;
 
#endif /* _DUMMY_DRV_VIDEO_H_ */
/contrib/sdk/sources/vaapi/libva-1.4.1/dummy_drv_video/object_heap.c
0,0 → 1,267
/*
* Copyright (c) 2007 Intel Corporation. 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, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
*/
 
#include <stdlib.h>
#include <assert.h>
#include "object_heap.h"
 
#define ASSERT assert
 
#define LAST_FREE -1
#define ALLOCATED -2
 
/*
* Expands the heap
* Return 0 on success, -1 on error
*/
static int
object_heap_expand(object_heap_p heap)
{
int i;
void *new_heap_index;
int next_free;
int new_heap_size = heap->heap_size + heap->heap_increment;
int bucket_index = new_heap_size / heap->heap_increment - 1;
 
if (bucket_index >= heap->num_buckets) {
int new_num_buckets = heap->num_buckets + 8;
void **new_bucket;
 
new_bucket = realloc(heap->bucket, new_num_buckets * sizeof(void *));
if (NULL == new_bucket) {
return -1;
}
 
heap->num_buckets = new_num_buckets;
heap->bucket = new_bucket;
}
 
new_heap_index = (void *) malloc(heap->heap_increment * heap->object_size);
if (NULL == new_heap_index) {
return -1; /* Out of memory */
}
 
heap->bucket[bucket_index] = new_heap_index;
next_free = heap->next_free;
for (i = new_heap_size; i-- > heap->heap_size;) {
object_base_p obj = (object_base_p)(new_heap_index + (i - heap->heap_size) * heap->object_size);
obj->id = i + heap->id_offset;
obj->next_free = next_free;
next_free = i;
}
heap->next_free = next_free;
heap->heap_size = new_heap_size;
return 0; /* Success */
}
 
/*
* Return 0 on success, -1 on error
*/
int
object_heap_init(object_heap_p heap, int object_size, int id_offset)
{
pthread_mutex_init(&heap->mutex, NULL);
heap->object_size = object_size;
heap->id_offset = id_offset & OBJECT_HEAP_OFFSET_MASK;
heap->heap_size = 0;
heap->heap_increment = 16;
heap->next_free = LAST_FREE;
heap->num_buckets = 0;
heap->bucket = NULL;
return object_heap_expand(heap);
}
 
/*
* Allocates an object
* Returns the object ID on success, returns -1 on error
*/
static int
object_heap_allocate_unlocked(object_heap_p heap)
{
object_base_p obj;
int bucket_index, obj_index;
 
if (LAST_FREE == heap->next_free) {
if (-1 == object_heap_expand(heap)) {
return -1; /* Out of memory */
}
}
ASSERT(heap->next_free >= 0);
 
bucket_index = heap->next_free / heap->heap_increment;
obj_index = heap->next_free % heap->heap_increment;
 
obj = (object_base_p)(heap->bucket[bucket_index] + obj_index * heap->object_size);
heap->next_free = obj->next_free;
obj->next_free = ALLOCATED;
return obj->id;
}
 
int
object_heap_allocate(object_heap_p heap)
{
int ret;
 
pthread_mutex_lock(&heap->mutex);
ret = object_heap_allocate_unlocked(heap);
pthread_mutex_unlock(&heap->mutex);
return ret;
}
 
/*
* Lookup an object by object ID
* Returns a pointer to the object on success, returns NULL on error
*/
static object_base_p
object_heap_lookup_unlocked(object_heap_p heap, int id)
{
object_base_p obj;
int bucket_index, obj_index;
 
if ((id < heap->id_offset) || (id > (heap->heap_size + heap->id_offset))) {
return NULL;
}
id &= OBJECT_HEAP_ID_MASK;
bucket_index = id / heap->heap_increment;
obj_index = id % heap->heap_increment;
obj = (object_base_p)(heap->bucket[bucket_index] + obj_index * heap->object_size);
 
/* Check if the object has in fact been allocated */
if (obj->next_free != ALLOCATED) {
return NULL;
}
return obj;
}
 
object_base_p
object_heap_lookup(object_heap_p heap, int id)
{
object_base_p obj;
 
pthread_mutex_lock(&heap->mutex);
obj = object_heap_lookup_unlocked(heap, id);
pthread_mutex_unlock(&heap->mutex);
return obj;
}
 
/*
* Iterate over all objects in the heap.
* Returns a pointer to the first object on the heap, returns NULL if heap is empty.
*/
object_base_p
object_heap_first(object_heap_p heap, object_heap_iterator *iter)
{
*iter = -1;
return object_heap_next(heap, iter);
}
 
/*
* Iterate over all objects in the heap.
* Returns a pointer to the next object on the heap, returns NULL if heap is empty.
*/
static object_base_p
object_heap_next_unlocked(object_heap_p heap, object_heap_iterator *iter)
{
object_base_p obj;
int bucket_index, obj_index;
int i = *iter + 1;
 
while (i < heap->heap_size) {
bucket_index = i / heap->heap_increment;
obj_index = i % heap->heap_increment;
 
obj = (object_base_p)(heap->bucket[bucket_index] + obj_index * heap->object_size);
if (obj->next_free == ALLOCATED) {
*iter = i;
return obj;
}
i++;
}
*iter = i;
return NULL;
}
 
object_base_p
object_heap_next(object_heap_p heap, object_heap_iterator *iter)
{
object_base_p obj;
 
pthread_mutex_lock(&heap->mutex);
obj = object_heap_next_unlocked(heap, iter);
pthread_mutex_unlock(&heap->mutex);
return obj;
}
 
/*
* Frees an object
*/
static void
object_heap_free_unlocked(object_heap_p heap, object_base_p obj)
{
/* Check if the object has in fact been allocated */
ASSERT(obj->next_free == ALLOCATED);
 
obj->next_free = heap->next_free;
heap->next_free = obj->id & OBJECT_HEAP_ID_MASK;
}
 
void
object_heap_free(object_heap_p heap, object_base_p obj)
{
if (!obj)
return;
pthread_mutex_lock(&heap->mutex);
object_heap_free_unlocked(heap, obj);
pthread_mutex_unlock(&heap->mutex);
}
 
/*
* Destroys a heap, the heap must be empty.
*/
void
object_heap_destroy(object_heap_p heap)
{
object_base_p obj;
int bucket_index, obj_index, i;
 
/* Check if heap is empty */
for (i = 0; i < heap->heap_size; i++) {
/* Check if object is not still allocated */
bucket_index = i / heap->heap_increment;
obj_index = i % heap->heap_increment;
obj = (object_base_p)(heap->bucket[bucket_index] + obj_index * heap->object_size);
ASSERT(obj->next_free != ALLOCATED);
}
 
for (i = 0; i < heap->heap_size / heap->heap_increment; i++) {
free(heap->bucket[i]);
}
 
pthread_mutex_destroy(&heap->mutex);
 
free(heap->bucket);
heap->bucket = NULL;
heap->heap_size = 0;
heap->next_free = LAST_FREE;
}
/contrib/sdk/sources/vaapi/libva-1.4.1/dummy_drv_video/object_heap.h
0,0 → 1,100
/*
* Copyright (c) 2007 Intel Corporation. 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, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
*/
 
#ifndef OBJECT_HEAP_H
#define OBJECT_HEAP_H
 
#include <pthread.h>
 
#define OBJECT_HEAP_OFFSET_MASK 0x7F000000
#define OBJECT_HEAP_ID_MASK 0x00FFFFFF
 
typedef struct object_base *object_base_p;
typedef struct object_heap *object_heap_p;
 
struct object_base {
int id;
int next_free;
};
 
struct object_heap {
pthread_mutex_t mutex;
int object_size;
int id_offset;
int next_free;
int heap_size;
int heap_increment;
void **bucket;
int num_buckets;
};
 
typedef int object_heap_iterator;
 
/*
* Return 0 on success, -1 on error
*/
int
object_heap_init(object_heap_p heap, int object_size, int id_offset);
 
/*
* Allocates an object
* Returns the object ID on success, returns -1 on error
*/
int
object_heap_allocate(object_heap_p heap);
 
/*
* Lookup an allocated object by object ID
* Returns a pointer to the object on success, returns NULL on error
*/
object_base_p
object_heap_lookup(object_heap_p heap, int id);
 
/*
* Iterate over all objects in the heap.
* Returns a pointer to the first object on the heap, returns NULL if heap is empty.
*/
object_base_p
object_heap_first(object_heap_p heap, object_heap_iterator *iter);
 
/*
* Iterate over all objects in the heap.
* Returns a pointer to the next object on the heap, returns NULL if heap is empty.
*/
object_base_p
object_heap_next(object_heap_p heap, object_heap_iterator *iter);
 
/*
* Frees an object
*/
void
object_heap_free(object_heap_p heap, object_base_p obj);
 
/*
* Destroys a heap, the heap must be empty.
*/
void
object_heap_destroy(object_heap_p heap);
 
#endif /* OBJECT_HEAP_H */