diff --git a/packages/mediacenter/xbmc-master/config/advancedsettings.xml b/packages/mediacenter/xbmc-master/config/advancedsettings.xml
deleted file mode 100644
index c54111aaa3..0000000000
--- a/packages/mediacenter/xbmc-master/config/advancedsettings.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- false
- cputemp
- gputemp
-
-
- 30
-
-
- 4.0
-
-
diff --git a/packages/mediacenter/xbmc-master/config/appliance.xml b/packages/mediacenter/xbmc-master/config/appliance.xml
deleted file mode 100644
index 98fd49f28c..0000000000
--- a/packages/mediacenter/xbmc-master/config/appliance.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
- /usr/bin/setwakeup.sh
-
-
-
-
-
-
diff --git a/packages/mediacenter/xbmc-master/config/os.openelec.tv/addon.xml b/packages/mediacenter/xbmc-master/config/os.openelec.tv/addon.xml
deleted file mode 100644
index 206659f9da..0000000000
--- a/packages/mediacenter/xbmc-master/config/os.openelec.tv/addon.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/packages/mediacenter/xbmc-master/config/repository.openelec.tv/addon.xml b/packages/mediacenter/xbmc-master/config/repository.openelec.tv/addon.xml
deleted file mode 100644
index 7b21ca7f12..0000000000
--- a/packages/mediacenter/xbmc-master/config/repository.openelec.tv/addon.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- @ADDON_URL@/addons.xml
- @ADDON_URL@/addons.xml.md5
- @ADDON_URL@
-
-
- Install Add-ons, Plugins, Games and Programs from [COLOR FF757677]Open[/COLOR][COLOR FF8ABEE2]ELEC[/COLOR]
- Download and install Add-ons, Plugins, Games and Programs from the Official [COLOR FF757677]Open[/COLOR][COLOR FF8ABEE2]ELEC[/COLOR] addon repository.[CR] By using the official Repository you will be able to take advantage of our extensive file mirror service to help get you faster downloads from a region close to you.[CR] All addons on this repository have under gone basic testing, if you find a broken or not working addon please report it to [COLOR FF757677]Open[/COLOR][COLOR FF8ABEE2]ELEC[/COLOR] so we can take any action needed.
- all
-
-
diff --git a/packages/mediacenter/xbmc-master/config/repository.openelec.tv/icon.png b/packages/mediacenter/xbmc-master/config/repository.openelec.tv/icon.png
deleted file mode 100644
index 1147ae1d37..0000000000
Binary files a/packages/mediacenter/xbmc-master/config/repository.openelec.tv/icon.png and /dev/null differ
diff --git a/packages/mediacenter/xbmc-master/debug.d/xbmc.conf b/packages/mediacenter/xbmc-master/debug.d/xbmc.conf
deleted file mode 100644
index 7c6c362ac3..0000000000
--- a/packages/mediacenter/xbmc-master/debug.d/xbmc.conf
+++ /dev/null
@@ -1 +0,0 @@
-XBMC_DEBUG="--debug"
diff --git a/packages/mediacenter/xbmc-master/fonts/DejaVuSans.ttf b/packages/mediacenter/xbmc-master/fonts/DejaVuSans.ttf
deleted file mode 100644
index 84ca1d7503..0000000000
Binary files a/packages/mediacenter/xbmc-master/fonts/DejaVuSans.ttf and /dev/null differ
diff --git a/packages/mediacenter/xbmc-master/fonts/Trebuchet MS Bold.ttf b/packages/mediacenter/xbmc-master/fonts/Trebuchet MS Bold.ttf
deleted file mode 100644
index 867f56d776..0000000000
Binary files a/packages/mediacenter/xbmc-master/fonts/Trebuchet MS Bold.ttf and /dev/null differ
diff --git a/packages/mediacenter/xbmc-master/fonts/YanoneKaffeesatz-Bold.ttf b/packages/mediacenter/xbmc-master/fonts/YanoneKaffeesatz-Bold.ttf
deleted file mode 100644
index e9964b0809..0000000000
Binary files a/packages/mediacenter/xbmc-master/fonts/YanoneKaffeesatz-Bold.ttf and /dev/null differ
diff --git a/packages/mediacenter/xbmc-master/package.mk b/packages/mediacenter/xbmc-master/package.mk
deleted file mode 100644
index a2e891eac4..0000000000
--- a/packages/mediacenter/xbmc-master/package.mk
+++ /dev/null
@@ -1,517 +0,0 @@
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-PKG_NAME="xbmc-master"
-PKG_VERSION="14-67f025d"
-PKG_REV="1"
-PKG_ARCH="any"
-PKG_LICENSE="GPL"
-PKG_SITE="http://www.xbmc.org"
-PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
-PKG_DEPENDS_TARGET="toolchain boost Python zlib bzip2 systemd pciutils lzo pcre swig:host libass enca curl rtmpdump fontconfig fribidi tinyxml libjpeg-turbo libpng tiff freetype jasper libogg libcdio libmodplug libmpeg2 taglib libxml2 libxslt yajl sqlite libvorbis ffmpeg xbmc-master:host"
-PKG_DEPENDS_HOST="toolchain"
-PKG_PRIORITY="optional"
-PKG_SECTION="mediacenter"
-PKG_SHORTDESC="xbmc: XBMC Mediacenter"
-PKG_LONGDESC="XBMC Media Center (which was formerly named Xbox Media Center) is a free and open source cross-platform media player and home entertainment system software with a 10-foot user interface designed for the living-room TV. Its graphical user interface allows the user to easily manage video, photos, podcasts, and music from a computer, optical disk, local network, and the internet using a remote control."
-
-PKG_IS_ADDON="no"
-PKG_AUTORECONF="no"
-
-# for dbus support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET dbus"
-
-# needed for hosttools (Texturepacker)
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET lzo:host SDL:host SDL_image:host"
-
-if [ "$DISPLAYSERVER" = "x11" ]; then
-# for libX11 support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libX11 libXext"
-# for libXrandr support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libXrandr"
- XBMC_XORG="--enable-x11 --enable-xrandr"
-else
- XBMC_XORG="--disable-x11 --disable-xrandr"
-fi
-
-if [ "$OPENGL" = "Mesa" ]; then
-# for OpenGL (GLX) support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET Mesa glu glew"
- XBMC_OPENGL="--enable-gl"
-else
- XBMC_OPENGL="--disable-gl"
-fi
-
-if [ "$OPENGLES_SUPPORT" = yes ]; then
-# for OpenGL-ES support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET $OPENGLES"
- XBMC_OPENGLES="--enable-gles"
-else
- XBMC_OPENGLES="--disable-gles"
-fi
-
-if [ "$SDL_SUPPORT" = yes ]; then
-# for SDL support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET SDL SDL_image"
- XBMC_SDL="--enable-sdl"
-else
- XBMC_SDL="--disable-sdl"
-fi
-
-if [ "$ALSA_SUPPORT" = yes ]; then
-# for ALSA support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET alsa-lib"
- XBMC_ALSA="--enable-alsa"
-else
- XBMC_ALSA="--disable-alsa"
-fi
-
-if [ "$PULSEAUDIO_SUPPORT" = yes ]; then
-# for PulseAudio support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET pulseaudio"
- XBMC_PULSEAUDIO="--enable-pulse"
-else
- XBMC_PULSEAUDIO="--disable-pulse"
-fi
-
-if [ "$ESPEAK_SUPPORT" = yes ]; then
-# for espeak support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET espeak"
-fi
-
-if [ "$CEC_SUPPORT" = yes ]; then
-# for CEC support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libcec"
- XBMC_CEC="--enable-libcec"
-else
- XBMC_CEC="--disable-libcec"
-fi
-
-if [ "$XBMC_SCR_RSXS" = yes ]; then
-# for RSXS Screensaver support
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libXt libXmu"
- XBMC_RSXS="--enable-rsxs"
-# fix build of RSXS Screensaver support if not using libiconv
- export jm_cv_func_gettimeofday_clobber=no
-else
- XBMC_RSXS="--disable-rsxs"
-fi
-
-if [ "$XBMC_VIS_PROJECTM" = yes ]; then
-# for ProjectM Visualisation support
- XBMC_PROJECTM="--enable-projectm"
-else
- XBMC_PROJECTM="--disable-projectm"
-fi
-
-if [ "$XBMC_VIS_GOOM" = yes ]; then
-# for GOOM Visualisation support
- XBMC_GOOM="--enable-goom"
-else
- XBMC_GOOM="--disable-goom"
-fi
-
-if [ "$XBMC_VIS_WAVEFORM" = yes ]; then
-# for Waveform Visualisation support
- XBMC_WAVEFORM="--enable-waveform"
-else
- XBMC_WAVEFORM="--disable-waveform"
-fi
-
-if [ "$XBMC_VIS_SPECTRUM" = yes ]; then
-# for Spectrum Visualisation support
- XBMC_SPECTRUM="--enable-spectrum"
-else
- XBMC_SPECTRUM="--disable-spectrum"
-fi
-
-if [ "$XBMC_VIS_FISHBMC" = yes ]; then
-# for FishBMC Visualisation support
- XBMC_FISHBMC="--enable-fishbmc"
-else
- XBMC_FISHBMC="--disable-fishbmc"
-fi
-
-if [ "$JOYSTICK_SUPPORT" = yes ]; then
-# for Joystick support
- XBMC_JOYSTICK="--enable-joystick"
-else
- XBMC_JOYSTICK="--disable-joystick"
-fi
-
-if [ "$OPTICAL_DRIVE_SUPPORT" = yes ]; then
- XBMC_OPTICAL="--enable-optical-drive"
-else
- XBMC_OPTICAL="--disable-optical-drive"
-fi
-
-if [ "$NONFREE_SUPPORT" = yes ]; then
-# for non-free support
- XBMC_NONFREE="--enable-non-free"
-else
- XBMC_NONFREE="--disable-non-free"
-fi
-
-if [ "$DVDCSS_SUPPORT" = yes ]; then
- XBMC_DVDCSS="--enable-dvdcss"
-else
- XBMC_DVDCSS="--disable-dvdcss"
-fi
-
-if [ "$FAAC_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET faac"
-fi
-
-if [ "$BLURAY_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libbluray"
- XBMC_BLURAY="--enable-libbluray"
-else
- XBMC_BLURAY="--disable-libbluray"
-fi
-
-if [ "$AVAHI_DAEMON" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET avahi nss-mdns"
- XBMC_AVAHI="--enable-avahi"
-else
- XBMC_AVAHI="--disable-avahi"
-fi
-
-if [ "$MYSQL_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET mysql"
- XBMC_MYSQL="--enable-mysql"
-else
- XBMC_MYSQL="--disable-mysql"
-fi
-
-if [ "$AIRPLAY_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libplist"
- XBMC_AIRPLAY="--enable-airplay"
-else
- XBMC_AIRPLAY="--disable-airplay"
-fi
-
-if [ "$AIRTUNES_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libshairplay"
- XBMC_AIRTUNES="--enable-airtunes"
-else
- XBMC_AIRTUNES="--disable-airtunes"
-fi
-
-if [ "$NFS_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libnfs"
- XBMC_NFS="--enable-nfs"
-else
- XBMC_NFS="--disable-nfs"
-fi
-
-if [ "$AFP_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET afpfs-ng"
- XBMC_AFP="--enable-afpclient"
-else
- XBMC_AFP="--disable-afpclient"
-fi
-
-if [ "$SAMBA_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET samba"
- XBMC_SAMBA="--enable-samba"
-else
- XBMC_SAMBA="--disable-samba"
-fi
-
-if [ "$WEBSERVER" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libmicrohttpd"
- XBMC_WEBSERVER="--enable-webserver"
-else
- XBMC_WEBSERVER="--disable-webserver"
-fi
-
-if [ "$UPNP_SUPPORT" = yes ]; then
- XBMC_UPNP="--enable-upnp"
-else
- XBMC_UPNP="--disable-upnp"
-fi
-
-if [ "$SSHLIB_SUPPORT" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libssh"
- XBMC_SSH="--enable-ssh"
-else
- XBMC_SSH="--disable-ssh"
-fi
-
-if [ ! "$XBMCPLAYER_DRIVER" = default ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET $XBMCPLAYER_DRIVER"
-
- if [ "$XBMCPLAYER_DRIVER" = bcm2835-driver ]; then
- XBMC_OPENMAX="--enable-openmax"
- XBMC_PLAYER="--enable-player=omxplayer"
- XBMC_CODEC="--with-platform=raspberry-pi"
- BCM2835_INCLUDES="-I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads/ \
- -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux"
- XBMC_CFLAGS="$XBMC_CFLAGS $BCM2835_INCLUDES"
- XBMC_CXXFLAGS="$XBMC_CXXFLAGS $BCM2835_INCLUDES"
- elif [ "$XBMCPLAYER_DRIVER" = libfslvpuwrap ]; then
- XBMC_CODEC="--enable-codec=imxvpu"
- else
- XBMC_OPENMAX="--disable-openmax"
- fi
-fi
-
-if [ "$VDPAU" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libvdpau"
- XBMC_VDPAU="--enable-vdpau"
-else
- XBMC_VDPAU="--disable-vdpau"
-fi
-
-if [ "$VAAPI" = yes ]; then
-# configure GPU drivers and dependencies:
- get_graphicdrivers
-
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET $LIBVA"
- XBMC_VAAPI="--enable-vaapi"
-else
- XBMC_VAAPI="--disable-vaapi"
-fi
-
-if [ "$CRYSTALHD" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET crystalhd"
- XBMC_CRYSTALHD="--enable-crystalhd"
-else
- XBMC_CRYSTALHD="--disable-crystalhd"
-fi
-
-export CXX_FOR_BUILD="$HOST_CXX"
-export CC_FOR_BUILD="$HOST_CC"
-export CXXFLAGS_FOR_BUILD="$HOST_CXXFLAGS"
-export CFLAGS_FOR_BUILD="$HOST_CFLAGS"
-export LDFLAGS_FOR_BUILD="$HOST_LDFLAGS"
-
-export PYTHON_VERSION="2.7"
-export PYTHON_CPPFLAGS="-I$SYSROOT_PREFIX/usr/include/python$PYTHON_VERSION"
-export PYTHON_LDFLAGS="-L$SYSROOT_PREFIX/usr/lib/python$PYTHON_VERSION -lpython$PYTHON_VERSION"
-export PYTHON_SITE_PKG="$SYSROOT_PREFIX/usr/lib/python$PYTHON_VERSION/site-packages"
-export ac_python_version="$PYTHON_VERSION"
-
-PKG_CONFIGURE_OPTS_TARGET="gl_cv_func_gettimeofday_clobber=no \
- ac_cv_lib_bluetooth_hci_devid=no \
- --disable-debug \
- --disable-optimizations \
- $XBMC_OPENGL \
- $XBMC_OPENGLES \
- $XBMC_SDL \
- $XBMC_OPENMAX \
- $XBMC_VDPAU \
- $XBMC_VAAPI \
- $XBMC_CRYSTALHD \
- --disable-vtbdecoder \
- --disable-tegra \
- --disable-profiling \
- $XBMC_JOYSTICK \
- $XBMC_CEC \
- --enable-udev \
- --disable-libusb \
- $XBMC_GOOM \
- $XBMC_RSXS \
- $XBMC_PROJECTM \
- $XBMC_WAVEFORM \
- $XBMC_SPECTRUM \
- $XBMC_FISHBMC \
- $XBMC_XORG \
- --disable-ccache \
- $XBMC_ALSA \
- $XBMC_PULSEAUDIO \
- --enable-rtmp \
- $XBMC_SAMBA \
- $XBMC_NFS \
- $XBMC_AFP \
- --enable-libvorbisenc \
- --disable-libcap \
- $XBMC_DVDCSS \
- --disable-mid \
- --disable-hal \
- $XBMC_AVAHI \
- $XBMC_UPNP \
- $XBMC_MYSQL \
- $XBMC_SSH \
- $XBMC_AIRPLAY \
- $XBMC_AIRTUNES \
- $XBMC_NONFREE \
- --disable-asap-codec \
- $XBMC_WEBSERVER \
- $XBMC_OPTICAL \
- $XBMC_BLURAY \
- --enable-texturepacker \
- $XBMC_CODEC \
- $XBMC_PLAYER"
-
-pre_configure_host() {
-# xbmc fails to build in subdirs
- cd $ROOT/$PKG_BUILD
- rm -rf .$HOST_NAME
-}
-
-make_host() {
- make -C tools/depends/native/JsonSchemaBuilder
-}
-
-makeinstall_host() {
- cp -PR tools/depends/native/JsonSchemaBuilder/native/JsonSchemaBuilder $ROOT/$TOOLCHAIN/bin
-}
-
-pre_build_target() {
-# adding fake Makefile for stripped skin
- mkdir -p $PKG_BUILD/addons/skin.confluence/media
- touch $PKG_BUILD/addons/skin.confluence/media/Makefile.in
-
-# autoreconf
- BOOTSTRAP_STANDALONE=1 make -C $PKG_BUILD -f bootstrap.mk
-}
-
-pre_configure_target() {
-# xbmc fails to build in subdirs
- cd $ROOT/$PKG_BUILD
- rm -rf .$TARGET_NAME
-
-# xbmc fails to build with LTO optimization if build without GOLD support
- [ ! "$GOLD_SUPPORT" = "yes" ] && strip_lto
-
-# Todo: XBMC segfaults on exit when building with LTO support
- strip_lto
-
- export CFLAGS="$CFLAGS $XBMC_CFLAGS"
- export CXXFLAGS="$CXXFLAGS $XBMC_CXXFLAGS"
- export LIBS="$LIBS -lz"
-
- export JSON_BUILDER=$ROOT/$TOOLCHAIN/bin/JsonSchemaBuilder
-}
-
-make_target() {
-# setup skin dir from default skin
- SKIN_DIR="skin.`tolower $SKIN_DEFAULT`"
-
-# setup default skin inside the sources
- sed -i -e "s|skin.confluence|$SKIN_DIR|g" $ROOT/$PKG_BUILD/xbmc/settings/Settings.h
-
- make externals
- make xbmc.bin
-
- if [ "$DISPLAYSERVER" = "x11" ]; then
- make xbmc-xrandr
- fi
-
- make -C tools/TexturePacker
- cp -PR tools/TexturePacker/TexturePacker $ROOT/$TOOLCHAIN/bin
-}
-
-post_makeinstall_target() {
- rm -rf $INSTALL/usr/bin/xbmc
- rm -rf $INSTALL/usr/bin/xbmc-standalone
- rm -rf $INSTALL/usr/lib/xbmc/*.cmake
-
- mkdir -p $INSTALL/usr/lib/xbmc
- cp $PKG_DIR/scripts/xbmc-config $INSTALL/usr/lib/xbmc
- cp $PKG_DIR/scripts/xbmc-hacks $INSTALL/usr/lib/xbmc
- cp $PKG_DIR/scripts/xbmc-sources $INSTALL/usr/lib/xbmc
-
- mkdir -p $INSTALL/usr/lib/openelec
- cp $PKG_DIR/scripts/systemd-addon-wrapper $INSTALL/usr/lib/openelec
-
- mkdir -p $INSTALL/usr/bin
- cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin
- ln -sf cputemp $INSTALL/usr/bin/gputemp
- cp $PKG_DIR/scripts/setwakeup.sh $INSTALL/usr/bin
- cp tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send
-
- if [ ! "$DISPLAYSERVER" = "x11" ]; then
- rm -rf $INSTALL/usr/lib/xbmc/xbmc-xrandr
- fi
-
- if [ ! "$XBMC_SCR_RSXS" = yes ]; then
- rm -rf $INSTALL/usr/share/xbmc/addons/screensaver.rsxs.*
- fi
-
- if [ ! "$XBMC_VIS_PROJECTM" = yes ]; then
- rm -rf $INSTALL/usr/share/xbmc/addons/visualization.projectm
- fi
-
- rm -rf $INSTALL/usr/share/applications
- rm -rf $INSTALL/usr/share/icons
- rm -rf $INSTALL/usr/share/xbmc/addons/repository.pvr-*
- rm -rf $INSTALL/usr/share/xbmc/addons/script.module.pysqlite
- rm -rf $INSTALL/usr/share/xbmc/addons/script.module.simplejson
- rm -rf $INSTALL/usr/share/xbmc/addons/visualization.dxspectrum
- rm -rf $INSTALL/usr/share/xbmc/addons/visualization.itunes
- rm -rf $INSTALL/usr/share/xbmc/addons/visualization.milkdrop
- rm -rf $INSTALL/usr/share/xbmc/addons/service.xbmc.versioncheck
- rm -rf $INSTALL/usr/share/xsessions
-
- mkdir -p $INSTALL/usr/share/xbmc/addons
- cp -R $PKG_DIR/config/os.openelec.tv $INSTALL/usr/share/xbmc/addons
- $SED "s|@OS_VERSION@|$OS_VERSION|g" -i $INSTALL/usr/share/xbmc/addons/os.openelec.tv/addon.xml
- cp -R $PKG_DIR/config/repository.openelec.tv $INSTALL/usr/share/xbmc/addons
- $SED "s|@ADDON_URL@|$ADDON_URL|g" -i $INSTALL/usr/share/xbmc/addons/repository.openelec.tv/addon.xml
-
- mkdir -p $INSTALL/usr/lib/python"$PYTHON_VERSION"/site-packages/xbmc
- cp -R tools/EventClients/lib/python/* $INSTALL/usr/lib/python"$PYTHON_VERSION"/site-packages/xbmc
-
-# install project specific configs
- mkdir -p $INSTALL/usr/share/xbmc/config
- if [ -f $PROJECT_DIR/$PROJECT/xbmc/guisettings.xml ]; then
- cp -R $PROJECT_DIR/$PROJECT/xbmc/guisettings.xml $INSTALL/usr/share/xbmc/config
- fi
-
- if [ -f $PROJECT_DIR/$PROJECT/xbmc/sources.xml ]; then
- cp -R $PROJECT_DIR/$PROJECT/xbmc/sources.xml $INSTALL/usr/share/xbmc/config
- fi
-
- mkdir -p $INSTALL/usr/share/xbmc/system/
- if [ -f $PROJECT_DIR/$PROJECT/xbmc/advancedsettings.xml ]; then
- cp $PROJECT_DIR/$PROJECT/xbmc/advancedsettings.xml $INSTALL/usr/share/xbmc/system/
- else
- cp $PKG_DIR/config/advancedsettings.xml $INSTALL/usr/share/xbmc/system/
- fi
-
- mkdir -p $INSTALL/usr/share/xbmc/system/settings
- if [ -f $PROJECT_DIR/$PROJECT/xbmc/appliance.xml ]; then
- cp $PROJECT_DIR/$PROJECT/xbmc/appliance.xml $INSTALL/usr/share/xbmc/system/settings
- else
- cp $PKG_DIR/config/appliance.xml $INSTALL/usr/share/xbmc/system/settings
- fi
-
- if [ "$XBMC_EXTRA_FONTS" = yes ]; then
- mkdir -p $INSTALL/usr/share/xbmc/media/Fonts
- cp $PKG_DIR/fonts/*.ttf $INSTALL/usr/share/xbmc/media/Fonts
- fi
-}
-
-post_install() {
-# link default.target to xbmc.target
- ln -sf xbmc.target $INSTALL/usr/lib/systemd/system/default.target
-
- enable_service xbmc-autostart.service
- enable_service xbmc-cleanlogs.service
- enable_service xbmc-config.service
- enable_service xbmc-hacks.service
- enable_service xbmc-sources.service
- enable_service xbmc-halt.service
- enable_service xbmc-poweroff.service
- enable_service xbmc-reboot.service
- enable_service xbmc-waitonnetwork.service
- enable_service xbmc.service
- enable_service xbmc-lirc-suspend.service
-}
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-051-add_ouya_controller_keymap.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-051-add_ouya_controller_keymap.patch
deleted file mode 100644
index 5a6df63bf4..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-051-add_ouya_controller_keymap.patch
+++ /dev/null
@@ -1,338 +0,0 @@
-diff -Naur xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.Ouya.Controller.xml xbmc-master-14-5ec51aa/system/keymaps/joystick.Ouya.Controller.xml
---- xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.Ouya.Controller.xml 1969-12-31 16:00:00.000000000 -0800
-+++ xbmc-master-14-5ec51aa/system/keymaps/joystick.Ouya.Controller.xml 2014-06-06 16:31:54.812044875 -0700
-@@ -0,0 +1,334 @@
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ AnalogSeekBack
-+ AnalogSeekForward
-+ ScrollUp
-+ ScrollDown
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ AnalogRewind
-+ AnalogFastForward
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ AnalogRewind
-+ AnalogFastForward
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ AnalogMove
-+ AnalogMove
-+ ZoomOut
-+ ZoomIn
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ CursorLeft
-+ CursorRight
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-052-ps4_controller_support.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-052-ps4_controller_support.patch
deleted file mode 100644
index 6beb85108b..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-052-ps4_controller_support.patch
+++ /dev/null
@@ -1,328 +0,0 @@
-diff -Naur xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.PS4.Controller.xml xbmc-master-14-5ec51aa/system/keymaps/joystick.PS4.Controller.xml
---- xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.PS4.Controller.xml 1969-12-31 16:00:00.000000000 -0800
-+++ xbmc-master-14-5ec51aa/system/keymaps/joystick.PS4.Controller.xml 2014-06-06 16:53:33.786191904 -0700
-@@ -0,0 +1,324 @@
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ Left
-+ Right
-+ Up
-+ Down
-+ AnalogSeekForward
-+ AnalogSeekBack
-+ ScrollUp
-+ ScrollDown
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ StepBack
-+ StepForward
-+ BigStepForward
-+ BigStepBack
-+
-+
-+
-+
-+
-+ ChannelUp
-+ ChannelDown
-+ PreviousChannelGroup
-+ NextChannelGroup
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ PreviousPicture
-+ NextPicture
-+ AnalogMove
-+ AnalogMove
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-101-fix_libdvd_xFLAGS-0.1.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-101-fix_libdvd_xFLAGS-0.1.patch
deleted file mode 100644
index 00df7bb51c..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-101-fix_libdvd_xFLAGS-0.1.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-diff -Naur xbmc-master-14-088e9fa/lib/libdvd/libdvdnav/misc/dvdnav-config2.sh xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdnav/misc/dvdnav-config2.sh
---- xbmc-master-14-088e9fa/lib/libdvd/libdvdnav/misc/dvdnav-config2.sh 2014-05-01 16:53:36.000000000 +0200
-+++ xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdnav/misc/dvdnav-config2.sh 2014-05-01 17:54:59.643325427 +0200
-@@ -56,17 +56,17 @@
- fi
-
- if test "$echo_cflags" = "yes"; then
-- echo -I$prefix/include $dvdread_cflags $extracflags $threadcflags
-+ echo $dvdread_cflags $extracflags $threadcflags
- fi
-
- if test "$echo_minicflags" = "yes"; then
-- echo -I$prefix/include -I$prefix/include/dvdnav $extracflags $threadcflags
-+ echo $extracflags $threadcflags
- fi
-
- if test "$echo_libs" = "yes"; then
-- echo -L$libdir -ldvdnav $dvdread_libs $threadlib
-+ echo -ldvdnav $dvdread_libs $threadlib
- fi
-
- if test "$echo_minilibs" = "yes"; then
-- echo -L$libdir -ldvdnavmini $threadlib
-+ echo -ldvdnavmini $threadlib
- fi
-diff -Naur xbmc-master-14-088e9fa/lib/libdvd/libdvdnav/misc/dvdnavmini.pc.in xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdnav/misc/dvdnavmini.pc.in
---- xbmc-master-14-088e9fa/lib/libdvd/libdvdnav/misc/dvdnavmini.pc.in 2014-05-01 16:53:36.000000000 +0200
-+++ xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdnav/misc/dvdnavmini.pc.in 2014-05-01 17:56:12.030447794 +0200
-@@ -7,5 +7,5 @@
- Description: DVD Navigation mini library
- Version: @VERSION@
-
--Cflags: -I${includedir} @DVDREAD_CFLAGS@ @THREAD_CFLAGS@
--Libs: -L${libdir} -ldvdnav @THREAD_LIBS@
-+Cflags: @DVDREAD_CFLAGS@ @THREAD_CFLAGS@
-+Libs: -ldvdnav @THREAD_LIBS@
-diff -Naur xbmc-master-14-088e9fa/lib/libdvd/libdvdnav/misc/dvdnav.pc.in xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdnav/misc/dvdnav.pc.in
---- xbmc-master-14-088e9fa/lib/libdvd/libdvdnav/misc/dvdnav.pc.in 2014-05-01 16:53:36.000000000 +0200
-+++ xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdnav/misc/dvdnav.pc.in 2014-05-01 17:55:50.427406667 +0200
-@@ -8,5 +8,5 @@
- Version: @VERSION@
-
- Requires.private: dvdread >= 4.1.2
--Cflags: -I${includedir} @THREAD_CFLAGS@
--Libs: -L${libdir} -ldvdnav @THREAD_LIBS@
-+Cflags: @THREAD_CFLAGS@
-+Libs: -ldvdnav @THREAD_LIBS@
-diff -Naur xbmc-master-14-088e9fa/lib/libdvd/libdvdread/misc/dvdread-config.sh xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdread/misc/dvdread-config.sh
---- xbmc-master-14-088e9fa/lib/libdvd/libdvdread/misc/dvdread-config.sh 2014-05-01 16:53:36.000000000 +0200
-+++ xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdread/misc/dvdread-config.sh 2014-05-01 17:56:55.745553577 +0200
-@@ -48,9 +48,9 @@
- fi
-
- if test "$echo_cflags" = "yes"; then
-- echo -I$prefix/include $extracflags
-+ echo $extracflags
- fi
-
- if test "$echo_libs" = "yes"; then
-- echo -L$libdir $dvdreadlib
-+ echo $dvdreadlib
- fi
-diff -Naur xbmc-master-14-088e9fa/lib/libdvd/libdvdread/misc/dvdread.pc.in xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdread/misc/dvdread.pc.in
---- xbmc-master-14-088e9fa/lib/libdvd/libdvdread/misc/dvdread.pc.in 2014-05-01 16:53:36.000000000 +0200
-+++ xbmc-master-14-088e9fa.patch/lib/libdvd/libdvdread/misc/dvdread.pc.in 2014-05-01 17:57:28.731937685 +0200
-@@ -7,5 +7,5 @@
- Description: Low level DVD access library
- Version: @VERSION@
-
--Cflags: -I${includedir}
--Libs: -L${libdir} -ldvdread
-+Cflags: -I.
-+Libs: -ldvdread
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-102-disable_backslash-0.1.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-102-disable_backslash-0.1.patch
deleted file mode 100644
index 0888920258..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-102-disable_backslash-0.1.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur xbmc-30a9070/system/keymaps/keyboard.xml xbmc-30a9070.patch/system/keymaps/keyboard.xml
---- xbmc-30a9070/system/keymaps/keyboard.xml 2011-07-28 06:20:13.000000000 +0200
-+++ xbmc-30a9070.patch/system/keymaps/keyboard.xml 2011-07-28 09:39:57.210973380 +0200
-@@ -90,7 +90,7 @@
- Number7
- Number8
- Number9
-- ToggleFullScreen
-+
- FirstPage
- LastPage
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-103-disable-online-check.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-103-disable-online-check.patch
deleted file mode 100644
index 57476fed62..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-103-disable-online-check.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 1716ffbf57a8d812f3bc7b26752e867066c36c44 Mon Sep 17 00:00:00 2001
-From: Stefan Saraev
-Date: Sat, 7 Jun 2014 12:40:57 +0300
-Subject: [PATCH] disable online check
-
----
- xbmc/GUIInfoManager.cpp | 1 -
- xbmc/utils/SystemInfo.cpp | 5 +----
- xbmc/windows/GUIWindowSystemInfo.cpp | 1 -
- 3 files changed, 1 insertion(+), 6 deletions(-)
-
-diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
-index 456c733..0c20ae2 100644
---- a/xbmc/GUIInfoManager.cpp
-+++ b/xbmc/GUIInfoManager.cpp
-@@ -273,7 +273,6 @@ const infomap system_labels[] = {{ "hasnetwork", SYSTEM_ETHERNET_LINK_ACT
- { "currentwindow", SYSTEM_CURRENT_WINDOW },
- { "currentcontrol", SYSTEM_CURRENT_CONTROL },
- { "dvdlabel", SYSTEM_DVD_LABEL },
-- { "internetstate", SYSTEM_INTERNET_STATE },
- { "osversioninfo", SYSTEM_OS_VERSION_INFO },
- { "kernelversion", SYSTEM_OS_VERSION_INFO }, // old, not correct name
- { "uptime", SYSTEM_UPTIME },
-diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp
-index 55ed760..aefeb70 100644
---- a/xbmc/utils/SystemInfo.cpp
-+++ b/xbmc/utils/SystemInfo.cpp
-@@ -240,7 +240,6 @@ bool CSysInfoJob::DoWork()
- {
- m_info.systemUptime = GetSystemUpTime(false);
- m_info.systemTotalUptime = GetSystemUpTime(true);
-- m_info.internetState = GetInternetState();
- m_info.videoEncoder = GetVideoEncoder();
- m_info.cpuFrequency = GetCPUFreqInfo();
- m_info.osVersionInfo = CSysInfo::GetOsPrettyNameWithVersion() + " (kernel: " + CSysInfo::GetKernelName() + " " + CSysInfo::GetKernelVersionFull() + ")";
-@@ -963,9 +962,7 @@ int CSysInfo::GetXbmcBitness(void)
-
- bool CSysInfo::HasInternet()
- {
-- if (m_info.internetState != CSysData::UNKNOWN)
-- return m_info.internetState == CSysData::CONNECTED;
-- return (m_info.internetState = CSysInfoJob::GetInternetState()) == CSysData::CONNECTED;
-+ return m_info.internetState == CSysData::UNKNOWN;
- }
-
- CStdString CSysInfo::GetHddSpaceInfo(int drive, bool shortText)
-diff --git a/xbmc/windows/GUIWindowSystemInfo.cpp b/xbmc/windows/GUIWindowSystemInfo.cpp
-index 03a23e3..1528939 100644
---- a/xbmc/windows/GUIWindowSystemInfo.cpp
-+++ b/xbmc/windows/GUIWindowSystemInfo.cpp
-@@ -126,7 +126,6 @@ void CGUIWindowSystemInfo::FrameMove()
- SetControlLabel(i++, "%s: %s", 13160, NETWORK_GATEWAY_ADDRESS);
- SetControlLabel(i++, "%s: %s", 13161, NETWORK_DNS1_ADDRESS);
- SetControlLabel(i++, "%s: %s", 20307, NETWORK_DNS2_ADDRESS);
-- SetControlLabel(i++, "%s %s", 13295, SYSTEM_INTERNET_STATE);
- }
- else if (m_section == CONTROL_BT_VIDEO)
- {
---
-1.9.1
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-104-use-udevil-to-umount.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-104-use-udevil-to-umount.patch
deleted file mode 100644
index 86bfb5c4fe..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-104-use-udevil-to-umount.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 855160db446fe0059f072b207d53c15ba18d952f Mon Sep 17 00:00:00 2001
-From: Stefan Saraev
-Date: Thu, 17 Apr 2014 12:12:50 +0300
-Subject: [PATCH] use udevil to umount
-
----
- xbmc/linux/PosixMountProvider.cpp | 2 +-
- xbmc/storage/linux/UDevProvider.cpp | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/xbmc/linux/PosixMountProvider.cpp b/xbmc/linux/PosixMountProvider.cpp
-index 2339709..7001563 100644
---- a/xbmc/linux/PosixMountProvider.cpp
-+++ b/xbmc/linux/PosixMountProvider.cpp
-@@ -131,7 +131,7 @@ bool CPosixMountProvider::Eject(CStdString mountpath)
- {
- // just go ahead and try to umount the disk
- // if it does umount, life is good, if not, no loss.
-- std::string cmd = "umount \"" + mountpath + "\"";
-+ std::string cmd = "udevil umount \"" + mountpath + "\"";
- int status = system(cmd.c_str());
-
- if (status == 0)
-diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp
-index 73aa408..8bd02b6 100644
---- a/xbmc/storage/linux/UDevProvider.cpp
-+++ b/xbmc/storage/linux/UDevProvider.cpp
-@@ -183,7 +183,7 @@ bool CUDevProvider::Eject(CStdString mountpath)
- {
- // just go ahead and try to umount the disk
- // if it does umount, life is good, if not, no loss.
-- std::string cmd = "umount \"" + mountpath + "\"";
-+ std::string cmd = "udevil umount \"" + mountpath + "\"";
- int status = system(cmd.c_str());
-
- if (status == 0)
---
-1.9.1
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-501-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-501-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch
deleted file mode 100644
index d58eeecb9d..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-501-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/xbmc/interfaces/python/XBPython.cpp b/xbmc/interfaces/python/XBPython.cpp
-index 01a129e..07b4878 100644
---- a/xbmc/interfaces/python/XBPython.cpp
-+++ b/xbmc/interfaces/python/XBPython.cpp
-@@ -445,10 +445,9 @@ bool XBPython::InitializeEngine()
- // at http://docs.python.org/using/cmdline.html#environment-variables
-
- #if !defined(TARGET_WINDOWS) && !defined(TARGET_ANDROID)
-- /* PYTHONOPTIMIZE is set off intentionally when using external Python.
-- Reason for this is because we cannot be sure what version of Python
-- was used to compile the various Python object files (i.e. .pyo,
-- .pyc, etc.). */
-+ // Required for python to find optimized code (pyo) files
-+ setenv("PYTHONOPTIMIZE", "1", 1);
-+
- // check if we are running as real xbmc.app or just binary
- if (!CUtil::GetFrameworksPath(true).empty())
- {
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-502-add_openelec.tv_RSS_news-0.1.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-502-add_openelec.tv_RSS_news-0.1.patch
deleted file mode 100644
index f0b08b5e8d..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-502-add_openelec.tv_RSS_news-0.1.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur xbmc-12.0.7/userdata/RssFeeds.xml xbmc-12.0.7.patch/userdata/RssFeeds.xml
---- xbmc-12.0.7/userdata/RssFeeds.xml 2013-03-15 14:25:26.000000000 +0100
-+++ xbmc-12.0.7.patch/userdata/RssFeeds.xml 2013-03-15 14:40:54.695338102 +0100
-@@ -3,6 +3,7 @@
-
-
-
-+ http://feeds.openelec.tv/news
- http://feeds.xbmc.org/xbmc
-
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-990.15-depends-mark_our_wrapped_functions_as_used.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-990.15-depends-mark_our_wrapped_functions_as_used.patch
deleted file mode 100644
index 7e78fbb3b9..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-990.15-depends-mark_our_wrapped_functions_as_used.patch
+++ /dev/null
@@ -1,458 +0,0 @@
-From 0c2eaf5082a30fb06bad553775e805a745d59ee2 Mon Sep 17 00:00:00 2001
-From: theuni
-Date: Tue, 22 Jan 2013 04:09:07 -0500
-Subject: [PATCH] depends: mark our wrapped functions as used
-
-otherwise they get stripped when enabling dead code stripping
----
- xbmc/cores/DllLoader/exports/wrapper.c | 138 ++++++++++++++++-----------------
- 1 file changed, 69 insertions(+), 69 deletions(-)
-
-diff -Naur xbmc-f81d56e/xbmc/cores/DllLoader/exports/wrapper.c xbmc-f81d56e.patch/xbmc/cores/DllLoader/exports/wrapper.c
---- xbmc-f81d56e/xbmc/cores/DllLoader/exports/wrapper.c 2013-05-18 12:30:19.000000000 +0200
-+++ xbmc-f81d56e.patch/xbmc/cores/DllLoader/exports/wrapper.c 2013-05-18 16:55:55.222087716 +0200
-@@ -115,7 +115,7 @@
- int dll_setvbuf(FILE *stream, char *buf, int type, size_t size);
- struct mntent *dll_getmntent(FILE *fp);
-
--void *__wrap_dlopen(const char *filename, int flag)
-+__attribute__((used)) void *__wrap_dlopen(const char *filename, int flag)
- {
- #if defined(TARGET_ANDROID)
- return dll_dlopen(filename, flag);
-@@ -124,213 +124,213 @@
- #endif
- }
-
--FILE *__wrap_popen(const char *command, const char *mode)
-+__attribute__((used)) FILE *__wrap_popen(const char *command, const char *mode)
- {
- return dll_popen(command, mode);
- }
-
--void* __wrap_calloc( size_t num, size_t size )
-+__attribute__((used)) void* __wrap_calloc( size_t num, size_t size )
- {
- return dllcalloc(num, size);
- }
-
--void* __wrap_malloc(size_t size)
-+__attribute__((used)) void* __wrap_malloc(size_t size)
- {
- return dllmalloc(size);
- }
-
--void* __wrap_realloc( void *memblock, size_t size )
-+__attribute__((used)) void* __wrap_realloc( void *memblock, size_t size )
- {
- return dllrealloc(memblock, size);
- }
-
--void __wrap_free( void* pPtr )
-+__attribute__((used)) void __wrap_free( void* pPtr )
- {
- dllfree(pPtr);
- }
-
--int __wrap_open(const char *file, int oflag, ...)
-+__attribute__((used)) int __wrap_open(const char *file, int oflag, ...)
- {
- return dll_open(file, oflag);
- }
-
--int __wrap_open64(const char *file, int oflag, ...)
-+__attribute__((used)) int __wrap_open64(const char *file, int oflag, ...)
- {
- return dll_open(file, oflag);
- }
-
--int __wrap_close(int fd)
-+__attribute__((used)) int __wrap_close(int fd)
- {
- return dll_close(fd);
- }
-
--ssize_t __wrap_write(int fd, const void *buf, size_t count)
-+__attribute__((used)) ssize_t __wrap_write(int fd, const void *buf, size_t count)
- {
- return dll_write(fd, buf, count);
- }
-
--ssize_t __wrap_read(int fd, void *buf, size_t count)
-+__attribute__((used)) ssize_t __wrap_read(int fd, void *buf, size_t count)
- {
- return dll_read(fd, buf, count);
- }
-
--__off_t __wrap_lseek(int fildes, __off_t offset, int whence)
-+__attribute__((used)) __off_t __wrap_lseek(int fildes, __off_t offset, int whence)
- {
- return dll_lseek(fildes, offset, whence);
- }
-
--__off64_t __wrap_lseek64(int fildes, __off64_t offset, int whence)
-+__attribute__((used)) __off64_t __wrap_lseek64(int fildes, __off64_t offset, int whence)
- {
- __off64_t seekRes = dll_lseeki64(fildes, offset, whence);
- return seekRes;
- }
-
--int __wrap_fclose(FILE *fp)
-+__attribute__((used)) int __wrap_fclose(FILE *fp)
- {
- return dll_fclose(fp);
- }
-
--int __wrap_ferror(FILE *stream)
-+__attribute__((used)) int __wrap_ferror(FILE *stream)
- {
- return dll_ferror(stream);
- }
-
--void __wrap_clearerr(FILE *stream)
-+__attribute__((used)) void __wrap_clearerr(FILE *stream)
- {
- return dll_clearerr(stream);
- }
-
--int __wrap_feof(FILE *stream)
-+__attribute__((used)) int __wrap_feof(FILE *stream)
- {
- return dll_feof(stream);
- }
-
--int __wrap_fileno(FILE *stream)
-+__attribute__((used)) int __wrap_fileno(FILE *stream)
- {
- return dll_fileno(stream);
- }
-
--FILE *__wrap_fopen(const char *path, const char *mode)
-+__attribute__((used)) FILE *__wrap_fopen(const char *path, const char *mode)
- {
- return dll_fopen(path, mode);
- }
-
--FILE *__wrap_fopen64(const char *path, const char *mode)
-+__attribute__((used)) FILE *__wrap_fopen64(const char *path, const char *mode)
- {
- return dll_fopen(path, mode);
- }
-
--FILE *__wrap_fdopen(int fildes, const char *mode)
-+__attribute__((used)) FILE *__wrap_fdopen(int fildes, const char *mode)
- {
- return dll_fdopen(fildes, mode);
- }
-
--FILE *__wrap_freopen(const char *path, const char *mode, FILE *stream)
-+__attribute__((used)) FILE *__wrap_freopen(const char *path, const char *mode, FILE *stream)
- {
- return dll_freopen(path, mode, stream);
- }
-
--size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
-+__attribute__((used)) size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
- {
- return dll_fread(ptr, size, nmemb, stream);
- }
-
--size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
-+__attribute__((used)) size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
- {
- return dll_fwrite(ptr, size, nmemb, stream);
- }
-
--int __wrap_fflush(FILE *stream)
-+__attribute__((used)) int __wrap_fflush(FILE *stream)
- {
- return dll_fflush(stream);
- }
-
--int __wrap_fputc(int c, FILE *stream)
-+__attribute__((used)) int __wrap_fputc(int c, FILE *stream)
- {
- return dll_fputc(c, stream);
- }
-
--int __wrap_fputs(const char *s, FILE *stream)
-+__attribute__((used)) int __wrap_fputs(const char *s, FILE *stream)
- {
- return dll_fputs(s, stream);
- }
-
--int __wrap__IO_putc(int c, FILE *stream)
-+__attribute__((used)) int __wrap__IO_putc(int c, FILE *stream)
- {
- return dll_putc(c, stream);
- }
-
--int __wrap_fseek(FILE *stream, long offset, int whence)
-+__attribute__((used)) int __wrap_fseek(FILE *stream, long offset, int whence)
- {
- return dll_fseek(stream, offset, whence);
- }
-
--int __wrap_fseeko64(FILE *stream, off64_t offset, int whence)
-+__attribute__((used)) int __wrap_fseeko64(FILE *stream, off64_t offset, int whence)
- {
- return dll_fseek64(stream, offset, whence);
- }
-
--long __wrap_ftell(FILE *stream)
-+__attribute__((used)) long __wrap_ftell(FILE *stream)
- {
- return dll_ftell(stream);
- }
-
--off64_t __wrap_ftello64(FILE *stream)
-+__attribute__((used)) off64_t __wrap_ftello64(FILE *stream)
- {
- return dll_ftell64(stream);
- }
-
--void __wrap_rewind(FILE *stream)
-+__attribute__((used)) void __wrap_rewind(FILE *stream)
- {
- dll_rewind(stream);
- }
-
--int __wrap_fgetpos(FILE *stream, fpos_t *pos)
-+__attribute__((used)) int __wrap_fgetpos(FILE *stream, fpos_t *pos)
- {
- return dll_fgetpos(stream, pos);
- }
-
--int __wrap_fgetpos64(FILE *stream, fpos64_t *pos)
-+__attribute__((used)) int __wrap_fgetpos64(FILE *stream, fpos64_t *pos)
- {
- return dll_fgetpos64(stream, pos);
- }
-
--int __wrap_fsetpos(FILE *stream, fpos_t *pos)
-+__attribute__((used)) int __wrap_fsetpos(FILE *stream, fpos_t *pos)
- {
- return dll_fsetpos(stream, pos);
- }
-
--int __wrap_fsetpos64(FILE *stream, fpos64_t *pos)
-+__attribute__((used)) int __wrap_fsetpos64(FILE *stream, fpos64_t *pos)
- {
- return dll_fsetpos64(stream, pos);
- }
-
--DIR * __wrap_opendir(const char *name)
-+__attribute__((used)) DIR * __wrap_opendir(const char *name)
- {
- return dll_opendir(name);
- }
-
--struct dirent * __wrap_readdir(DIR* dirp)
-+__attribute__((used)) struct dirent * __wrap_readdir(DIR* dirp)
- {
- return dll_readdir(dirp);
- }
-
--struct dirent * __wrap_readdir64(DIR* dirp)
-+__attribute__((used)) struct dirent * __wrap_readdir64(DIR* dirp)
- {
- return dll_readdir(dirp);
- }
-
--int __wrap_closedir(DIR* dirp)
-+__attribute__((used)) int __wrap_closedir(DIR* dirp)
- {
- return dll_closedir(dirp);
- }
-
--void __wrap_rewinddir(DIR* dirp)
-+__attribute__((used)) void __wrap_rewinddir(DIR* dirp)
- {
- dll_rewinddir(dirp);
- }
-
--int __wrap_fprintf(FILE *stream, const char *format, ...)
-+__attribute__((used)) int __wrap_fprintf(FILE *stream, const char *format, ...)
- {
- int res;
- va_list va;
-@@ -340,12 +340,12 @@
- return res;
- }
-
--int __wrap_vfprintf(FILE *stream, const char *format, va_list ap)
-+__attribute__((used)) int __wrap_vfprintf(FILE *stream, const char *format, va_list ap)
- {
- return dll_vfprintf(stream, format, ap);
- }
-
--int __wrap_printf(const char *format, ...)
-+__attribute__((used)) int __wrap_printf(const char *format, ...)
- {
- int res;
- va_list va;
-@@ -355,42 +355,42 @@
- return res;
- }
-
--int __wrap_fgetc(FILE *stream)
-+__attribute__((used)) int __wrap_fgetc(FILE *stream)
- {
- return dll_fgetc(stream);
- }
-
--char *__wrap_fgets(char *s, int size, FILE *stream)
-+__attribute__((used)) char *__wrap_fgets(char *s, int size, FILE *stream)
- {
- return dll_fgets(s, size, stream);
- }
-
--int __wrap__IO_getc(FILE *stream)
-+__attribute__((used)) int __wrap__IO_getc(FILE *stream)
- {
- return dll_getc(stream);
- }
-
--int __wrap__IO_getc_unlocked(FILE *stream)
-+__attribute__((used)) int __wrap__IO_getc_unlocked(FILE *stream)
- {
- return dll_getc(stream);
- }
-
--int __wrap_getc_unlocked(FILE *stream)
-+__attribute__((used)) int __wrap_getc_unlocked(FILE *stream)
- {
- return dll_getc(stream);
- }
-
--int __wrap_ungetc(int c, FILE *stream)
-+__attribute__((used)) int __wrap_ungetc(int c, FILE *stream)
- {
- return dll_ungetc(c, stream);
- }
-
--int __wrap_getc(FILE *stream)
-+__attribute__((used)) int __wrap_getc(FILE *stream)
- {
- return dll_getc(stream);
- }
-
--int __wrap_ioctl(int d, unsigned long int request, ...)
-+__attribute__((used)) int __wrap_ioctl(int d, unsigned long int request, ...)
- {
- int res;
- va_list va;
-@@ -400,57 +400,57 @@
- return res;
- }
-
--int __wrap__stat(const char *path, struct _stat *buffer)
-+__attribute__((used)) int __wrap__stat(const char *path, struct _stat *buffer)
- {
- return dll_stat(path, buffer);
- }
-
--int __wrap_stat(const char *path, struct _stat *buffer)
-+__attribute__((used)) int __wrap_stat(const char *path, struct _stat *buffer)
- {
- return dll_stat(path, buffer);
- }
-
--int __wrap___xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
-+__attribute__((used)) int __wrap___xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
- {
- return dll_stat64(__filename, __stat_buf);
- }
-
--int __wrap___lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
-+__attribute__((used)) int __wrap___lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
- {
- return dll_stat64(__filename, __stat_buf);
- }
-
--void __wrap_flockfile(FILE *file)
-+__attribute__((used)) void __wrap_flockfile(FILE *file)
- {
- dll_flockfile(file);
- }
-
--int __wrap_ftrylockfile(FILE *file)
-+__attribute__((used)) int __wrap_ftrylockfile(FILE *file)
- {
- return dll_ftrylockfile(file);
- }
-
--void __wrap_funlockfile(FILE *file)
-+__attribute__((used)) void __wrap_funlockfile(FILE *file)
- {
- dll_funlockfile(file);
- }
-
--int __wrap___fxstat64(int ver, int fd, struct stat64 *buf)
-+__attribute__((used)) int __wrap___fxstat64(int ver, int fd, struct stat64 *buf)
- {
- return dll_fstat64(fd, buf);
- }
-
--int __wrap_fstat(int fd, struct _stat *buf)
-+__attribute__((used)) int __wrap_fstat(int fd, struct _stat *buf)
- {
- return dll_fstat(fd, buf);
- }
-
--int __wrap_setvbuf(FILE *stream, char *buf, int type, size_t size)
-+__attribute__((used)) int __wrap_setvbuf(FILE *stream, char *buf, int type, size_t size)
- {
- return dll_setvbuf(stream, buf, type, size);
- }
-
--struct mntent *__wrap_getmntent(FILE *fp)
-+__attribute__((used)) struct mntent *__wrap_getmntent(FILE *fp)
- {
- #ifdef _LINUX
- return dll_getmntent(fp);
-@@ -464,12 +464,12 @@
- // thing to actually call our wrapped functions.
- #if _FORTIFY_SOURCE > 1
-
--size_t __wrap___fread_chk(void * ptr, size_t ptrlen, size_t size, size_t n, FILE * stream)
-+__attribute__((used)) size_t __wrap___fread_chk(void * ptr, size_t ptrlen, size_t size, size_t n, FILE * stream)
- {
- return dll_fread(ptr, size, n, stream);
- }
-
--int __wrap___printf_chk(int flag, const char *format, ...)
-+__attribute__((used)) int __wrap___printf_chk(int flag, const char *format, ...)
- {
- int res;
- va_list va;
-@@ -479,12 +479,12 @@
- return res;
- }
-
--int __wrap___vfprintf_chk(FILE* stream, int flag, const char *format, _G_va_list ap)
-+__attribute__((used)) int __wrap___vfprintf_chk(FILE* stream, int flag, const char *format, _G_va_list ap)
- {
- return dll_vfprintf(stream, format, ap);
- }
-
--int __wrap___fprintf_chk(FILE * stream, int flag, const char *format, ...)
-+__attribute__((used)) int __wrap___fprintf_chk(FILE * stream, int flag, const char *format, ...)
- {
- int res;
- va_list va;
-@@ -494,12 +494,12 @@
- return res;
- }
-
--char *__wrap___fgets_chk(char *s, size_t size, int n, FILE *stream)
-+__attribute__((used)) char *__wrap___fgets_chk(char *s, size_t size, int n, FILE *stream)
- {
- return dll_fgets(s, n, stream);
- }
-
--size_t __wrap___read_chk(int fd, void *buf, size_t nbytes, size_t buflen)
-+__attribute__((used)) size_t __wrap___read_chk(int fd, void *buf, size_t nbytes, size_t buflen)
- {
- return dll_read(fd, buf, nbytes);
- }
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.02-dont-set-_NET_WM_STATE_FULLSCREEN.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.02-dont-set-_NET_WM_STATE_FULLSCREEN.patch
deleted file mode 100644
index 3f331b1574..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.02-dont-set-_NET_WM_STATE_FULLSCREEN.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 4f6188bc2bcee52ab3a150fff336b58c11f8928a Mon Sep 17 00:00:00 2001
-From: Stefan Saraev
-Date: Sat, 22 Mar 2014 22:18:28 +0200
-Subject: [PATCH] dont set _NET_WM_STATE_FULLSCREEN
-
----
- xbmc/windowing/X11/WinSystemX11.cpp | 6 ------
- 1 files changed, 0 insertions(+), 6 deletions(-)
-
-diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
-index c95f4ec..d12e050 100644
---- a/xbmc/windowing/X11/WinSystemX11.cpp
-+++ b/xbmc/windowing/X11/WinSystemX11.cpp
-@@ -903,12 +903,6 @@ bool CWinSystemX11::SetWindow(int width, int height, bool fullscreen, const std:
- InputOutput, vi->visual,
- mask, &swa);
-
-- if (fullscreen && hasWM)
-- {
-- Atom fs = XInternAtom(m_dpy, "_NET_WM_STATE_FULLSCREEN", True);
-- XChangeProperty(m_dpy, m_mainWindow, XInternAtom(m_dpy, "_NET_WM_STATE", True), XA_ATOM, 32, PropModeReplace, (unsigned char *) &fs, 1);
-- }
--
- // define invisible cursor
- Pixmap bitmapNoData;
- XColor black;
---
-1.7.2.5
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.10-disable-minimize.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.10-disable-minimize.patch
deleted file mode 100644
index c0fe5a62ab..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.10-disable-minimize.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-commit 17807066bc04cd28bba89fd176d4d0f69ead9728
-Author: Stefan Saraev
-Date: Sat Oct 12 16:18:50 2013 +0300
-
- disable minimize
-
-diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
-index b5d40c0..18bea9d 100644
---- a/xbmc/Application.cpp
-+++ b/xbmc/Application.cpp
-@@ -5448,7 +5448,6 @@ bool CApplication::SwitchToFullScreen()
-
- void CApplication::Minimize()
- {
-- g_Windowing.Minimize();
- }
-
- PLAYERCOREID CApplication::GetCurrentPlayer()
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.12-run-tzdata-setup-on-timezone-change.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.12-run-tzdata-setup-on-timezone-change.patch
deleted file mode 100644
index 51a7e52381..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.12-run-tzdata-setup-on-timezone-change.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 25be1b385303a8114d7e227ffab52a22de42ccd1 Mon Sep 17 00:00:00 2001
-From: Stefan Saraev
-Date: Tue, 26 Nov 2013 20:53:08 +0200
-Subject: [PATCH] run tzdata-setup on timezone change
-
----
- xbmc/linux/LinuxTimezone.cpp | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/xbmc/linux/LinuxTimezone.cpp b/xbmc/linux/LinuxTimezone.cpp
-index be7bce6..4000181 100644
---- a/xbmc/linux/LinuxTimezone.cpp
-+++ b/xbmc/linux/LinuxTimezone.cpp
-@@ -158,6 +158,9 @@ void CLinuxTimezone::OnSettingChanged(const CSetting *setting)
- const std::string &settingId = setting->GetId();
- if (settingId == "locale.timezone")
- {
-+ const std::string cmd = std::string("sh /usr/lib/openelec/tzdata-setup ") + ((CSettingString*)setting)->GetValue().c_str();
-+ system(cmd.c_str());
-+
- SetTimezone(((CSettingString*)setting)->GetValue());
-
- CDateTime::ResetTimezoneBias();
---
-1.8.3.2
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-999.00-service-addons-use-a-wrapper-to-setup-systemd.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-999.00-service-addons-use-a-wrapper-to-setup-systemd.patch
deleted file mode 100644
index d81adcd3f1..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-999.00-service-addons-use-a-wrapper-to-setup-systemd.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 9c1dea43c9b9b66c48d057d3c0e44cd4a807e4dc Mon Sep 17 00:00:00 2001
-From: Stefan Saraev
-Date: Fri, 20 Dec 2013 00:36:34 +0200
-Subject: [PATCH] service addons: use a wrapper to setup systemd
-
----
- xbmc/addons/AddonDatabase.cpp | 3 +++
- xbmc/addons/AddonInstaller.cpp | 10 ++++++++++
- xbmc/addons/AddonInstaller.h | 2 ++
- 3 files changed, 15 insertions(+)
-
-diff --git a/xbmc/addons/AddonDatabase.cpp b/xbmc/addons/AddonDatabase.cpp
-index 4202363..105749f 100644
---- a/xbmc/addons/AddonDatabase.cpp
-+++ b/xbmc/addons/AddonDatabase.cpp
-@@ -20,6 +20,7 @@
-
- #include "AddonDatabase.h"
- #include "addons/AddonManager.h"
-+#include "addons/AddonInstaller.h"
- #include "utils/log.h"
- #include "utils/Variant.h"
- #include "utils/StringUtils.h"
-@@ -581,6 +582,7 @@ bool CAddonDatabase::DisableAddon(const CStdString &addonID, bool disable /* = t
- boost::shared_ptr service = boost::dynamic_pointer_cast(addon);
- if (service)
- service->Stop();
-+ CAddonInstaller::Get().CallOEWrapper(addonID, true);
- }
- // restart the pvr manager when disabling a pvr add-on with the pvr manager enabled
- else if (CAddonMgr::Get().GetAddon(addonID, addon, ADDON_PVRDLL, false) && addon &&
-@@ -601,6 +603,7 @@ bool CAddonDatabase::DisableAddon(const CStdString &addonID, bool disable /* = t
- // If the addon is a service, start it
- if (CAddonMgr::Get().GetAddon(addonID, addon, ADDON_SERVICE, false) && addon && disabled)
- {
-+ CAddonInstaller::Get().CallOEWrapper(addonID, false);
- boost::shared_ptr service = boost::dynamic_pointer_cast(addon);
- if (service)
- service->Start();
-diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp
-index 8c9f241..d2f4610 100644
---- a/xbmc/addons/AddonInstaller.cpp
-+++ b/xbmc/addons/AddonInstaller.cpp
-@@ -70,6 +70,13 @@ CAddonInstaller &CAddonInstaller::Get()
- return addonInstaller;
- }
-
-+void CAddonInstaller::CallOEWrapper(const std::string& ID, bool disable)
-+{
-+ char cmd[255];
-+ snprintf(cmd, sizeof(cmd), "/usr/lib/openelec/systemd-addon-wrapper %s %d", ID.c_str(), disable);
-+ system(cmd);
-+}
-+
- void CAddonInstaller::OnJobComplete(unsigned int jobID, bool success, CJob* job)
- {
- if (success)
-@@ -586,6 +593,7 @@ bool CAddonInstallJob::OnPreInstall()
- boost::shared_ptr service = boost::dynamic_pointer_cast(addon);
- if (service)
- service->Stop();
-+ CAddonInstaller::Get().CallOEWrapper(m_addon->ID(), true);
- CAddonMgr::Get().RemoveAddon(m_addon->ID()); // remove it
- return running;
- }
-@@ -713,6 +721,7 @@ void CAddonInstallJob::OnPostInstall(bool reloadAddon)
- AddonPtr addon;
- CAddonMgr::Get().GetAddon(m_addon->ID(), addon);
- boost::shared_ptr service = boost::dynamic_pointer_cast(addon);
-+ CAddonInstaller::Get().CallOEWrapper(m_addon->ID(), false);
- if (service)
- service->Start();
- }
-@@ -794,6 +803,7 @@ bool CAddonUnInstallJob::DoWork()
- boost::shared_ptr service = boost::dynamic_pointer_cast(m_addon);
- if (service)
- service->Stop();
-+ CAddonInstaller::Get().CallOEWrapper(m_addon->ID(), true);
- }
-
- AddonPtr repoPtr = CAddonInstallJob::GetRepoForAddon(m_addon);
-diff --git a/xbmc/addons/AddonInstaller.h b/xbmc/addons/AddonInstaller.h
-index 39cab93..2938c7f 100644
---- a/xbmc/addons/AddonInstaller.h
-+++ b/xbmc/addons/AddonInstaller.h
-@@ -29,6 +29,8 @@ class CAddonInstaller : public IJobCallback
- public:
- static CAddonInstaller &Get();
-
-+ void CallOEWrapper(const std::string& ID, bool disable);
-+
- bool IsDownloading() const;
- void GetInstallList(ADDON::VECADDONS &addons) const;
- bool GetProgress(const CStdString &addonID, unsigned int &percent) const;
---
-1.8.3.2
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-999.03-0001-handle-SIGTERM.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-999.03-0001-handle-SIGTERM.patch
deleted file mode 100644
index 6f86040bf5..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-999.03-0001-handle-SIGTERM.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From dbc86891d089a2a871be5a8663e8a5a9a1cffb53 Mon Sep 17 00:00:00 2001
-From: Stefan Saraev
-Date: Thu, 5 Jun 2014 18:50:04 +0300
-Subject: [PATCH] handle SIGTERM
-
-In some situations, due to deadlocks or crashes, xbmc fails to exit properly in
-CApplication::Stop(), so g_powerManager.Reboot() / g_powerManager.Powerdown() never gets
-called, that's a big no-no for openelec as our users can't shutdown or reboot.
-There are few addons reported to cause this behaviour: trakkt.tv, watchdog, weather.underground.
-
-I've also noticed that sometimes new threads (FileCache ??) get started AFTER
-CApplication::Stop() is called, delaying shutdown with 1+ minute (2 curl timeoouts?).
-The problem seems to be in CJobManager::CancelJobs() but I am too lame to understand where,
-why, and how to fix it.
-
-To me, it seems best to let systemd handle it. systemd sends SIGTERM, then waits
-TimeoutStopSec=xx seconds then sends SIGKILL,s so dont call g_application.Stop() from
-ApplicationMessenger as it can not be trusted. save the requested exitcode instead
-(that's required for CEC to switch off the tv) and do it from a simple SIGTERM handler instead.
-
-CEC thread has enough time (5 seconds in xbmc.service) to switch of the TV after receiving OnQuit.
-As a side "effect", now guisettings.xml will ALWAYS be saved, even if shutdown / rebooot
-is requested externaly (ssh, 3rdparty script).
----
- xbmc/Application.cpp | 10 ++++++++--
- xbmc/Application.h | 1 +
- xbmc/ApplicationMessenger.cpp | 6 ++++--
- xbmc/XBApplicationEx.cpp | 1 +
- xbmc/XBApplicationEx.h | 1 +
- xbmc/main/main.cpp | 15 +++++++++++++++
- 6 files changed, 30 insertions(+), 4 deletions(-)
-
-diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
-index 7f1b764..4441969 100644
---- a/xbmc/Application.cpp
-+++ b/xbmc/Application.cpp
-@@ -3493,11 +3493,18 @@ bool CApplication::Cleanup()
- }
- }
-
-+void CApplication::SetExitCode(int exitCode)
-+{
-+ // save it for CEC
-+ m_ExitCode = exitCode;
-+ m_ExitCodeSet = true;
-+}
-+
- void CApplication::Stop(int exitCode)
- {
- try
- {
-- CVariant vExitCode(exitCode);
-+ CVariant vExitCode(m_ExitCode);
- CAnnouncementManager::Get().Announce(System, "xbmc", "OnQuit", vExitCode);
-
- SaveFileState(true);
-@@ -3521,7 +3528,6 @@ void CApplication::Stop(int exitCode)
-
- m_bStop = true;
- m_AppFocused = false;
-- m_ExitCode = exitCode;
- CLog::Log(LOGNOTICE, "stop all");
-
- // cancel any jobs from the jobmanager
-diff --git a/xbmc/Application.h b/xbmc/Application.h
-index 2243f15..97fb316 100644
---- a/xbmc/Application.h
-+++ b/xbmc/Application.h
-@@ -149,6 +149,7 @@ public:
- void StartPVRManager(bool bOpenPVRWindow = false);
- void StopPVRManager();
- bool IsCurrentThread() const;
-+ void SetExitCode(int exitCode);
- void Stop(int exitCode);
- void RestartApp();
- void UnloadSkin(bool forReload = false);
-diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp
-index 3524e89..54a15da 100644
---- a/xbmc/ApplicationMessenger.cpp
-+++ b/xbmc/ApplicationMessenger.cpp
-@@ -259,13 +259,14 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg)
-
- case TMSG_POWERDOWN:
- {
-- g_application.Stop(EXITCODE_POWERDOWN);
-+ g_application.SetExitCode(EXITCODE_POWERDOWN);
- g_powerManager.Powerdown();
- }
- break;
-
- case TMSG_QUIT:
- {
-+ g_application.SetExitCode(EXITCODE_QUIT);
- g_application.Stop(EXITCODE_QUIT);
- }
- break;
-@@ -287,7 +288,7 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg)
- case TMSG_RESTART:
- case TMSG_RESET:
- {
-- g_application.Stop(EXITCODE_REBOOT);
-+ g_application.SetExitCode(EXITCODE_REBOOT);
- g_powerManager.Reboot();
- }
- break;
-@@ -295,6 +296,7 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg)
- case TMSG_RESTARTAPP:
- {
- #if defined(TARGET_WINDOWS) || defined(TARGET_LINUX)
-+ g_application.SetExitCode(EXITCODE_RESTARTAPP);
- g_application.Stop(EXITCODE_RESTARTAPP);
- #endif
- }
-diff --git a/xbmc/XBApplicationEx.cpp b/xbmc/XBApplicationEx.cpp
-index ad6a145..6058938 100644
---- a/xbmc/XBApplicationEx.cpp
-+++ b/xbmc/XBApplicationEx.cpp
-@@ -40,6 +40,7 @@ CXBApplicationEx::CXBApplicationEx()
- m_bStop = false;
- m_AppFocused = true;
- m_ExitCode = EXITCODE_QUIT;
-+ m_ExitCodeSet = false;
- m_renderGUI = false;
- }
-
-diff --git a/xbmc/XBApplicationEx.h b/xbmc/XBApplicationEx.h
-index c46cba1..ed3f35f 100644
---- a/xbmc/XBApplicationEx.h
-+++ b/xbmc/XBApplicationEx.h
-@@ -40,6 +40,7 @@ public:
- // Variables for timing
- bool m_bStop;
- int m_ExitCode;
-+ bool m_ExitCodeSet;
- bool m_AppFocused;
- bool m_renderGUI;
-
-diff --git a/xbmc/main/main.cpp b/xbmc/main/main.cpp
-index ec86426..ad8fe6e 100644
---- a/xbmc/main/main.cpp
-+++ b/xbmc/main/main.cpp
-@@ -40,9 +40,24 @@
- #include "input/linux/LIRC.h"
- #endif
- #include "XbmcContext.h"
-+#include "Application.h"
-+
-+void xbmc_term_handler(int signum)
-+{
-+ CLog::Log(LOGINFO, "Received SIGTERM...");
-+ if (!g_application.m_ExitCodeSet)
-+ g_application.SetExitCode(EXITCODE_RESTARTAPP);
-+ g_application.Stop(EXITCODE_RESTARTAPP);
-+}
-
- int main(int argc, char* argv[])
- {
-+ // SIGTERM handler
-+ struct sigaction action;
-+ memset(&action, 0, sizeof(struct sigaction));
-+ action.sa_handler = xbmc_term_handler;
-+ sigaction(SIGTERM, &action, NULL);
-+
- // set up some xbmc specific relationships
- XBMC::Context context;
-
---
-1.9.1
-
diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-999.90-show_rss-setting_in_standard_group.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-999.90-show_rss-setting_in_standard_group.patch
deleted file mode 100644
index 50186d7813..0000000000
--- a/packages/mediacenter/xbmc-master/patches/xbmc-master-999.90-show_rss-setting_in_standard_group.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur xbmc-13.alpha-536cf62/system/settings/settings.xml xbmc-13.alpha-536cf62.patch/system/settings/settings.xml
---- xbmc-13.alpha-536cf62/system/settings/settings.xml 2014-01-29 18:31:46.000000000 +0100
-+++ xbmc-13.alpha-536cf62.patch/system/settings/settings.xml 2014-01-31 13:12:46.789297639 +0100
-@@ -91,7 +91,7 @@
-
-
-
-- 1
-+ 0
- true
-
-
diff --git a/packages/mediacenter/xbmc-master/profile.d/02-xbmc.conf b/packages/mediacenter/xbmc-master/profile.d/02-xbmc.conf
deleted file mode 100644
index 882e7d0f0a..0000000000
--- a/packages/mediacenter/xbmc-master/profile.d/02-xbmc.conf
+++ /dev/null
@@ -1,29 +0,0 @@
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-# PATH
-for addon in /storage/.xbmc/addons/*/bin /usr/lib/xbmc/addons/*/bin; do
- [ -d "$addon" ] && PATH="$PATH:$addon"
-done
-export PATH
-
-# LD_LIBRARY_PATH
-for addon in /storage/.xbmc/addons/*/lib /usr/lib/xbmc/addons/*/lib; do
- [ -d "$addon" ] && LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$addon"
-done
-export LD_LIBRARY_PATH
diff --git a/packages/mediacenter/xbmc-master/profile.d/03-addons.conf b/packages/mediacenter/xbmc-master/profile.d/03-addons.conf
deleted file mode 100644
index 16a8159967..0000000000
--- a/packages/mediacenter/xbmc-master/profile.d/03-addons.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-oe_setup_addon() {
- if [ ! -z $1 ] ; then
- DEF="/storage/.xbmc/addons/$1/settings-default.xml"
- CUR="/storage/.xbmc/userdata/addon_data/$1/settings.xml"
-
- # export some useful variables
- ADDON_DIR="$HOME/.xbmc/addons/$1"
- ADDON_HOME="$HOME/.xbmc/userdata/addon_data/$1"
- ADDON_LOG_FILE="$ADDON_HOME/service.log"
-
- [ ! -d $ADDON_HOME ] && mkdir -p $ADDON_HOME
-
- # copy defaults
- if [ -f "$DEF" -a ! -f "$CUR" ] ; then
- cp "$DEF" "$CUR"
- fi
-
- # parse config
- [ -f "$DEF" ] && eval $(cat "$DEF" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d')
- [ -f "$CUR" ] && eval $(cat "$CUR" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d')
- fi
-}
diff --git a/packages/mediacenter/xbmc-master/scripts/cputemp b/packages/mediacenter/xbmc-master/scripts/cputemp
deleted file mode 100755
index aacdedb2af..0000000000
--- a/packages/mediacenter/xbmc-master/scripts/cputemp
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-# inspired by
-# https://github.com/xtranophilist/gnome-shell-extension-cpu-temperature/blob/master/extension.js
-
-TEMP=0
-
-if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then
- if which lspci >/dev/null; then
- if lspci -n | grep 0300 | grep -q 10de; then
- [ -x /usr/bin/nvidia-smi ] && TEMP=`/usr/bin/nvidia-smi -q -x | grep '' | awk '{ print $1 }' | sed 's,,,g'`
- fi
- fi
-fi
-
-if [ "$1" = "cpu" -o "$TEMP" = "0" ]; then
- if [ -f /sys/class/hwmon/hwmon1/temp1_input ]; then
- # used on Asus systems (ie. AT5IONT-I)
- TEMP=`cat /sys/class/hwmon/hwmon1/temp1_input`
- elif [ -f /sys/devices/platform/coretemp.0/temp1_input ]; then
- # used with coretemp
- TEMP=`cat /sys/devices/platform/coretemp.0/temp1_input`
- elif [ -f /sys/devices/platform/coretemp.0/temp2_input ]; then
- # used with coretemp
- TEMP=`cat /sys/devices/platform/coretemp.0/temp2_input`
- elif [ -f /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp ]; then
- # used on some intel systems
- TEMP=`cat /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp`
- elif [ -f /sys/devices/virtual/thermal/thermal_zone0/temp ]; then
- # used on some intel systems
- TEMP=`cat /sys/devices/virtual/thermal/thermal_zone0/temp`
- elif [ -f /sys/class/hwmon/hwmon0/temp1_input ]; then
- # hwmon for new 2.6.39, 3.0 linux kernels
- TEMP=`cat /sys/class/hwmon/hwmon0/temp1_input`
- elif [ -f /sys/class/hwmon/hwmon0/device/temp1_input ]; then
- # used on AMD systems
- TEMP=`cat /sys/class/hwmon/hwmon0/device/temp1_input`
- elif [ -f /sys/class/hwmon/hwmon0/device/temp2_input ]; then
- # used on ION systems
- TEMP=`cat /sys/class/hwmon/hwmon0/device/temp2_input`
- elif [ -f /sys/class/thermal/thermal_zone0/temp ]; then
- # used on RaspberryPi
- TEMP=`cat /sys/class/thermal/thermal_zone0/temp`
- fi
-
- TEMP="$(( $TEMP / 1000 ))"
-fi
-
-echo "${TEMP} C"
diff --git a/packages/mediacenter/xbmc-master/scripts/setwakeup.sh b/packages/mediacenter/xbmc-master/scripts/setwakeup.sh
deleted file mode 100755
index 76aa3d7c26..0000000000
--- a/packages/mediacenter/xbmc-master/scripts/setwakeup.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-if [ -f /sys/class/rtc/rtc0/wakealarm ]; then
- logger -t setwakeup.sh "### Setting system wakeup time ###"
- echo 0 > /sys/class/rtc/rtc0/wakealarm
- echo $1 > /sys/class/rtc/rtc0/wakealarm
- logger -t setwakeup.sh "### $(cat /proc/driver/rtc) ###"
-fi
diff --git a/packages/mediacenter/xbmc-master/scripts/systemd-addon-wrapper b/packages/mediacenter/xbmc-master/scripts/systemd-addon-wrapper
deleted file mode 100755
index e963c61af9..0000000000
--- a/packages/mediacenter/xbmc-master/scripts/systemd-addon-wrapper
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-if [ ! -d /storage/.config/system.d ] ; then
- mkdir -p /storage/.config/system.d
-fi
-
-if [ -f "/storage/.xbmc/addons/$1/system.d/$1.service" ] ; then
- if [ $2 -eq 1 ] ; then
- # disable = true: cleanup
- systemctl stop "$1.service"
- systemctl disable "/storage/.xbmc/addons/$1/system.d/$1.service"
- else
- # disable = false: setup
- systemctl enable "/storage/.xbmc/addons/$1/system.d/$1.service"
- systemctl start "$1.service"
- fi
-fi
diff --git a/packages/mediacenter/xbmc-master/scripts/xbmc-config b/packages/mediacenter/xbmc-master/scripts/xbmc-config
deleted file mode 100755
index 1ad05bf38e..0000000000
--- a/packages/mediacenter/xbmc-master/scripts/xbmc-config
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-if [ -e /run/lirc/lircd.irtrans ]; then
- XBMC_ARGS="--lircdev /run/lirc/lircd.irtrans"
-else
- XBMC_ARGS="--lircdev /run/lirc/lircd"
-fi
-
-echo "XBMC_ARGS=\"$XBMC_ARGS\"" > /run/openelec/xbmc.conf
diff --git a/packages/mediacenter/xbmc-master/scripts/xbmc-hacks b/packages/mediacenter/xbmc-master/scripts/xbmc-hacks
deleted file mode 100755
index 2fabd47a19..0000000000
--- a/packages/mediacenter/xbmc-master/scripts/xbmc-hacks
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-# hack: make addon-bins executable
- chmod +x /storage/.xbmc/addons/*/bin/*
-
-# hack: update RSSnews.xml in userdata
- if [ -f /storage/.xbmc/userdata/RssFeeds.xml ]; then
- sed -e "s,http://openelec.tv/news?format=feed&type=rss,http://feeds.openelec.tv/news,g" \
- -i /storage/.xbmc/userdata/RssFeeds.xml
- fi
diff --git a/packages/mediacenter/xbmc-master/scripts/xbmc-sources b/packages/mediacenter/xbmc-master/scripts/xbmc-sources
deleted file mode 100755
index 12fa659a8f..0000000000
--- a/packages/mediacenter/xbmc-master/scripts/xbmc-sources
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-. /etc/profile
-
-#
-# setup XBMC sources
-#
-
- if [ ! -f $HOME/.xbmc/userdata/sources.xml ]; then
- if [ -f /usr/share/xbmc/config/sources.xml ]; then
- # include project specific sources
- cp /usr/share/xbmc/config/sources.xml $HOME/.xbmc/userdata
- else
- cat > $HOME/.xbmc/userdata/sources.xml << EOF
-
-
-
-
-
- Music
- $HOME/music/
-
-
-
-
-
- Pictures
- $HOME/pictures/
-
-
-
-EOF
- fi
- fi
-
-#
-# common setup guisettings
-#
-
- if [ ! -f $HOME/.xbmc/userdata/guisettings.xml ] ; then
- echo "" > $HOME/.xbmc/userdata/guisettings.xml
-
- cat >> $HOME/.xbmc/userdata/guisettings.xml << EOF
-
- $HOME/screenshots/
-
-EOF
-
- #
- # include project specific options
- #
-
- if [ -f /usr/share/xbmc/config/guisettings.xml ]; then
- cat /usr/share/xbmc/config/guisettings.xml >> $HOME/.xbmc/userdata/guisettings.xml
- fi
-
- echo "" >> $HOME/.xbmc/userdata/guisettings.xml
- fi
diff --git a/packages/mediacenter/xbmc-master/sleep.d.serial/10-addon-sleep.sh b/packages/mediacenter/xbmc-master/sleep.d.serial/10-addon-sleep.sh
deleted file mode 100755
index e44529791e..0000000000
--- a/packages/mediacenter/xbmc-master/sleep.d.serial/10-addon-sleep.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-. /etc/profile
-
-# see https://wiki.archlinux.org/index.php/Power_Management#Hooks_in_.2Fusr.2Flib.2Fsystemd.2Fsystem-sleep
-
-for script in $HOME/.xbmc/addons/*/sleep.d/*.power; do
- progress "running addon sleep script $script ($@)..."
- sh $script $@
-done
-
-exit 0
\ No newline at end of file
diff --git a/packages/mediacenter/xbmc-master/sleep.d.serial/20-custon-sleep.sh b/packages/mediacenter/xbmc-master/sleep.d.serial/20-custon-sleep.sh
deleted file mode 100755
index 3ad0e0c04e..0000000000
--- a/packages/mediacenter/xbmc-master/sleep.d.serial/20-custon-sleep.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2013 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-. /etc/profile
-
-# see https://wiki.archlinux.org/index.php/Power_Management#Hooks_in_.2Fusr.2Flib.2Fsystemd.2Fsystem-sleep
-
-for script in $HOME/.config/sleep.d/*.power; do
- if [ -f $script ]; then
- progress "running custom sleep script $script ($@)..."
- sh $script $@
- fi
-done
-
-exit 0
\ No newline at end of file
diff --git a/packages/mediacenter/xbmc-master/sleep.d/openelec-sleep.sh b/packages/mediacenter/xbmc-master/sleep.d/openelec-sleep.sh
deleted file mode 100755
index 6b314cd7bd..0000000000
--- a/packages/mediacenter/xbmc-master/sleep.d/openelec-sleep.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# OpenELEC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenELEC. If not, see .
-################################################################################
-
-. /etc/profile
-
-run_scripts()
-{
- list_scripts $1
- for script in $SCRIPTS ; do
- progress "running sleep script $script ($1)..."
- sh /usr/lib/systemd/system-sleep.serial/$script $1
- done
-}
-
-list_scripts()
-{
- case $1 in
- pre)
- SCRIPTS=$(ls /usr/lib/systemd/system-sleep.serial/ | sort)
- ;;
- post)
- SCRIPTS=$(ls /usr/lib/systemd/system-sleep.serial/ | sort -r)
- ;;
- esac
-}
-
-run_scripts $1
-
-exit 0
diff --git a/packages/mediacenter/xbmc-master/splash/splash.png b/packages/mediacenter/xbmc-master/splash/splash.png
deleted file mode 100644
index 6b2897b0a1..0000000000
Binary files a/packages/mediacenter/xbmc-master/splash/splash.png and /dev/null differ
diff --git a/packages/mediacenter/xbmc-master/splash/splash1.png b/packages/mediacenter/xbmc-master/splash/splash1.png
deleted file mode 100644
index ac0aa0052f..0000000000
Binary files a/packages/mediacenter/xbmc-master/splash/splash1.png and /dev/null differ
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-autostart.service b/packages/mediacenter/xbmc-master/system.d/xbmc-autostart.service
deleted file mode 100644
index 2e98307e0f..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-autostart.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=XBMC user autostart script
-Before=xbmc.service
-After=graphical.target
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=-/bin/sh -c ". /etc/profile; exec /bin/sh /storage/.config/autostart.sh"
-RemainAfterExit=yes
-
-[Install]
-WantedBy=xbmc.service
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-cleanlogs.service b/packages/mediacenter/xbmc-master/system.d/xbmc-cleanlogs.service
deleted file mode 100644
index 9faab0eec2..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-cleanlogs.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=XBMC clean debug logs
-ConditionKernelCommandLine=!debugging
-ConditionPathExists=!/storage/.cache/debug.openelec
-Before=xbmc.service
-
-[Service]
-Type=oneshot
-ExecStart=-/bin/sh -c 'rm -rf /storage/.xbmc/userdata/addon_data/*/*.log /storage/.xbmc/userdata/addon_data/*/log/*'
-RemainAfterExit=yes
-
-[Install]
-WantedBy=xbmc.service
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-config.service b/packages/mediacenter/xbmc-master/system.d/xbmc-config.service
deleted file mode 100644
index cb0f33faf8..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-config.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=XBMC configfile writer
-Before=xbmc.service
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=/usr/lib/xbmc/xbmc-config
-RemainAfterExit=yes
-
-[Install]
-WantedBy=xbmc.service
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-hacks.service b/packages/mediacenter/xbmc-master/system.d/xbmc-hacks.service
deleted file mode 100644
index efb48a6ac3..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-hacks.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=XBMC hacks
-Before=xbmc.service
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=/usr/lib/xbmc/xbmc-hacks
-RemainAfterExit=yes
-
-[Install]
-WantedBy=xbmc.service
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-halt.service b/packages/mediacenter/xbmc-master/system.d/xbmc-halt.service
deleted file mode 100644
index 16ab30c50e..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-halt.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=XBMC halt script
-After=xbmc.service
-Before=systemd-halt.service
-DefaultDependencies=no
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=-/bin/sh /storage/.config/shutdown.sh halt
-RemainAfterExit=yes
-
-[Install]
-WantedBy=halt.target
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-lirc-suspend.service b/packages/mediacenter/xbmc-master/system.d/xbmc-lirc-suspend.service
deleted file mode 100644
index f229b6b193..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-lirc-suspend.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=LIRC sleep hook
-Before=sleep.target
-StopWhenUnneeded=yes
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=-/usr/bin/xbmc-send --host=127.0.0.1 -a "LIRC.Stop"
-ExecStop=-/usr/bin/xbmc-send --host=127.0.0.1 -a "LIRC.Start"
-
-[Install]
-WantedBy=sleep.target
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-poweroff.service b/packages/mediacenter/xbmc-master/system.d/xbmc-poweroff.service
deleted file mode 100644
index 8a607da56a..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-poweroff.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=XBMC poweroff script
-After=xbmc.service
-Before=systemd-poweroff.service
-DefaultDependencies=no
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=-/bin/sh /storage/.config/shutdown.sh poweroff
-RemainAfterExit=yes
-
-[Install]
-WantedBy=poweroff.target
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-reboot.service b/packages/mediacenter/xbmc-master/system.d/xbmc-reboot.service
deleted file mode 100644
index 7ee1d5dabe..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-reboot.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=XBMC reboot script
-After=xbmc.service
-Before=systemd-reboot.service
-DefaultDependencies=no
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=-/bin/sh /storage/.config/shutdown.sh reboot
-RemainAfterExit=yes
-
-[Install]
-WantedBy=reboot.target
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-sources.service b/packages/mediacenter/xbmc-master/system.d/xbmc-sources.service
deleted file mode 100644
index 48e6dfb8a7..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-sources.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=XBMC sources Setup
-Before=xbmc.service
-
-[Service]
-Type=oneshot
-Environment=HOME=/storage
-ExecStart=/usr/lib/xbmc/xbmc-sources
-RemainAfterExit=yes
-
-[Install]
-WantedBy=xbmc.service
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc-waitonnetwork.service b/packages/mediacenter/xbmc-master/system.d/xbmc-waitonnetwork.service
deleted file mode 100644
index dc27a793ee..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc-waitonnetwork.service
+++ /dev/null
@@ -1,17 +0,0 @@
-[Unit]
-Description=Wait on network
-After=connman.service
-Before=xorg.service fbset.service
-
-ConditionPathExists=/storage/.cache/openelec/network_wait
-
-[Service]
-Type=oneshot
-EnvironmentFile=/storage/.cache/openelec/network_wait
-ExecStartPre=/bin/sh -c 'echo "waiting on Network to come online ... (max. $WAIT_NETWORK_TIME sec.)"
-ExecStart=/usr/bin/cm-online ${WAIT_NETWORK_TIME}
-StandardOutput=tty
-RemainAfterExit=yes
-
-[Install]
-WantedBy=xbmc.service
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc.service b/packages/mediacenter/xbmc-master/system.d/xbmc.service
deleted file mode 100644
index 545d31c62e..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc.service
+++ /dev/null
@@ -1,21 +0,0 @@
-[Unit]
-Description=XBMC Media Center
-After=graphical.target
-Requires=graphical.target
-
-[Service]
-Environment=DISPLAY=:0.0
-Environment=SDL_MOUSE_RELATIVE=0
-Environment=HOME=/storage
-EnvironmentFile=-/run/openelec/xbmc.conf
-EnvironmentFile=-/run/openelec/debug/xbmc.conf
-ExecStart=/bin/sh -c ". /etc/profile; exec /usr/lib/xbmc/xbmc.bin --standalone -fs $XBMC_ARGS $XBMC_DEBUG"
-# keep KillMode=process unless there is no good reason to switch to cgroup
-KillMode=process
-TimeoutStopSec=5
-Restart=always
-RestartSec=2
-StartLimitInterval=0
-
-[Install]
-WantedBy=xbmc.target
diff --git a/packages/mediacenter/xbmc-master/system.d/xbmc.target b/packages/mediacenter/xbmc-master/system.d/xbmc.target
deleted file mode 100644
index 02e0fc0c82..0000000000
--- a/packages/mediacenter/xbmc-master/system.d/xbmc.target
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=XBMC Mediacenter Interface
-Requires=multi-user.target graphical.target
-After=graphical.target
-Conflicts=rescue.target
-AllowIsolate=yes
-
-[Install]
-Alias=default.target
diff --git a/packages/mediacenter/xbmc/package.mk b/packages/mediacenter/xbmc/package.mk
index ab80709d05..2b9070d07c 100644
--- a/packages/mediacenter/xbmc/package.mk
+++ b/packages/mediacenter/xbmc/package.mk
@@ -17,13 +17,14 @@
################################################################################
PKG_NAME="xbmc"
-PKG_VERSION="13-6d3bb09"
+PKG_VERSION="14-67f025d"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.xbmc.org"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
-PKG_DEPENDS_TARGET="toolchain boost Python zlib bzip2 systemd pciutils lzo pcre swig:host libass enca curl rtmpdump fontconfig fribidi gnutls tinyxml libjpeg-turbo libpng tiff freetype jasper libmad libsamplerate libogg libcdio libmodplug flac libmpeg2 taglib libxml2 libxslt yajl sqlite libvorbis"
+PKG_DEPENDS_TARGET="toolchain boost Python zlib bzip2 systemd pciutils lzo pcre swig:host libass enca curl rtmpdump fontconfig fribidi tinyxml libjpeg-turbo libpng tiff freetype jasper libogg libcdio libmodplug libmpeg2 taglib libxml2 libxslt yajl sqlite libvorbis ffmpeg xbmc:host"
+PKG_DEPENDS_HOST="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="mediacenter"
PKG_SHORTDESC="xbmc: XBMC Mediacenter"
@@ -176,13 +177,6 @@ if [ "$FAAC_SUPPORT" = yes ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET faac"
fi
-if [ "$ENCODER_LAME" = yes ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET lame"
- XBMC_LAMEENC="--enable-libmp3lame"
-else
- XBMC_LAMEENC="--disable-libmp3lame"
-fi
-
if [ "$BLURAY_SUPPORT" = yes ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libbluray"
XBMC_BLURAY="--enable-libbluray"
@@ -301,11 +295,6 @@ else
XBMC_CRYSTALHD="--disable-crystalhd"
fi
-if [ "$TARGET_ARCH" = "i386" -o "$TARGET_ARCH" = "x86_64" ]; then
-# TODO: hack to for including FM patch on x86, rework this in OpenELEC-5.0
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET ffmpeg"
-fi
-
export CXX_FOR_BUILD="$HOST_CXX"
export CC_FOR_BUILD="$HOST_CC"
export CXXFLAGS_FOR_BUILD="$HOST_CXXFLAGS"
@@ -320,8 +309,6 @@ export ac_python_version="$PYTHON_VERSION"
PKG_CONFIGURE_OPTS_TARGET="gl_cv_func_gettimeofday_clobber=no \
ac_cv_lib_bluetooth_hci_devid=no \
- --with-arch=$TARGET_ARCH \
- --with-cpu=$TARGET_CPU \
--disable-debug \
--disable-optimizations \
$XBMC_OPENGL \
@@ -331,8 +318,6 @@ PKG_CONFIGURE_OPTS_TARGET="gl_cv_func_gettimeofday_clobber=no \
$XBMC_VDPAU \
$XBMC_VAAPI \
$XBMC_CRYSTALHD \
- --disable-xvba \
- --disable-vdadecoder \
--disable-vtbdecoder \
--disable-tegra \
--disable-profiling \
@@ -356,8 +341,6 @@ PKG_CONFIGURE_OPTS_TARGET="gl_cv_func_gettimeofday_clobber=no \
$XBMC_AFP \
--enable-libvorbisenc \
--disable-libcap \
- --enable-ffmpeg-libvorbis \
- $XBMC_LAMEENC \
$XBMC_DVDCSS \
--disable-mid \
--disable-hal \
@@ -372,11 +355,24 @@ PKG_CONFIGURE_OPTS_TARGET="gl_cv_func_gettimeofday_clobber=no \
$XBMC_WEBSERVER \
$XBMC_OPTICAL \
$XBMC_BLURAY \
- --enable-texturepacker --with-texturepacker-root="$ROOT/$TOOLCHAIN" \
- --disable-external-libraries \
+ --enable-texturepacker \
$XBMC_CODEC \
$XBMC_PLAYER"
+pre_configure_host() {
+# xbmc fails to build in subdirs
+ cd $ROOT/$PKG_BUILD
+ rm -rf .$HOST_NAME
+}
+
+make_host() {
+ make -C tools/depends/native/JsonSchemaBuilder
+}
+
+makeinstall_host() {
+ cp -PR tools/depends/native/JsonSchemaBuilder/native/JsonSchemaBuilder $ROOT/$TOOLCHAIN/bin
+}
+
pre_build_target() {
# adding fake Makefile for stripped skin
mkdir -p $PKG_BUILD/addons/skin.confluence/media
@@ -400,6 +396,8 @@ pre_configure_target() {
export CFLAGS="$CFLAGS $XBMC_CFLAGS"
export CXXFLAGS="$CXXFLAGS $XBMC_CXXFLAGS"
export LIBS="$LIBS -lz"
+
+ export JSON_BUILDER=$ROOT/$TOOLCHAIN/bin/JsonSchemaBuilder
}
make_target() {
@@ -516,5 +514,4 @@ post_install() {
enable_service xbmc-waitonnetwork.service
enable_service xbmc.service
enable_service xbmc-lirc-suspend.service
- enable_service display-manager.service
}
diff --git a/packages/mediacenter/xbmc/patches/x86/xbmc-995.01-fernetmenta-fixes.patch b/packages/mediacenter/xbmc/patches/x86/xbmc-995.01-fernetmenta-fixes.patch
deleted file mode 100644
index 861125cecd..0000000000
--- a/packages/mediacenter/xbmc/patches/x86/xbmc-995.01-fernetmenta-fixes.patch
+++ /dev/null
@@ -1,23576 +0,0 @@
-From b4096af7aaae5c6090b61b30189d0d79c0dcb6a0 Mon Sep 17 00:00:00 2001
-From: wsnipex
-Date: Sat, 18 Jan 2014 12:51:47 +0100
-Subject: [PATCH 001/122] [depends] move ffmpeg to unified deps
-
----
- tools/depends/target/Makefile | 4 +-
- tools/depends/target/ffmpeg/FFMPEG-VERSION | 5 ++
- tools/depends/target/ffmpeg/Makefile | 80 ++++++++++++++++++++++++++++++
- 3 files changed, 88 insertions(+), 1 deletion(-)
- create mode 100644 tools/depends/target/ffmpeg/FFMPEG-VERSION
- create mode 100644 tools/depends/target/ffmpeg/Makefile
-
-diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile
-index 4588917..1d5f129 100644
---- a/tools/depends/target/Makefile
-+++ b/tools/depends/target/Makefile
-@@ -15,7 +15,7 @@ DEPENDS = \
- python26 afpfs-ng libshairplay \
- libplist libcec libbluray boost tinyxml dummy-libxbmc \
- libamplayer libssh taglib xbmc-pvr-addons libusb libnfs libmp3lame \
-- pythonmodule-pil libxslt
-+ pythonmodule-pil libxslt ffmpeg
-
- ifeq ($(ENABLE_GPLV3),1)
- DEPENDS+=samba-gplv3 libcdio-gplv3
-@@ -60,6 +60,7 @@ ifeq ($(OS),linux)
- DEPENDS += alsa-lib libsdl linux-system-libs
- ALSA_LIB = alsa-lib
- LINUX_SYSTEM_LIBS = linux-system-libs
-+ FFMPEG_DEPENDS = gnutls
- endif
- endif
-
-@@ -96,6 +97,7 @@ nettle: gmp
- pythonmodule-pil: $(ZLIB) libjpeg-turbo libpng freetype2 python26
- libsdl: $(LINUX_SYSTEM_LIBS)
- libxslt: libgcrypt
-+ffmpeg: $(ICONV) $(ZLIB) bzip2 libvorbis $(FFMPEG_DEPENDS)
-
- .installed-$(PLATFORM): $(DEPENDS)
- touch $@
-diff --git a/tools/depends/target/ffmpeg/FFMPEG-VERSION b/tools/depends/target/ffmpeg/FFMPEG-VERSION
-new file mode 100644
-index 0000000..850943e
---- /dev/null
-+++ b/tools/depends/target/ffmpeg/FFMPEG-VERSION
-@@ -0,0 +1,5 @@
-+LIBNAME=ffmpeg
-+BASE_URL=https://github.com/FernetMenta/FFmpeg/archive
-+VERSION=11086c540305ffb208e6fc17d301db989d3c4151
-+ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz
-+
-diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile
-new file mode 100644
-index 0000000..8b95d5c
---- /dev/null
-+++ b/tools/depends/target/ffmpeg/Makefile
-@@ -0,0 +1,80 @@
-+include ../../Makefile.include
-+include FFMPEG-VERSION
-+DEPS= ../../Makefile.include FFMPEG-VERSION Makefile
-+
-+# set to "yes" to enable patching
-+# we don't apply patches until we move to a vanilla ffmpeg tarball
-+APPLY_PATCHES=no
-+
-+# configuration settings
-+ffmpg_config = --prefix=$(PREFIX)
-+ffmpg_config += --cc=$(CC) --cxx=$(CXX)
-+ffmpg_config += --disable-devices --disable-doc
-+ffmpg_config += --disable-ffplay --disable-ffmpeg
-+ffmpg_config += --disable-ffprobe --disable-ffserver
-+ffmpg_config += --enable-gpl --enable-runtime-cpudetect
-+ffmpg_config += --enable-postproc --enable-pthreads
-+ffmpg_config += --enable-muxer=spdif --enable-muxer=adts
-+ffmpg_config += --enable-muxer=asf --enable-muxer=ipod
-+ffmpg_config += --enable-encoder=ac3 --enable-encoder=aac
-+ffmpg_config += --enable-encoder=wmav2 --enable-protocol=http
-+ifeq ($(CROSS_COMPILING), yes)
-+ ffmpg_config += --arch=$(CPU) --enable-cross-compile
-+endif
-+ifeq ($(OS), linux)
-+ ffmpg_config += --target-os=$(OS) --cpu=$(CPU)
-+ ffmpg_config += --enable-vdpau --enable-vaapi --enable-gnutls
-+ ffmpg_config += --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis
-+endif
-+ifeq ($(OS), android)
-+ ifeq ($(findstring arm, $(CPU)), arm)
-+ ffmpg_config += --cpu=cortex-a9
-+ else
-+ ffmpg_config += --cpu=i686 --disable-mmx
-+ endif
-+ ffmpg_config += --target-os=linux
-+endif
-+ifeq ($(OS), ios)
-+ ffmpg_config += --cpu=cortex-a8 --yasmexe=$(NATIVEPREFIX)/bin/yasm
-+ ffmpg_config += --disable-decoder=mpeg_xvmc --enable-vda --disable-crystalhd
-+endif
-+ifeq ($(OS), osx)
-+ ffmpg_config += --disable-decoder=mpeg_xvmc --enable-vda --disable-crystalhd
-+endif
-+ifeq ($(findstring arm, $(CPU)), arm)
-+ ffmpg_config += --enable-pic --disable-armv5te --disable-armv6t2
-+endif
-+ifeq ($(Configuration), Release)
-+ ffmpg_config += --disable-debug
-+endif
-+
-+
-+CLEAN_FILES=$(ARCHIVE) $(PLATFORM)
-+
-+all: .installed-$(PLATFORM)
-+
-+$(TARBALLS_LOCATION)/$(ARCHIVE):
-+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) -Ls --create-dirs -f -o $(TARBALLS_LOCATION)/$(ARCHIVE) $(BASE_URL)/$(VERSION).tar.gz
-+
-+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
-+ rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
-+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
-+ cd $(PLATFORM); sed -i "s%pkg_config_default=pkg-config%export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig\npkg_config_default=$(NATIVEPREFIX)/bin/pkg-config%" configure
-+ cd $(PLATFORM);\
-+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
-+ ./configure $(ffmpg_config)
-+
-+build: $(PLATFORM)
-+ $(MAKE) -C $(PLATFORM)
-+
-+.installed-$(PLATFORM): build
-+ $(MAKE) -C $(PLATFORM) install
-+ touch $@
-+
-+clean:
-+ $(MAKE) -C $(PLATFORM) clean
-+ rm -f .installed-$(PLATFORM)
-+
-+distclean::
-+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
-+
---
-1.9.3
-
-
-From 66d38435ffb7734bfbfdfc5657ba93ff1b61e5ba Mon Sep 17 00:00:00 2001
-From: wsnipex
-Date: Sat, 18 Jan 2014 21:58:35 +0100
-Subject: [PATCH 002/122] [configure] remove internal ffmpeg
-
----
- Makefile.in | 14 +-
- Makefile.include.in | 3 -
- configure.in | 337 ++++++++++---------------------
- tools/depends/target/ffmpeg/autobuild.sh | 166 +++++++++++++++
- 4 files changed, 282 insertions(+), 238 deletions(-)
- create mode 100755 tools/depends/target/ffmpeg/autobuild.sh
-
-diff --git a/Makefile.in b/Makefile.in
-index 754f153..bb83339 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -473,13 +473,13 @@ DYNOBJSXBMC+= xbmc/freebsd/freebsd.a
- endif
-
- ifeq (@USE_STATIC_FFMPEG@,1)
--FFMPEGOBJS = lib/ffmpeg/libavcodec/libavcodec.a \
-- lib/ffmpeg/libavfilter/libavfilter.a \
-- lib/ffmpeg/libswresample/libswresample.a \
-- lib/ffmpeg/libavformat/libavformat.a \
-- lib/ffmpeg/libavutil/libavutil.a \
-- lib/ffmpeg/libpostproc/libpostproc.a \
-- lib/ffmpeg/libswscale/libswscale.a
-+FFMPEGOBJS = @FFMPEG_LIBDIR@/libavcodec.a \
-+ @FFMPEG_LIBDIR@/libavfilter.a \
-+ @FFMPEG_LIBDIR@/libswresample.a \
-+ @FFMPEG_LIBDIR@/libavformat.a \
-+ @FFMPEG_LIBDIR@/libavutil.a \
-+ @FFMPEG_LIBDIR@/libpostproc.a \
-+ @FFMPEG_LIBDIR@/libswscale.a
- DYNOBJSXBMC+= $(FFMPEGOBJS)
- LIBS+= @GNUTLS_ALL_LIBS@ @VORBISENC_ALL_LIBS@ @HOGWEED_ALL_LIBS@
-
-diff --git a/Makefile.include.in b/Makefile.include.in
-index 3452dd9..b409aec 100644
---- a/Makefile.include.in
-+++ b/Makefile.include.in
-@@ -44,9 +44,6 @@ INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.addon
- INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.pvr
- INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.codec
- INCLUDES+=$(sort @INCLUDES@)
--ifneq (@USE_EXTERNAL_FFMPEG@,1)
-- INCLUDES+=-I@abs_top_srcdir@/lib/ffmpeg
--endif
- INCLUDES+=-I@abs_top_srcdir@/xbmc/linux
- INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer
- DEFINES+= \
-diff --git a/configure.in b/configure.in
-index b5ac25e..1a49651 100644
---- a/configure.in
-+++ b/configure.in
-@@ -188,13 +188,16 @@ libusb_disabled_udev_found="== libusb disabled. =="
- libcec_enabled="== libcec enabled. =="
- libcec_disabled="== libcec disabled. CEC adapter support will not be available. =="
-
--# External library message strings
--external_libraries_enabled="== Use of all supported external libraries enabled. =="
--external_libraries_disabled="== Use of all supported external libraries disabled. =="
- dashes="------------------------"
- final_message="\n XBMC Configuration:"
- final_message="\n$dashes$final_message\n$dashes"
-
-+AC_ARG_WITH([ffmpeg],
-+ [AS_HELP_STRING([--with-ffmpeg],
-+ [ffmpeg options: auto (search pkg-config or auto build), force (always build ffmpeg), shared (link dynamically), path_to_ffmpeg [default=force]])],
-+ [ffmpeg_dir=$with_ffmpeg],
-+ [with_ffmpeg=force])
-+
- AC_ARG_ENABLE([shared-lib],
- [AS_HELP_STRING([--enable-shared-lib],
- [build libxbmc. helpful for tests (default is no)])],
-@@ -207,30 +210,12 @@ AC_ARG_ENABLE([debug],
- [use_debug=$enableval],
- [use_debug=yes])
-
--AC_ARG_WITH([arch],
-- [AS_HELP_STRING([--with-arch],
-- [build with given arch passing to internal ffmpeg (default is no, needed for crosscompiling)])],
-- [use_arch=$withval],
-- [use_arch=no])
--
- AC_ARG_WITH([platform],
- [AS_HELP_STRING([--with-platform],
- [use a pre-configured config for common arm boards])],
- [use_platform=$withval],
- [use_platform=none])
-
--AC_ARG_WITH([cpu],
-- [AS_HELP_STRING([--with-cpu],
-- [build with given cpu passing to ffmpeg (default is no)])],
-- [use_cpu=$withval],
-- [use_cpu=no])
--
--AC_ARG_ENABLE([neon],
-- [AS_HELP_STRING([--enable-neon],
-- [enable neon passing to ffmpeg (default is no)])],
-- [use_neon=$enableval],
-- [use_neon=no])
--
- AC_ARG_ENABLE([optimizations],
- [AS_HELP_STRING([--enable-optimizations],
- [enable optimization (default is yes)])],
-@@ -423,12 +408,6 @@ AC_ARG_ENABLE([upnp],
- [use_upnp=$enableval],
- [use_upnp=yes])
-
--AC_ARG_ENABLE([ffmpeg_libvorbis],
-- [AS_HELP_STRING([--enable-ffmpeg-libvorbis],
-- [enable FFmpeg vorbis encoding (default is no)])],
-- [use_ffmpeg_libvorbis=$enableval],
-- [use_ffmpeg_libvorbis=no])
--
- AC_ARG_ENABLE([dvdcss],
- [AS_HELP_STRING([--enable-dvdcss],
- [enable DVDCSS support (default is yes)])],
-@@ -562,13 +541,6 @@ AC_ARG_ENABLE([codec],
- [add_codecs=$enableval],
- [add_codecs=no])
-
--### External libraries options
--AC_ARG_ENABLE([external-libraries],
-- [AS_HELP_STRING([--enable-external-libraries],
-- [enable use of all supported external libraries (default is no) 'Linux only'])],
-- [use_external_libraries=$enableval],
-- [use_external_libraries=no])
--
- AC_ARG_ENABLE([libav-compat],
- [AS_HELP_STRING([--enable-libav-compat],
- [build a wrapper around libav to provide the functions needed by XBMC. This is
-@@ -600,17 +572,6 @@ PKG_PROG_PKG_CONFIG
- MAKE="${MAKE:-make}"
- OBJDUMP="${OBJDUMP:-objdump}"
-
--use_external_ffmpeg=no
--use_static_ffmpeg=no
--
--# ffmpeg needs the output of uname -s (e.x. linux, darwin) for the target_os
--# there is no autoconf variable which will give
--# the correct output format when doing cross compilation
--# so we have to use our own var here
--# defaults to the build side target_os
--# and should be overridden for cross below (see android)
--ffmpeg_target_os=$(tolower $(uname -s))
--
- # host detection and setup
- case $host in
- i*86*-linux-android*)
-@@ -618,7 +579,6 @@ case $host in
- ARCH="i486-linux"
- use_arch="x86"
- use_cpu="i686"
-- ffmpeg_target_os=linux
- use_joystick=no
- use_gles=yes
- use_optical_drive=no
-@@ -632,7 +592,7 @@ case $host in
- use_arch="x86"
- use_cpu="i686"
- fi
-- use_static_ffmpeg=yes
-+ USE_STATIC_FFMPEG=1
- ;;
- x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
- ARCH="x86_64-linux"
-@@ -640,7 +600,7 @@ case $host in
- use_arch="x86_64"
- use_cpu="x86_64"
- fi
-- use_static_ffmpeg=yes
-+ USE_STATIC_FFMPEG=1
- ;;
- i386-*-freebsd*)
- ARCH="x86-freebsd"
-@@ -689,21 +649,19 @@ case $host in
- arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
- ARCH="arm"
- use_arch="arm"
-- ffmpeg_target_os=linux
- use_joystick=no
- use_neon=yes
- use_gles=yes
- use_sdl=no
- use_x11=no
- use_wayland=no
-- use_static_ffmpeg=yes
-+ USE_STATIC_FFMPEG=1
- ;;
- arm*-*linux-android*)
- target_platform=target_android
- use_arch="arm"
- use_cpu=cortex-a9
- ARCH="arm"
-- ffmpeg_target_os=linux
- use_joystick=no
- use_neon=yes
- use_gles=yes
-@@ -748,7 +706,6 @@ case $use_platform in
- USE_OMXLIB=1; AC_DEFINE([HAVE_OMXLIB],[1],["Define to 1 if OMX libs is enabled"])
- CFLAGS="$CFLAGS"
- CXXFLAGS="$CXXFLAGS"
-- ffmpeg_target_os=linux
- ;;
- esac
-
-@@ -824,7 +781,6 @@ if echo "$ARCH" | grep -q "freebsd" ; then
- CXXFLAGS="$CXXFLAGS -I$LOCALBASE/include"
- CPPFLAGS="$CPPFLAGS -I$LOCALBASE/include"
- LDFLAGS="$LDFLAGS -L$LOCALBASE/lib"
-- FFMPEG_EXTRACFLAGS="-I$LOCALBASE/include"
- fi
- if test "$host_vendor" = "apple" ; then
- # standard xbmc paths
-@@ -845,14 +801,12 @@ if test "$host_vendor" = "apple" ; then
- LIBS="$LIBS -framework SystemConfiguration"
- LIBS="$LIBS -framework VideoDecodeAcceleration"
- fi
-- USE_EXTERNAL_FFMPEG=1
- elif test "$target_platform" = "target_raspberry_pi"; then
- ARCH="arm"
- use_arch="arm"
- elif test "$use_arch" = "arm"; then
- CFLAGS="$CFLAGS -mno-apcs-stack-check"
- CXXFLAGS="$CXXFLAGS -mno-apcs-stack-check"
-- FFMPEG_EXTRACFLAGS=""
- if test "$use_tegra" = "yes"; then
- # Compile for ARMv7a architecture, need to test gcc for vfpv3-d16 support
- SAVE_CFLAGS="$CFLAGS"
-@@ -861,7 +815,6 @@ elif test "$use_arch" = "arm"; then
- [AC_LANG_SOURCE([int foo;])],
- [ CFLAGS="$SAVE_CFLAGS -Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
- CXXFLAGS="$CXXFLAGS -Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
-- FFMPEG_EXTRACFLAGS="$FFMPEG_EXTRACFLAGS -mtune=cortex-a9 -mfpu=vfpv3-d16"
- use_cpu=cortex-a9],
- [ CFLAGS="$SAVE_CFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"
- CXXFLAGS="$CXXFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"
-@@ -870,19 +823,9 @@ elif test "$use_arch" = "arm"; then
- if test "$use_neon" = "yes"; then
- CFLAGS="$CFLAGS -mfpu=neon -mvectorize-with-neon-quad"
- CXXFLAGS="$CXXFLAGS -mfpu=neon -mvectorize-with-neon-quad"
-- FFMPEG_EXTRACFLAGS="$FFMPEG_EXTRACFLAGS -mfpu=neon"
- fi
- fi
- fi
--if test "$use_static_ffmpeg" = "yes"; then
-- USE_STATIC_FFMPEG=1
-- AC_DEFINE([USE_STATIC_FFMPEG], [1], [link ffmpeg statically])
-- # ffmpeg may depend on gnutls and vorbisenc, we add those libs at the end of linker
-- # command in order to resolve any missing symbols
-- GNUTLS_ALL_LIBS=`${PKG_CONFIG} --static --libs-only-l --silence-errors gnutls`
-- HOGWEED_ALL_LIBS=`${PKG_CONFIG} --static --libs-only-l --silence-errors hogweed nettle`
-- VORBISENC_ALL_LIBS=`${PKG_CONFIG} --static --libs-only-l --silence-errors vorbisenc`
--fi
-
- # Checks for library functions.
- AC_FUNC_ALLOCA
-@@ -1118,7 +1061,7 @@ if test "$gcrypt_headers_available" = "yes"; then
- AC_CHECK_LIB([gcrypt],[gcry_control],, AC_MSG_ERROR($missing_library))
- AC_DEFINE([HAVE_GCRYPT],[1],[Define if we have gcrypt])
- fi
--PKG_CHECK_MODULES([GNUTLS], [gnutls], [have_gnutls=yes];AC_DEFINE([HAVE_GNUTLS], [1], [Define if we have gnutls]), AC_MSG_WARN("gnutls not found, ffmpeg TLS support disabled"))
-+PKG_CHECK_MODULES([GNUTLS], [gnutls], [have_gnutls=yes];AC_DEFINE([HAVE_GNUTLS], [1], [Define if we have gnutls]), AC_MSG_WARN("gnutls not found"))
-
- AC_CHECK_LIB([bz2], [main],, AC_MSG_ERROR($missing_library))
- AC_CHECK_LIB([jpeg], [main],, AC_MSG_ERROR($missing_library)) # check for cximage
-@@ -1769,40 +1712,108 @@ else
- AC_MSG_NOTICE($libcap_disabled)
- fi
-
--### External libraries checks
--
--# Hacks for supporting libav
-+# FFmpeg
-+FFMPEG_LIBNAMES="libavcodec >= 55.39.101
-+ libavfilter >= 3.90.100
-+ libavformat >= 55.19.104
-+ libavutil >= 52.48.101
-+ libpostproc >= 52.3.100
-+ libswscale >= 2.5.101
-+ libswresample >= 0.17.104"
-+
-+if test "$with_ffmpeg" = "shared"; then
-+ # allow linking against shared ffmpeg libs
-+ # a proper version must be installed, we won't build ffmpeg
-+ USE_STATIC_FFMPEG=0
-+ AC_DEFINE([USE_STATIC_FFMPEG], [0], [FFmpeg linked dynamically])
-+fi
-+if test "${USE_STATIC_FFMPEG}" = "1"; then
-+ AC_DEFINE([USE_STATIC_FFMPEG], [1], [FFmpeg linked statically])
-+ ff_libs=$(${ECHO} ${FFMPEG_LIBNAMES} | ${AWK} '/lib/{print $1}' ORS=' ')
-+ if test -n "${PKG_CONFIG_SYSROOT_DIR}"; then
-+ # workaround for cross compiling with buildroot on different buildsystem
-+ # Rpi buildroots pkg-config returns static libs with
-+ # PKG_CONFIG_SYSROOT_DIR prefixed, OEs does not
-+ # so lets make sure we always prefix in case PKG_CONFIG_SYSROOT_DIR is defined
-+ pkg_cfg_prefix="${PKG_CONFIG_SYSROOT_DIR}"
-+ elif test "${target_platform}" = "target_raspberry_pi" && test "${USE_BUILDROOT}" = "1"; then
-+ pkg_cfg_prefix=${SYSROOT}
-+ fi
-
--USE_LIBAV_HACKS=0
--if test "$use_libav_hacks" = "yes"; then
-- export PKG_CONFIG_PATH="${srcdir}/lib/xbmc-libav-hacks/pkgconfig/:$PKG_CONFIG_PATH"
-- USE_LIBAV_HACKS=1
-- AC_DEFINE([USE_LIBAV_HACKS], [1], [Whether to use libav compatibility hacks.])
--fi
-+ if test "$cross_compiling" != "yes"; then
-+ ffmpeg_build="${abs_top_srcdir}/tools/depends/target/ffmpeg"
-+ if test "$use_debug" != "yes"; then
-+ FFMPEG_OPTS="-r"
-+ fi
-+ if test "$use_optimizations" != "yes"; then
-+ FFMPEG_OPTS="${FFMPEG_OPTS} --disable-optimizations"
-+ fi
-
--# External FFmpeg
--if test "$use_external_ffmpeg" = "yes"; then
-- FFMPEG_LIBNAMES="libavcodec libavfilter libavformat libavutil libpostproc libswscale libswresample"
-+ if test "$with_ffmpeg" = "auto" || test "$with_ffmpeg" = "yes"; then
-+ SAVE_INCLUDES="$INCLUDES"
-+ SAVE_LIBS="$LIBS"
-+ # check for system installed ffmpeg. We require minimum versions.
-+ PKG_CHECK_MODULES([FFMPEG], [$FFMPEG_LIBNAMES],
-+ [INCLUDES="$INCLUDES $FFMPEG_CFLAGS"; LIBS="$LIBS $FFMPEG_LIBS"; FFMPEG_FOUND="true"],
-+ [FFMPEG_FOUND="false"])
-+
-+ if test "${USE_STATIC_FFMPEG}" = "1" && test "$FFMPEG_FOUND" = "true"; then
-+ # we need to check if static libs are available
-+ FFMPEG_LIBDIR=$(${PKG_CONFIG} --static --variable=libdir libavcodec)
-+ for ff_lib in ${ff_libs}; do
-+ if test -f ${FFMPEG_LIBDIR}/${ff_lib}.a; then :; else
-+ AC_MSG_NOTICE("${FFMPEG_LIBDIR}/${ff_lib}.a not found")
-+ FFMPEG_FOUND="false"
-+ # restore includes and libs, the ones we found are invalid
-+ INCLUDES="$SAVE_INCLUDES"
-+ LIBS="$SAVE_LIBS"
-+ unset FFMPEG_LIBS FFMPEG_CFLAGS FFMPEG_LIBDIR
-+ fi
-+ done
-+ fi
-+ if test "$with_ffmpeg" = "yes" || test "$FFMPEG_FOUND" = "false"; then
-+ # ffmpeg not found with pkg-config, lets install it
-+ AC_MSG_NOTICE("Installing FFmpeg")
-+ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" ${ffmpeg_build}/autobuild.sh ${FFMPEG_OPTS}
-+ export PKG_CONFIG_PATH="${ffmpeg_build}/ffmpeg-install/lib/pkgconfig:$PKG_CONFIG_PATH"
-+ fi
-
-- PKG_CHECK_MODULES([FFMPEG], [$FFMPEG_LIBNAMES],
-- [INCLUDES="$INCLUDES $FFMPEG_CFLAGS"; LIBS="$LIBS $FFMPEG_LIBS"],
-- AC_MSG_ERROR($missing_library))
-+ elif test "$with_ffmpeg" = "force"; then
-+ # always build our ffmpeg
-+ AC_MSG_NOTICE("FFmpeg installation forced by user - installing our version")
-+ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" ${ffmpeg_build}/autobuild.sh ${FFMPEG_OPTS}
-+ export PKG_CONFIG_PATH="${ffmpeg_build}/ffmpeg-install/lib/pkgconfig:$PKG_CONFIG_PATH"
-
-- # in case the headers are in a custom directory
-- SAVE_CPPFLAGS="$CPPFLAGS"
-- CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
-+ elif test "$with_ffmpeg" != "no"; then
-+ # user passed --with-ffmpeg=/some/path, lets use it
-+ AC_MSG_NOTICE("using ffmpeg: ${with_ffmpeg}")
-+ export PKG_CONFIG_PATH="${with_ffmpeg}/lib/pkgconfig:$PKG_CONFIG_PATH"
-+ fi
-+ fi
-+fi
-
-- AC_CHECK_HEADERS([libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h libavutil/avutil.h libpostproc/postprocess.h libswscale/swscale.h],,
-- [AC_MSG_ERROR($missing_headers)])
-+if test "$FFMPEG_FOUND" != "true"; then
-+ PKG_CHECK_MODULES([FFMPEG], [$FFMPEG_LIBNAMES],
-+ [INCLUDES="$INCLUDES $FFMPEG_CFLAGS"; LIBS="$LIBS $FFMPEG_LIBS"; FFMPEG_FOUND="true"],
-+ [AC_MSG_ERROR("ffmpeg not found")])
-+fi
-
-- AC_MSG_NOTICE($external_ffmpeg_enabled)
-- USE_EXTERNAL_FFMPEG=1
-- AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
-+if test "${USE_STATIC_FFMPEG}" = "1"; then
-+ # get the libdir for static linking
-+ FFMPEG_LIBDIR=${pkg_cfg_prefix}$(PKG_CONFIG_SYSROOT_DIR="" ${PKG_CONFIG} --static --variable=libdir libavcodec)
-+ GNUTLS_ALL_LIBS=$(${PKG_CONFIG} --static --libs-only-l --silence-errors gnutls)
-+ VORBISENC_ALL_LIBS=$(${PKG_CONFIG} --static --libs-only-l --silence-errors vorbisenc)
-
-- CPPFLAGS="$SAVE_CPPFLAGS"
--else
-- AC_MSG_NOTICE($external_ffmpeg_disabled)
-- USE_EXTERNAL_FFMPEG=0
-+ # check if static libs are available
-+ for ff_lib in ${ff_libs}; do
-+ if test -f ${FFMPEG_LIBDIR}/${ff_lib}.a; then :; else
-+ AC_MSG_ERROR("${FFMPEG_LIBDIR}/${ff_lib}.a not found")
-+ fi
-+ # filter out libs we link statically
-+ filter=$(${ECHO} ${ff_lib} | ${SED} 's/lib/-l/g')
-+ LIBS=$(${ECHO} ${LIBS} | ${SED} "s/${filter}//g")
-+ done
-+ LIBS=$(${ECHO} ${LIBS} | ${SED} ':a;N;$!ba;s/\n/ /g')
- fi
-
- echo "Checking for SWIG installation"
-@@ -2482,12 +2493,6 @@ fi
-
- ### External libraries messages
-
--if test "$use_external_ffmpeg" = "yes"; then
-- final_message="$final_message\n External FFmpeg:\tYes"
--else
-- final_message="$final_message\n External FFmpeg:\tNo"
--fi
--
- if test "$host_vendor" = "apple" ; then
- # built internal but referenced as external, we link directly to them.
- # this MUST be the last thing before OUTPUT_FILES as they do not
-@@ -2626,9 +2631,11 @@ AC_SUBST(DISABLE_GOOM)
- AC_SUBST(DISABLE_RSXS)
- AC_SUBST(DISABLE_FISHBMC)
- AC_SUBST(DISABLE_PROJECTM)
--AC_SUBST(USE_SKIN_TOUCHED)
--AC_SUBST(USE_EXTERNAL_FFMPEG)
-+AC_SUBST(FFMPEG_LIBDIR)
- AC_SUBST(USE_STATIC_FFMPEG)
-+AC_SUBST(GNUTLS_ALL_LIBS)
-+AC_SUBST(VORBISENC_ALL_LIBS)
-+AC_SUBST(USE_SKIN_TOUCHED)
- AC_SUBST(USE_LIBAV_HACKS)
- AC_SUBST(PYTHON_VERSION)
- AC_SUBST(OUTPUT_FILES)
-@@ -2728,132 +2735,6 @@ fi
- ])
- ])
-
--XB_CONFIG_MODULE([lib/ffmpeg], [
-- if test "$host_vendor" = "apple" ; then
-- ffmpg_config="--target-os=$ffmpeg_target_os"
-- # handle disables first, we do individual enables later
-- ffmpg_config="$ffmpg_config --disable-muxers --disable-encoders"
-- ffmpg_config="$ffmpg_config --disable-devices --disable-doc"
-- ffmpg_config="$ffmpg_config --disable-ffplay --disable-ffmpeg"
-- ffmpg_config="$ffmpg_config --disable-ffprobe --disable-ffserver"
-- ffmpg_config="$ffmpg_config --enable-vda --disable-crystalhd"
-- ffmpg_config="$ffmpg_config --disable-decoder=mpeg_xvmc"
--
-- # handle conditional enables/disables
-- if test "$use_debug" = "no"; then
-- ffmpg_config="$ffmpg_config --disable-debug"
-- fi
-- if test "$use_cpu" != "no"; then
-- ffmpg_config="$ffmpg_config --cpu=$use_cpu"
-- fi
-- if test "$use_arch" != "no"; then
-- ffmpg_config="$ffmpg_config --arch=$use_arch --enable-cross-compile"
-- fi
-- if test "$use_arch" = "arm"; then
-- ffmpg_config="$ffmpg_config --enable-pic"
-- ffmpg_config="$ffmpg_config --disable-armv5te --disable-armv6t2"
-- if test "$use_neon" = "yes"; then
-- ffmpg_config="$ffmpg_config --enable-neon"
-- else
-- ffmpg_config="$ffmpg_config --disable-neon"
-- fi
-- else
-- ffmpg_config="$ffmpg_config --disable-amd3dnow"
-- fi
-- if test "$use_ffmpeg_libvorbis" = "yes"; then
-- ffmpg_config="$ffmpg_config --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis"
-- else
-- ffmpg_config="$ffmpg_config --disable-libvorbis"
-- fi
-- if test "$have_gnutls" = "yes"; then
-- ffmpg_config="$ffmpg_config --enable-gnutls"
-- fi
--
-- # handle individual enables
-- ffmpg_config="$ffmpg_config --enable-gpl"
-- ffmpg_config="$ffmpg_config --enable-postproc"
-- ffmpg_config="$ffmpg_config --enable-static --enable-pthreads"
-- ffmpg_config="$ffmpg_config --enable-muxer=spdif --enable-muxer=adts --enable-muxer=asf --enable-muxer=ipod"
-- ffmpg_config="$ffmpg_config --enable-encoder=ac3 --enable-encoder=aac --enable-encoder=wmav2"
-- ffmpg_config="$ffmpg_config --enable-protocol=http"
-- ffmpg_config="$ffmpg_config --enable-runtime-cpudetect"
--
-- # ffmpeg will not compile with llvm-gcc-4.2, use clang instead
-- case $CC in
-- *llvm-gcc-4.2*)
-- ffmpg_config="$ffmpg_config --cc=clang" ;;
-- *)
-- ffmpg_config="$ffmpg_config --cc=$CC" ;;
-- esac
--
-- # extra-cflags must be passed alone or it gets expanded wrong by the ffmpeg configure
-- FFMPEG_EXTRACFLAGS="$CFLAGS $FFMPEG_EXTRACFLAGS -w -D_DARWIN_C_SOURCE -Dattribute_deprecated="
--
-- LDFLAGS="$LDFLAGS" ./configure --extra-cflags="$FFMPEG_EXTRACFLAGS" $ffmpg_config --as="$AS"
--
-- # if using llvm-gcc-4.2 as assembler, -MMD is not enough to generate
-- # dependency files in the right place, replace it with something that works
-- case $AS in
-- *llvm-gcc-4.2*)
-- sed -ie "s#AS_DEPFLAGS=-MMD#AS_DEPFLAGS=-MMD -MF \$(\@:.o=.d) -MT \$\@#" config.mak ;;
-- esac
--
-- # ffmpeg will use yasm found at ${prefix}/bin during configure
-- # but then hardcodes 'yasm' in config.mak, fix it.
-- sed -ie "s#YASM=yasm#YASM=${YASM}#" config.mak
-- sed -ie "s#YASMDEP=yasm#YASMDEP=${YASM}#" config.mak
-- sed -ie "s# -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 # #" config.mak
-- else
-- CFLAGS="" \
-- CPPFLAGS="" \
-- CXXFLAGS="" \
-- LDFLAGS="$(echo "$LDFLAGS" | sed "s/-Wl,-Bsymbolic-functions//g")" \
-- ./configure \
-- --extra-cflags="$PASSED_CFLAGS $FFMPEG_EXTRACFLAGS" \
-- `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
-- `if test "$cross_compiling" = "yes"; then echo --enable-cross-compile; fi` \
-- `if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\
-- `if test "$use_cpu" != "no"; then echo --cpu=$use_cpu; fi`\
-- `if test "$use_neon" = "yes"; then echo --enable-neon; else echo --disable-neon; fi`\
-- --target-os=$ffmpeg_target_os \
-- --disable-muxers \
-- --enable-muxer=spdif \
-- --enable-muxer=adts \
-- --enable-muxer=asf \
-- --enable-muxer=ipod \
-- --disable-encoders \
-- --enable-encoder=ac3 \
-- --enable-encoder=aac \
-- --enable-encoder=wmav2 \
-- `if test "$use_ffmpeg_libvorbis" = "yes"; then echo --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis; else echo --disable-libvorbis; fi` \
-- --disable-decoder=mpeg_xvmc \
-- --disable-devices \
-- --disable-ffprobe \
-- --disable-ffplay \
-- --disable-ffserver \
-- --disable-ffmpeg \
-- --disable-crystalhd \
-- `if test "$use_static_ffmpeg" = "yes"; then echo --enable-static --disable-shared; else echo --disable-static --enable-shared; fi` \
-- --disable-doc \
-- --enable-postproc \
-- --enable-gpl \
-- `if test "x$use_vdpau" != "xno"; then echo --enable-vdpau; else echo --disable-vdpau; fi` \
-- `if test "x$use_vaapi" != "xno"; then echo --enable-vaapi; else echo --disable-vaapi; fi` \
-- `if test "$use_optimizations" != "no"; then echo --enable-optimizations; else echo --disable-optimizations; fi` \
-- --enable-protocol=http \
-- `if test "$have_gnutls" = "yes"; then echo --enable-gnutls; fi` \
-- --enable-pthreads \
-- --enable-runtime-cpudetect \
-- `if test "$use_hardcoded_tables" = "yes"; then echo --enable-hardcoded-tables; else echo --disable-hardcoded-tables; fi`\
-- `if test "$target_platform" = "target_android"; then echo "--custom-libname-with-major=\\$(SLIBPREF)\\$(FULLNAME)-\\$(LIBMAJOR)-${ARCH}\\$(SLIBSUF)"; \
-- else echo "--custom-libname-with-major=\\$(FULLNAME)-\\$(LIBMAJOR)-${ARCH}\\$(SLIBSUF)"; fi` \
-- `case $host_cpu in i?86*) echo --disable-pic ;; *) echo --enable-pic ;; esac` \
-- --cc="$CC" &&
-- sed -i -e "s#define HAVE_SYMVER 1#define HAVE_SYMVER 0#" config.h &&
-- sed -i -e "s#define HAVE_SYMVER_GNU_ASM 1#define HAVE_SYMVER_GNU_ASM 0#" config.h
-- fi
--], [$USE_EXTERNAL_FFMPEG])
--
- XB_CONFIG_MODULE([lib/libdvd/libdvdcss], [
- ./configure \
- CC="$CC" \
-diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh
-new file mode 100755
-index 0000000..b7a1ba6
---- /dev/null
-+++ b/tools/depends/target/ffmpeg/autobuild.sh
-@@ -0,0 +1,166 @@
-+#!/bin/bash
-+#
-+# Copyright (C) 2005-2013 Team XBMC
-+# http://xbmc.org
-+#
-+# This Program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2, or (at your option)
-+# any later version.
-+#
-+# This Program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with XBMC; see the file COPYING. If not, see
-+# .
-+#
-+
-+
-+MYDIR=$(cd $(dirname $0); pwd)
-+cd $MYDIR
-+FFMPEG_PREFIX=${MYDIR}/ffmpeg-install
-+
-+BASE_URL=$(grep "BASE_URL=" FFMPEG-VERSION | sed 's/BASE_URL=//g')
-+VERSION=$(grep "VERSION=" FFMPEG-VERSION | sed 's/VERSION=//g')
-+ARCHIVE=ffmpeg-${VERSION}.tar.gz
-+
-+function usage {
-+ echo "usage $(basename $0)
-+ [-p | --prefix] ... ffmepg install prefix
-+ [-d | --download] ... no build, download tarfile only
-+ [-r | --release] ... disable debugging symbols
-+ [-j] ... make concurrency level
-+ [--cpu=CPU] ... minimum required CPU
-+ [--arch=ARCH] ... select architecture
-+ [--disable-optimizations]
-+ "
-+}
-+
-+while :
-+do
-+ case $1 in
-+ -h | --help)
-+ usage
-+ exit 0
-+ ;;
-+ -p | --prefix)
-+ FFMPEG_PREFIX=$2
-+ shift 2
-+ ;;
-+ --prefix=*)
-+ FFMPEG_PREFIX=${1#*=}
-+ shift
-+ ;;
-+ -d | --download)
-+ downloadonly=true
-+ shift
-+ ;;
-+ -r | --release)
-+ FLAGS="$FLAGS --disable-debug"
-+ shift
-+ ;;
-+ --disable-optimizations)
-+ FLAGS="$FLAGS --disable-optimizations"
-+ shift
-+ ;;
-+ --cpu=*)
-+ FLAGS="$FLAGS --cpu=${1#*=}"
-+ shift
-+ ;;
-+ --arch=*)
-+ FLAGS="$FLAGS --arch=${1#*=}"
-+ shift
-+ ;;
-+ --extra-cflags=*)
-+ FLAGS="$FLAGS --extra-cflags=\"${1#*=}\""
-+ shift
-+ ;;
-+ --extra-cxxflags=*)
-+ FLAGS="$FLAGS --extra-cxxflags=\"${1#*=}\""
-+ shift
-+ ;;
-+ -j)
-+ BUILDTHREADS=$2
-+ shift 2
-+ ;;
-+ --)
-+ shift
-+ break
-+ ;;
-+ -*)
-+ echo "WARN: Unknown option (ignored): $1" >&2
-+ shift
-+ ;;
-+ *)
-+ break
-+ ;;
-+ esac
-+done
-+
-+BUILDTHREADS=${BUILDTHREADS:-$(grep -c processor /proc/cpuinfo)}
-+
-+[ -z ${VERSION} ] && exit 3
-+if [ -f ${FFMPEG_PREFIX}/lib/pkgconfig/libavcodec.pc ] && [ -f .ffmpeg-installed ]
-+then
-+ CURVER=$(cat .ffmpeg-installed)
-+ [ "$VERSION" == "$CURVER" ] && exit 0
-+fi
-+
-+[ -f ${ARCHIVE} ] || curl -Ls --create-dirs -f -o ${ARCHIVE} ${BASE_URL}/${VERSION}.tar.gz
-+[ $downloadonly ] && exit 0
-+
-+[ -d ffmpeg-${VERSION} ] && rm -rf ffmpeg-${VERSION} && rm .ffmpeg-installed >/dev/null 2>&1
-+if [ -d ${FFMPEG_PREFIX} ]
-+then
-+ [ -w ${FFMPEG_PREFIX} ] || SUDO="sudo"
-+else
-+ [ -w $(dirname ${FFMPEG_PREFIX}) ] || SUDO="sudo"
-+fi
-+
-+mkdir ffmpeg-${VERSION}
-+cd ffmpeg-${VERSION} || exit 2
-+tar --strip-components=1 -xf ../${ARCHIVE}
-+
-+CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \
-+./configure --prefix=$FFMPEG_PREFIX \
-+ --disable-devices \
-+ --disable-ffplay \
-+ --disable-ffmpeg \
-+ --disable-ffprobe \
-+ --disable-ffserver \
-+ --disable-doc \
-+ --enable-gpl \
-+ --enable-runtime-cpudetect \
-+ --enable-postproc \
-+ --enable-vaapi \
-+ --enable-vdpau \
-+ --enable-bzlib \
-+ --enable-gnutls \
-+ --enable-muxer=spdif \
-+ --enable-muxer=adts \
-+ --enable-muxer=asf \
-+ --enable-muxer=ipod \
-+ --enable-encoder=ac3 \
-+ --enable-encoder=aac \
-+ --enable-encoder=wmav2 \
-+ --enable-protocol=http \
-+ --enable-libvorbis \
-+ --enable-muxer=ogg \
-+ --enable-encoder=libvorbis \
-+ --enable-nonfree \
-+ --enable-pthreads \
-+ --enable-zlib \
-+ ${FLAGS}
-+
-+make -j ${BUILDTHREADS}
-+if [ $? -eq 0 ]
-+then
-+ [ ${SUDO} ] && echo "Root priviledges are required to install to ${FFMPEG_PREFIX}"
-+ ${SUDO} make install && echo "$VERSION" > ../.ffmpeg-installed
-+else
-+ echo "ERROR: building ffmpeg failed"
-+ exit 1
-+fi
---
-1.9.3
-
-
-From 3872359c850f3053aacaca95319819dead320738 Mon Sep 17 00:00:00 2001
-From: Rainer Hochecker
-Date: Wed, 22 Jan 2014 11:45:48 +0100
-Subject: [PATCH 003/122] ffmpeg: remove dll wrappers
-
----
- Makefile.in | 6 -
- configure.in | 1 -
- lib/DllAvCodec.h | 281 -------------
- lib/DllAvFilter.h | 313 --------------
- lib/DllAvFormat.h | 322 ---------------
- lib/DllAvUtil.h | 291 -------------
- lib/DllPostProc.h | 129 ------
- lib/DllSwResample.h | 131 ------
- lib/DllSwScale.h | 153 -------
- lib/Makefile.in | 103 -----
- lib/xbmc-dll-symbols/DllAvFormat.c | 126 ------
- lib/xbmc-dll-symbols/Makefile | 6 -
- lib/xbmc-libav-hacks/Makefile | 6 -
- lib/xbmc-libav-hacks/accessors.c | 35 --
- lib/xbmc-libav-hacks/alloc_output_context2.c | 80 ----
- lib/xbmc-libav-hacks/buffersink.c | 36 --
- lib/xbmc-libav-hacks/graphparser.c | 451 ---------------------
- lib/xbmc-libav-hacks/libav_hacks.h | 96 -----
- lib/xbmc-libav-hacks/pkgconfig/libswresample.pc | 4 -
- lib/xbmc-libav-hacks/swresample.c | 80 ----
- xbmc/addons/AddonCallbacksCodec.cpp | 22 +-
- xbmc/cdrip/EncoderFFmpeg.cpp | 162 ++++----
- xbmc/cdrip/EncoderFFmpeg.h | 15 +-
- .../cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp | 61 ++-
- xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h | 12 +-
- .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 71 ++--
- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 13 +-
- .../AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h | 7 +-
- .../Engines/ActiveAE/ActiveAEResample.cpp | 66 +--
- .../Engines/ActiveAE/ActiveAEResample.h | 9 +-
- .../AudioEngine/Engines/ActiveAE/ActiveAESound.cpp | 7 +-
- .../AudioEngine/Engines/ActiveAE/ActiveAESound.h | 2 +-
- xbmc/cores/AudioEngine/Interfaces/AEEncoder.h | 5 +-
- xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp | 9 +-
- xbmc/cores/AudioEngine/Utils/AEStreamInfo.h | 10 +-
- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 35 +-
- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 3 -
- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 20 +-
- xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 4 -
- xbmc/cores/VideoRenderers/WinRenderer.cpp | 2 +-
- xbmc/cores/VideoRenderers/WinRenderer.h | 3 -
- xbmc/cores/dvdplayer/DVDAudio.h | 4 +-
- .../dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h | 5 +-
- .../DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp | 57 ++-
- .../DVDCodecs/Audio/DVDAudioCodecFFmpeg.h | 15 +-
- xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp | 20 +-
- .../DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 39 +-
- .../DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.h | 11 +-
- .../DVDCodecs/Overlay/DVDOverlayCodecText.h | 2 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp | 16 +-
- .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 6 +-
- .../DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp | 4 +-
- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 205 +++-------
- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 27 +-
- .../dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp | 25 +-
- .../dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.h | 2 -
- .../DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp | 164 ++++----
- .../DVDCodecs/Video/DVDVideoCodecVideoToolBox.h | 5 -
- .../dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp | 15 +-
- .../dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.h | 4 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h | 2 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/DXVAHD.h | 2 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 2 +
- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h | 2 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h | 2 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 7 +-
- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 11 +-
- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h | 5 +-
- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 134 +++---
- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h | 15 +-
- .../dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp | 25 +-
- .../dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h | 10 +-
- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp | 5 +-
- xbmc/cores/dvdplayer/DVDFileInfo.cpp | 15 +-
- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 +-
- xbmc/cores/dvdplayer/DVDStreamInfo.h | 5 +-
- xbmc/cores/omxplayer/OMXAudio.cpp | 11 +-
- xbmc/cores/omxplayer/OMXAudio.h | 8 +-
- xbmc/cores/omxplayer/OMXAudioCodec.h | 2 +-
- xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 65 ++-
- xbmc/cores/omxplayer/OMXAudioCodecOMX.h | 14 +-
- xbmc/cores/omxplayer/OMXPlayer.cpp | 2 +-
- xbmc/linux/OMXCore.h | 2 +-
- xbmc/music/karaoke/karaokevideobackground.cpp | 12 +-
- xbmc/pictures/Picture.cpp | 14 +-
- xbmc/utils/BitstreamConverter.cpp | 118 +++---
- xbmc/utils/BitstreamConverter.h | 13 +-
- xbmc/video/FFmpegVideoDecoder.cpp | 89 ++--
- xbmc/video/FFmpegVideoDecoder.h | 11 +-
- 89 files changed, 742 insertions(+), 3677 deletions(-)
- delete mode 100644 lib/DllAvCodec.h
- delete mode 100644 lib/DllAvFilter.h
- delete mode 100644 lib/DllAvFormat.h
- delete mode 100644 lib/DllAvUtil.h
- delete mode 100644 lib/DllPostProc.h
- delete mode 100644 lib/DllSwResample.h
- delete mode 100644 lib/DllSwScale.h
- delete mode 100644 lib/Makefile.in
- delete mode 100644 lib/xbmc-dll-symbols/DllAvFormat.c
- delete mode 100644 lib/xbmc-dll-symbols/Makefile
- delete mode 100644 lib/xbmc-libav-hacks/Makefile
- delete mode 100644 lib/xbmc-libav-hacks/accessors.c
- delete mode 100644 lib/xbmc-libav-hacks/alloc_output_context2.c
- delete mode 100644 lib/xbmc-libav-hacks/buffersink.c
- delete mode 100644 lib/xbmc-libav-hacks/graphparser.c
- delete mode 100644 lib/xbmc-libav-hacks/libav_hacks.h
- delete mode 100644 lib/xbmc-libav-hacks/pkgconfig/libswresample.pc
- delete mode 100644 lib/xbmc-libav-hacks/swresample.c
-
-diff --git a/Makefile.in b/Makefile.in
-index bb83339..5339447 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -35,7 +35,6 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
- lib/libXDAAP/libxdaap.a \
- lib/libhts/libhts.a \
- lib/libsquish/libsquish.a \
-- lib/xbmc-dll-symbols/dll-symbols.a \
- xbmc/addons/addons.a \
- xbmc/cdrip/cdrip.a \
- xbmc/cores/AudioEngine/audioengine.a \
-@@ -187,10 +186,6 @@ ifeq (@USE_OMXPLAYER@,1)
- DIRECTORY_ARCHIVES += xbmc/cores/omxplayer/omxplayer.a
- endif
-
--ifeq (@USE_LIBAV_HACKS@,1)
--DIRECTORY_ARCHIVES += lib/xbmc-libav-hacks/dll-libavhacks.a
--endif
--
- PAPCODECS_DIRS= \
- lib/nosefart \
- lib/timidity \
-@@ -393,7 +388,6 @@ libaddon: exports
- $(MAKE) -C lib/addons/library.xbmc.gui
- $(MAKE) -C lib/addons/library.xbmc.pvr
- dvdpcodecs: dllloader
-- $(MAKE) -C lib
- $(MAKE) -C lib/libdvd
-
- ifeq (@USE_LIBSTAGEFRIGHT@,1)
-diff --git a/configure.in b/configure.in
-index 1a49651..a324a0d 100644
---- a/configure.in
-+++ b/configure.in
-@@ -2524,7 +2524,6 @@ OUTPUT_FILES="Makefile \
- xbmc/cores/Makefile \
- xbmc/cores/VideoRenderers/Makefile \
- xbmc/cores/dvdplayer/Makefile \
-- lib/Makefile \
- lib/libdvd/Makefile \
- xbmc/cores/DllLoader/Makefile \
- xbmc/cores/DllLoader/exports/Makefile \
-diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h
-deleted file mode 100644
-index af13a15..0000000
---- a/lib/DllAvCodec.h
-+++ /dev/null
-@@ -1,281 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "DllAvUtil.h"
--#include "utils/log.h"
--
--extern "C" {
--#ifndef HAVE_MMX
--#define HAVE_MMX
--#endif
--#ifndef __STDC_CONSTANT_MACROS
--#define __STDC_CONSTANT_MACROS
--#endif
--#ifndef __STDC_LIMIT_MACROS
--#define __STDC_LIMIT_MACROS
--#endif
--
--#ifndef __GNUC__
--#pragma warning(disable:4244)
--#endif
--
--#if (defined USE_EXTERNAL_FFMPEG)
-- #include
--#else
-- #include "libavcodec/avcodec.h"
--#endif
--}
--
--#include "threads/SingleLock.h"
--
--class DllAvCodecInterface
--{
--public:
-- virtual ~DllAvCodecInterface() {}
-- virtual void avcodec_register_all(void)=0;
-- virtual void avcodec_flush_buffers(AVCodecContext *avctx)=0;
-- virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)=0;
-- virtual AVCodec *avcodec_find_decoder(enum AVCodecID id)=0;
-- virtual AVCodec *avcodec_find_encoder(enum AVCodecID id)=0;
-- virtual int avcodec_close_dont_call(AVCodecContext *avctx)=0;
-- virtual AVFrame *avcodec_alloc_frame(void)=0;
-- virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height)=0;
-- virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)=0;
-- virtual int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)=0;
-- virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)=0;
-- virtual int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)=0;
-- virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height)=0;
-- virtual AVCodecContext *avcodec_alloc_context3(AVCodec *codec)=0;
-- virtual void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)=0;
-- virtual void avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec)=0;
-- virtual AVCodecParserContext *av_parser_init(int codec_id)=0;
-- virtual int av_parser_parse2(AVCodecParserContext *s,AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size,
-- const uint8_t *buf, int buf_size,
-- int64_t pts, int64_t dts, int64_t pos)=0;
-- virtual void av_parser_close(AVCodecParserContext *s)=0;
-- virtual AVBitStreamFilterContext *av_bitstream_filter_init(const char *name)=0;
-- virtual int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-- AVCodecContext *avctx, const char *args,
-- uint8_t **poutbuf, int *poutbuf_size,
-- const uint8_t *buf, int buf_size, int keyframe) =0;
-- virtual void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc) =0;
-- virtual void avpicture_free(AVPicture *picture)=0;
-- virtual void av_free_packet(AVPacket *pkt)=0;
-- virtual int avpicture_alloc(AVPicture *picture, PixelFormat pix_fmt, int width, int height)=0;
-- virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt)=0;
-- virtual AVCodec *av_codec_next(AVCodec *c)=0;
-- virtual int av_dup_packet(AVPacket *pkt)=0;
-- virtual void av_init_packet(AVPacket *pkt)=0;
-- virtual int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align) = 0;
-- virtual void avcodec_free_frame(AVFrame **frame)=0;
-- virtual int av_codec_is_decoder(const AVCodec *codec)=0;
-- virtual AVDictionary* av_frame_get_metadata(const AVFrame* frame)=0;
--};
--
--#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--
--// Use direct layer
--class DllAvCodec : public DllDynamic, DllAvCodecInterface
--{
--public:
-- static CCriticalSection m_critSection;
--
-- virtual ~DllAvCodec() {}
-- virtual void avcodec_register_all()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- ::avcodec_register_all();
-- }
-- virtual void avcodec_flush_buffers(AVCodecContext *avctx) { ::avcodec_flush_buffers(avctx); }
-- virtual int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::avcodec_open2(avctx, codec, options);
-- }
-- virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) { *(volatile int *)0x0 = 0; return 0; }
-- virtual int avcodec_close_dont_call(AVCodecContext *avctx) { *(volatile int *)0x0 = 0; return 0; }
-- virtual AVCodec *avcodec_find_decoder(enum AVCodecID id) { return ::avcodec_find_decoder(id); }
-- virtual AVCodec *avcodec_find_encoder(enum AVCodecID id) { return ::avcodec_find_encoder(id); }
-- virtual int avcodec_close(AVCodecContext *avctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::avcodec_close(avctx);
-- }
-- virtual AVFrame *avcodec_alloc_frame() { return ::avcodec_alloc_frame(); }
-- virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height) { return ::avpicture_fill(picture, ptr, pix_fmt, width, height); }
-- virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video2(avctx, picture, got_picture_ptr, avpkt); }
-- virtual int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio4(avctx, frame, got_frame_ptr, avpkt); }
-- virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, avpkt); }
-- virtual int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { return ::avcodec_encode_audio2(avctx, avpkt, frame, got_packet_ptr); }
-- virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height) { return ::avpicture_get_size(pix_fmt, width, height); }
-- virtual AVCodecContext *avcodec_alloc_context3(AVCodec *codec) { return ::avcodec_alloc_context3(codec); }
-- virtual void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) { ::avcodec_string(buf, buf_size, enc, encode); }
-- virtual void avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec) { ::avcodec_get_context_defaults3(s, codec); }
--
-- virtual AVCodecParserContext *av_parser_init(int codec_id) { return ::av_parser_init(codec_id); }
-- virtual int av_parser_parse2(AVCodecParserContext *s,AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size,
-- const uint8_t *buf, int buf_size,
-- int64_t pts, int64_t dts, int64_t pos)
-- {
-- return ::av_parser_parse2(s, avctx, poutbuf, poutbuf_size, buf, buf_size, pts, dts, pos);
-- }
-- virtual void av_parser_close(AVCodecParserContext *s) { ::av_parser_close(s); }
--
-- virtual AVBitStreamFilterContext *av_bitstream_filter_init(const char *name) { return ::av_bitstream_filter_init(name); }
-- virtual int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-- AVCodecContext *avctx, const char *args,
-- uint8_t **poutbuf, int *poutbuf_size,
-- const uint8_t *buf, int buf_size, int keyframe) { return ::av_bitstream_filter_filter(bsfc, avctx, args, poutbuf, poutbuf_size, buf, buf_size, keyframe); }
-- virtual void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc) { ::av_bitstream_filter_close(bsfc); }
--
-- virtual void avpicture_free(AVPicture *picture) { ::avpicture_free(picture); }
-- virtual void av_free_packet(AVPacket *pkt) { ::av_free_packet(pkt); }
-- virtual int avpicture_alloc(AVPicture *picture, PixelFormat pix_fmt, int width, int height) { return ::avpicture_alloc(picture, pix_fmt, width, height); }
-- virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt) { return ::avcodec_default_get_format(s, fmt); }
-- virtual AVCodec *av_codec_next(AVCodec *c) { return ::av_codec_next(c); }
--
-- virtual int av_dup_packet(AVPacket *pkt) { return ::av_dup_packet(pkt); }
-- virtual void av_init_packet(AVPacket *pkt) { return ::av_init_packet(pkt); }
-- virtual int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align) { return ::avcodec_fill_audio_frame(frame, nb_channels, sample_fmt, buf, buf_size, align); }
-- virtual void avcodec_free_frame(AVFrame **frame) { return ::avcodec_free_frame(frame); };
-- virtual int av_codec_is_decoder(const AVCodec *codec) { return ::av_codec_is_decoder(codec); }
-- virtual AVDictionary* av_frame_get_metadata(const AVFrame* frame) { return ::av_frame_get_metadata(frame); }
--
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllAvCodec: Using libavcodec system library");
--#endif
-- return true;
-- }
-- virtual void Unload() {}
--};
--#else
--class DllAvCodec : public DllDynamic, DllAvCodecInterface
--{
-- DECLARE_DLL_WRAPPER(DllAvCodec, DLL_PATH_LIBAVCODEC)
-- DEFINE_FUNC_ALIGNED1(void, __cdecl, avcodec_flush_buffers, AVCodecContext*)
-- DEFINE_FUNC_ALIGNED3(int, __cdecl, avcodec_open2_dont_call, AVCodecContext*, AVCodec *, AVDictionary **)
-- DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_video2, AVCodecContext*, AVFrame*, int*, AVPacket*)
-- DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_audio4, AVCodecContext*, AVFrame*, int*, AVPacket*)
-- DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_subtitle2, AVCodecContext*, AVSubtitle*, int*, AVPacket*)
-- DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_encode_audio2, AVCodecContext*, AVPacket*, const AVFrame*, int*)
-- DEFINE_FUNC_ALIGNED1(AVCodecContext*, __cdecl, avcodec_alloc_context3, AVCodec *)
-- DEFINE_FUNC_ALIGNED1(AVCodecParserContext*, __cdecl, av_parser_init, int)
-- DEFINE_FUNC_ALIGNED9(int, __cdecl, av_parser_parse2, AVCodecParserContext*,AVCodecContext*, uint8_t**, int*, const uint8_t*, int, int64_t, int64_t, int64_t)
-- DEFINE_METHOD1(int, av_dup_packet, (AVPacket *p1))
-- DEFINE_METHOD1(void, av_init_packet, (AVPacket *p1))
--
-- LOAD_SYMBOLS();
--
-- DEFINE_METHOD0(void, avcodec_register_all_dont_call)
-- DEFINE_METHOD1(AVCodec*, avcodec_find_decoder, (enum AVCodecID p1))
-- DEFINE_METHOD1(AVCodec*, avcodec_find_encoder, (enum AVCodecID p1))
-- DEFINE_METHOD1(int, avcodec_close_dont_call, (AVCodecContext *p1))
-- DEFINE_METHOD0(AVFrame*, avcodec_alloc_frame)
-- DEFINE_METHOD5(int, avpicture_fill, (AVPicture *p1, uint8_t *p2, PixelFormat p3, int p4, int p5))
-- DEFINE_METHOD3(int, avpicture_get_size, (PixelFormat p1, int p2, int p3))
-- DEFINE_METHOD4(void, avcodec_string, (char *p1, int p2, AVCodecContext *p3, int p4))
-- DEFINE_METHOD2(void, avcodec_get_context_defaults3, (AVCodecContext *p1, AVCodec *p2))
-- DEFINE_METHOD1(void, av_parser_close, (AVCodecParserContext *p1))
-- DEFINE_METHOD1(void, avpicture_free, (AVPicture *p1))
-- DEFINE_METHOD1(AVBitStreamFilterContext*, av_bitstream_filter_init, (const char *p1))
-- DEFINE_METHOD8(int, av_bitstream_filter_filter, (AVBitStreamFilterContext* p1, AVCodecContext* p2, const char* p3, uint8_t** p4, int* p5, const uint8_t* p6, int p7, int p8))
-- DEFINE_METHOD1(void, av_bitstream_filter_close, (AVBitStreamFilterContext *p1))
-- DEFINE_METHOD1(void, av_free_packet, (AVPacket *p1))
-- DEFINE_METHOD4(int, avpicture_alloc, (AVPicture *p1, PixelFormat p2, int p3, int p4))
-- DEFINE_METHOD2(enum PixelFormat, avcodec_default_get_format, (struct AVCodecContext *p1, const enum PixelFormat *p2))
-- DEFINE_METHOD6(int, avcodec_fill_audio_frame, (AVFrame* p1, int p2, enum AVSampleFormat p3, const uint8_t* p4, int p5, int p6))
-- DEFINE_METHOD1(void, avcodec_free_frame, (AVFrame **p1))
-- DEFINE_METHOD1(AVCodec*, av_codec_next, (AVCodec *p1))
-- DEFINE_METHOD1(int, av_codec_is_decoder, (const AVCodec *p1))
-- DEFINE_METHOD1(AVDictionary*, av_frame_get_metadata, (const AVFrame* p1))
--
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD(avcodec_flush_buffers)
-- RESOLVE_METHOD_RENAME(avcodec_open2,avcodec_open2_dont_call)
-- RESOLVE_METHOD_RENAME(avcodec_close,avcodec_close_dont_call)
-- RESOLVE_METHOD(avcodec_find_decoder)
-- RESOLVE_METHOD(avcodec_find_encoder)
-- RESOLVE_METHOD(avcodec_alloc_frame)
-- RESOLVE_METHOD_RENAME(avcodec_register_all, avcodec_register_all_dont_call)
-- RESOLVE_METHOD(avpicture_fill)
-- RESOLVE_METHOD(avcodec_decode_video2)
-- RESOLVE_METHOD(avcodec_decode_audio4)
-- RESOLVE_METHOD(avcodec_decode_subtitle2)
-- RESOLVE_METHOD(avcodec_encode_audio2)
-- RESOLVE_METHOD(avpicture_get_size)
-- RESOLVE_METHOD(avcodec_alloc_context3)
-- RESOLVE_METHOD(avcodec_string)
-- RESOLVE_METHOD(avcodec_get_context_defaults3)
-- RESOLVE_METHOD(av_parser_init)
-- RESOLVE_METHOD(av_parser_parse2)
-- RESOLVE_METHOD(av_parser_close)
-- RESOLVE_METHOD(av_bitstream_filter_init)
-- RESOLVE_METHOD(av_bitstream_filter_filter)
-- RESOLVE_METHOD(av_bitstream_filter_close)
-- RESOLVE_METHOD(avpicture_free)
-- RESOLVE_METHOD(avpicture_alloc)
-- RESOLVE_METHOD(av_free_packet)
-- RESOLVE_METHOD(avcodec_default_get_format)
-- RESOLVE_METHOD(av_codec_next)
-- RESOLVE_METHOD(av_dup_packet)
-- RESOLVE_METHOD(av_init_packet)
-- RESOLVE_METHOD(avcodec_fill_audio_frame)
-- RESOLVE_METHOD(avcodec_free_frame)
-- RESOLVE_METHOD(av_codec_is_decoder)
-- RESOLVE_METHOD(av_frame_get_metadata)
-- END_METHOD_RESOLVE()
--
-- /* dependencies of libavcodec */
-- DllAvUtil m_dllAvUtil;
--
--public:
-- static CCriticalSection m_critSection;
-- int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avcodec_open2_dont_call(avctx,codec, options);
-- }
-- int avcodec_close(AVCodecContext *avctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avcodec_close_dont_call(avctx);
-- }
-- void avcodec_register_all()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- avcodec_register_all_dont_call();
-- }
-- virtual bool Load()
-- {
-- if (!m_dllAvUtil.Load())
-- return false;
-- return DllDynamic::Load();
-- }
--};
--
--#endif
-diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h
-deleted file mode 100644
-index 6ef603a..0000000
---- a/lib/DllAvFilter.h
-+++ /dev/null
-@@ -1,313 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "DllAvCodec.h"
--#include "DllAvFormat.h"
--#include "DllSwResample.h"
--#include "utils/log.h"
--
--extern "C" {
--#ifndef HAVE_MMX
--#define HAVE_MMX
--#endif
--#ifndef __STDC_CONSTANT_MACROS
--#define __STDC_CONSTANT_MACROS
--#endif
--
--#ifndef __GNUC__
--#pragma warning(disable:4244)
--#endif
--
--#if (defined USE_EXTERNAL_FFMPEG)
-- #include
-- #include
-- #include
--#if LIBAVFILTER_VERSION_MICRO >= 100 && LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,43,100)
-- #include
--#endif
-- #include
--#else
-- #include "libavfilter/avfilter.h"
-- #include "libavfilter/avfiltergraph.h"
-- #include "libavfilter/buffersink.h"
--#if LIBAVFILTER_VERSION_MICRO >= 100 && LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,43,100)
-- #include "libavfilter/avcodec.h"
--#endif
-- #include "libavfilter/buffersrc.h"
--#endif
--}
--
--#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)
--#define LIBAVFILTER_AVFRAME_BASED
--#endif
--
--#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,78,100)
-- #define HAVE_AVFILTER_GRAPH_PARSE_PTR
--#endif
--
--#include "threads/SingleLock.h"
--
--class DllAvFilterInterface
--{
--public:
-- virtual ~DllAvFilterInterface() {}
-- virtual void avfilter_free(AVFilterContext *filter)=0;
-- virtual void avfilter_graph_free(AVFilterGraph **graph)=0;
-- virtual int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)=0;
-- virtual AVFilter *avfilter_get_by_name(const char *name)=0;
-- virtual AVFilterGraph *avfilter_graph_alloc(void)=0;
-- virtual AVFilterInOut *avfilter_inout_alloc()=0;
-- virtual void avfilter_inout_free(AVFilterInOut **inout)=0;
--#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR)
-- virtual int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0;
--#else
-- virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0;
--#endif
-- virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0;
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame)=0;
--#else
-- virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0;
-- virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0;
--#endif
-- virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0;
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- virtual int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame) = 0;
--#else
-- virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags)=0;
--#endif
-- virtual AVBufferSinkParams *av_buffersink_params_alloc()=0;
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- virtual int av_buffersink_poll_frame(AVFilterContext *ctx)=0;
--#endif
--};
--
--#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--// Use direct mapping
--class DllAvFilter : public DllDynamic, DllAvFilterInterface
--{
--public:
-- virtual ~DllAvFilter() {}
-- virtual void avfilter_free(AVFilterContext *filter)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- ::avfilter_free(filter);
-- }
-- virtual void avfilter_graph_free(AVFilterGraph **graph)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- ::avfilter_graph_free(graph);
-- }
-- void avfilter_register_all()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- ::avfilter_register_all();
-- }
-- virtual int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx) { return ::avfilter_graph_create_filter(filt_ctx, filt, name, args, opaque, graph_ctx); }
-- virtual AVFilter *avfilter_get_by_name(const char *name) { return ::avfilter_get_by_name(name); }
-- virtual AVFilterGraph *avfilter_graph_alloc() { return ::avfilter_graph_alloc(); }
-- virtual AVFilterInOut *avfilter_inout_alloc()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::avfilter_inout_alloc();
-- }
-- virtual void avfilter_inout_free(AVFilterInOut **inout)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- ::avfilter_inout_free(inout);
-- }
--#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR)
-- virtual int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::avfilter_graph_parse_ptr(graph, filters, inputs, outputs, log_ctx);
-- }
--#else
-- virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::avfilter_graph_parse(graph, filters, inputs, outputs, log_ctx);
-- }
--#endif
-- virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
-- {
-- return ::avfilter_graph_config(graphctx, log_ctx);
-- }
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame) { return ::av_buffersrc_add_frame(buffer_filter, frame); }
--#else
-- virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); }
-- virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); }
--#endif
-- virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); }
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- virtual int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame) { return ::av_buffersink_get_frame(ctx, frame); }
--#else
-- virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref(buffer_sink, bufref, flags); }
--#endif
-- virtual AVBufferSinkParams *av_buffersink_params_alloc() { return ::av_buffersink_params_alloc(); }
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- virtual int av_buffersink_poll_frame(AVFilterContext *ctx) { return ::av_buffersink_poll_frame(ctx); }
--#endif
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllAvFilter: Using libavfilter system library");
--#endif
-- return true;
-- }
-- virtual void Unload() {}
--};
--#else
--class DllAvFilter : public DllDynamic, DllAvFilterInterface
--{
-- DECLARE_DLL_WRAPPER(DllAvFilter, DLL_PATH_LIBAVFILTER)
--
-- LOAD_SYMBOLS()
--
-- DEFINE_METHOD1(void, avfilter_free_dont_call, (AVFilterContext *p1))
-- DEFINE_METHOD1(void, avfilter_graph_free_dont_call, (AVFilterGraph **p1))
-- DEFINE_METHOD0(void, avfilter_register_all_dont_call)
-- DEFINE_METHOD6(int, avfilter_graph_create_filter, (AVFilterContext **p1, AVFilter *p2, const char *p3, const char *p4, void *p5, AVFilterGraph *p6))
-- DEFINE_METHOD1(AVFilter*, avfilter_get_by_name, (const char *p1))
-- DEFINE_METHOD0(AVFilterGraph*, avfilter_graph_alloc)
-- DEFINE_METHOD0(AVFilterInOut*, avfilter_inout_alloc_dont_call)
-- DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1))
--#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR)
-- DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_ptr_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *)
--#else
-- DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *)
--#endif
-- DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *)
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- DEFINE_METHOD2(int, av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2))
--#else
-- DEFINE_METHOD3(int, av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3))
-- DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1))
--#endif
-- DEFINE_METHOD4(int, avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4))
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- DEFINE_FUNC_ALIGNED2(int , __cdecl, av_buffersink_get_frame, AVFilterContext *, AVFrame *);
--#else
-- DEFINE_FUNC_ALIGNED3(int , __cdecl, av_buffersink_get_buffer_ref, AVFilterContext *, AVFilterBufferRef **, int);
--#endif
-- DEFINE_FUNC_ALIGNED0(AVBufferSinkParams*, __cdecl, av_buffersink_params_alloc);
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- DEFINE_FUNC_ALIGNED1(int , __cdecl, av_buffersink_poll_frame, AVFilterContext *);
--#endif
--
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD_RENAME(avfilter_free, avfilter_free_dont_call)
-- RESOLVE_METHOD_RENAME(avfilter_graph_free, avfilter_graph_free_dont_call)
-- RESOLVE_METHOD_RENAME(avfilter_register_all, avfilter_register_all_dont_call)
-- RESOLVE_METHOD(avfilter_graph_create_filter)
-- RESOLVE_METHOD(avfilter_get_by_name)
-- RESOLVE_METHOD(avfilter_graph_alloc)
-- RESOLVE_METHOD_RENAME(avfilter_inout_alloc, avfilter_inout_alloc_dont_call)
-- RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call)
--#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR)
-- RESOLVE_METHOD_RENAME(avfilter_graph_parse_ptr, avfilter_graph_parse_ptr_dont_call)
--#else
-- RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call)
--#endif
-- RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call)
-- RESOLVE_METHOD(av_buffersrc_add_frame)
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- RESOLVE_METHOD(avfilter_unref_buffer)
--#endif
-- RESOLVE_METHOD(avfilter_link)
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- RESOLVE_METHOD(av_buffersink_get_frame)
--#else
-- RESOLVE_METHOD(av_buffersink_get_buffer_ref)
--#endif
-- RESOLVE_METHOD(av_buffersink_params_alloc)
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- RESOLVE_METHOD(av_buffersink_poll_frame)
--#endif
-- END_METHOD_RESOLVE()
--
-- /* dependencies of libavfilter */
-- DllAvUtil m_dllAvUtil;
-- DllSwResample m_dllSwResample;
-- DllAvFormat m_dllAvFormat;
--
--public:
-- void avfilter_free(AVFilterContext *filter)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- avfilter_free_dont_call(filter);
-- }
-- void avfilter_graph_free(AVFilterGraph **graph)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- avfilter_graph_free_dont_call(graph);
-- }
-- void avfilter_register_all()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- avfilter_register_all_dont_call();
-- }
-- AVFilterInOut* avfilter_inout_alloc()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avfilter_inout_alloc_dont_call();
-- }
--#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR)
-- int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avfilter_graph_parse_ptr_dont_call(graph, filters, inputs, outputs, log_ctx);
-- }
--#else
-- int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avfilter_graph_parse_dont_call(graph, filters, inputs, outputs, log_ctx);
-- }
--#endif
-- void avfilter_inout_free(AVFilterInOut **inout)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- avfilter_inout_free_dont_call(inout);
-- }
-- int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avfilter_graph_config_dont_call(graphctx, log_ctx);
-- }
-- virtual bool Load()
-- {
-- if (!m_dllAvUtil.Load())
-- return false;
-- if (!m_dllSwResample.Load())
-- return false;
-- if (!m_dllAvFormat.Load())
-- return false;
-- return DllDynamic::Load();
-- }
--};
--#endif
-diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h
-deleted file mode 100644
-index fc7e166..0000000
---- a/lib/DllAvFormat.h
-+++ /dev/null
-@@ -1,322 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "DllAvCodec.h"
--
--extern "C" {
--#ifndef HAVE_MMX
--#define HAVE_MMX
--#endif
--#ifndef __STDC_CONSTANT_MACROS
--#define __STDC_CONSTANT_MACROS
--#endif
--#ifndef __GNUC__
--#pragma warning(disable:4244)
--#endif
--#if (defined USE_EXTERNAL_FFMPEG)
-- #include
-- /* xbmc_read_frame_flush() is defined for us in lib/xbmc-dll-symbols/DllAvFormat.c */
-- void xbmc_read_frame_flush(AVFormatContext *s);
--#else
-- #include "libavformat/avformat.h"
-- #if defined(TARGET_DARWIN) || defined(USE_STATIC_FFMPEG)
-- void ff_read_frame_flush(AVFormatContext *s); // internal replacement
-- #define xbmc_read_frame_flush ff_read_frame_flush
-- #endif
--#endif
--}
--
--/* Flag introduced without a version bump */
--#ifndef AVSEEK_FORCE
--#define AVSEEK_FORCE 0x20000
--#endif
--
--#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55,12,100)
--#define AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE
--#endif
--
--typedef int64_t offset_t;
--
--class DllAvFormatInterface
--{
--public:
-- virtual ~DllAvFormatInterface() {}
-- virtual void av_register_all_dont_call(void)=0;
-- virtual void avformat_network_init_dont_call(void)=0;
-- virtual void avformat_network_deinit_dont_call(void)=0;
-- virtual AVInputFormat *av_find_input_format(const char *short_name)=0;
-- virtual void avformat_close_input(AVFormatContext **s)=0;
-- virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt)=0;
-- virtual void av_read_frame_flush(AVFormatContext *s)=0;
-- virtual int av_read_play(AVFormatContext *s)=0;
-- virtual int av_read_pause(AVFormatContext *s)=0;
-- virtual int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)=0;
--#if (!defined USE_EXTERNAL_FFMPEG) && (!defined TARGET_DARWIN) && (!defined USE_STATIC_FFMPEG)
-- virtual int avformat_find_stream_info_dont_call(AVFormatContext *ic, AVDictionary **options)=0;
--#endif
-- virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0;
-- virtual AVIOContext *avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque,
-- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-- offset_t (*seek)(void *opaque, offset_t offset, int whence))=0;
-- virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)=0;
-- virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)=0;
-- virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)=0;
-- virtual void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)=0;
-- virtual int avio_open(AVIOContext **s, const char *filename, int flags)=0;
-- virtual int avio_close(AVIOContext *s)=0;
-- virtual int avio_open_dyn_buf(AVIOContext **s)=0;
-- virtual int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)=0;
-- virtual offset_t avio_seek(AVIOContext *s, offset_t offset, int whence)=0;
-- virtual int avio_read(AVIOContext *s, unsigned char *buf, int size)=0;
-- virtual void avio_w8(AVIOContext *s, int b)=0;
-- virtual void avio_write(AVIOContext *s, const unsigned char *buf, int size)=0;
-- virtual void avio_wb24(AVIOContext *s, unsigned int val)=0;
-- virtual void avio_wb32(AVIOContext *s, unsigned int val)=0;
-- virtual void avio_wb16(AVIOContext *s, unsigned int val)=0;
-- virtual AVFormatContext *avformat_alloc_context(void)=0;
-- virtual int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat, const char *format_name, const char *filename) = 0;
-- virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)=0;
-- virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0;
-- virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options)=0;
-- virtual int av_write_trailer(AVFormatContext *s)=0;
-- virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0;
--#if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE)
-- virtual AVRational av_stream_get_r_frame_rate(const AVStream *s)=0;
--#endif
--};
--
--#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--
--// Use direct mapping
--class DllAvFormat : public DllDynamic, DllAvFormatInterface
--{
--public:
-- virtual ~DllAvFormat() {}
-- virtual void av_register_all()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::av_register_all();
-- }
-- virtual void av_register_all_dont_call() { *(volatile int* )0x0 = 0; }
-- virtual void avformat_network_init_dont_call() { *(volatile int* )0x0 = 0; }
-- virtual void avformat_network_deinit_dont_call() { *(volatile int* )0x0 = 0; }
-- virtual AVInputFormat *av_find_input_format(const char *short_name) { return ::av_find_input_format(short_name); }
-- virtual void avformat_close_input(AVFormatContext **s) { ::avformat_close_input(s); }
-- virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt) { return ::av_read_frame(s, pkt); }
-- virtual void av_read_frame_flush(AVFormatContext *s) { ::xbmc_read_frame_flush(s); }
-- virtual int av_read_play(AVFormatContext *s) { return ::av_read_play(s); }
-- virtual int av_read_pause(AVFormatContext *s) { return ::av_read_pause(s); }
-- virtual int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { return ::av_seek_frame(s, stream_index, timestamp, flags); }
-- virtual int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return ::avformat_find_stream_info(ic, options);
-- }
-- virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
-- { return ::avformat_open_input(ps, filename, fmt, options); }
-- virtual AVIOContext *avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque,
-- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-- offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::avio_alloc_context(buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); }
-- virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened) {return ::av_probe_input_format(pd, is_opened); }
-- virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers
-- virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); }
-- virtual void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::av_dump_format(ic, index, url, is_output); }
-- virtual int avio_open(AVIOContext **s, const char *filename, int flags) { return ::avio_open(s, filename, flags); }
-- virtual int avio_close(AVIOContext *s) { return ::avio_close(s); }
-- virtual int avio_open_dyn_buf(AVIOContext **s) { return ::avio_open_dyn_buf(s); }
-- virtual int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) { return ::avio_close_dyn_buf(s, pbuffer); }
-- virtual offset_t avio_seek(AVIOContext *s, offset_t offset, int whence) { return ::avio_seek(s, offset, whence); }
-- virtual int avio_read(AVIOContext *s, unsigned char *buf, int size) { return ::avio_read(s, buf, size); }
-- virtual void avio_w8(AVIOContext *s, int b) { ::avio_w8(s, b); }
-- virtual void avio_write(AVIOContext *s, const unsigned char *buf, int size) { ::avio_write(s, buf, size); }
-- virtual void avio_wb24(AVIOContext *s, unsigned int val) { ::avio_wb24(s, val); }
-- virtual void avio_wb32(AVIOContext *s, unsigned int val) { ::avio_wb32(s, val); }
-- virtual void avio_wb16(AVIOContext *s, unsigned int val) { ::avio_wb16(s, val); }
-- virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); }
-- virtual int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat, const char *format_name, const char *filename){ return ::avformat_alloc_output_context2(ctx,oformat,format_name,filename); }
-- virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); }
-- virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); }
-- virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options) { return ::avformat_write_header (s, options); }
-- virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); }
-- virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); }
--#if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE)
-- virtual AVRational av_stream_get_r_frame_rate(const AVStream *s) { return ::av_stream_get_r_frame_rate(s); }
--#endif
--
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllAvFormat: Using libavformat system library");
--#endif
-- CSingleLock lock(DllAvCodec::m_critSection);
-- if (++m_avformat_refcnt == 1)
-- ::avformat_network_init();
-- return true;
-- }
-- virtual void Unload() {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- if (--m_avformat_refcnt == 0)
-- ::avformat_network_deinit();
-- }
--
--protected:
-- static int m_avformat_refcnt;
--};
--
--#else
--
--class DllAvFormat : public DllDynamic, DllAvFormatInterface
--{
-- DECLARE_DLL_WRAPPER(DllAvFormat, DLL_PATH_LIBAVFORMAT)
--
-- LOAD_SYMBOLS()
--
-- DEFINE_METHOD0(void, av_register_all_dont_call)
-- DEFINE_METHOD0(void, avformat_network_init_dont_call)
-- DEFINE_METHOD0(void, avformat_network_deinit_dont_call)
-- DEFINE_METHOD1(AVInputFormat*, av_find_input_format, (const char *p1))
-- DEFINE_METHOD1(void, avformat_close_input, (AVFormatContext **p1))
-- DEFINE_METHOD1(int, av_read_play, (AVFormatContext *p1))
-- DEFINE_METHOD1(int, av_read_pause, (AVFormatContext *p1))
-- DEFINE_METHOD1(void, av_read_frame_flush, (AVFormatContext *p1))
-- DEFINE_FUNC_ALIGNED2(int, __cdecl, av_read_frame, AVFormatContext *, AVPacket *)
-- DEFINE_FUNC_ALIGNED4(int, __cdecl, av_seek_frame, AVFormatContext*, int, int64_t, int)
-- DEFINE_FUNC_ALIGNED2(int, __cdecl, avformat_find_stream_info_dont_call, AVFormatContext*, AVDictionary **)
-- DEFINE_FUNC_ALIGNED4(int, __cdecl, avformat_open_input, AVFormatContext **, const char *, AVInputFormat *, AVDictionary **)
-- DEFINE_FUNC_ALIGNED2(AVInputFormat*, __cdecl, av_probe_input_format, AVProbeData*, int)
-- DEFINE_FUNC_ALIGNED3(AVInputFormat*, __cdecl, av_probe_input_format2, AVProbeData*, int, int*)
-- DEFINE_FUNC_ALIGNED6(int, __cdecl, av_probe_input_buffer, AVIOContext *, AVInputFormat **, const char *, void *, unsigned int, unsigned int)
-- DEFINE_FUNC_ALIGNED3(int, __cdecl, avio_read, AVIOContext*, unsigned char *, int)
-- DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_w8, AVIOContext*, int)
-- DEFINE_FUNC_ALIGNED3(void, __cdecl, avio_write, AVIOContext*, const unsigned char *, int)
-- DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_wb24, AVIOContext*, unsigned int)
-- DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_wb32, AVIOContext*, unsigned int)
-- DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_wb16, AVIOContext*, unsigned int)
-- DEFINE_METHOD7(AVIOContext *, avio_alloc_context, (unsigned char *p1, int p2, int p3, void *p4,
-- int (*p5)(void *opaque, uint8_t *buf, int buf_size),
-- int (*p6)(void *opaque, uint8_t *buf, int buf_size),
-- offset_t (*p7)(void *opaque, offset_t offset, int whence)))
-- DEFINE_METHOD4(void, av_dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4))
-- DEFINE_METHOD3(int, avio_open, (AVIOContext **p1, const char *p2, int p3))
-- DEFINE_METHOD1(int, avio_close, (AVIOContext *p1))
-- DEFINE_METHOD1(int, avio_open_dyn_buf, (AVIOContext **p1))
-- DEFINE_METHOD2(int, avio_close_dyn_buf, (AVIOContext *p1, uint8_t **p2))
-- DEFINE_METHOD3(offset_t, avio_seek, (AVIOContext *p1, offset_t p2, int p3))
-- DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context)
-- DEFINE_METHOD4(int, avformat_alloc_output_context2, (AVFormatContext **p1, AVOutputFormat *p2, const char *p3, const char *p4))
-- DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2))
-- DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3))
-- DEFINE_METHOD2(int, avformat_write_header , (AVFormatContext *p1, AVDictionary **p2))
-- DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1))
-- DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2))
--#if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE)
-- DEFINE_METHOD1(AVRational, av_stream_get_r_frame_rate, (const AVStream *p1))
--#endif
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call)
-- RESOLVE_METHOD_RENAME(avformat_network_init, avformat_network_init_dont_call)
-- RESOLVE_METHOD_RENAME(avformat_network_deinit, avformat_network_deinit_dont_call)
-- RESOLVE_METHOD(av_find_input_format)
-- RESOLVE_METHOD(avformat_close_input)
-- RESOLVE_METHOD(av_read_frame)
-- RESOLVE_METHOD(av_read_play)
-- RESOLVE_METHOD(av_read_pause)
-- RESOLVE_METHOD(av_read_frame_flush)
-- RESOLVE_METHOD(av_seek_frame)
-- RESOLVE_METHOD_RENAME(avformat_find_stream_info, avformat_find_stream_info_dont_call)
-- RESOLVE_METHOD(avformat_open_input)
-- RESOLVE_METHOD(avio_alloc_context)
-- RESOLVE_METHOD(av_probe_input_format)
-- RESOLVE_METHOD(av_probe_input_format2)
-- RESOLVE_METHOD(av_probe_input_buffer)
-- RESOLVE_METHOD(av_dump_format)
-- RESOLVE_METHOD(avio_open)
-- RESOLVE_METHOD(avio_close)
-- RESOLVE_METHOD(avio_open_dyn_buf)
-- RESOLVE_METHOD(avio_close_dyn_buf)
-- RESOLVE_METHOD(avio_seek)
-- RESOLVE_METHOD(avio_read)
-- RESOLVE_METHOD(avio_w8)
-- RESOLVE_METHOD(avio_write)
-- RESOLVE_METHOD(avio_wb24)
-- RESOLVE_METHOD(avio_wb32)
-- RESOLVE_METHOD(avio_wb16)
-- RESOLVE_METHOD(avformat_alloc_context)
-- RESOLVE_METHOD(avformat_alloc_output_context2)
-- RESOLVE_METHOD(avformat_new_stream)
-- RESOLVE_METHOD(av_guess_format)
-- RESOLVE_METHOD(avformat_write_header)
-- RESOLVE_METHOD(av_write_trailer)
-- RESOLVE_METHOD(av_write_frame)
--#if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE)
-- RESOLVE_METHOD(av_stream_get_r_frame_rate)
--#endif
-- END_METHOD_RESOLVE()
--
-- /* dependencies of libavformat */
-- DllAvCodec m_dllAvCodec;
-- // DllAvUtil loaded implicitely by m_dllAvCodec
--
--public:
-- void av_register_all()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- av_register_all_dont_call();
-- }
-- int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- return avformat_find_stream_info_dont_call(ic, options);
-- }
--
-- virtual bool Load()
-- {
-- if (!m_dllAvCodec.Load())
-- return false;
-- bool loaded = DllDynamic::Load();
--
-- CSingleLock lock(DllAvCodec::m_critSection);
-- if (++m_avformat_refcnt == 1 && loaded)
-- avformat_network_init_dont_call();
-- return loaded;
-- }
--
-- virtual void Unload()
-- {
-- CSingleLock lock(DllAvCodec::m_critSection);
-- if (--m_avformat_refcnt == 0 && DllDynamic::IsLoaded())
-- avformat_network_deinit_dont_call();
--
-- DllDynamic::Unload();
-- }
--
--protected:
-- static int m_avformat_refcnt;
--};
--
--#endif
-diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h
-deleted file mode 100644
-index 0fcdf10..0000000
---- a/lib/DllAvUtil.h
-+++ /dev/null
-@@ -1,291 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "utils/log.h"
--
--#ifndef __GNUC__
--#pragma warning(push)
--#pragma warning(disable:4244)
--#endif
--
--extern "C" {
--#if (defined USE_EXTERNAL_FFMPEG)
-- #include
-- // for av_get_default_channel_layout
-- #include
-- #include
-- #include
-- // for LIBAVCODEC_VERSION_INT:
-- #include
-- // for enum AVSampleFormat
-- #include
-- #include
-- #include
-- #include
-- #if (defined USE_LIBAV_HACKS)
-- #include "xbmc-libav-hacks/libav_hacks.h"
-- #endif
--#else
-- #include "libavutil/avutil.h"
-- //for av_get_default_channel_layout
-- #include "libavutil/audioconvert.h"
-- #include "libavutil/crc.h"
-- #include "libavutil/opt.h"
-- #include "libavutil/mem.h"
-- #include "libavutil/fifo.h"
-- // for enum AVSampleFormat
-- #include "libavutil/samplefmt.h"
--#endif
--}
--
--#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52,29,100)
--#define AVFRAME_IN_LAVU
--#endif
--
--#ifndef __GNUC__
--#pragma warning(pop)
--#endif
--
--// calback used for logging
--void ff_avutil_log(void* ptr, int level, const char* format, va_list va);
--
--class DllAvUtilInterface
--{
--public:
-- virtual ~DllAvUtilInterface() {}
-- virtual void av_log_set_callback(void (*)(void*, int, const char*, va_list))=0;
-- virtual void *av_malloc(unsigned int size)=0;
-- virtual void *av_mallocz(unsigned int size)=0;
-- virtual void *av_realloc(void *ptr, unsigned int size)=0;
-- virtual void av_free(void *ptr)=0;
-- virtual void av_freep(void *ptr)=0;
-- virtual int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding)=0;
-- virtual int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)=0;
-- virtual int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)=0;
-- virtual const AVCRC* av_crc_get_table(AVCRCId crc_id)=0;
-- virtual uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)=0;
-- virtual int av_opt_set(void *obj, const char *name, const char *val, int search_flags)=0;
-- virtual int av_opt_set_double(void *obj, const char *name, double val, int search_flags)=0;
-- virtual int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)=0;
-- virtual AVFifoBuffer *av_fifo_alloc(unsigned int size) = 0;
-- virtual void av_fifo_free(AVFifoBuffer *f) = 0;
-- virtual void av_fifo_reset(AVFifoBuffer *f) = 0;
-- virtual int av_fifo_size(AVFifoBuffer *f) = 0;
-- virtual int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)) = 0;
-- virtual int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)) = 0;
-- virtual char *av_strdup(const char *s)=0;
-- virtual int av_get_bytes_per_sample(enum AVSampleFormat p1) = 0;
-- virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) = 0;
-- virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)=0;
-- virtual void av_dict_free(AVDictionary **pm) = 0;
-- virtual int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0;
-- virtual int64_t av_get_default_channel_layout(int nb_channels)=0;
-- virtual int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0;
-- virtual int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt) = 0;
-- virtual int av_get_channel_layout_channel_index (uint64_t channel_layout, uint64_t channel) = 0;
-- virtual int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0;
-- virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) = 0;
-- virtual uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index) = 0;
--#if defined(AVFRAME_IN_LAVU)
-- virtual void av_frame_free(AVFrame **frame)=0;
-- virtual AVFrame *av_frame_alloc(void)=0;
-- virtual void av_frame_unref(AVFrame *frame)=0;
-- virtual void av_frame_move_ref(AVFrame *dst, AVFrame *src)=0;
--#endif
--};
--
--#if defined (USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--// Use direct layer
--class DllAvUtilBase : public DllDynamic, DllAvUtilInterface
--{
--public:
--
-- virtual ~DllAvUtilBase() {}
-- virtual void av_log_set_callback(void (*foo)(void*, int, const char*, va_list)) { ::av_log_set_callback(foo); }
-- virtual void *av_malloc(unsigned int size) { return ::av_malloc(size); }
-- virtual void *av_mallocz(unsigned int size) { return ::av_mallocz(size); }
-- virtual void *av_realloc(void *ptr, unsigned int size) { return ::av_realloc(ptr, size); }
-- virtual void av_free(void *ptr) { ::av_free(ptr); }
-- virtual void av_freep(void *ptr) { ::av_freep(ptr); }
-- virtual int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding d) { return ::av_rescale_rnd(a, b, c, d); }
-- virtual int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) { return ::av_rescale_q(a, bq, cq); }
-- virtual int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size) { return ::av_crc_init(ctx, le, bits, poly, ctx_size); }
-- virtual const AVCRC* av_crc_get_table(AVCRCId crc_id) { return ::av_crc_get_table(crc_id); }
-- virtual uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length) { return ::av_crc(ctx, crc, buffer, length); }
-- virtual int av_opt_set(void *obj, const char *name, const char *val, int search_flags) { return ::av_opt_set(obj, name, val, search_flags); }
-- virtual int av_opt_set_double(void *obj, const char *name, double val, int search_flags) { return ::av_opt_set_double(obj, name, val, search_flags); }
-- virtual int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags) { return ::av_opt_set_int(obj, name, val, search_flags); }
-- virtual AVFifoBuffer *av_fifo_alloc(unsigned int size) {return ::av_fifo_alloc(size); }
-- virtual void av_fifo_free(AVFifoBuffer *f) { ::av_fifo_free(f); }
-- virtual void av_fifo_reset(AVFifoBuffer *f) { ::av_fifo_reset(f); }
-- virtual int av_fifo_size(AVFifoBuffer *f) { return ::av_fifo_size(f); }
-- virtual int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int))
-- { return ::av_fifo_generic_read(f, dest, buf_size, func); }
-- virtual int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int))
-- { return ::av_fifo_generic_write(f, src, size, func); }
-- virtual char *av_strdup(const char *s) { return ::av_strdup(s); }
-- virtual int av_get_bytes_per_sample(enum AVSampleFormat p1)
-- { return ::av_get_bytes_per_sample(p1); }
-- virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return ::av_dict_get(m, key, prev, flags); }
-- virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_dict_set(pm, key, value, flags); }
-- virtual void av_dict_free(AVDictionary **pm) { ::av_dict_free(pm); }
-- virtual int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
-- { return ::av_samples_get_buffer_size(linesize, nb_channels, nb_samples, sample_fmt, align); }
-- virtual int64_t av_get_default_channel_layout(int nb_channels) { return ::av_get_default_channel_layout(nb_channels); }
-- virtual int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
-- { return ::av_samples_alloc(audio_data, linesize, nb_channels, nb_samples, sample_fmt, align); }
-- virtual int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt) { return ::av_sample_fmt_is_planar(sample_fmt); }
-- virtual int av_get_channel_layout_channel_index (uint64_t channel_layout, uint64_t channel) { return ::av_get_channel_layout_channel_index(channel_layout, channel); }
-- virtual int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
-- { return ::av_samples_fill_arrays(audio_data, linesize, buf, nb_channels, nb_samples, sample_fmt, align); }
-- virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
-- { return ::av_samples_copy(dst, src, dst_offset, src_offset, nb_samples, nb_channels, sample_fmt); }
-- virtual uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
-- { return ::av_channel_layout_extract_channel(channel_layout, index); }
--#if defined(AVFRAME_IN_LAVU)
-- virtual void av_frame_free(AVFrame **frame) { return ::av_frame_free(frame); }
-- virtual AVFrame *av_frame_alloc() { return ::av_frame_alloc(); }
-- virtual void av_frame_unref(AVFrame *frame) { return ::av_frame_unref(frame); }
-- virtual void av_frame_move_ref(AVFrame *dst, AVFrame *src) { return ::av_frame_move_ref(dst,src); }
--#endif
--
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllAvUtilBase: Using libavutil system library");
--#endif
-- return true;
-- }
-- virtual void Unload() {}
--};
--
--#else
--
--class DllAvUtilBase : public DllDynamic, DllAvUtilInterface
--{
-- DECLARE_DLL_WRAPPER(DllAvUtilBase, DLL_PATH_LIBAVUTIL)
--
-- LOAD_SYMBOLS()
--
-- DEFINE_METHOD1(void, av_log_set_callback, (void (*p1)(void*, int, const char*, va_list)))
-- DEFINE_METHOD1(void*, av_malloc, (unsigned int p1))
-- DEFINE_METHOD1(void*, av_mallocz, (unsigned int p1))
-- DEFINE_METHOD2(void*, av_realloc, (void *p1, unsigned int p2))
-- DEFINE_METHOD1(void, av_free, (void *p1))
-- DEFINE_METHOD1(void, av_freep, (void *p1))
-- DEFINE_METHOD4(int64_t, av_rescale_rnd, (int64_t p1, int64_t p2, int64_t p3, enum AVRounding p4));
-- DEFINE_METHOD3(int64_t, av_rescale_q, (int64_t p1, AVRational p2, AVRational p3));
-- DEFINE_METHOD1(const AVCRC*, av_crc_get_table, (AVCRCId p1))
-- DEFINE_METHOD5(int, av_crc_init, (AVCRC *p1, int p2, int p3, uint32_t p4, int p5));
-- DEFINE_METHOD4(uint32_t, av_crc, (const AVCRC *p1, uint32_t p2, const uint8_t *p3, size_t p4));
-- DEFINE_METHOD4(int, av_opt_set, (void *p1, const char *p2, const char *p3, int p4));
-- DEFINE_METHOD4(int, av_opt_set_double, (void *p1, const char *p2, double p3, int p4))
-- DEFINE_METHOD4(int, av_opt_set_int, (void *p1, const char *p2, int64_t p3, int p4))
-- DEFINE_METHOD1(AVFifoBuffer*, av_fifo_alloc, (unsigned int p1))
-- DEFINE_METHOD1(void, av_fifo_free, (AVFifoBuffer *p1))
-- DEFINE_METHOD1(void, av_fifo_reset, (AVFifoBuffer *p1))
-- DEFINE_METHOD1(int, av_fifo_size, (AVFifoBuffer *p1))
-- DEFINE_METHOD4(int, av_fifo_generic_read, (AVFifoBuffer *p1, void *p2, int p3, void (*p4)(void*, void*, int)))
-- DEFINE_METHOD4(int, av_fifo_generic_write, (AVFifoBuffer *p1, void *p2, int p3, int (*p4)(void*, void*, int)))
-- DEFINE_METHOD1(char*, av_strdup, (const char *p1))
-- DEFINE_METHOD1(int, av_get_bytes_per_sample, (enum AVSampleFormat p1))
-- DEFINE_METHOD4(AVDictionaryEntry *, av_dict_get, (AVDictionary *p1, const char *p2, const AVDictionaryEntry *p3, int p4))
-- DEFINE_METHOD4(int, av_dict_set, (AVDictionary **p1, const char *p2, const char *p3, int p4));
-- DEFINE_METHOD1(void, av_dict_free, (AVDictionary **p1));
-- DEFINE_METHOD5(int, av_samples_get_buffer_size, (int *p1, int p2, int p3, enum AVSampleFormat p4, int p5))
-- DEFINE_METHOD1(int64_t, av_get_default_channel_layout, (int p1))
-- DEFINE_METHOD6(int, av_samples_alloc, (uint8_t **p1, int *p2, int p3, int p4, enum AVSampleFormat p5, int p6))
-- DEFINE_METHOD1(int, av_sample_fmt_is_planar, (enum AVSampleFormat p1))
-- DEFINE_METHOD2(int, av_get_channel_layout_channel_index, (uint64_t p1, uint64_t p2))
-- DEFINE_METHOD7(int, av_samples_fill_arrays, (uint8_t **p1, int *p2, const uint8_t *p3, int p4, int p5, enum AVSampleFormat p6, int p7))
-- DEFINE_METHOD7(int, av_samples_copy, (uint8_t **p1, uint8_t *const *p2, int p3, int p4, int p5, int p6, enum AVSampleFormat p7))
-- DEFINE_METHOD2(uint64_t, av_channel_layout_extract_channel, (uint64_t p1, int p2))
--#if defined(AVFRAME_IN_LAVU)
-- DEFINE_METHOD1(void, av_frame_free, (AVFrame **p1))
-- DEFINE_METHOD0(AVFrame *, av_frame_alloc)
-- DEFINE_METHOD1(void, av_frame_unref, (AVFrame *p1))
-- DEFINE_METHOD2(void, av_frame_move_ref, (AVFrame *p1, AVFrame* p2))
--#endif
--
-- public:
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD(av_log_set_callback)
-- RESOLVE_METHOD(av_malloc)
-- RESOLVE_METHOD(av_mallocz)
-- RESOLVE_METHOD(av_realloc)
-- RESOLVE_METHOD(av_free)
-- RESOLVE_METHOD(av_freep)
-- RESOLVE_METHOD(av_rescale_rnd)
-- RESOLVE_METHOD(av_rescale_q)
-- RESOLVE_METHOD(av_crc_init)
-- RESOLVE_METHOD(av_crc_get_table)
-- RESOLVE_METHOD(av_crc)
-- RESOLVE_METHOD(av_opt_set)
-- RESOLVE_METHOD(av_opt_set_double)
-- RESOLVE_METHOD(av_opt_set_int)
-- RESOLVE_METHOD(av_fifo_alloc)
-- RESOLVE_METHOD(av_fifo_free)
-- RESOLVE_METHOD(av_fifo_reset)
-- RESOLVE_METHOD(av_fifo_size)
-- RESOLVE_METHOD(av_fifo_generic_read)
-- RESOLVE_METHOD(av_fifo_generic_write)
-- RESOLVE_METHOD(av_strdup)
-- RESOLVE_METHOD(av_get_bytes_per_sample)
-- RESOLVE_METHOD(av_dict_get)
-- RESOLVE_METHOD(av_dict_set)
-- RESOLVE_METHOD(av_dict_free)
-- RESOLVE_METHOD(av_samples_get_buffer_size)
-- RESOLVE_METHOD(av_get_default_channel_layout)
-- RESOLVE_METHOD(av_samples_alloc)
-- RESOLVE_METHOD(av_sample_fmt_is_planar)
-- RESOLVE_METHOD(av_get_channel_layout_channel_index)
-- RESOLVE_METHOD(av_samples_fill_arrays)
-- RESOLVE_METHOD(av_samples_copy)
-- RESOLVE_METHOD(av_channel_layout_extract_channel)
--#if defined(AVFRAME_IN_LAVU)
-- RESOLVE_METHOD(av_frame_free)
-- RESOLVE_METHOD(av_frame_alloc)
-- RESOLVE_METHOD(av_frame_unref)
-- RESOLVE_METHOD(av_frame_move_ref)
--#endif
-- END_METHOD_RESOLVE()
--};
--
--#endif
--
--class DllAvUtil : public DllAvUtilBase
--{
--public:
-- virtual bool Load()
-- {
-- if( DllAvUtilBase::Load() )
-- {
-- DllAvUtilBase::av_log_set_callback(ff_avutil_log);
-- return true;
-- }
-- return false;
-- }
--};
-diff --git a/lib/DllPostProc.h b/lib/DllPostProc.h
-deleted file mode 100644
-index ebba5e2..0000000
---- a/lib/DllPostProc.h
-+++ /dev/null
-@@ -1,129 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "utils/log.h"
--
--extern "C" {
--#define HAVE_MMX
--#ifndef __STDC_CONSTANT_MACROS
--#define __STDC_CONSTANT_MACROS
--#endif
--#ifndef __STDC_LIMIT_MACROS
--#define __STDC_LIMIT_MACROS
--#endif
--#ifndef __GNUC__
--#pragma warning(disable:4244)
--#endif
--
--#if (defined USE_EXTERNAL_FFMPEG)
-- #include
-- #include
--#else
-- #include "libavutil/avutil.h"
-- #include "libpostproc/postprocess.h"
--#endif
--}
--
--#include "utils/CPUInfo.h"
--
--inline int PPCPUFlags()
--{
-- unsigned int cpuFeatures = g_cpuInfo.GetCPUFeatures();
-- int flags = 0;
--
-- if (cpuFeatures & CPU_FEATURE_MMX)
-- flags |= PP_CPU_CAPS_MMX;
-- if (cpuFeatures & CPU_FEATURE_MMX2)
-- flags |= PP_CPU_CAPS_MMX2;
-- if (cpuFeatures & CPU_FEATURE_3DNOW)
-- flags |= PP_CPU_CAPS_3DNOW;
-- if (cpuFeatures & CPU_FEATURE_ALTIVEC)
-- flags |= PP_CPU_CAPS_ALTIVEC;
--
-- return flags;
--}
--
--class DllPostProcInterface
--{
--public:
-- virtual ~DllPostProcInterface() {}
-- virtual void pp_postprocess(uint8_t * src[3], int srcStride[3], uint8_t * dst[3], int dstStride[3],
-- int horizontalSize, int verticalSize, QP_STORE_T *QP_store, int QP_stride,
-- pp_mode *mode, pp_context *ppContext, int pict_type)=0;
-- virtual pp_mode *pp_get_mode_by_name_and_quality(char *name, int quality)=0;
-- virtual void pp_free_mode(pp_mode *mode)=0;
-- virtual pp_context *pp_get_context(int width, int height, int flags)=0;
-- virtual void pp_free_context(pp_context *ppContext)=0;
--};
--
--#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--
--// We call directly.
--class DllPostProc : public DllDynamic, DllPostProcInterface
--{
--public:
--
-- virtual ~DllPostProc() {}
-- virtual void pp_postprocess(uint8_t * src[3], int srcStride[3], uint8_t * dst[3], int dstStride[3],
-- int horizontalSize, int verticalSize, QP_STORE_T *QP_store, int QP_stride,
-- pp_mode *mode, pp_context *ppContext, int pict_type) { ::pp_postprocess((const uint8_t** )src, srcStride, dst, dstStride, horizontalSize, verticalSize, QP_store, QP_stride, mode, ppContext, pict_type); }
-- virtual pp_mode *pp_get_mode_by_name_and_quality(char *name, int quality) { return ::pp_get_mode_by_name_and_quality(name, quality); }
-- virtual void pp_free_mode(pp_mode *mode) { ::pp_free_mode(mode); }
-- virtual pp_context *pp_get_context(int width, int height, int flags) { return ::pp_get_context(width, height, flags); }
-- virtual void pp_free_context(pp_context *ppContext) { ::pp_free_context(ppContext); }
--
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllPostProc: Using libpostproc system library");
--#endif
-- return true;
-- }
-- virtual void Unload() {}
--};
--
--#else
--class DllPostProc : public DllDynamic, DllPostProcInterface
--{
-- DECLARE_DLL_WRAPPER(DllPostProc, DLL_PATH_LIBPOSTPROC)
-- DEFINE_METHOD11(void, pp_postprocess, (uint8_t* p1[3], int p2[3], uint8_t * p3[3], int p4[3],
-- int p5, int p6, QP_STORE_T *p7, int p8,
-- pp_mode *p9, pp_context *p10, int p11))
-- DEFINE_METHOD2(pp_mode*, pp_get_mode_by_name_and_quality, (char *p1, int p2))
-- DEFINE_METHOD1(void, pp_free_mode, (pp_mode *p1))
-- DEFINE_METHOD3(pp_context*, pp_get_context, (int p1, int p2, int p3))
-- DEFINE_METHOD1(void, pp_free_context, (pp_context *p1))
--
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD(pp_postprocess)
-- RESOLVE_METHOD(pp_get_mode_by_name_and_quality)
-- RESOLVE_METHOD(pp_free_mode)
-- RESOLVE_METHOD(pp_get_context)
-- RESOLVE_METHOD(pp_free_context)
-- END_METHOD_RESOLVE()
--};
--
--#endif
-diff --git a/lib/DllSwResample.h b/lib/DllSwResample.h
-deleted file mode 100644
-index cd1452b..0000000
---- a/lib/DllSwResample.h
-+++ /dev/null
-@@ -1,131 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "utils/log.h"
--
--extern "C" {
--#ifndef HAVE_MMX
--#define HAVE_MMX
--#endif
--#ifndef __STDC_CONSTANT_MACROS
--#define __STDC_CONSTANT_MACROS
--#endif
--#ifndef __GNUC__
--#pragma warning(disable:4244)
--#endif
--#if (defined USE_EXTERNAL_FFMPEG)
-- #if (defined USE_LIBAV_HACKS)
-- #include "xbmc-libav-hacks/libav_hacks.h"
-- #else
-- #include
-- #endif
--#else
-- #include "libswresample/swresample.h"
--#endif
--}
--
--class DllSwResampleInterface
--{
--public:
-- virtual ~DllSwResampleInterface() {}
-- virtual struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)=0;
-- virtual int swr_init(struct SwrContext *s)=0;
-- virtual void swr_free(struct SwrContext **s)=0;
-- virtual int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count)=0;
-- virtual int64_t swr_get_delay(struct SwrContext *s, int64_t base) = 0;
-- virtual int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map) = 0;
-- virtual int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride) = 0;
-- virtual int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance) = 0;
--};
--
--#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--
--// Use direct mapping
--class DllSwResample : public DllDynamic, DllSwResampleInterface
--{
--public:
-- virtual ~DllSwResample() {}
--
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllAvFormat: Using libswresample system library");
--#endif
-- return true;
-- }
-- virtual void Unload() {}
-- virtual struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx) { return ::swr_alloc_set_opts(s, out_ch_layout, out_sample_fmt, out_sample_rate, in_ch_layout, in_sample_fmt, in_sample_rate, log_offset, log_ctx); }
-- virtual int swr_init(struct SwrContext *s) { return ::swr_init(s); }
-- virtual void swr_free(struct SwrContext **s){ return ::swr_free(s); }
-- virtual int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count){ return ::swr_convert(s, out, out_count, in, in_count); }
-- virtual int64_t swr_get_delay(struct SwrContext *s, int64_t base) { return ::swr_get_delay(s, base); }
-- virtual int swr_set_channel_mapping (struct SwrContext *s, const int *channel_map) { return ::swr_set_channel_mapping(s, channel_map); }
-- virtual int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride) { return ::swr_set_matrix(s, matrix, stride); }
-- virtual int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance) { return ::swr_set_compensation(s, sample_delta, compensation_distance); }
--};
--
--#else
--
--class DllSwResample : public DllDynamic, DllSwResampleInterface
--{
-- DECLARE_DLL_WRAPPER(DllSwResample, DLL_PATH_LIBSWRESAMPLE)
--
-- LOAD_SYMBOLS()
--
-- DEFINE_METHOD9(SwrContext*, swr_alloc_set_opts, (struct SwrContext *p1, int64_t p2, enum AVSampleFormat p3, int p4, int64_t p5, enum AVSampleFormat p6, int p7, int p8, void * p9));
-- DEFINE_METHOD1(int, swr_init, (struct SwrContext *p1))
-- DEFINE_METHOD1(void, swr_free, (struct SwrContext **p1))
-- DEFINE_METHOD5(int, swr_convert, (struct SwrContext *p1, uint8_t **p2, int p3, const uint8_t **p4, int p5))
-- DEFINE_METHOD2(int64_t, swr_get_delay, (struct SwrContext *p1, int64_t p2))
-- DEFINE_METHOD2(int, swr_set_channel_mapping, (struct SwrContext *p1, const int *p2))
-- DEFINE_METHOD3(int, swr_set_matrix, (struct SwrContext *p1, const double *p2, int p3))
-- DEFINE_METHOD3(int, swr_set_compensation, (struct SwrContext *p1, int p2, int p3))
--
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD(swr_alloc_set_opts)
-- RESOLVE_METHOD(swr_init)
-- RESOLVE_METHOD(swr_free)
-- RESOLVE_METHOD(swr_convert)
-- RESOLVE_METHOD(swr_get_delay)
-- RESOLVE_METHOD(swr_set_channel_mapping)
-- RESOLVE_METHOD(swr_set_matrix)
-- RESOLVE_METHOD(swr_set_compensation)
-- END_METHOD_RESOLVE()
--
-- /* dependencies of libavformat */
-- DllAvUtil m_dllAvUtil;
--
--public:
--
-- virtual bool Load()
-- {
-- if (!m_dllAvUtil.Load())
-- return false;
-- return DllDynamic::Load();
-- }
--};
--
--#endif
-diff --git a/lib/DllSwScale.h b/lib/DllSwScale.h
-deleted file mode 100644
-index 97e3b40..0000000
---- a/lib/DllSwScale.h
-+++ /dev/null
-@@ -1,153 +0,0 @@
--#pragma once
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#include "DynamicDll.h"
--#include "DllAvUtil.h"
--#include "utils/log.h"
--
--extern "C" {
--#ifndef HAVE_MMX
--#define HAVE_MMX
--#endif
--
--#ifndef __STDC_CONSTANT_MACROS
--#define __STDC_CONSTANT_MACROS
--#endif
--
--#ifndef __STDC_LIMIT_MACROS
--#define __STDC_LIMIT_MACROS
--#endif
--
--#ifndef __GNUC__
--#pragma warning(disable:4244)
--#endif
--
--#if (defined USE_EXTERNAL_FFMPEG)
-- #include
--#else
-- #include "libswscale/swscale.h"
--#endif
--}
--
--#include "../xbmc/utils/CPUInfo.h"
--
--inline int SwScaleCPUFlags()
--{
-- unsigned int cpuFeatures = g_cpuInfo.GetCPUFeatures();
-- int flags = 0;
--
-- if (cpuFeatures & CPU_FEATURE_MMX)
-- flags |= SWS_CPU_CAPS_MMX;
-- if (cpuFeatures & CPU_FEATURE_MMX2)
-- flags |= SWS_CPU_CAPS_MMX2;
-- if (cpuFeatures & CPU_FEATURE_3DNOW)
-- flags |= SWS_CPU_CAPS_3DNOW;
-- if (cpuFeatures & CPU_FEATURE_ALTIVEC)
-- flags |= SWS_CPU_CAPS_ALTIVEC;
--
-- return flags;
--}
--
--class DllSwScaleInterface
--{
--public:
-- virtual ~DllSwScaleInterface() {}
--
-- virtual struct SwsContext *sws_getCachedContext(struct SwsContext *context,
-- int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
-- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)=0;
--
-- virtual struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
-- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)=0;
--
-- virtual int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
-- int srcSliceH, uint8_t* dst[], int dstStride[])=0;
--
-- virtual void sws_freeContext(struct SwsContext *context)=0;
--};
--
--#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
--
--// We call into this library directly.
--class DllSwScale : public DllDynamic, public DllSwScaleInterface
--{
--public:
-- virtual ~DllSwScale() {}
-- virtual struct SwsContext *sws_getCachedContext(struct SwsContext *context,
-- int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
-- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
-- { return ::sws_getCachedContext(context, srcW, srcH, (enum PixelFormat)srcFormat, dstW, dstH, (enum PixelFormat)dstFormat, flags, srcFilter, dstFilter, param); }
--
-- virtual struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
-- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
-- { return ::sws_getContext(srcW, srcH, (enum PixelFormat)srcFormat, dstW, dstH, (enum PixelFormat)dstFormat, flags, srcFilter, dstFilter, param); }
--
-- virtual int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
-- int srcSliceH, uint8_t* dst[], int dstStride[])
-- { return ::sws_scale(context, src, srcStride, srcSliceY, srcSliceH, dst, dstStride); }
-- virtual void sws_freeContext(struct SwsContext *context) { ::sws_freeContext(context); }
--
-- // DLL faking.
-- virtual bool ResolveExports() { return true; }
-- virtual bool Load() {
--#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
-- CLog::Log(LOGDEBUG, "DllSwScale: Using libswscale system library");
--#endif
-- return true;
-- }
-- virtual void Unload() {}
--};
--
--#else
--
--class DllSwScale : public DllDynamic, public DllSwScaleInterface
--{
-- DECLARE_DLL_WRAPPER(DllSwScale, DLL_PATH_LIBSWSCALE)
-- DEFINE_METHOD11(struct SwsContext *, sws_getCachedContext, ( struct SwsContext *p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8,
-- SwsFilter * p9, SwsFilter * p10, double * p11))
-- DEFINE_METHOD10(struct SwsContext *, sws_getContext, ( int p1, int p2, int p3, int p4, int p5, int p6, int p7,
-- SwsFilter * p8, SwsFilter * p9, double * p10))
-- DEFINE_METHOD7(int, sws_scale, (struct SwsContext *p1, uint8_t** p2, int *p3, int p4, int p5, uint8_t **p6, int *p7))
-- DEFINE_METHOD1(void, sws_freeContext, (struct SwsContext *p1))
--
-- BEGIN_METHOD_RESOLVE()
-- RESOLVE_METHOD(sws_getCachedContext)
-- RESOLVE_METHOD(sws_getContext)
-- RESOLVE_METHOD(sws_scale)
-- RESOLVE_METHOD(sws_freeContext)
-- END_METHOD_RESOLVE()
--
-- /* dependency of libswscale */
-- DllAvUtil m_dllAvUtil;
--
--public:
-- virtual bool Load()
-- {
-- if (!m_dllAvUtil.Load())
-- return false;
-- return DllDynamic::Load();
-- }
--};
--
--#endif
-diff --git a/lib/Makefile.in b/lib/Makefile.in
-deleted file mode 100644
-index ca18a4a..0000000
---- a/lib/Makefile.in
-+++ /dev/null
-@@ -1,103 +0,0 @@
--ARCH=@ARCH@
--
--AR=@AR@
--LD=@LD@
--CC=@CC@
--CXX=@CXX@
--SYSDIR=@abs_top_srcdir@/system/players/dvdplayer
--
--ifeq (@USE_ANDROID@,1)
--AVPREFIX=lib
--else
--AVPREFIX=
--endif
--
--AVFORMAT_SO=$(AVPREFIX)avformat-54-$(ARCH).so
--AVCODEC_SO=$(AVPREFIX)avcodec-54-$(ARCH).so
--AVUTIL_SO=$(AVPREFIX)avutil-52-$(ARCH).so
--AVFILTER_SO=$(AVPREFIX)avfilter-3-$(ARCH).so
--SWSCALE_SO=$(AVPREFIX)swscale-2-$(ARCH).so
--POSTPROC_SO=$(AVPREFIX)postproc-52-$(ARCH).so
--SWRESAMPLE_SO=$(AVPREFIX)swresample-0-$(ARCH).so
--
--DIRS=
--ifneq (@USE_EXTERNAL_FFMPEG@,1)
-- DIRS+=ffmpeg
--endif
--
--LIBS=
--ifneq (@USE_EXTERNAL_FFMPEG@,1)
--ifneq (@USE_STATIC_FFMPEG@,1)
-- LIBS+=$(AVUTIL_SO) \
-- $(AVCODEC_SO) \
-- $(AVFORMAT_SO) \
-- $(POSTPROC_SO) \
-- $(AVFILTER_SO) \
-- $(SWSCALE_SO) \
-- $(SWRESAMPLE_SO)
--endif
--endif
--
--.PHONY: $(DIRS) codecs
--
--ifneq ($(findstring osx,$(ARCH)), osx)
--ifneq (@USE_STATIC_FFMPEG@,1)
--
--codecs: $(addprefix $(SYSDIR)/, $(LIBS));
--
--$(SYSDIR)/$(AVUTIL_SO): ffmpeg/libavutil/libavutil.so
-- cp ffmpeg/libavutil/libavutil.so $@
--
--$(SYSDIR)/$(AVCODEC_SO): ffmpeg/libavcodec/libavcodec.so
-- cp ffmpeg/libavcodec/libavcodec.so $@
--
--$(SYSDIR)/$(AVFORMAT_SO): ffmpeg/libavformat/libavformat.so
-- cp ffmpeg/libavformat/libavformat.so $@
--
--$(SYSDIR)/$(AVFILTER_SO): ffmpeg/libavfilter/libavfilter.so
-- cp ffmpeg/libavfilter/libavfilter.so $@
--
--$(SYSDIR)/$(SWSCALE_SO): ffmpeg/libswscale/libswscale.so
-- cp ffmpeg/libswscale/libswscale.so $@
--
--$(SYSDIR)/$(POSTPROC_SO): ffmpeg/libpostproc/libpostproc.so
-- cp ffmpeg/libpostproc/libpostproc.so $@
--
--$(SYSDIR)/$(SWRESAMPLE_SO): ffmpeg/libswresample/libswresample.so
-- cp ffmpeg/libswresample/libswresample.so $@
--
--ffmpeg/libavutil/libavutil.so : ffmpeg;
--ffmpeg/libavcodec/libavcodec.so : ffmpeg;
--ffmpeg/libavformat/libavformat.so : ffmpeg;
--ffmpeg/libavfilter/libavfilter.so : ffmpeg;
--ffmpeg/libswscale/libswscale.so : ffmpeg;
--ffmpeg/libpostproc/libpostproc.so : ffmpeg;
--ffmpeg/libswresample/libswresample.so : ffmpeg;
--endif
--endif
--
--ifeq (@USE_STATIC_FFMPEG@,1)
--ffmpeg/libavutil/libavutil.a : ffmpeg;
--ffmpeg/libavcodec/libavcodec.a : ffmpeg;
--ffmpeg/libavformat/libavformat.a : ffmpeg;
--ffmpeg/libavfilter/libavfilter.a : ffmpeg;
--ffmpeg/libswscale/libswscale.a : ffmpeg;
--ffmpeg/libpostproc/libpostproc.a : ffmpeg;
--ffmpeg/libswresample/libswresample.a : ffmpeg;
--endif
--
--ffmpeg:
-- $(MAKE) -C $@
--ifeq ($(findstring osx,$(ARCH)), osx)
-- -$(AR) d ffmpeg/libavcodec/libavcodec.a log2_tab.o
-- -$(AR) d ffmpeg/libavformat/libavformat.a log2_tab.o
-- -$(AR) d ffmpeg/libswresample/libswresample.a log2_tab.o
--endif
--
--clean:
-- rm -f $(addprefix $(SYSDIR)/, $(LIBS))
-- for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" clean); fi ); done
--
--distclean:
-- rm -f $(addprefix $(SYSDIR)/, $(LIBS))
-- for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" distclean || $(MAKE) -C "$$d" clean); fi ); done
-diff --git a/lib/xbmc-dll-symbols/DllAvFormat.c b/lib/xbmc-dll-symbols/DllAvFormat.c
-deleted file mode 100644
-index a592a1f..0000000
---- a/lib/xbmc-dll-symbols/DllAvFormat.c
-+++ /dev/null
-@@ -1,126 +0,0 @@
--/*
-- * various utility functions used within FFmpeg
-- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
-- *
-- * FFmpeg is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Lesser General Public
-- * License as published by the Free Software Foundation; either
-- * version 2.1 of the License, or (at your option) any later version.
-- *
-- * FFmpeg is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Lesser General Public License for more details.
-- *
-- * You should have received a copy of the GNU Lesser General Public
-- * License along with FFmpeg; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-- */
--
--/* Functions defined here are functions that cannot be resolved through the
-- * ffmpeg shared libraries, yet are used in XBMC.
-- */
--
--#if (defined HAVE_CONFIG_H) && (!defined WIN32)
-- #include "config.h"
--#endif
--#if (defined USE_EXTERNAL_FFMPEG)
--#include
--
--/* Taken from libavformat/utils.c */
--#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0)
--static void flush_packet_queue(AVFormatContext *s)
--{
-- AVPacketList *pktl;
--
-- for(;;) {
-- pktl = s->packet_buffer;
-- if (!pktl)
-- break;
-- s->packet_buffer = pktl->next;
-- av_free_packet(&pktl->pkt);
-- av_free(pktl);
-- }
-- while(s->raw_packet_buffer){
-- pktl = s->raw_packet_buffer;
-- s->raw_packet_buffer = pktl->next;
-- av_free_packet(&pktl->pkt);
-- av_free(pktl);
-- }
-- s->packet_buffer_end=
-- s->raw_packet_buffer_end= NULL;
--#ifdef RAW_PACKET_BUFFER_SIZE
-- // Added on: 2009-06-25
-- s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
--#endif
--}
--#else
--static void free_packet_buffer(AVPacketList **pkt_buf, AVPacketList **pkt_buf_end)
--{
-- while (*pkt_buf) {
-- AVPacketList *pktl = *pkt_buf;
-- *pkt_buf = pktl->next;
-- av_free_packet(&pktl->pkt);
-- av_freep(&pktl);
-- }
-- *pkt_buf_end = NULL;
--}
--/* XXX: suppress the packet queue */
--static void flush_packet_queue(AVFormatContext *s)
--{
-- free_packet_buffer(&s->parse_queue, &s->parse_queue_end);
-- free_packet_buffer(&s->packet_buffer, &s->packet_buffer_end);
-- free_packet_buffer(&s->raw_packet_buffer, &s->raw_packet_buffer_end);
--
-- s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
--}
--#endif
--
--/* Taken from libavformat/utils.c
-- * Original name is ff_read_frame_flush
-- * */
--void xbmc_read_frame_flush(AVFormatContext *s)
--{
-- AVStream *st;
-- int i, j;
--
-- flush_packet_queue(s);
--
--#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0)
-- s->cur_st = NULL;
--#endif
--
-- /* for each stream, reset read state */
-- for(i = 0; i < s->nb_streams; i++) {
-- st = s->streams[i];
--
-- if (st->parser) {
-- av_parser_close(st->parser);
-- st->parser = NULL;
--#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0)
-- av_free_packet(&st->cur_pkt);
--#endif
-- }
-- st->last_IP_pts = AV_NOPTS_VALUE;
--#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0)
-- st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */
-- st->reference_dts = AV_NOPTS_VALUE;
-- /* fail safe */
-- st->cur_ptr = NULL;
-- st->cur_len = 0;
--#else
--#define RELATIVE_TS_BASE (INT64_MAX - (1LL<<48))
-- if(st->first_dts == AV_NOPTS_VALUE) st->cur_dts = RELATIVE_TS_BASE;
-- else st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */
--#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(55,0,0)
-- st->reference_dts = AV_NOPTS_VALUE;
--#endif
--
-- st->probe_packets = MAX_PROBE_PACKETS;
--#endif
--
-- for(j=0; jpts_buffer[j]= AV_NOPTS_VALUE;
-- }
--}
--#endif /* (defined USE_EXTERNAL_FFMPEG) */
-diff --git a/lib/xbmc-dll-symbols/Makefile b/lib/xbmc-dll-symbols/Makefile
-deleted file mode 100644
-index d3e5198..0000000
---- a/lib/xbmc-dll-symbols/Makefile
-+++ /dev/null
-@@ -1,6 +0,0 @@
--SRCS = DllAvFormat.c
--
--LIB = dll-symbols.a
--
--include ../../Makefile.include
---include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
-diff --git a/lib/xbmc-libav-hacks/Makefile b/lib/xbmc-libav-hacks/Makefile
-deleted file mode 100644
-index ca447d4..0000000
---- a/lib/xbmc-libav-hacks/Makefile
-+++ /dev/null
-@@ -1,6 +0,0 @@
--SRCS = swresample.c alloc_output_context2.c buffersink.c accessors.c graphparser.c
--
--LIB = dll-libavhacks.a
--
--include ../../Makefile.include
---include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
-diff --git a/lib/xbmc-libav-hacks/accessors.c b/lib/xbmc-libav-hacks/accessors.c
-deleted file mode 100644
-index 417bf32..0000000
---- a/lib/xbmc-libav-hacks/accessors.c
-+++ /dev/null
-@@ -1,35 +0,0 @@
--/*
-- * Copyright (C) 2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, write to
-- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-- * http://www.gnu.org/copyleft/gpl.html
-- *
-- */
--
--#include "libav_hacks.h"
--
--AVDictionary *av_frame_get_metadata (const AVFrame *frame)
--{
-- return NULL;
--}
--
--AVRational av_stream_get_r_frame_rate(const AVStream *s)
--{
-- AVRational zero;
-- zero.num = 0;
-- zero.den = 1;
-- return zero;
--}
-diff --git a/lib/xbmc-libav-hacks/alloc_output_context2.c b/lib/xbmc-libav-hacks/alloc_output_context2.c
-deleted file mode 100644
-index b0aa5eb..0000000
---- a/lib/xbmc-libav-hacks/alloc_output_context2.c
-+++ /dev/null
-@@ -1,80 +0,0 @@
--/*
-- * Code copied from libavformat/mux.c
-- *
-- * Original license is:
-- *
-- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
-- *
-- * This file is part of FFmpeg.
-- *
-- * FFmpeg is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Lesser General Public
-- * License as published by the Free Software Foundation; either
-- * version 2.1 of the License, or (at your option) any later version.
-- *
-- * FFmpeg is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Lesser General Public License for more details.
-- *
-- * You should have received a copy of the GNU Lesser General Public
-- * License along with FFmpeg; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-- */
--
--#include "libav_hacks.h"
--
--#include
--
--int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *oformat,
-- const char *format, const char *filename)
--{
-- AVFormatContext *s = avformat_alloc_context();
-- int ret = 0;
--
-- *avctx = NULL;
-- if (!s)
-- goto nomem;
--
-- if (!oformat) {
-- if (format) {
-- oformat = av_guess_format(format, NULL, NULL);
-- if (!oformat) {
-- av_log(s, AV_LOG_ERROR, "Requested output format '%s' is not a suitable output format\n", format);
-- ret = AVERROR(EINVAL);
-- goto error;
-- }
-- } else {
-- oformat = av_guess_format(NULL, filename, NULL);
-- if (!oformat) {
-- ret = AVERROR(EINVAL);
-- av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n",
-- filename);
-- goto error;
-- }
-- }
-- }
--
-- s->oformat = oformat;
-- if (s->oformat->priv_data_size > 0) {
-- s->priv_data = av_mallocz(s->oformat->priv_data_size);
-- if (!s->priv_data)
-- goto nomem;
-- if (s->oformat->priv_class) {
-- *(const AVClass**)s->priv_data= s->oformat->priv_class;
-- av_opt_set_defaults(s->priv_data);
-- }
-- } else
-- s->priv_data = NULL;
--
-- if (filename)
-- av_strlcpy(s->filename, filename, sizeof(s->filename));
-- *avctx = s;
-- return 0;
--nomem:
-- av_log(s, AV_LOG_ERROR, "Out of memory\n");
-- ret = AVERROR(ENOMEM);
--error:
-- avformat_free_context(s);
-- return ret;
--}
-diff --git a/lib/xbmc-libav-hacks/buffersink.c b/lib/xbmc-libav-hacks/buffersink.c
-deleted file mode 100644
-index e3fdd35..0000000
---- a/lib/xbmc-libav-hacks/buffersink.c
-+++ /dev/null
-@@ -1,36 +0,0 @@
--/*
-- * Code copied from libavfilter/buffersink.c
-- *
-- * Original license is:
-- *
-- * Copyright (c) 2011 Stefano Sabatini
-- *
-- * This file is part of FFmpeg.
-- *
-- * FFmpeg is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Lesser General Public
-- * License as published by the Free Software Foundation; either
-- * version 2.1 of the License, or (at your option) any later version.
-- *
-- * FFmpeg is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Lesser General Public License for more details.
-- *
-- * You should have received a copy of the GNU Lesser General Public
-- * License along with FFmpeg; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-- */
--
--#include "libav_hacks.h"
--
--AVBufferSinkParams *av_buffersink_params_alloc(void)
--{
-- static const int pixel_fmts[] = { AV_PIX_FMT_NONE };
-- AVBufferSinkParams *params = av_malloc(sizeof(AVBufferSinkParams));
-- if (!params)
-- return NULL;
--
-- params->pixel_fmts = pixel_fmts;
-- return params;
--}
-diff --git a/lib/xbmc-libav-hacks/graphparser.c b/lib/xbmc-libav-hacks/graphparser.c
-deleted file mode 100644
-index ef52392..0000000
---- a/lib/xbmc-libav-hacks/graphparser.c
-+++ /dev/null
-@@ -1,451 +0,0 @@
--/*
-- * Copied code from libavfilter/graphparser.c
-- *
-- * Original license is:
-- *
-- * filter graph parser
-- * Copyright (c) 2008 Vitor Sessak
-- * Copyright (c) 2007 Bobby Bingham
-- *
-- * This file is part of FFmpeg.
-- *
-- * FFmpeg is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Lesser General Public
-- * License as published by the Free Software Foundation; either
-- * version 2.1 of the License, or (at your option) any later version.
-- *
-- * FFmpeg is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Lesser General Public License for more details.
-- *
-- * You should have received a copy of the GNU Lesser General Public
-- * License along with FFmpeg; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-- */
--
--#include "libav_hacks.h"
--
--#include
--#include
--
--#define WHITESPACES " \n\t"
--
--/**
-- * Link two filters together.
-- *
-- * @see avfilter_link()
-- */
--static int link_filter(AVFilterContext *src, int srcpad,
-- AVFilterContext *dst, int dstpad,
-- void *log_ctx)
--{
-- int ret;
-- if ((ret = avfilter_link(src, srcpad, dst, dstpad))) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Cannot create the link %s:%d -> %s:%d\n",
-- src->filter->name, srcpad, dst->filter->name, dstpad);
-- return ret;
-- }
--
-- return 0;
--}
--
--/**
-- * Parse the name of a link, which has the format "[linkname]".
-- *
-- * @return a pointer (that need to be freed after use) to the name
-- * between parenthesis
-- */
--static char *parse_link_name(const char **buf, void *log_ctx)
--{
-- const char *start = *buf;
-- char *name;
-- (*buf)++;
--
-- name = av_get_token(buf, "]");
--
-- if (!name[0]) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Bad (empty?) label found in the following: \"%s\".\n", start);
-- goto fail;
-- }
--
-- if (*(*buf)++ != ']') {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Mismatched '[' found in the following: \"%s\".\n", start);
-- fail:
-- av_freep(&name);
-- }
--
-- return name;
--}
--
--/**
-- * Create an instance of a filter, initialize and insert it in the
-- * filtergraph in *ctx.
-- *
-- * @param filt_ctx put here a filter context in case of successful creation and configuration, NULL otherwise.
-- * @param ctx the filtergraph context
-- * @param index an index which is supposed to be unique for each filter instance added to the filtergraph
-- * @param filt_name the name of the filter to create
-- * @param args the arguments provided to the filter during its initialization
-- * @param log_ctx the log context to use
-- * @return 0 in case of success, a negative AVERROR code otherwise
-- */
--static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,
-- const char *filt_name, const char *args, void *log_ctx)
--{
-- AVFilter *filt;
-- char inst_name[30];
-- char tmp_args[256];
-- int ret;
--
-- snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt_name, index);
--
-- filt = avfilter_get_by_name(filt_name);
--
-- if (!filt) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "No such filter: '%s'\n", filt_name);
-- return AVERROR(EINVAL);
-- }
--
-- *filt_ctx = avfilter_graph_alloc_filter(ctx, filt, inst_name);
-- if (!*filt_ctx) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Error creating filter '%s'\n", filt_name);
-- return AVERROR(ENOMEM);
-- }
--
-- if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&
-- ctx->scale_sws_opts) {
-- snprintf(tmp_args, sizeof(tmp_args), "%s:%s",
-- args, ctx->scale_sws_opts);
-- args = tmp_args;
-- }
--
-- ret = avfilter_init_str(*filt_ctx, args);
-- if (ret < 0) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Error initializing filter '%s'", filt_name);
-- if (args)
-- av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args);
-- av_log(log_ctx, AV_LOG_ERROR, "\n");
-- return ret;
-- }
--
-- return 0;
--}
--
--/**
-- * Parse a string of the form FILTER_NAME[=PARAMS], and create a
-- * corresponding filter instance which is added to graph with
-- * create_filter().
-- *
-- * @param filt_ctx Pointer that is set to the created and configured filter
-- * context on success, set to NULL on failure.
-- * @param filt_ctx put here a pointer to the created filter context on
-- * success, NULL otherwise
-- * @param buf pointer to the buffer to parse, *buf will be updated to
-- * point to the char next after the parsed string
-- * @param index an index which is assigned to the created filter
-- * instance, and which is supposed to be unique for each filter
-- * instance added to the filtergraph
-- * @return 0 in case of success, a negative AVERROR code otherwise
-- */
--static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph,
-- int index, void *log_ctx)
--{
-- char *opts = NULL;
-- char *name = av_get_token(buf, "=,;[\n");
-- int ret;
--
-- if (**buf == '=') {
-- (*buf)++;
-- opts = av_get_token(buf, "[],;\n");
-- }
--
-- ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
-- av_free(name);
-- av_free(opts);
-- return ret;
--}
--
--static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links)
--{
-- AVFilterInOut *ret;
--
-- while (*links && (!(*links)->name || strcmp((*links)->name, label)))
-- links = &((*links)->next);
--
-- ret = *links;
--
-- if (ret) {
-- *links = ret->next;
-- ret->next = NULL;
-- }
--
-- return ret;
--}
--
--static void insert_inout(AVFilterInOut **inouts, AVFilterInOut *element)
--{
-- element->next = *inouts;
-- *inouts = element;
--}
--
--static void append_inout(AVFilterInOut **inouts, AVFilterInOut **element)
--{
-- while (*inouts && (*inouts)->next)
-- inouts = &((*inouts)->next);
--
-- if (!*inouts)
-- *inouts = *element;
-- else
-- (*inouts)->next = *element;
-- *element = NULL;
--}
--
--static int link_filter_inouts(AVFilterContext *filt_ctx,
-- AVFilterInOut **curr_inputs,
-- AVFilterInOut **open_inputs, void *log_ctx)
--{
-- int pad, ret;
--
-- for (pad = 0; pad < filt_ctx->nb_inputs; pad++) {
-- AVFilterInOut *p = *curr_inputs;
--
-- if (p) {
-- *curr_inputs = (*curr_inputs)->next;
-- p->next = NULL;
-- } else if (!(p = av_mallocz(sizeof(*p))))
-- return AVERROR(ENOMEM);
--
-- if (p->filter_ctx) {
-- ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx);
-- av_free(p->name);
-- av_free(p);
-- if (ret < 0)
-- return ret;
-- } else {
-- p->filter_ctx = filt_ctx;
-- p->pad_idx = pad;
-- append_inout(open_inputs, &p);
-- }
-- }
--
-- if (*curr_inputs) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Too many inputs specified for the \"%s\" filter.\n",
-- filt_ctx->filter->name);
-- return AVERROR(EINVAL);
-- }
--
-- pad = filt_ctx->nb_outputs;
-- while (pad--) {
-- AVFilterInOut *currlinkn = av_mallocz(sizeof(AVFilterInOut));
-- if (!currlinkn)
-- return AVERROR(ENOMEM);
-- currlinkn->filter_ctx = filt_ctx;
-- currlinkn->pad_idx = pad;
-- insert_inout(curr_inputs, currlinkn);
-- }
--
-- return 0;
--}
--
--static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
-- AVFilterInOut **open_outputs, void *log_ctx)
--{
-- AVFilterInOut *parsed_inputs = NULL;
-- int pad = 0;
--
-- while (**buf == '[') {
-- char *name = parse_link_name(buf, log_ctx);
-- AVFilterInOut *match;
--
-- if (!name)
-- return AVERROR(EINVAL);
--
-- /* First check if the label is not in the open_outputs list */
-- match = extract_inout(name, open_outputs);
--
-- if (match) {
-- av_free(name);
-- } else {
-- /* Not in the list, so add it as an input */
-- if (!(match = av_mallocz(sizeof(AVFilterInOut)))) {
-- av_free(name);
-- return AVERROR(ENOMEM);
-- }
-- match->name = name;
-- match->pad_idx = pad;
-- }
--
-- append_inout(&parsed_inputs, &match);
--
-- *buf += strspn(*buf, WHITESPACES);
-- pad++;
-- }
--
-- append_inout(&parsed_inputs, curr_inputs);
-- *curr_inputs = parsed_inputs;
--
-- return pad;
--}
--
--static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
-- AVFilterInOut **open_inputs,
-- AVFilterInOut **open_outputs, void *log_ctx)
--{
-- int ret, pad = 0;
--
-- while (**buf == '[') {
-- char *name = parse_link_name(buf, log_ctx);
-- AVFilterInOut *match;
--
-- AVFilterInOut *input = *curr_inputs;
--
-- if (!name)
-- return AVERROR(EINVAL);
--
-- if (!input) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "No output pad can be associated to link label '%s'.\n", name);
-- av_free(name);
-- return AVERROR(EINVAL);
-- }
-- *curr_inputs = (*curr_inputs)->next;
--
-- /* First check if the label is not in the open_inputs list */
-- match = extract_inout(name, open_inputs);
--
-- if (match) {
-- if ((ret = link_filter(input->filter_ctx, input->pad_idx,
-- match->filter_ctx, match->pad_idx, log_ctx)) < 0) {
-- av_free(name);
-- return ret;
-- }
-- av_free(match->name);
-- av_free(name);
-- av_free(match);
-- av_free(input);
-- } else {
-- /* Not in the list, so add the first input as a open_output */
-- input->name = name;
-- insert_inout(open_outputs, input);
-- }
-- *buf += strspn(*buf, WHITESPACES);
-- pad++;
-- }
--
-- return pad;
--}
--
--static int parse_sws_flags(const char **buf, AVFilterGraph *graph)
--{
-- char *p = strchr(*buf, ';');
--
-- if (strncmp(*buf, "sws_flags=", 10))
-- return 0;
--
-- if (!p) {
-- av_log(graph, AV_LOG_ERROR, "sws_flags not terminated with ';'.\n");
-- return AVERROR(EINVAL);
-- }
--
-- *buf += 4; // keep the 'flags=' part
--
-- av_freep(&graph->scale_sws_opts);
-- if (!(graph->scale_sws_opts = av_mallocz(p - *buf + 1)))
-- return AVERROR(ENOMEM);
-- av_strlcpy(graph->scale_sws_opts, *buf, p - *buf + 1);
--
-- *buf = p + 1;
-- return 0;
--}
--
--int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters,
-- AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr,
-- void *log_ctx)
--{
-- int index = 0, ret = 0;
-- char chr = 0;
--
-- AVFilterInOut *curr_inputs = NULL;
-- AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL;
-- AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL;
--
-- if ((ret = parse_sws_flags(&filters, graph)) < 0)
-- goto end;
--
-- do {
-- AVFilterContext *filter;
-- const char *filterchain = filters;
-- filters += strspn(filters, WHITESPACES);
--
-- if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0)
-- goto end;
--
-- if ((ret = parse_filter(&filter, &filters, graph, index, log_ctx)) < 0)
-- goto end;
--
-- if (filter->input_count == 1 && !curr_inputs && !index) {
-- /* First input pad, assume it is "[in]" if not specified */
-- const char *tmp = "[in]";
-- if ((ret = parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
-- goto end;
-- }
--
-- if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, log_ctx)) < 0)
-- goto end;
--
-- if ((ret = parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
-- log_ctx)) < 0)
-- goto end;
--
-- filters += strspn(filters, WHITESPACES);
-- chr = *filters++;
--
-- if (chr == ';' && curr_inputs) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
-- filterchain);
-- ret = AVERROR(EINVAL);
-- goto end;
-- }
-- index++;
-- } while (chr == ',' || chr == ';');
--
-- if (chr) {
-- av_log(log_ctx, AV_LOG_ERROR,
-- "Unable to parse graph description substring: \"%s\"\n",
-- filters - 1);
-- ret = AVERROR(EINVAL);
-- goto end;
-- }
--
-- if (curr_inputs) {
-- /* Last output pad, assume it is "[out]" if not specified */
-- const char *tmp = "[out]";
-- if ((ret = parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
-- log_ctx)) < 0)
-- goto end;
-- }
--
--end:
-- /* clear open_in/outputs only if not passed as parameters */
-- if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
-- else avfilter_inout_free(&open_inputs);
-- if (open_outputs_ptr) *open_outputs_ptr = open_outputs;
-- else avfilter_inout_free(&open_outputs);
-- avfilter_inout_free(&curr_inputs);
--
-- if (ret < 0) {
-- while (graph->nb_filters)
-- avfilter_free(graph->filters[0]);
-- av_freep(&graph->filters);
-- }
-- return ret;
--}
-diff --git a/lib/xbmc-libav-hacks/libav_hacks.h b/lib/xbmc-libav-hacks/libav_hacks.h
-deleted file mode 100644
-index f81e29e..0000000
---- a/lib/xbmc-libav-hacks/libav_hacks.h
-+++ /dev/null
-@@ -1,96 +0,0 @@
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#ifndef __LIBAV_HACKS_H
--#define __LIBAV_HACKS_H
--
--#include
--#include
--#include
--#include
--#include
--
--#if LIBAVUTIL_VERSION_MICRO >= 100
--#error "You should not enable libav hacks when building against FFmpeg."
--#endif
--
--#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52,8,0)
--#error "Your libav version is too old. Please update to libav-10 or git master."
--#endif
--
--// libavutil
--
--#define AVFRAME_IN_LAVU
--
--#define AV_CODEC_ID_OTF AV_CODEC_ID_TTF
--#define AV_CODEC_ID_SUBRIP AV_CODEC_ID_FIRST_SUBTITLE
--
--AVDictionary *av_frame_get_metadata (const AVFrame *frame);
--
--// libavformat
--
--int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat,
-- const char *format_name, const char *filename);
--
--#define AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE
--
--AVRational av_stream_get_r_frame_rate(const AVStream *s);
--
--// libavresample
--
--#define SwrContext AVAudioResampleContext
--
--struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
-- int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
-- int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
-- int log_offset, void *log_ctx);
--
--int swr_init(struct SwrContext *s);
--
--void swr_free(struct SwrContext **s);
--
--int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
-- const uint8_t **in , int in_count);
--
--int64_t swr_get_delay(struct SwrContext *s, int64_t base);
--
--int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
--
--int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
--
--int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
--
--// libavfilter
--
--#define LIBAVFILTER_AVFRAME_BASED
--
--typedef struct {
-- const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE
--} AVBufferSinkParams;
--
--AVBufferSinkParams *av_buffersink_params_alloc(void);
--
--#define HAVE_AVFILTER_GRAPH_PARSE_PTR
--
--int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters,
-- AVFilterInOut **inputs, AVFilterInOut **outputs,
-- void *log_ctx);
--
--#endif
-diff --git a/lib/xbmc-libav-hacks/pkgconfig/libswresample.pc b/lib/xbmc-libav-hacks/pkgconfig/libswresample.pc
-deleted file mode 100644
-index 1319d85..0000000
---- a/lib/xbmc-libav-hacks/pkgconfig/libswresample.pc
-+++ /dev/null
-@@ -1,4 +0,0 @@
--Name: libswresample to libavresample
--Version: 0
--Description: Hack to provide libswresample through libavresample
--Requires: libavresample
-diff --git a/lib/xbmc-libav-hacks/swresample.c b/lib/xbmc-libav-hacks/swresample.c
-deleted file mode 100644
-index f674ef7..0000000
---- a/lib/xbmc-libav-hacks/swresample.c
-+++ /dev/null
-@@ -1,80 +0,0 @@
--/*
-- * Copyright (C) 2005-2013 Team XBMC
-- * http://xbmc.org
-- *
-- * This Program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2, or (at your option)
-- * any later version.
-- *
-- * This Program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with XBMC; see the file COPYING. If not, see
-- * .
-- *
-- */
--
--#include "libav_hacks.h"
--
--#include
--#include
--
--struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
-- int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
-- int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
-- int log_offset, void *log_ctx)
--{
-- AVAudioResampleContext *ret = avresample_alloc_context();
-- av_opt_set_int(ret, "out_channel_layout", out_ch_layout , 0);
-- av_opt_set_int(ret, "out_sample_fmt" , out_sample_fmt , 0);
-- av_opt_set_int(ret, "out_sample_rate" , out_sample_rate, 0);
-- av_opt_set_int(ret, "in_channel_layout" , in_ch_layout , 0);
-- av_opt_set_int(ret, "in_sample_fmt" , in_sample_fmt , 0);
-- av_opt_set_int(ret, "in_sample_rate" , in_sample_rate , 0);
-- return ret;
--}
--
--
--int swr_init(struct SwrContext *s)
--{
-- return avresample_open(s);
--}
--
--void swr_free(struct SwrContext **s)
--{
-- avresample_close(*s);
-- *s = NULL;
--}
--
--int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
-- const uint8_t **in , int in_count)
--{
-- return avresample_convert(s, out, 0, out_count, (uint8_t**)in, 0,in_count);
--}
--
--int64_t swr_get_delay(struct SwrContext *s, int64_t base)
--{
-- int64_t in_sr, out_sr;
-- av_opt_get_int(s, "in_sample_rate", 0, &in_sr);
-- av_opt_get_int(s, "out_sample_rate", 0, &out_sr);
-- return av_rescale_rnd(avresample_available(s), base, out_sr, AV_ROUND_UP) + av_rescale_rnd(avresample_get_delay(s), base, in_sr, AV_ROUND_UP);
--}
--
--int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
--{
-- return avresample_set_channel_mapping(s, channel_map);
--}
--
--int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
--{
-- return avresample_set_matrix(s, matrix, stride);
--}
--
--int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance)
--{
-- return avresample_set_compensation(s, sample_delta, compensation_distance);
--}
-diff --git a/xbmc/addons/AddonCallbacksCodec.cpp b/xbmc/addons/AddonCallbacksCodec.cpp
-index 711cc5c..8ae1e4e 100644
---- a/xbmc/addons/AddonCallbacksCodec.cpp
-+++ b/xbmc/addons/AddonCallbacksCodec.cpp
-@@ -21,10 +21,13 @@
- #include "Application.h"
- #include "Addon.h"
- #include "AddonCallbacksCodec.h"
--#include "DllAvCodec.h"
--#include "DllAvFormat.h"
- #include "utils/StringUtils.h"
-
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+#include "libavformat/avformat.h"
-+}
-+
- namespace ADDON
- {
- class CCodecIds
-@@ -57,23 +60,12 @@ class CCodecIds
- private:
- CCodecIds(void)
- {
-- DllAvCodec dllAvCodec;
-- DllAvFormat dllAvFormat;
--
-- // load ffmpeg and register formats
-- if (!dllAvCodec.Load() || !dllAvFormat.Load())
-- {
-- CLog::Log(LOGWARNING, "failed to load ffmpeg");
-- return;
-- }
-- dllAvFormat.av_register_all();
--
- // get ids and names
- AVCodec* codec = NULL;
- xbmc_codec_t tmp;
-- while ((codec = dllAvCodec.av_codec_next(codec)))
-+ while ((codec = av_codec_next(codec)))
- {
-- if (dllAvCodec.av_codec_is_decoder(codec))
-+ if (av_codec_is_decoder(codec))
- {
- tmp.codec_type = (xbmc_codec_type_t)codec->type;
- tmp.codec_id = codec->id;
-diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp
-index 0f20c5f..c6756e7 100644
---- a/xbmc/cdrip/EncoderFFmpeg.cpp
-+++ b/xbmc/cdrip/EncoderFFmpeg.cpp
-@@ -58,19 +58,15 @@ CEncoderFFmpeg::CEncoderFFmpeg():
-
- bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int iInBits)
- {
-- if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllAvFormat.Load() || !m_dllSwResample.Load()) return false;
-- m_dllAvFormat.av_register_all();
-- m_dllAvCodec.avcodec_register_all();
--
- CStdString filename = URIUtils::GetFileName(strFile);
-- if(m_dllAvFormat.avformat_alloc_output_context2(&m_Format,NULL,NULL,filename.c_str()))
-+ if(avformat_alloc_output_context2(&m_Format,NULL,NULL,filename.c_str()))
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Unable to guess the output format for the file %s", filename.c_str());
- return false;
- }
-
- AVCodec *codec;
-- codec = m_dllAvCodec.avcodec_find_encoder(m_Format->oformat->audio_codec);
-+ codec = avcodec_find_encoder(m_Format->oformat->audio_codec);
-
- if (!codec)
- {
-@@ -78,10 +74,10 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
- return false;
- }
-
-- m_Format->pb = m_dllAvFormat.avio_alloc_context(m_BCBuffer, sizeof(m_BCBuffer), AVIO_FLAG_WRITE, this, NULL, avio_write_callback, avio_seek_callback);
-+ m_Format->pb = avio_alloc_context(m_BCBuffer, sizeof(m_BCBuffer), AVIO_FLAG_WRITE, this, NULL, avio_write_callback, avio_seek_callback);
- if (!m_Format->pb)
- {
-- m_dllAvUtil.av_freep(&m_Format);
-+ av_freep(&m_Format);
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to allocate ByteIOContext");
- return false;
- }
-@@ -89,11 +85,11 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
- m_Format->bit_rate = CSettings::Get().GetInt("audiocds.bitrate") * 1000;
-
- /* add a stream to it */
-- m_Stream = m_dllAvFormat.avformat_new_stream(m_Format, codec);
-+ m_Stream = avformat_new_stream(m_Format, codec);
- if (!m_Stream)
- {
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to allocate AVStream context");
- return false;
- }
-@@ -105,7 +101,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
- m_CodecCtx->bit_rate = m_Format->bit_rate;
- m_CodecCtx->sample_rate = iInRate;
- m_CodecCtx->channels = iInChannels;
-- m_CodecCtx->channel_layout = m_dllAvUtil.av_get_default_channel_layout(iInChannels);
-+ m_CodecCtx->channel_layout = av_get_default_channel_layout(iInChannels);
- m_CodecCtx->time_base.num = 1;
- m_CodecCtx->time_base.den = iInRate;
- /* Allow experimental encoders (like FFmpeg builtin AAC encoder) */
-@@ -123,9 +119,9 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
- case 16: m_InFormat = AV_SAMPLE_FMT_S16; break;
- case 32: m_InFormat = AV_SAMPLE_FMT_S32; break;
- default:
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
-
-@@ -134,30 +130,30 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
-
- m_NeedConversion = (m_OutFormat != m_InFormat);
-
-- if (m_OutFormat <= AV_SAMPLE_FMT_NONE || m_dllAvCodec.avcodec_open2(m_CodecCtx, codec, NULL))
-+ if (m_OutFormat <= AV_SAMPLE_FMT_NONE || avcodec_open2(m_CodecCtx, codec, NULL))
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to open the codec %s", codec->long_name ? codec->long_name : codec->name);
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
-
- /* calculate how many bytes we need per frame */
- m_NeededFrames = m_CodecCtx->frame_size;
-- m_NeededBytes = m_dllAvUtil.av_samples_get_buffer_size(NULL, iInChannels, m_NeededFrames, m_InFormat, 0);
-- m_Buffer = (uint8_t*)m_dllAvUtil.av_malloc(m_NeededBytes);
-+ m_NeededBytes = av_samples_get_buffer_size(NULL, iInChannels, m_NeededFrames, m_InFormat, 0);
-+ m_Buffer = (uint8_t*)av_malloc(m_NeededBytes);
- m_BufferSize = 0;
-
-- m_BufferFrame = m_dllAvCodec.avcodec_alloc_frame();
-+ m_BufferFrame = avcodec_alloc_frame();
- if(!m_BufferFrame || !m_Buffer)
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to allocate necessary buffers");
-- if(m_BufferFrame) m_dllAvCodec.avcodec_free_frame(&m_BufferFrame);
-- if(m_Buffer) m_dllAvUtil.av_freep(&m_Buffer);
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ if(m_BufferFrame) avcodec_free_frame(&m_BufferFrame);
-+ if(m_Buffer) av_freep(&m_Buffer);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
-
-@@ -165,59 +161,59 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
- m_BufferFrame->format = m_InFormat;
- m_BufferFrame->channel_layout = m_CodecCtx->channel_layout;
-
-- m_dllAvCodec.avcodec_fill_audio_frame(m_BufferFrame, iInChannels, m_InFormat, m_Buffer, m_NeededBytes, 0);
-+ avcodec_fill_audio_frame(m_BufferFrame, iInChannels, m_InFormat, m_Buffer, m_NeededBytes, 0);
-
- if(m_NeedConversion)
- {
-- m_SwrCtx = m_dllSwResample.swr_alloc_set_opts(NULL,
-+ m_SwrCtx = swr_alloc_set_opts(NULL,
- m_CodecCtx->channel_layout, m_OutFormat, m_CodecCtx->sample_rate,
- m_CodecCtx->channel_layout, m_InFormat, m_CodecCtx->sample_rate,
- 0, NULL);
-- if(!m_SwrCtx || m_dllSwResample.swr_init(m_SwrCtx) < 0)
-+ if(!m_SwrCtx || swr_init(m_SwrCtx) < 0)
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to initialize the resampler");
-- m_dllAvCodec.avcodec_free_frame(&m_BufferFrame);
-- m_dllAvUtil.av_freep(&m_Buffer);
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ avcodec_free_frame(&m_BufferFrame);
-+ av_freep(&m_Buffer);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
-
-- m_ResampledBufferSize = m_dllAvUtil.av_samples_get_buffer_size(NULL, iInChannels, m_NeededFrames, m_OutFormat, 0);
-- m_ResampledBuffer = (uint8_t*)m_dllAvUtil.av_malloc(m_ResampledBufferSize);
-- m_ResampledFrame = m_dllAvCodec.avcodec_alloc_frame();
-+ m_ResampledBufferSize = av_samples_get_buffer_size(NULL, iInChannels, m_NeededFrames, m_OutFormat, 0);
-+ m_ResampledBuffer = (uint8_t*)av_malloc(m_ResampledBufferSize);
-+ m_ResampledFrame = avcodec_alloc_frame();
- if(!m_ResampledBuffer || !m_ResampledFrame)
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to allocate a frame for resampling");
-- if (m_ResampledFrame) m_dllAvCodec.avcodec_free_frame(&m_ResampledFrame);
-- if (m_ResampledBuffer) m_dllAvUtil.av_freep(&m_ResampledBuffer);
-- if (m_SwrCtx) m_dllSwResample.swr_free(&m_SwrCtx);
-- m_dllAvCodec.avcodec_free_frame(&m_BufferFrame);
-- m_dllAvUtil.av_freep(&m_Buffer);
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ if (m_ResampledFrame) avcodec_free_frame(&m_ResampledFrame);
-+ if (m_ResampledBuffer) av_freep(&m_ResampledBuffer);
-+ if (m_SwrCtx) swr_free(&m_SwrCtx);
-+ avcodec_free_frame(&m_BufferFrame);
-+ av_freep(&m_Buffer);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
- m_ResampledFrame->nb_samples = m_NeededFrames;
- m_ResampledFrame->format = m_OutFormat;
- m_ResampledFrame->channel_layout = m_CodecCtx->channel_layout;
-- m_dllAvCodec.avcodec_fill_audio_frame(m_ResampledFrame, iInChannels, m_OutFormat, m_ResampledBuffer, m_ResampledBufferSize, 0);
-+ avcodec_fill_audio_frame(m_ResampledFrame, iInChannels, m_OutFormat, m_ResampledBuffer, m_ResampledBufferSize, 0);
- }
-
- /* set input stream information and open the file */
- if (!CEncoder::Init(strFile, iInChannels, iInRate, iInBits))
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to call CEncoder::Init");
-- if (m_ResampledFrame ) m_dllAvCodec.avcodec_free_frame(&m_ResampledFrame);
-- if (m_ResampledBuffer) m_dllAvUtil.av_freep(&m_ResampledBuffer);
-- if (m_SwrCtx) m_dllSwResample.swr_free(&m_SwrCtx);
-- m_dllAvCodec.avcodec_free_frame(&m_BufferFrame);
-- m_dllAvUtil.av_freep(&m_Buffer);
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ if (m_ResampledFrame ) avcodec_free_frame(&m_ResampledFrame);
-+ if (m_ResampledBuffer) av_freep(&m_ResampledBuffer);
-+ if (m_SwrCtx) swr_free(&m_SwrCtx);
-+ avcodec_free_frame(&m_BufferFrame);
-+ av_freep(&m_Buffer);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
-
-@@ -230,17 +226,17 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
- SetTag("encoder" , "XBMC FFmpeg Encoder");
-
- /* write the header */
-- if (m_dllAvFormat.avformat_write_header(m_Format, NULL) != 0)
-+ if (avformat_write_header(m_Format, NULL) != 0)
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to write the header");
-- if (m_ResampledFrame ) m_dllAvCodec.avcodec_free_frame(&m_ResampledFrame);
-- if (m_ResampledBuffer) m_dllAvUtil.av_freep(&m_ResampledBuffer);
-- if (m_SwrCtx) m_dllSwResample.swr_free(&m_SwrCtx);
-- m_dllAvCodec.avcodec_free_frame(&m_BufferFrame);
-- m_dllAvUtil.av_freep(&m_Buffer);
-- m_dllAvUtil.av_freep(&m_Stream);
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format);
-+ if (m_ResampledFrame ) avcodec_free_frame(&m_ResampledFrame);
-+ if (m_ResampledBuffer) av_freep(&m_ResampledBuffer);
-+ if (m_SwrCtx) swr_free(&m_SwrCtx);
-+ avcodec_free_frame(&m_BufferFrame);
-+ av_freep(&m_Buffer);
-+ av_freep(&m_Stream);
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format);
- return false;
- }
-
-@@ -251,7 +247,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
-
- void CEncoderFFmpeg::SetTag(const CStdString tag, const CStdString value)
- {
-- m_dllAvUtil.av_dict_set(&m_Format->metadata, tag.c_str(), value.c_str(), 0);
-+ av_dict_set(&m_Format->metadata, tag.c_str(), value.c_str(), 0);
- }
-
- int CEncoderFFmpeg::avio_write_callback(void *opaque, uint8_t *buf, int buf_size)
-@@ -296,13 +292,13 @@ bool CEncoderFFmpeg::WriteFrame()
- int encoded, got_output;
- AVFrame* frame;
-
-- m_dllAvCodec.av_init_packet(&m_Pkt);
-+ av_init_packet(&m_Pkt);
- m_Pkt.data = NULL;
- m_Pkt.size = 0;
-
- if(m_NeedConversion)
- {
-- if (m_dllSwResample.swr_convert(m_SwrCtx, m_ResampledFrame->extended_data, m_NeededFrames, (const uint8_t**)m_BufferFrame->extended_data, m_NeededFrames) < 0)
-+ if (swr_convert(m_SwrCtx, m_ResampledFrame->extended_data, m_NeededFrames, (const uint8_t**)m_BufferFrame->extended_data, m_NeededFrames) < 0)
- {
- CLog::Log(LOGERROR, "CEncoderFFmpeg::WriteFrame - Error resampling audio");
- return false;
-@@ -311,7 +307,7 @@ bool CEncoderFFmpeg::WriteFrame()
- }
- else frame = m_BufferFrame;
-
-- encoded = m_dllAvCodec.avcodec_encode_audio2(m_CodecCtx, &m_Pkt, frame, &got_output);
-+ encoded = avcodec_encode_audio2(m_CodecCtx, &m_Pkt, frame, &got_output);
-
- m_BufferSize = 0;
-
-@@ -323,15 +319,15 @@ bool CEncoderFFmpeg::WriteFrame()
- if (got_output)
- {
- if (m_CodecCtx->coded_frame && m_CodecCtx->coded_frame->pts != AV_NOPTS_VALUE)
-- m_Pkt.pts = m_dllAvUtil.av_rescale_q(m_CodecCtx->coded_frame->pts, m_Stream->time_base, m_CodecCtx->time_base);
-+ m_Pkt.pts = av_rescale_q(m_CodecCtx->coded_frame->pts, m_Stream->time_base, m_CodecCtx->time_base);
-
-- if (m_dllAvFormat.av_write_frame(m_Format, &m_Pkt) < 0) {
-+ if (av_write_frame(m_Format, &m_Pkt) < 0) {
- CLog::Log(LOGERROR, "CEncoderFFMmpeg::WriteFrame - Failed to write the frame data");
- return false;
- }
- }
-
-- m_dllAvCodec.av_free_packet(&m_Pkt);
-+ av_free_packet(&m_Pkt);
-
- return true;
- }
-@@ -348,34 +344,30 @@ bool CEncoderFFmpeg::Close()
- }
-
- /* Flush if needed */
-- m_dllAvUtil.av_freep(&m_Buffer);
-- m_dllAvCodec.avcodec_free_frame(&m_BufferFrame);
-+ av_freep(&m_Buffer);
-+ avcodec_free_frame(&m_BufferFrame);
-
-- if (m_SwrCtx) m_dllSwResample.swr_free(&m_SwrCtx);
-- if (m_ResampledFrame ) m_dllAvCodec.avcodec_free_frame(&m_ResampledFrame);
-- if (m_ResampledBuffer) m_dllAvUtil.av_freep(&m_ResampledBuffer);
-+ if (m_SwrCtx) swr_free(&m_SwrCtx);
-+ if (m_ResampledFrame ) avcodec_free_frame(&m_ResampledFrame);
-+ if (m_ResampledBuffer) av_freep(&m_ResampledBuffer);
- m_NeedConversion = false;
-
- WriteFrame();
-
- /* write the trailer */
-- m_dllAvFormat.av_write_trailer(m_Format);
-+ av_write_trailer(m_Format);
- FlushStream();
- FileClose();
-
- /* cleanup */
-- m_dllAvCodec.avcodec_close(m_CodecCtx);
-- m_dllAvUtil.av_freep(&m_Stream );
-- m_dllAvUtil.av_freep(&m_Format->pb);
-- m_dllAvUtil.av_freep(&m_Format );
-+ avcodec_close(m_CodecCtx);
-+ av_freep(&m_Stream );
-+ av_freep(&m_Format->pb);
-+ av_freep(&m_Format );
- }
-
- m_BufferSize = 0;
-
-- m_dllAvFormat.Unload();
-- m_dllAvUtil .Unload();
-- m_dllAvCodec .Unload();
-- m_dllSwResample.Unload();
- return true;
- }
-
-diff --git a/xbmc/cdrip/EncoderFFmpeg.h b/xbmc/cdrip/EncoderFFmpeg.h
-index a16c7e9..7155796 100644
---- a/xbmc/cdrip/EncoderFFmpeg.h
-+++ b/xbmc/cdrip/EncoderFFmpeg.h
-@@ -22,10 +22,13 @@
- */
-
- #include "Encoder.h"
--#include "DllAvFormat.h"
--#include "DllAvCodec.h"
--#include "DllAvUtil.h"
--#include "DllSwResample.h"
-+
-+extern "C" {
-+#include "libavformat/avformat.h"
-+#include "libavcodec/avcodec.h"
-+#include "libavutil/avutil.h"
-+#include "libswresample/swresample.h"
-+}
-
- class CEncoderFFmpeg : public CEncoder
- {
-@@ -38,10 +41,6 @@ class CEncoderFFmpeg : public CEncoder
- void AddTag(int key, const char* value);
-
- private:
-- DllAvCodec m_dllAvCodec;
-- DllAvUtil m_dllAvUtil;
-- DllAvFormat m_dllAvFormat;
-- DllSwResample m_dllSwResample;
-
- AVFormatContext *m_Format;
- AVCodecContext *m_CodecCtx;
-diff --git a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp
-index b91ed43..5d9e2fb 100644
---- a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp
-+++ b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp
-@@ -46,10 +46,10 @@ CAEEncoderFFmpeg::CAEEncoderFFmpeg():
- CAEEncoderFFmpeg::~CAEEncoderFFmpeg()
- {
- Reset();
-- m_dllAvUtil.av_freep(&m_CodecCtx);
-- m_dllAvUtil.av_freep(&m_ResampBuffer);
-+ av_freep(&m_CodecCtx);
-+ av_freep(&m_ResampBuffer);
- if (m_SwrCtx)
-- m_dllSwResample.swr_free(&m_SwrCtx);
-+ swr_free(&m_SwrCtx);
- }
-
- bool CAEEncoderFFmpeg::IsCompatible(AEAudioFormat format)
-@@ -102,11 +102,6 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format, bool allow_planar_input
- {
- Reset();
-
-- if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllSwResample.Load())
-- return false;
--
-- m_dllAvCodec.avcodec_register_all();
--
- bool ac3 = CSettings::Get().GetBool("audiooutput.ac3passthrough");
-
- AVCodec *codec = NULL;
-@@ -119,7 +114,7 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format, bool allow_planar_input
- m_CodecID = AV_CODEC_ID_DTS;
- m_PackFunc = &CAEPackIEC61937::PackDTS_1024;
- m_BitRate = DTS_ENCODE_BITRATE;
-- codec = m_dllAvCodec.avcodec_find_encoder(m_CodecID);
-+ codec = avcodec_find_encoder(m_CodecID);
- }
- #endif
-
-@@ -130,14 +125,14 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format, bool allow_planar_input
- m_CodecID = AV_CODEC_ID_AC3;
- m_PackFunc = &CAEPackIEC61937::PackAC3;
- m_BitRate = AC3_ENCODE_BITRATE;
-- codec = m_dllAvCodec.avcodec_find_encoder(m_CodecID);
-+ codec = avcodec_find_encoder(m_CodecID);
- }
-
- /* check we got the codec */
- if (!codec)
- return false;
-
-- m_CodecCtx = m_dllAvCodec.avcodec_alloc_context3(codec);
-+ m_CodecCtx = avcodec_alloc_context3(codec);
- m_CodecCtx->bit_rate = m_BitRate;
- m_CodecCtx->sample_rate = format.m_sampleRate;
- m_CodecCtx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
-@@ -220,9 +215,9 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format, bool allow_planar_input
- m_CodecCtx->channels = BuildChannelLayout(m_CodecCtx->channel_layout, m_Layout);
-
- /* open the codec */
-- if (m_dllAvCodec.avcodec_open2(m_CodecCtx, codec, NULL))
-+ if (avcodec_open2(m_CodecCtx, codec, NULL))
- {
-- m_dllAvUtil.av_freep(&m_CodecCtx);
-+ av_freep(&m_CodecCtx);
- return false;
- }
-
-@@ -239,11 +234,11 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format, bool allow_planar_input
-
- if (m_NeedConversion)
- {
-- m_SwrCtx = m_dllSwResample.swr_alloc_set_opts(NULL,
-+ m_SwrCtx = swr_alloc_set_opts(NULL,
- m_CodecCtx->channel_layout, m_CodecCtx->sample_fmt, m_CodecCtx->sample_rate,
- m_CodecCtx->channel_layout, AV_SAMPLE_FMT_FLT, m_CodecCtx->sample_rate,
- 0, NULL);
-- if (!m_SwrCtx || m_dllSwResample.swr_init(m_SwrCtx) < 0)
-+ if (!m_SwrCtx || swr_init(m_SwrCtx) < 0)
- {
- CLog::Log(LOGERROR, "CAEEncoderFFmpeg::Initialize - Failed to initialise resampler.");
- return false;
-@@ -284,14 +279,14 @@ int CAEEncoderFFmpeg::Encode(float *data, unsigned int frames)
-
- /* size of the buffer sent to the encoder: either from the input data or after
- * conversion, in all cases it is in the m_CodecCtx->sample_fmt format */
-- int buf_size = m_dllAvUtil.av_samples_get_buffer_size(NULL, m_CodecCtx->channels, frames, m_CodecCtx->sample_fmt, 0);
-+ int buf_size = av_samples_get_buffer_size(NULL, m_CodecCtx->channels, frames, m_CodecCtx->sample_fmt, 0);
- assert(buf_size>0);
-
- /* allocate the input frame
- * sadly, we have to alloc/dealloc it everytime since we have no guarantee the
- * data argument will be constant over iterated calls and the frame needs to
- * setup pointers inside data */
-- frame = m_dllAvCodec.avcodec_alloc_frame();
-+ frame = avcodec_alloc_frame();
- if (!frame)
- return 0;
-
-@@ -303,43 +298,43 @@ int CAEEncoderFFmpeg::Encode(float *data, unsigned int frames)
- {
- if (!m_ResampBuffer || buf_size > m_ResampBufferSize)
- {
-- m_ResampBuffer = (uint8_t*)m_dllAvUtil.av_realloc(m_ResampBuffer, buf_size);
-+ m_ResampBuffer = (uint8_t*)av_realloc(m_ResampBuffer, buf_size);
- if (!m_ResampBuffer)
- {
- CLog::Log(LOGERROR, "CAEEncoderFFmpeg::Encode - Failed to allocate %i bytes buffer for resampling", buf_size);
-- m_dllAvCodec.avcodec_free_frame(&frame);
-+ avcodec_free_frame(&frame);
- return 0;
- }
- m_ResampBufferSize = buf_size;
- }
-
-- m_dllAvCodec.avcodec_fill_audio_frame(frame, m_CodecCtx->channels, m_CodecCtx->sample_fmt, m_ResampBuffer, buf_size, 0);
-+ avcodec_fill_audio_frame(frame, m_CodecCtx->channels, m_CodecCtx->sample_fmt, m_ResampBuffer, buf_size, 0);
-
- /* important note: the '&input' here works because we convert from a packed
- * format (ie, interleaved). If it were to be used to convert from planar
- * formats (ie, non-interleaved, which is not currently supported by AE),
- * we would need to adapt it or it would segfault. */
-- if (m_dllSwResample.swr_convert(m_SwrCtx, frame->extended_data, frames, &input, frames) < 0)
-+ if (swr_convert(m_SwrCtx, frame->extended_data, frames, &input, frames) < 0)
- {
- CLog::Log(LOGERROR, "CAEEncoderFFmpeg::Encode - Resampling failed");
-- m_dllAvCodec.avcodec_free_frame(&frame);
-+ avcodec_free_frame(&frame);
- return 0;
- }
- }
- else
-- m_dllAvCodec.avcodec_fill_audio_frame(frame, m_CodecCtx->channels, m_CodecCtx->sample_fmt,
-+ avcodec_fill_audio_frame(frame, m_CodecCtx->channels, m_CodecCtx->sample_fmt,
- input, buf_size, 0);
-
- /* initialize the output packet */
-- m_dllAvCodec.av_init_packet(&m_Pkt);
-+ av_init_packet(&m_Pkt);
- m_Pkt.size = sizeof(m_Buffer) - IEC61937_DATA_OFFSET;
- m_Pkt.data = m_Buffer + IEC61937_DATA_OFFSET;
-
- /* encode it */
-- int ret = m_dllAvCodec.avcodec_encode_audio2(m_CodecCtx, &m_Pkt, frame, &got_output);
-+ int ret = avcodec_encode_audio2(m_CodecCtx, &m_Pkt, frame, &got_output);
-
- /* free temporary data */
-- m_dllAvCodec.avcodec_free_frame(&frame);
-+ avcodec_free_frame(&frame);
-
- if (ret < 0 || !got_output)
- {
-@@ -356,7 +351,7 @@ int CAEEncoderFFmpeg::Encode(float *data, unsigned int frames)
- }
-
- /* free the packet */
-- m_dllAvCodec.av_free_packet(&m_Pkt);
-+ av_free_packet(&m_Pkt);
-
- /* return the number of frames used */
- return m_NeededFrames;
-@@ -374,7 +369,7 @@ int CAEEncoderFFmpeg::Encode(uint8_t *in, int in_size, uint8_t *out, int out_siz
- * sadly, we have to alloc/dealloc it everytime since we have no guarantee the
- * data argument will be constant over iterated calls and the frame needs to
- * setup pointers inside data */
-- frame = m_dllAvCodec.avcodec_alloc_frame();
-+ frame = avcodec_alloc_frame();
- if (!frame)
- return 0;
-
-@@ -382,19 +377,19 @@ int CAEEncoderFFmpeg::Encode(uint8_t *in, int in_size, uint8_t *out, int out_siz
- frame->format = m_CodecCtx->sample_fmt;
- frame->channel_layout = m_CodecCtx->channel_layout;
-
-- m_dllAvCodec.avcodec_fill_audio_frame(frame, m_CodecCtx->channels, m_CodecCtx->sample_fmt,
-+ avcodec_fill_audio_frame(frame, m_CodecCtx->channels, m_CodecCtx->sample_fmt,
- in, in_size, 0);
-
- /* initialize the output packet */
-- m_dllAvCodec.av_init_packet(&m_Pkt);
-+ av_init_packet(&m_Pkt);
- m_Pkt.size = out_size - IEC61937_DATA_OFFSET;
- m_Pkt.data = out + IEC61937_DATA_OFFSET;
-
- /* encode it */
-- int ret = m_dllAvCodec.avcodec_encode_audio2(m_CodecCtx, &m_Pkt, frame, &got_output);
-+ int ret = avcodec_encode_audio2(m_CodecCtx, &m_Pkt, frame, &got_output);
-
- /* free temporary data */
-- m_dllAvCodec.avcodec_free_frame(&frame);
-+ avcodec_free_frame(&frame);
-
- if (ret < 0 || !got_output)
- {
-@@ -406,7 +401,7 @@ int CAEEncoderFFmpeg::Encode(uint8_t *in, int in_size, uint8_t *out, int out_siz
- m_PackFunc(NULL, m_Pkt.size, out);
-
- /* free the packet */
-- m_dllAvCodec.av_free_packet(&m_Pkt);
-+ av_free_packet(&m_Pkt);
-
- /* return the number of frames used */
- return m_NeededFrames;
-diff --git a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h
-index 4fb67c4..dad3708 100644
---- a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h
-+++ b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h
-@@ -23,11 +23,12 @@
- #include "cores/AudioEngine/Utils/AERemap.h"
- #include "cores/AudioEngine/Utils/AEPackIEC61937.h"
-
-+extern "C" {
-+#include "libswresample/swresample.h"
-+}
-+
- /* ffmpeg re-defines this, so undef it to squash the warning */
- #undef restrict
--#include "DllAvCodec.h"
--#include "DllAvFormat.h"
--#include "DllSwResample.h"
-
- class CAEEncoderFFmpeg: public IAEEncoder
- {
-@@ -48,11 +49,6 @@ class CAEEncoderFFmpeg: public IAEEncoder
- virtual int GetData(uint8_t **data);
- virtual double GetDelay(unsigned int bufferSize);
- private:
-- DllAvCodec m_dllAvCodec;
-- DllAvFormat m_dllAvFormat;
-- DllAvUtil m_dllAvUtil;
-- DllSwResample m_dllSwResample;
--
- std::string m_CodecName;
- AVCodecID m_CodecID;
- unsigned int m_BitRate;
-diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
-index 8013d71..b23a501 100644
---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
-+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
-@@ -178,10 +178,6 @@ void CActiveAE::Dispose()
- m_controlPort.Purge();
- m_dataPort.Purge();
- m_sink.Dispose();
--
-- m_dllAvFormat.Unload();
-- m_dllAvCodec.Unload();
-- m_dllAvUtil.Unload();
- }
-
- //-----------------------------------------------------------------------------
-@@ -2041,7 +2037,7 @@ void CActiveAE::MixSounds(CSoundPacket &dstSample)
- int available_samples = it->sound->GetSound(false)->nb_samples - it->samples_played;
- int mix_samples = std::min(max_samples, available_samples);
- int start = it->samples_played *
-- m_dllAvUtil.av_get_bytes_per_sample(it->sound->GetSound(false)->config.fmt) *
-+ av_get_bytes_per_sample(it->sound->GetSound(false)->config.fmt) *
- it->sound->GetSound(false)->config.channels /
- it->sound->GetSound(false)->planes;
-
-@@ -2125,13 +2121,6 @@ void CActiveAE::LoadSettings()
-
- bool CActiveAE::Initialize()
- {
-- if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllAvFormat.Load())
-- {
-- CLog::Log(LOGERROR,"CActiveAE::Initialize - failed to load ffmpeg libraries");
-- return false;
-- }
-- m_dllAvFormat.av_register_all();
--
- Create();
- Message *reply;
- if (m_controlPort.SendOutMessageSync(CActiveAEControlProtocol::INIT,
-@@ -2387,19 +2376,19 @@ void CActiveAE::OnAppFocusChange(bool focus)
- uint8_t **CActiveAE::AllocSoundSample(SampleConfig &config, int &samples, int &bytes_per_sample, int &planes, int &linesize)
- {
- uint8_t **buffer;
-- planes = m_dllAvUtil.av_sample_fmt_is_planar(config.fmt) ? config.channels : 1;
-+ planes = av_sample_fmt_is_planar(config.fmt) ? config.channels : 1;
- buffer = new uint8_t*[planes];
-
- // align buffer to 16 in order to be compatible with sse in CAEConvert
-- m_dllAvUtil.av_samples_alloc(buffer, &linesize, config.channels,
-+ av_samples_alloc(buffer, &linesize, config.channels,
- samples, config.fmt, 16);
-- bytes_per_sample = m_dllAvUtil.av_get_bytes_per_sample(config.fmt);
-+ bytes_per_sample = av_get_bytes_per_sample(config.fmt);
- return buffer;
- }
-
- void CActiveAE::FreeSoundSample(uint8_t **data)
- {
-- m_dllAvUtil.av_freep(data);
-+ av_freep(data);
- delete [] data;
- }
-
-@@ -2443,9 +2432,9 @@ IAESound *CActiveAE::MakeSound(const std::string& file)
- }
- int fileSize = sound->GetFileSize();
-
-- fmt_ctx = m_dllAvFormat.avformat_alloc_context();
-- unsigned char* buffer = (unsigned char*)m_dllAvUtil.av_malloc(SOUNDBUFFER_SIZE+FF_INPUT_BUFFER_PADDING_SIZE);
-- io_ctx = m_dllAvFormat.avio_alloc_context(buffer, SOUNDBUFFER_SIZE, 0,
-+ fmt_ctx = avformat_alloc_context();
-+ unsigned char* buffer = (unsigned char*)av_malloc(SOUNDBUFFER_SIZE+FF_INPUT_BUFFER_PADDING_SIZE);
-+ io_ctx = avio_alloc_context(buffer, SOUNDBUFFER_SIZE, 0,
- sound, CActiveAESound::Read, NULL, CActiveAESound::Seek);
- io_ctx->max_packet_size = sound->GetChunkSize();
- if(io_ctx->max_packet_size)
-@@ -2456,22 +2445,22 @@ IAESound *CActiveAE::MakeSound(const std::string& file)
-
- fmt_ctx->pb = io_ctx;
-
-- m_dllAvFormat.av_probe_input_buffer(io_ctx, &io_fmt, file.c_str(), NULL, 0, 0);
-+ av_probe_input_buffer(io_ctx, &io_fmt, file.c_str(), NULL, 0, 0);
- if (!io_fmt)
- {
-- m_dllAvFormat.avformat_close_input(&fmt_ctx);
-+ avformat_close_input(&fmt_ctx);
- delete sound;
- return NULL;
- }
-
- // find decoder
-- if (m_dllAvFormat.avformat_open_input(&fmt_ctx, file.c_str(), NULL, NULL) == 0)
-+ if (avformat_open_input(&fmt_ctx, file.c_str(), NULL, NULL) == 0)
- {
- fmt_ctx->flags |= AVFMT_FLAG_NOPARSE;
-- if (m_dllAvFormat.avformat_find_stream_info(fmt_ctx, NULL) >= 0)
-+ if (avformat_find_stream_info(fmt_ctx, NULL) >= 0)
- {
- dec_ctx = fmt_ctx->streams[0]->codec;
-- dec = m_dllAvCodec.avcodec_find_decoder(dec_ctx->codec_id);
-+ dec = avcodec_find_decoder(dec_ctx->codec_id);
- config.sample_rate = dec_ctx->sample_rate;
- config.channels = dec_ctx->channels;
- config.channel_layout = dec_ctx->channel_layout;
-@@ -2479,39 +2468,39 @@ IAESound *CActiveAE::MakeSound(const std::string& file)
- }
- if (dec == NULL)
- {
-- m_dllAvFormat.avformat_close_input(&fmt_ctx);
-+ avformat_close_input(&fmt_ctx);
- delete sound;
- return NULL;
- }
-
-- dec_ctx = m_dllAvCodec.avcodec_alloc_context3(dec);
-+ dec_ctx = avcodec_alloc_context3(dec);
- dec_ctx->sample_rate = config.sample_rate;
- dec_ctx->channels = config.channels;
- if (!config.channel_layout)
-- config.channel_layout = m_dllAvUtil.av_get_default_channel_layout(config.channels);
-+ config.channel_layout = av_get_default_channel_layout(config.channels);
- dec_ctx->channel_layout = config.channel_layout;
-
- AVPacket avpkt;
- AVFrame *decoded_frame = NULL;
-- decoded_frame = m_dllAvCodec.avcodec_alloc_frame();
-+ decoded_frame = avcodec_alloc_frame();
-
-- if (m_dllAvCodec.avcodec_open2(dec_ctx, dec, NULL) >= 0)
-+ if (avcodec_open2(dec_ctx, dec, NULL) >= 0)
- {
- bool init = false;
-
- // decode until eof
-- m_dllAvCodec.av_init_packet(&avpkt);
-+ av_init_packet(&avpkt);
- int len;
-- while (m_dllAvFormat.av_read_frame(fmt_ctx, &avpkt) >= 0)
-+ while (av_read_frame(fmt_ctx, &avpkt) >= 0)
- {
- int got_frame = 0;
-- len = m_dllAvCodec.avcodec_decode_audio4(dec_ctx, decoded_frame, &got_frame, &avpkt);
-+ len = avcodec_decode_audio4(dec_ctx, decoded_frame, &got_frame, &avpkt);
- if (len < 0)
- {
-- m_dllAvCodec.avcodec_close(dec_ctx);
-- m_dllAvUtil.av_free(dec_ctx);
-- m_dllAvUtil.av_free(&decoded_frame);
-- m_dllAvFormat.avformat_close_input(&fmt_ctx);
-+ avcodec_close(dec_ctx);
-+ av_free(dec_ctx);
-+ av_free(&decoded_frame);
-+ avformat_close_input(&fmt_ctx);
- delete sound;
- return NULL;
- }
-@@ -2519,7 +2508,7 @@ IAESound *CActiveAE::MakeSound(const std::string& file)
- {
- if (!init)
- {
-- int samples = fileSize / m_dllAvUtil.av_get_bytes_per_sample(dec_ctx->sample_fmt) / config.channels;
-+ int samples = fileSize / av_get_bytes_per_sample(dec_ctx->sample_fmt) / config.channels;
- config.fmt = dec_ctx->sample_fmt;
- config.bits_per_sample = dec_ctx->bits_per_coded_sample;
- sound->InitSound(true, config, samples);
-@@ -2529,12 +2518,12 @@ IAESound *CActiveAE::MakeSound(const std::string& file)
- decoded_frame->nb_samples, decoded_frame->linesize[0]);
- }
- }
-- m_dllAvCodec.avcodec_close(dec_ctx);
-+ avcodec_close(dec_ctx);
- }
-
-- m_dllAvUtil.av_free(dec_ctx);
-- m_dllAvUtil.av_free(decoded_frame);
-- m_dllAvFormat.avformat_close_input(&fmt_ctx);
-+ av_free(dec_ctx);
-+ av_free(decoded_frame);
-+ avformat_close_input(&fmt_ctx);
-
- sound->Finish();
-
-diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
-index 8596617..700098b 100644
---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
-+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
-@@ -31,9 +31,11 @@
- #include
-
- // ffmpeg
--#include "DllAvFormat.h"
--#include "DllAvCodec.h"
--#include "DllAvUtil.h"
-+extern "C" {
-+#include "libavformat/avformat.h"
-+#include "libavcodec/avcodec.h"
-+#include "libavutil/avutil.h"
-+}
-
- class IAESink;
- class IAEEncoder;
-@@ -347,11 +349,6 @@ class CActiveAE : public IAE, private CThread
- bool m_vizInitialized;
- CCriticalSection m_vizLock;
-
-- // ffmpeg
-- DllAvFormat m_dllAvFormat;
-- DllAvCodec m_dllAvCodec;
-- DllAvUtil m_dllAvUtil;
--
- // polled via the interface
- float m_aeVolume;
- bool m_aeMuted;
-diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h
-index 58205a4..f8d0ba0 100644
---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h
-+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h
-@@ -19,12 +19,15 @@
- *
- */
-
--#include "DllAvUtil.h"
--#include "DllSwResample.h"
- #include "cores/AudioEngine/Utils/AEAudioFormat.h"
- #include "cores/AudioEngine/Interfaces/AE.h"
- #include
-
-+extern "C" {
-+#include "libavutil/avutil.h"
-+#include "libswresample/swresample.h"
-+}
-+
- namespace ActiveAE
- {
-
-diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
-index e131f16..6478f3a 100644
---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
-+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
-@@ -19,24 +19,26 @@
- */
-
- #include "ActiveAEResample.h"
-+#include "utils/log.h"
-+
-+extern "C" {
-+#include "libavutil/channel_layout.h"
-+#include "libavutil/opt.h"
-+#include "libswresample/swresample.h"
-+}
-
- using namespace ActiveAE;
-
- CActiveAEResample::CActiveAEResample()
- {
- m_pContext = NULL;
-- m_loaded = false;
-- if (m_dllAvUtil.Load() && m_dllSwResample.Load())
-- m_loaded = true;
-+ m_loaded = true;
- }
-
- CActiveAEResample::~CActiveAEResample()
- {
- if (m_pContext)
-- m_dllSwResample.swr_free(&m_pContext);
--
-- m_dllAvUtil.Unload();
-- m_dllSwResample.Unload();
-+ swr_free(&m_pContext);
- }
-
- bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality)
-@@ -56,11 +58,11 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
- m_src_bits = src_bits;
-
- if (m_dst_chan_layout == 0)
-- m_dst_chan_layout = m_dllAvUtil.av_get_default_channel_layout(m_dst_channels);
-+ m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels);
- if (m_src_chan_layout == 0)
-- m_src_chan_layout = m_dllAvUtil.av_get_default_channel_layout(m_src_channels);
-+ m_src_chan_layout = av_get_default_channel_layout(m_src_channels);
-
-- m_pContext = m_dllSwResample.swr_alloc_set_opts(NULL, m_dst_chan_layout, m_dst_fmt, m_dst_rate,
-+ m_pContext = swr_alloc_set_opts(NULL, m_dst_chan_layout, m_dst_fmt, m_dst_rate,
- m_src_chan_layout, m_src_fmt, m_src_rate,
- 0, NULL);
-
-@@ -72,24 +74,24 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
-
- if(quality == AE_QUALITY_HIGH)
- {
-- m_dllAvUtil.av_opt_set_double(m_pContext, "cutoff", 1.0, 0);
-- m_dllAvUtil.av_opt_set_int(m_pContext,"filter_size", 256, 0);
-+ av_opt_set_double(m_pContext, "cutoff", 1.0, 0);
-+ av_opt_set_int(m_pContext,"filter_size", 256, 0);
- }
- else if(quality == AE_QUALITY_MID)
- {
- // 0.97 is default cutoff so use (1.0 - 0.97) / 2.0 + 0.97
-- m_dllAvUtil.av_opt_set_double(m_pContext, "cutoff", 0.985, 0);
-- m_dllAvUtil.av_opt_set_int(m_pContext,"filter_size", 64, 0);
-+ av_opt_set_double(m_pContext, "cutoff", 0.985, 0);
-+ av_opt_set_int(m_pContext,"filter_size", 64, 0);
- }
- else if(quality == AE_QUALITY_LOW)
- {
-- m_dllAvUtil.av_opt_set_double(m_pContext, "cutoff", 0.97, 0);
-- m_dllAvUtil.av_opt_set_int(m_pContext,"filter_size", 32, 0);
-+ av_opt_set_double(m_pContext, "cutoff", 0.97, 0);
-+ av_opt_set_int(m_pContext,"filter_size", 32, 0);
- }
-
- if (m_dst_fmt == AV_SAMPLE_FMT_S32 || m_dst_fmt == AV_SAMPLE_FMT_S32P)
- {
-- m_dllAvUtil.av_opt_set_int(m_pContext, "output_sample_bits", m_dst_bits, 0);
-+ av_opt_set_int(m_pContext, "output_sample_bits", m_dst_bits, 0);
- }
-
- // tell resampler to clamp float values
-@@ -98,7 +100,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
- (m_src_fmt == AV_SAMPLE_FMT_FLT || m_src_fmt == AV_SAMPLE_FMT_FLTP) &&
- !remapLayout && normalize)
- {
-- m_dllAvUtil.av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0);
-+ av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0);
- }
-
- if (remapLayout)
-@@ -118,10 +120,10 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
- }
- }
-
-- m_dllAvUtil.av_opt_set_int(m_pContext, "out_channel_count", m_dst_channels, 0);
-- m_dllAvUtil.av_opt_set_int(m_pContext, "out_channel_layout", m_dst_chan_layout, 0);
-+ av_opt_set_int(m_pContext, "out_channel_count", m_dst_channels, 0);
-+ av_opt_set_int(m_pContext, "out_channel_layout", m_dst_chan_layout, 0);
-
-- if (m_dllSwResample.swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0)
-+ if (swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0)
- {
- CLog::Log(LOGERROR, "CActiveAEResample::Init - setting channel matrix failed");
- return false;
-@@ -133,7 +135,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
- memset(m_rematrix, 0, sizeof(m_rematrix));
- for (int out=0; outRead(buf, size);
- }
-
--offset_t CActiveAESound::Seek(void *h, offset_t pos, int whence)
-+int64_t CActiveAESound::Seek(void *h, int64_t pos, int whence)
- {
- CFile* pFile = static_cast(h)->m_pFile;
- if(whence == AVSEEK_SIZE)
-diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h
-index 75227ab..9324e1e 100644
---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h
-+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h
-@@ -56,7 +56,7 @@ class CActiveAESound : public IAESound
- bool IsSeekPosible() { return m_isSeekPosible; }
-
- static int Read(void *h, uint8_t* buf, int size);
-- static offset_t Seek(void *h, offset_t pos, int whence);
-+ static int64_t Seek(void *h, int64_t pos, int whence);
-
- protected:
- std::string m_filename;
-diff --git a/xbmc/cores/AudioEngine/Interfaces/AEEncoder.h b/xbmc/cores/AudioEngine/Interfaces/AEEncoder.h
-index 7a9cf99..d070d36 100644
---- a/xbmc/cores/AudioEngine/Interfaces/AEEncoder.h
-+++ b/xbmc/cores/AudioEngine/Interfaces/AEEncoder.h
-@@ -19,9 +19,12 @@
- *
- */
-
--#include "DllAvCodec.h"
- #include "cores/AudioEngine/Utils/AEAudioFormat.h"
-
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+}
-+
- /**
- * IAEEncoder interface for on the fly audio compression
- */
-diff --git a/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp b/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp
-index f0babde..08e375b 100644
---- a/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp
-+++ b/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp
-@@ -19,6 +19,7 @@
- */
-
- #include "AEStreamInfo.h"
-+#include "utils/log.h"
-
- #define IEC61937_PREAMBLE1 0xF872
- #define IEC61937_PREAMBLE2 0x4E1F
-@@ -85,13 +86,11 @@ CAEStreamInfo::CAEStreamInfo() :
- m_dataIsLE (false),
- m_packFunc (NULL)
- {
-- m_dllAvUtil.Load();
-- m_dllAvUtil.av_crc_init(m_crcTrueHD, 0, 16, 0x2D, sizeof(m_crcTrueHD));
-+ av_crc_init(m_crcTrueHD, 0, 16, 0x2D, sizeof(m_crcTrueHD));
- }
-
- CAEStreamInfo::~CAEStreamInfo()
- {
-- m_dllAvUtil.Unload();
- }
-
- int CAEStreamInfo::AddData(uint8_t *data, unsigned int size, uint8_t **buffer/* = NULL */, unsigned int *bufferSize/* = 0 */)
-@@ -360,7 +359,7 @@ unsigned int CAEStreamInfo::SyncAC3(uint8_t *data, unsigned int size)
- crc_size = (framesize >> 1) + (framesize >> 3) - 1;
-
- if (crc_size <= size - skip)
-- if (m_dllAvUtil.av_crc(m_dllAvUtil.av_crc_get_table(AV_CRC_16_ANSI), 0, &data[2], crc_size * 2))
-+ if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &data[2], crc_size * 2))
- continue;
-
- /* if we get here, we can sync */
-@@ -668,7 +667,7 @@ unsigned int CAEStreamInfo::SyncTrueHD(uint8_t *data, unsigned int size)
- continue;
-
- /* verify the crc of the audio unit */
-- uint16_t crc = m_dllAvUtil.av_crc(m_crcTrueHD, 0, data + 4, 24);
-+ uint16_t crc = av_crc(m_crcTrueHD, 0, data + 4, 24);
- crc ^= (data[29] << 8) | data[28];
- if (((data[31] << 8) | data[30]) != crc)
- continue;
-diff --git a/xbmc/cores/AudioEngine/Utils/AEStreamInfo.h b/xbmc/cores/AudioEngine/Utils/AEStreamInfo.h
-index 4d7bcdd..8fadab0 100644
---- a/xbmc/cores/AudioEngine/Utils/AEStreamInfo.h
-+++ b/xbmc/cores/AudioEngine/Utils/AEStreamInfo.h
-@@ -26,8 +26,12 @@
-
- /* ffmpeg re-defines this, so undef it to squash the warning */
- #undef restrict
--#include "DllAvCodec.h"
--#include "DllAvFormat.h"
-+
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+#include "libavformat/avformat.h"
-+#include "libavutil/crc.h"
-+}
-
- class CAEStreamInfo
- {
-@@ -67,8 +71,6 @@ class CAEStreamInfo
- CAEPackIEC61937::PackFunc GetPackFunc () { return m_packFunc ; }
- unsigned int GetBufferSize () { return m_bufferSize ; }
- private:
-- DllAvUtil m_dllAvUtil;
--
- uint8_t m_buffer[MAX_IEC61937_PACKET];
- unsigned int m_bufferSize;
- unsigned int m_skipBytes;
-diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
-index 3b9851d..73eb193 100644
---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
-+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
-@@ -40,7 +40,6 @@
- #include "guilib/Texture.h"
- #include "guilib/LocalizeStrings.h"
- #include "threads/SingleLock.h"
--#include "DllSwScale.h"
- #include "utils/log.h"
- #include "utils/GLUtils.h"
- #include "utils/StringUtils.h"
-@@ -48,6 +47,11 @@
- #include "RenderFormats.h"
- #include "cores/IPlayer.h"
- #include "cores/dvdplayer/DVDCodecs/DVDCodecUtils.h"
-+#include "cores/FFmpeg.h"
-+
-+extern "C" {
-+#include "libswscale/swscale.h"
-+}
-
- #ifdef HAVE_LIBVDPAU
- #include "cores/dvdplayer/DVDCodecs/Video/VDPAU.h"
-@@ -191,8 +195,6 @@ CLinuxRendererGL::CLinuxRendererGL()
- m_nonLinStretch = false;
- m_nonLinStretchGui = false;
- m_pixelRatio = 0.0f;
--
-- m_dllSwScale = new DllSwScale;
- }
-
- CLinuxRendererGL::~CLinuxRendererGL()
-@@ -213,7 +215,7 @@ CLinuxRendererGL::~CLinuxRendererGL()
-
- if (m_context)
- {
-- m_dllSwScale->sws_freeContext(m_context);
-+ sws_freeContext(m_context);
- m_context = NULL;
- }
-
-@@ -223,8 +225,6 @@ CLinuxRendererGL::~CLinuxRendererGL()
- delete m_pYUVShader;
- m_pYUVShader = NULL;
- }
--
-- delete m_dllSwScale;
- }
-
- bool CLinuxRendererGL::ValidateRenderer()
-@@ -779,9 +779,6 @@ unsigned int CLinuxRendererGL::PreInit()
- // setup the background colour
- m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
-
-- if (!m_dllSwScale->Load())
-- CLog::Log(LOGERROR,"CLinuxRendererGL::PreInit - failed to load rescale libraries!");
--
- return true;
- }
-
-@@ -1131,7 +1128,7 @@ void CLinuxRendererGL::UnInit()
-
- if (m_context)
- {
-- m_dllSwScale->sws_freeContext(m_context);
-+ sws_freeContext(m_context);
- m_context = NULL;
- }
-
-@@ -3159,14 +3156,14 @@ void CLinuxRendererGL::ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsign
- m_rgbBuffer = (BYTE*)glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB) + PBO_OFFSET;
- }
-
-- m_context = m_dllSwScale->sws_getCachedContext(m_context,
-- im->width, im->height, srcFormat,
-- im->width, im->height, PIX_FMT_BGRA,
-+ m_context = sws_getCachedContext(m_context,
-+ im->width, im->height, (AVPixelFormat)srcFormat,
-+ im->width, im->height, (AVPixelFormat)PIX_FMT_BGRA,
- SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
-
- uint8_t *dst[] = { m_rgbBuffer, 0, 0, 0 };
- int dstStride[] = { (int)m_sourceWidth * 4, 0, 0, 0 };
-- m_dllSwScale->sws_scale(m_context, src, srcStride, 0, im->height, dst, dstStride);
-+ sws_scale(m_context, src, srcStride, 0, im->height, dst, dstStride);
-
- if (m_rgbPbo)
- {
-@@ -3239,9 +3236,9 @@ void CLinuxRendererGL::ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, un
- m_rgbBuffer = (BYTE*)glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB) + PBO_OFFSET;
- }
-
-- m_context = m_dllSwScale->sws_getCachedContext(m_context,
-- im->width, im->height >> 1, srcFormat,
-- im->width, im->height >> 1, PIX_FMT_BGRA,
-+ m_context = sws_getCachedContext(m_context,
-+ im->width, im->height >> 1, (AVPixelFormat)srcFormat,
-+ im->width, im->height >> 1, (AVPixelFormat)PIX_FMT_BGRA,
- SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
- uint8_t *dstTop[] = { m_rgbBuffer, 0, 0, 0 };
- uint8_t *dstBot[] = { m_rgbBuffer + m_sourceWidth * m_sourceHeight * 2, 0, 0, 0 };
-@@ -3249,8 +3246,8 @@ void CLinuxRendererGL::ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, un
-
- //convert each YUV field to an RGB field, the top field is placed at the top of the rgb buffer
- //the bottom field is placed at the bottom of the rgb buffer
-- m_dllSwScale->sws_scale(m_context, srcTop, srcStrideTop, 0, im->height >> 1, dstTop, dstStride);
-- m_dllSwScale->sws_scale(m_context, srcBot, srcStrideBot, 0, im->height >> 1, dstBot, dstStride);
-+ sws_scale(m_context, srcTop, srcStrideTop, 0, im->height >> 1, dstTop, dstStride);
-+ sws_scale(m_context, srcBot, srcStrideBot, 0, im->height >> 1, dstBot, dstStride);
-
- if (m_rgbPbo)
- {
-diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h
-index 63ea287..304017f 100644
---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h
-+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h
-@@ -112,8 +112,6 @@ extern YUVCOEF yuv_coef_bt709;
- extern YUVCOEF yuv_coef_ebu;
- extern YUVCOEF yuv_coef_smtp240m;
-
--class DllSwScale;
--
- class CLinuxRendererGL : public CBaseRenderer
- {
- public:
-@@ -312,7 +310,6 @@ class CLinuxRendererGL : public CBaseRenderer
- float m_clearColour;
-
- // software scale library (fallback if required gl version is not available)
-- DllSwScale *m_dllSwScale;
- BYTE *m_rgbBuffer; // if software scale is used, this will hold the result image
- unsigned int m_rgbBufferSize;
- GLuint m_rgbPbo;
-diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
-index 30c0601..72eb725 100644
---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
-+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
-@@ -34,6 +34,7 @@
- #include "utils/fastmemcpy.h"
- #include "utils/MathUtils.h"
- #include "utils/GLUtils.h"
-+#include "utils/log.h"
- #include "settings/AdvancedSettings.h"
- #include "settings/DisplaySettings.h"
- #include "settings/MediaSettings.h"
-@@ -43,7 +44,6 @@
- #include "VideoShaders/VideoFilterShader.h"
- #include "windowing/WindowingFactory.h"
- #include "guilib/Texture.h"
--#include "lib/DllSwScale.h"
- #include "../dvdplayer/DVDCodecs/Video/OpenMaxVideo.h"
- #include "threads/SingleLock.h"
- #include "RenderCapture.h"
-@@ -51,6 +51,10 @@
- #include "xbmc/Application.h"
- #include "cores/IPlayer.h"
-
-+extern "C" {
-+#include "libswscale/swscale.h"
-+}
-+
- #if defined(__ARM_NEON__)
- #include "yuv2rgb.neon.h"
- #include "utils/CPUInfo.h"
-@@ -132,7 +136,6 @@ CLinuxRendererGLES::CLinuxRendererGLES()
- m_rgbBuffer = NULL;
- m_rgbBufferSize = 0;
-
-- m_dllSwScale = new DllSwScale;
- m_sw_context = NULL;
- m_NumYV12Buffers = 0;
- m_iLastRenderBuffer = 0;
-@@ -167,8 +170,6 @@ CLinuxRendererGLES::~CLinuxRendererGLES()
- delete m_pYUVShader;
- m_pYUVShader = NULL;
- }
--
-- delete m_dllSwScale;
- }
-
- bool CLinuxRendererGLES::ValidateRenderTarget()
-@@ -607,9 +608,6 @@ unsigned int CLinuxRendererGLES::PreInit()
- // setup the background colour
- m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
-
-- if (!m_dllSwScale->Load())
-- CLog::Log(LOGERROR,"CLinuxRendererGL::PreInit - failed to load rescale libraries!");
--
- return true;
- }
-
-@@ -837,9 +835,9 @@ void CLinuxRendererGLES::UnInit()
- for (int i = 0; i < NUM_BUFFERS; ++i)
- (this->*m_textureDelete)(i);
-
-- if (m_dllSwScale && m_sw_context)
-+ if (m_sw_context)
- {
-- m_dllSwScale->sws_freeContext(m_sw_context);
-+ sws_freeContext(m_sw_context);
- m_sw_context = NULL;
- }
-
-@@ -1684,7 +1682,7 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
- else
- #endif
- {
-- m_sw_context = m_dllSwScale->sws_getCachedContext(m_sw_context,
-+ m_sw_context = sws_getCachedContext(m_sw_context,
- im->width, im->height, PIX_FMT_YUV420P,
- im->width, im->height, PIX_FMT_RGBA,
- SWS_FAST_BILINEAR, NULL, NULL, NULL);
-@@ -1693,7 +1691,7 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
- int srcStride[] = { im->stride[0], im->stride[1], im->stride[2], 0 };
- uint8_t *dst[] = { m_rgbBuffer, 0, 0, 0 };
- int dstStride[] = { m_sourceWidth*4, 0, 0, 0 };
-- m_dllSwScale->sws_scale(m_sw_context, src, srcStride, 0, im->height, dst, dstStride);
-+ sws_scale(m_sw_context, src, srcStride, 0, im->height, dst, dstStride);
- }
- }
-
-diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h
-index 45e9c20..642cded 100644
---- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h
-+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h
-@@ -115,9 +115,6 @@ extern YUVCOEF yuv_coef_bt709;
- extern YUVCOEF yuv_coef_ebu;
- extern YUVCOEF yuv_coef_smtp240m;
-
--class DllSwScale;
--struct SwsContext;
--
- class CEvent;
-
- class CLinuxRendererGLES : public CBaseRenderer
-@@ -314,7 +311,6 @@ class CLinuxRendererGLES : public CBaseRenderer
- float m_clearColour;
-
- // software scale libraries (fallback if required gl version is not available)
-- DllSwScale *m_dllSwScale;
- struct SwsContext *m_sw_context;
- BYTE *m_rgbBuffer; // if software scale is used, this will hold the result image
- unsigned int m_rgbBufferSize;
-diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp
-index 48794a7..7e82dd4 100644
---- a/xbmc/cores/VideoRenderers/WinRenderer.cpp
-+++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp
-@@ -20,7 +20,7 @@
-
- #ifdef HAS_DX
-
--#include "DllSwScale.h"
-+#include "libswscale/swscale.h"
- #include "Util.h"
- #include "WinRenderer.h"
- #include "cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h"
-diff --git a/xbmc/cores/VideoRenderers/WinRenderer.h b/xbmc/cores/VideoRenderers/WinRenderer.h
-index 7486464..63eb3cd 100644
---- a/xbmc/cores/VideoRenderers/WinRenderer.h
-+++ b/xbmc/cores/VideoRenderers/WinRenderer.h
-@@ -208,9 +208,6 @@ class CWinRenderer : public CBaseRenderer
- std::vector m_formats;
-
- // software scale libraries (fallback if required pixel shaders version is not available)
-- DllAvUtil *m_dllAvUtil;
-- DllAvCodec *m_dllAvCodec;
-- DllSwScale *m_dllSwScale;
- struct SwsContext *m_sw_scale_ctx;
-
- // Software rendering
-diff --git a/xbmc/cores/dvdplayer/DVDAudio.h b/xbmc/cores/dvdplayer/DVDAudio.h
-index 4328fc3..4e22383 100644
---- a/xbmc/cores/dvdplayer/DVDAudio.h
-+++ b/xbmc/cores/dvdplayer/DVDAudio.h
-@@ -30,7 +30,9 @@
- #include "cores/AudioEngine/Utils/AEChannelInfo.h"
- class IAEStream;
-
--#include "DllAvCodec.h"
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+}
-
- typedef struct stDVDAudioFrame DVDAudioFrame;
-
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
-index 08839ee..baadb79 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
-@@ -30,7 +30,10 @@
- #include "config.h"
- #endif
- #include
--#include "DllAvCodec.h"
-+
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+}
-
- struct AVStream;
-
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
-index af897fe..aeb3995 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
-@@ -59,19 +59,14 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- AVCodec* pCodec;
- m_bOpenedCodec = false;
-
-- if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllSwResample.Load())
-- return false;
--
-- m_dllAvCodec.avcodec_register_all();
--
-- pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec);
-+ pCodec = avcodec_find_decoder(hints.codec);
- if (!pCodec)
- {
- CLog::Log(LOGDEBUG,"CDVDAudioCodecFFmpeg::Open() Unable to find codec %d", hints.codec);
- return false;
- }
-
-- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec);
-+ m_pCodecContext = avcodec_alloc_context3(pCodec);
- m_pCodecContext->debug_mv = 0;
- m_pCodecContext->debug = 0;
- m_pCodecContext->workaround_bugs = 1;
-@@ -91,7 +86,7 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
-
- if( hints.extradata && hints.extrasize > 0 )
- {
-- m_pCodecContext->extradata = (uint8_t*)m_dllAvUtil.av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
-+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
- if(m_pCodecContext->extradata)
- {
- m_pCodecContext->extradata_size = hints.extrasize;
-@@ -99,14 +94,14 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- }
- }
-
-- if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0)
-+ if (avcodec_open2(m_pCodecContext, pCodec, NULL) < 0)
- {
- CLog::Log(LOGDEBUG,"CDVDAudioCodecFFmpeg::Open() Unable to open codec");
- Dispose();
- return false;
- }
-
-- m_pFrame1 = m_dllAvCodec.avcodec_alloc_frame();
-+ m_pFrame1 = avcodec_alloc_frame();
- m_bOpenedCodec = true;
- m_iSampleFormat = AV_SAMPLE_FMT_NONE;
-
-@@ -115,27 +110,23 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
-
- void CDVDAudioCodecFFmpeg::Dispose()
- {
-- if (m_pFrame1) m_dllAvUtil.av_free(m_pFrame1);
-+ if (m_pFrame1) av_free(m_pFrame1);
- m_pFrame1 = NULL;
-
- if (m_pConvert)
-- m_dllSwResample.swr_free(&m_pConvert);
-+ swr_free(&m_pConvert);
-
- if (m_pBuffer2)
-- m_dllAvUtil.av_freep(&m_pBuffer2);
-+ av_freep(&m_pBuffer2);
-
- if (m_pCodecContext)
- {
-- if (m_bOpenedCodec) m_dllAvCodec.avcodec_close(m_pCodecContext);
-+ if (m_bOpenedCodec) avcodec_close(m_pCodecContext);
- m_bOpenedCodec = false;
-- m_dllAvUtil.av_free(m_pCodecContext);
-+ av_free(m_pCodecContext);
- m_pCodecContext = NULL;
- }
-
-- m_dllAvCodec.Unload();
-- m_dllAvUtil.Unload();
-- m_dllSwResample.Unload();
--
- m_iBufferSize1 = 0;
- m_iBufferSize2 = 0;
- m_iBufferTotalSize2 = 0;
-@@ -150,10 +141,10 @@ int CDVDAudioCodecFFmpeg::Decode(uint8_t* pData, int iSize)
- m_iBufferSize2 = 0;
-
- AVPacket avpkt;
-- m_dllAvCodec.av_init_packet(&avpkt);
-+ av_init_packet(&avpkt);
- avpkt.data = pData;
- avpkt.size = iSize;
-- iBytesUsed = m_dllAvCodec.avcodec_decode_audio4( m_pCodecContext
-+ iBytesUsed = avcodec_decode_audio4( m_pCodecContext
- , m_pFrame1
- , &got_frame
- , &avpkt);
-@@ -162,7 +153,7 @@ int CDVDAudioCodecFFmpeg::Decode(uint8_t* pData, int iSize)
- m_iBufferSize1 = 0;
- return iBytesUsed;
- }
-- m_iBufferSize1 = m_pFrame1->nb_samples * m_pCodecContext->channels * m_dllAvUtil.av_get_bytes_per_sample(m_pCodecContext->sample_fmt);
-+ m_iBufferSize1 = m_pFrame1->nb_samples * m_pCodecContext->channels * av_get_bytes_per_sample(m_pCodecContext->sample_fmt);
-
- /* some codecs will attempt to consume more data than what we gave */
- if (iBytesUsed > iSize)
-@@ -202,17 +193,17 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat()
- if(m_pCodecContext->sample_fmt != AV_SAMPLE_FMT_FLT && m_iBufferSize1 > 0)
- {
- if(m_pConvert && (m_pCodecContext->sample_fmt != m_iSampleFormat || m_channels != m_pCodecContext->channels))
-- m_dllSwResample.swr_free(&m_pConvert);
-+ swr_free(&m_pConvert);
-
- if(!m_pConvert)
- {
- m_iSampleFormat = m_pCodecContext->sample_fmt;
-- m_pConvert = m_dllSwResample.swr_alloc_set_opts(NULL,
-- m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels), AV_SAMPLE_FMT_FLT, m_pCodecContext->sample_rate,
-- m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels), m_pCodecContext->sample_fmt, m_pCodecContext->sample_rate,
-+ m_pConvert = swr_alloc_set_opts(NULL,
-+ av_get_default_channel_layout(m_pCodecContext->channels), AV_SAMPLE_FMT_FLT, m_pCodecContext->sample_rate,
-+ av_get_default_channel_layout(m_pCodecContext->channels), m_pCodecContext->sample_fmt, m_pCodecContext->sample_rate,
- 0, NULL);
-
-- if(!m_pConvert || m_dllSwResample.swr_init(m_pConvert) < 0)
-+ if(!m_pConvert || swr_init(m_pConvert) < 0)
- {
- CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", m_pCodecContext->sample_fmt);
- m_iBufferSize1 = 0;
-@@ -221,10 +212,10 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat()
- }
- }
-
-- int needed_buf_size = m_dllAvUtil.av_samples_get_buffer_size(NULL, m_pCodecContext->channels, m_pFrame1->nb_samples, AV_SAMPLE_FMT_FLT, 0);
-+ int needed_buf_size = av_samples_get_buffer_size(NULL, m_pCodecContext->channels, m_pFrame1->nb_samples, AV_SAMPLE_FMT_FLT, 0);
- if(m_iBufferTotalSize2 < needed_buf_size)
- {
-- m_pBuffer2 = (uint8_t*)m_dllAvUtil.av_realloc(m_pBuffer2, needed_buf_size);
-+ m_pBuffer2 = (uint8_t*)av_realloc(m_pBuffer2, needed_buf_size);
- if(!m_pBuffer2)
- {
- CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to allocate a %i bytes buffer for resampling", needed_buf_size);
-@@ -237,7 +228,7 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat()
- }
-
- int outsamples;
-- outsamples = m_dllSwResample.swr_convert(m_pConvert, &m_pBuffer2, m_iBufferTotalSize2, (const uint8_t**)m_pFrame1->extended_data, m_pFrame1->nb_samples);
-+ outsamples = swr_convert(m_pConvert, &m_pBuffer2, m_iBufferTotalSize2, (const uint8_t**)m_pFrame1->extended_data, m_pFrame1->nb_samples);
-
- if(outsamples < 0)
- {
-@@ -253,7 +244,7 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat()
- }
-
- m_iBufferSize1 = 0;
-- m_iBufferSize2 = m_pFrame1->nb_samples * m_pCodecContext->channels * m_dllAvUtil.av_get_bytes_per_sample(AV_SAMPLE_FMT_FLT);
-+ m_iBufferSize2 = m_pFrame1->nb_samples * m_pCodecContext->channels * av_get_bytes_per_sample(AV_SAMPLE_FMT_FLT);
- }
- }
-
-@@ -276,7 +267,7 @@ int CDVDAudioCodecFFmpeg::GetData(uint8_t** dst)
-
- void CDVDAudioCodecFFmpeg::Reset()
- {
-- if (m_pCodecContext) m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext);
-+ if (m_pCodecContext) avcodec_flush_buffers(m_pCodecContext);
- m_iBufferSize1 = 0;
- m_iBufferSize2 = 0;
- m_iBuffered = 0;
-@@ -348,7 +339,7 @@ void CDVDAudioCodecFFmpeg::BuildChannelMap()
- else
- {
- CLog::Log(LOGINFO, "CDVDAudioCodecFFmpeg::GetChannelMap - FFmpeg reported %d channels, but the layout contains %d ignoring", m_pCodecContext->channels, bits);
-- layout = m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels);
-+ layout = av_get_default_channel_layout(m_pCodecContext->channels);
- }
-
- m_channelLayout.Reset();
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
-index 1646e00..7d78516 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
-@@ -21,10 +21,13 @@
- */
-
- #include "DVDAudioCodec.h"
--#include "DllAvCodec.h"
--#include "DllAvFormat.h"
--#include "DllAvUtil.h"
--#include "DllSwResample.h"
-+
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+#include "libavformat/avformat.h"
-+#include "libavutil/avutil.h"
-+#include "libswresample/swresample.h"
-+}
-
- class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
- {
-@@ -63,10 +66,6 @@ class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
- int m_channels;
- uint64_t m_layout;
-
-- DllAvCodec m_dllAvCodec;
-- DllAvUtil m_dllAvUtil;
-- DllSwResample m_dllSwResample;
--
- void BuildChannelMap();
- void ConvertToFloat();
- };
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
-index 5443cb3..46841a1 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
-@@ -23,7 +23,11 @@
- #include "cores/VideoRenderers/RenderManager.h"
- #include "utils/log.h"
- #include "utils/fastmemcpy.h"
--#include "DllSwScale.h"
-+#include "cores/FFmpeg.h"
-+
-+extern "C" {
-+#include "libswscale/swscale.h"
-+}
-
- // allocate a new picture (PIX_FMT_YUV420P)
- DVDVideoPicture* CDVDCodecUtils::AllocatePicture(int iWidth, int iHeight)
-@@ -241,12 +245,6 @@ DVDVideoPicture* CDVDCodecUtils::ConvertToYUV422PackedPicture(DVDVideoPicture *p
-
- //if this is going to be used for anything else than testing the renderer
- //the library should not be loaded on every function call
-- DllSwScale dllSwScale;
-- if (!dllSwScale.Load())
-- {
-- CLog::Log(LOGERROR,"CDVDCodecUtils::ConvertToYUY2Picture - failed to load rescale libraries!");
-- }
-- else
- {
- // Perform the scaling.
- uint8_t* src[] = { pSrc->data[0], pSrc->data[1], pSrc->data[2], NULL };
-@@ -260,11 +258,11 @@ DVDVideoPicture* CDVDCodecUtils::ConvertToYUV422PackedPicture(DVDVideoPicture *p
- else
- dstformat = PIX_FMT_YUYV422;
-
-- struct SwsContext *ctx = dllSwScale.sws_getContext(pSrc->iWidth, pSrc->iHeight, PIX_FMT_YUV420P,
-- pPicture->iWidth, pPicture->iHeight, dstformat,
-+ struct SwsContext *ctx = sws_getContext(pSrc->iWidth, pSrc->iHeight, PIX_FMT_YUV420P,
-+ pPicture->iWidth, pPicture->iHeight, (AVPixelFormat)dstformat,
- SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
-- dllSwScale.sws_scale(ctx, src, srcStride, 0, pSrc->iHeight, dst, dstStride);
-- dllSwScale.sws_freeContext(ctx);
-+ sws_scale(ctx, src, srcStride, 0, pSrc->iHeight, dst, dstStride);
-+ sws_freeContext(ctx);
- }
- }
- else
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp
-index 805ee22..72b9bca 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp
-@@ -45,18 +45,14 @@ CDVDOverlayCodecFFmpeg::~CDVDOverlayCodecFFmpeg()
-
- bool CDVDOverlayCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
- {
-- if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load()) return false;
--
-- m_dllAvCodec.avcodec_register_all();
--
-- AVCodec* pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec);
-+ AVCodec* pCodec = avcodec_find_decoder(hints.codec);
- if (!pCodec)
- {
- CLog::Log(LOGDEBUG,"%s - Unable to find codec %d", __FUNCTION__, hints.codec);
- return false;
- }
-
-- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec);
-+ m_pCodecContext = avcodec_alloc_context3(pCodec);
- m_pCodecContext->debug_mv = 0;
- m_pCodecContext->debug = 0;
- m_pCodecContext->workaround_bugs = FF_BUG_AUTODETECT;
-@@ -69,7 +65,7 @@ bool CDVDOverlayCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &optio
- if( hints.extradata && hints.extrasize > 0 )
- {
- m_pCodecContext->extradata_size = hints.extrasize;
-- m_pCodecContext->extradata = (uint8_t*)m_dllAvUtil.av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
-+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
- memcpy(m_pCodecContext->extradata, hints.extradata, hints.extrasize);
-
- // start parsing of extra data - create a copy to be safe and make it zero-terminating to avoid access violations!
-@@ -110,7 +106,7 @@ bool CDVDOverlayCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &optio
- delete[] parse_extra;
- }
-
-- if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0)
-+ if (avcodec_open2(m_pCodecContext, pCodec, NULL) < 0)
- {
- CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Unable to open codec");
- return false;
-@@ -123,14 +119,11 @@ void CDVDOverlayCodecFFmpeg::Dispose()
- {
- if (m_pCodecContext)
- {
-- if (m_pCodecContext->codec) m_dllAvCodec.avcodec_close(m_pCodecContext);
-- m_dllAvUtil.av_free(m_pCodecContext);
-+ if (m_pCodecContext->codec) avcodec_close(m_pCodecContext);
-+ av_free(m_pCodecContext);
- m_pCodecContext = NULL;
- }
- FreeSubtitle(m_Subtitle);
--
-- m_dllAvCodec.Unload();
-- m_dllAvUtil.Unload();
- }
-
- void CDVDOverlayCodecFFmpeg::FreeSubtitle(AVSubtitle& sub)
-@@ -139,13 +132,13 @@ void CDVDOverlayCodecFFmpeg::FreeSubtitle(AVSubtitle& sub)
- {
- if(sub.rects[i])
- {
-- m_dllAvUtil.av_free(sub.rects[i]->pict.data[0]);
-- m_dllAvUtil.av_free(sub.rects[i]->pict.data[1]);
-- m_dllAvUtil.av_freep(&sub.rects[i]);
-+ av_free(sub.rects[i]->pict.data[0]);
-+ av_free(sub.rects[i]->pict.data[1]);
-+ av_freep(&sub.rects[i]);
- }
- }
- if(sub.rects)
-- m_dllAvUtil.av_freep(&sub.rects);
-+ av_freep(&sub.rects);
- sub.num_rects = 0;
- sub.start_display_time = 0;
- sub.end_display_time = 0;
-@@ -161,13 +154,13 @@ int CDVDOverlayCodecFFmpeg::Decode(DemuxPacket *pPacket)
- FreeSubtitle(m_Subtitle);
-
- AVPacket avpkt;
-- m_dllAvCodec.av_init_packet(&avpkt);
-+ av_init_packet(&avpkt);
- avpkt.data = pPacket->pData;
- avpkt.size = pPacket->iSize;
- avpkt.pts = pPacket->pts == DVD_NOPTS_VALUE ? AV_NOPTS_VALUE : (int64_t)pPacket->pts;
- avpkt.dts = pPacket->dts == DVD_NOPTS_VALUE ? AV_NOPTS_VALUE : (int64_t)pPacket->dts;
-
-- len = m_dllAvCodec.avcodec_decode_subtitle2(m_pCodecContext, &m_Subtitle, &gotsub, &avpkt);
-+ len = avcodec_decode_subtitle2(m_pCodecContext, &m_Subtitle, &gotsub, &avpkt);
-
- if (len < 0)
- {
-@@ -216,7 +209,7 @@ void CDVDOverlayCodecFFmpeg::Flush()
- FreeSubtitle(m_Subtitle);
- m_SubtitleIndex = -1;
-
-- m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext);
-+ avcodec_flush_buffers(m_pCodecContext);
- }
-
- CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay()
-@@ -309,9 +302,9 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay()
- for(int i=0;ipalette[i] = Endian_SwapLE32(((uint32_t *)rect.pict.data[1])[i]);
-
-- m_dllAvUtil.av_free(rect.pict.data[0]);
-- m_dllAvUtil.av_free(rect.pict.data[1]);
-- m_dllAvUtil.av_freep(&m_Subtitle.rects[m_SubtitleIndex]);
-+ av_free(rect.pict.data[0]);
-+ av_free(rect.pict.data[1]);
-+ av_freep(&m_Subtitle.rects[m_SubtitleIndex]);
- m_SubtitleIndex++;
-
- return overlay;
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.h
-index 3306d94..f84e9a4 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.h
-@@ -21,8 +21,11 @@
- */
-
- #include "DVDOverlayCodec.h"
--#include "DllAvCodec.h"
--#include "DllAvUtil.h"
-+
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+#include "libavutil/avutil.h"
-+}
-
- class CDVDOverlaySpu;
- class CDVDOverlayText;
-@@ -50,8 +53,4 @@ class CDVDOverlayCodecFFmpeg : public CDVDOverlayCodec
-
- int m_width;
- int m_height;
--
-- DllAvCodec m_dllAvCodec;
-- DllAvUtil m_dllAvUtil;
--
- };
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecText.h b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecText.h
-index e4ee3fa..4e3b223 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecText.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecText.h
-@@ -21,7 +21,7 @@
- */
-
- #include "DVDOverlayCodec.h"
--#include "DllAvCodec.h"
-+#include "libavcodec/avcodec.h"
-
- class CDVDOverlayText;
-
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
-index 7585636..b6e1ed3 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
-@@ -36,9 +36,12 @@
- #include "threads/Thread.h"
- #include "utils/log.h"
- #include "utils/fastmemcpy.h"
--#include "DllSwScale.h"
-+extern "C" {
-+#include "libswscale/swscale.h"
-+}
- #include "utils/TimeUtils.h"
- #include "windowing/WindowingFactory.h"
-+#include "cores/FFmpeg.h"
-
- namespace BCM
- {
-@@ -248,7 +251,6 @@ class CMPCOutputThread : public CThread
- int m_aspectratio_x;
- int m_aspectratio_y;
- CEvent m_ready_event;
-- DllSwScale *m_dllSwScale;
- struct SwsContext *m_sw_scale_ctx;
- };
-
-@@ -348,9 +350,6 @@ CMPCOutputThread::CMPCOutputThread(void *device, DllLibCrystalHD *dll, bool has_
- m_aspectratio_y(1)
- {
- m_sw_scale_ctx = NULL;
-- m_dllSwScale = new DllSwScale;
-- m_dllSwScale->Load();
--
-
- if (g_Windowing.GetRenderQuirks() & RENDER_QUIRKS_YV12_PREFERED)
- m_output_YV12 = true;
-@@ -366,8 +365,7 @@ CMPCOutputThread::~CMPCOutputThread()
- delete m_FreeList.Pop();
-
- if (m_sw_scale_ctx)
-- m_dllSwScale->sws_freeContext(m_sw_scale_ctx);
-- delete m_dllSwScale;
-+ sws_freeContext(m_sw_scale_ctx);
- }
-
- unsigned int CMPCOutputThread::GetReadyCount(void)
-@@ -949,11 +947,11 @@ bool CMPCOutputThread::GetDecoderOutput(void)
- uint8_t* dst[] = { pBuffer->m_y_buffer_ptr, pBuffer->m_u_buffer_ptr, pBuffer->m_v_buffer_ptr, NULL };
- int dstStride[] = { pBuffer->m_width, pBuffer->m_width/2, pBuffer->m_width/2, 0 };
-
-- m_sw_scale_ctx = m_dllSwScale->sws_getCachedContext(m_sw_scale_ctx,
-+ m_sw_scale_ctx = sws_getCachedContext(m_sw_scale_ctx,
- pBuffer->m_width, pBuffer->m_height, PIX_FMT_YUYV422,
- pBuffer->m_width, pBuffer->m_height, PIX_FMT_YUV420P,
- SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
-- m_dllSwScale->sws_scale(m_sw_scale_ctx, src, srcStride, 0, pBuffer->m_height, dst, dstStride);
-+ sws_scale(m_sw_scale_ctx, src, srcStride, 0, pBuffer->m_height, dst, dstStride);
- }
- break;
- default:
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
-index f6751f4..d82e4bb 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
-@@ -21,13 +21,15 @@
- */
-
- #include "system.h"
--#include "DllAvFormat.h"
--#include "DllAvCodec.h"
-
- #include
- #include
- #include "cores/VideoRenderers/RenderFormats.h"
-
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+}
-+
- struct DVDCodecAvailableType
- {
- AVCodecID codec;
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp
-index 7f6e1ca..373ae2c 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp
-@@ -22,7 +22,9 @@
- #include "config.h"
- #elif defined(TARGET_WINDOWS)
- #include "system.h"
--#include "DllAvCodec.h"
-+extern "C" {
-+#include "libavcodec/avcodec.h"
-+}
- #endif
-
- #if defined(HAVE_LIBCRYSTALHD)
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
-index 9b6a34d..7348d5f 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
-@@ -63,6 +63,13 @@
- #endif
- #include "utils/StringUtils.h"
-
-+extern "C" {
-+#include "libavutil/opt.h"
-+#include "libavfilter/avfilter.h"
-+#include "libavfilter/buffersink.h"
-+#include "libavfilter/buffersrc.h"
-+}
-+
- using namespace boost;
-
- enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
-@@ -72,7 +79,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
-
- // if frame threading is enabled hw accel is not allowed
- if((EDECODEMETHOD) CSettings::Get().GetInt("videoplayer.decodingmethod") != VS_DECODEMETHOD_HARDWARE || !ctx->IsHardwareAllowed())
-- return ctx->m_dllAvCodec.avcodec_default_get_format(avctx, fmt);
-+ return avcodec_default_get_format(avctx, fmt);
-
- const PixelFormat * cur = fmt;
- while(*cur != PIX_FMT_NONE)
-@@ -134,7 +141,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
- #endif
- cur++;
- }
-- return ctx->m_dllAvCodec.avcodec_default_get_format(avctx, fmt);
-+ return avcodec_default_get_format(avctx, fmt);
- }
-
- CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec()
-@@ -144,11 +151,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec()
- m_pFilterGraph = NULL;
- m_pFilterIn = NULL;
- m_pFilterOut = NULL;
--#if defined(LIBAVFILTER_AVFRAME_BASED)
- m_pFilterFrame = NULL;
--#else
-- m_pBufferRef = NULL;
--#endif
-
- m_iPictureWidth = 0;
- m_iPictureHeight = 0;
-@@ -175,16 +178,6 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- {
- AVCodec* pCodec;
-
-- if(!m_dllAvUtil.Load()
-- || !m_dllAvCodec.Load()
-- || !m_dllSwScale.Load()
-- || !m_dllPostProc.Load()
-- || !m_dllAvFilter.Load()
-- ) return false;
--
-- m_dllAvCodec.avcodec_register_all();
-- m_dllAvFilter.avfilter_register_all();
--
- m_bSoftware = hints.software;
- m_iOrientation = hints.orientation;
-
-@@ -219,7 +212,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- }
-
- if(pCodec == NULL)
-- pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec);
-+ pCodec = avcodec_find_decoder(hints.codec);
-
- if(pCodec == NULL)
- {
-@@ -230,7 +223,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::Open() Using codec: %s",pCodec->long_name ? pCodec->long_name : pCodec->name);
-
- if(m_pCodecContext == NULL)
-- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec);
-+ m_pCodecContext = avcodec_alloc_context3(pCodec);
-
- m_pCodecContext->opaque = (void*)this;
- m_pCodecContext->debug_mv = 0;
-@@ -276,7 +269,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- if( hints.extradata && hints.extrasize > 0 )
- {
- m_pCodecContext->extradata_size = hints.extrasize;
-- m_pCodecContext->extradata = (uint8_t*)m_dllAvUtil.av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
-+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
- memcpy(m_pCodecContext->extradata, hints.extradata, hints.extrasize);
- }
-
-@@ -293,7 +286,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- if (it->m_name == "surfaces")
- m_uSurfacesCount = std::atoi(it->m_value.c_str());
- else
-- m_dllAvUtil.av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0);
-+ av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0);
- }
-
- int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount());
-@@ -302,19 +295,17 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
- || pCodec->id == AV_CODEC_ID_MPEG4 ))
- m_pCodecContext->thread_count = num_threads;
-
-- if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0)
-+ if (avcodec_open2(m_pCodecContext, pCodec, NULL) < 0)
- {
- CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Unable to open codec");
- return false;
- }
-
-- m_pFrame = m_dllAvCodec.avcodec_alloc_frame();
-+ m_pFrame = avcodec_alloc_frame();
- if (!m_pFrame) return false;
-
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- m_pFilterFrame = m_dllAvUtil.av_frame_alloc();
-+ m_pFilterFrame = av_frame_alloc();
- if (!m_pFilterFrame) return false;
--#endif
-
- UpdateName();
- return true;
-@@ -322,33 +313,26 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
-
- void CDVDVideoCodecFFmpeg::Dispose()
- {
-- if (m_pFrame) m_dllAvUtil.av_free(m_pFrame);
-+ if (m_pFrame) av_free(m_pFrame);
- m_pFrame = NULL;
-
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- m_dllAvUtil.av_frame_free(&m_pFilterFrame);
--#endif
-+ av_frame_free(&m_pFilterFrame);
-
- if (m_pCodecContext)
- {
-- if (m_pCodecContext->codec) m_dllAvCodec.avcodec_close(m_pCodecContext);
-+ if (m_pCodecContext->codec) avcodec_close(m_pCodecContext);
- if (m_pCodecContext->extradata)
- {
-- m_dllAvUtil.av_free(m_pCodecContext->extradata);
-+ av_free(m_pCodecContext->extradata);
- m_pCodecContext->extradata = NULL;
- m_pCodecContext->extradata_size = 0;
- }
-- m_dllAvUtil.av_free(m_pCodecContext);
-+ av_free(m_pCodecContext);
- m_pCodecContext = NULL;
- }
- SAFE_RELEASE(m_pHardware);
-
- FilterClose();
--
-- m_dllAvCodec.Unload();
-- m_dllAvUtil.Unload();
-- m_dllAvFilter.Unload();
-- m_dllPostProc.Unload();
- }
-
- void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop)
-@@ -476,13 +460,13 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p
- m_pCodecContext->reordered_opaque = pts_dtoi(pts);
-
- AVPacket avpkt;
-- m_dllAvCodec.av_init_packet(&avpkt);
-+ av_init_packet(&avpkt);
- avpkt.data = pData;
- avpkt.size = iSize;
- /* We lie, but this flag is only used by pngdec.c.
- * Setting it correctly would allow CorePNG decoding. */
- avpkt.flags = AV_PKT_FLAG_KEY;
-- len = m_dllAvCodec.avcodec_decode_video2(m_pCodecContext, m_pFrame, &iGotPicture, &avpkt);
-+ len = avcodec_decode_video2(m_pCodecContext, m_pFrame, &iGotPicture, &avpkt);
-
- if(m_iLastKeyframe < m_pCodecContext->has_b_frames + 2)
- m_iLastKeyframe = m_pCodecContext->has_b_frames + 2;
-@@ -557,7 +541,7 @@ void CDVDVideoCodecFFmpeg::Reset()
- {
- m_started = false;
- m_iLastKeyframe = m_pCodecContext->has_b_frames;
-- m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext);
-+ avcodec_flush_buffers(m_pCodecContext);
-
- if (m_pHardware)
- m_pHardware->Reset();
-@@ -571,14 +555,6 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture)
- pDvdVideoPicture->iWidth = m_pFrame->width;
- pDvdVideoPicture->iHeight = m_pFrame->height;
-
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- if(m_pBufferRef)
-- {
-- pDvdVideoPicture->iWidth = m_pBufferRef->video->w;
-- pDvdVideoPicture->iHeight = m_pBufferRef->video->h;
-- }
--#endif
--
- /* crop of 10 pixels if demuxer asked it */
- if(m_pCodecContext->coded_width && m_pCodecContext->coded_width < (int)pDvdVideoPicture->iWidth
- && m_pCodecContext->coded_width > (int)pDvdVideoPicture->iWidth - 10)
-@@ -592,10 +568,6 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture)
-
- /* use variable in the frame */
- AVRational pixel_aspect = m_pFrame->sample_aspect_ratio;
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- if (m_pBufferRef)
-- pixel_aspect = m_pBufferRef->video->sample_aspect_ratio;
--#endif
-
- if (pixel_aspect.num == 0)
- aspect_ratio = 0;
-@@ -620,7 +592,7 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture)
- if (!m_pFrame)
- return false;
-
-- AVDictionaryEntry * entry = m_dllAvUtil.av_dict_get(m_dllAvCodec.av_frame_get_metadata(m_pFrame), "stereo_mode", NULL, 0);
-+ AVDictionaryEntry * entry = av_dict_get(av_frame_get_metadata(m_pFrame), "stereo_mode", NULL, 0);
- if(entry && entry->value)
- {
- strncpy(pDvdVideoPicture->stereo_mode, (const char*)entry->value, sizeof(pDvdVideoPicture->stereo_mode));
-@@ -690,12 +662,7 @@ bool CDVDVideoCodecFFmpeg::GetPicture(DVDVideoPicture* pDvdVideoPicture)
- pDvdVideoPicture->extended_format = 0;
-
- PixelFormat pix_fmt;
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- if(m_pBufferRef)
-- pix_fmt = (PixelFormat)m_pBufferRef->format;
-- else
--#endif
-- pix_fmt = (PixelFormat)m_pFrame->format;
-+ pix_fmt = (PixelFormat)m_pFrame->format;
-
- pDvdVideoPicture->format = CDVDCodecUtils::EFormatFromPixfmt(pix_fmt);
- return true;
-@@ -718,14 +685,14 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters, bool scale)
- return 0;
- }
-
-- if (!(m_pFilterGraph = m_dllAvFilter.avfilter_graph_alloc()))
-+ if (!(m_pFilterGraph = avfilter_graph_alloc()))
- {
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - unable to alloc filter graph");
- return -1;
- }
-
-- AVFilter* srcFilter = m_dllAvFilter.avfilter_get_by_name("buffer");
-- AVFilter* outFilter = m_dllAvFilter.avfilter_get_by_name("buffersink"); // should be last filter in the graph for now
-+ AVFilter* srcFilter = avfilter_get_by_name("buffer");
-+ AVFilter* outFilter = avfilter_get_by_name("buffersink"); // should be last filter in the graph for now
-
- CStdString args = StringUtils::Format("%d:%d:%d:%d:%d:%d:%d",
- m_pCodecContext->width,
-@@ -736,64 +703,57 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters, bool scale)
- m_pCodecContext->sample_aspect_ratio.num,
- m_pCodecContext->sample_aspect_ratio.den);
-
-- if ((result = m_dllAvFilter.avfilter_graph_create_filter(&m_pFilterIn, srcFilter, "src", args, NULL, m_pFilterGraph)) < 0)
-+ if ((result = avfilter_graph_create_filter(&m_pFilterIn, srcFilter, "src", args, NULL, m_pFilterGraph)) < 0)
- {
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_graph_create_filter: src");
- return result;
- }
-
-- buffersink_params = m_dllAvFilter.av_buffersink_params_alloc();
-- buffersink_params->pixel_fmts = &m_formats[0];
--#ifdef FF_API_OLD_VSINK_API
-- if ((result = m_dllAvFilter.avfilter_graph_create_filter(&m_pFilterOut, outFilter, "out", NULL, (void*)buffersink_params->pixel_fmts, m_pFilterGraph)) < 0)
--#else
-- if ((result = m_dllAvFilter.avfilter_graph_create_filter(&m_pFilterOut, outFilter, "out", NULL, buffersink_params, m_pFilterGraph)) < 0)
--#endif
-+ if ((result = avfilter_graph_create_filter(&m_pFilterOut, outFilter, "out", NULL, NULL, m_pFilterGraph)) < 0)
- {
-- m_dllAvUtil.av_freep(&buffersink_params);
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_graph_create_filter: out");
- return result;
- }
-- m_dllAvUtil.av_freep(&buffersink_params);
-+ if ((result = av_opt_set_int_list(m_pFilterOut, "pix_fmts", &m_formats[0], AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0)
-+ {
-+ CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - failed settings pix formats");
-+ return result;
-+ }
-
- if (!filters.empty())
- {
-- AVFilterInOut* outputs = m_dllAvFilter.avfilter_inout_alloc();
-- AVFilterInOut* inputs = m_dllAvFilter.avfilter_inout_alloc();
-+ AVFilterInOut* outputs = avfilter_inout_alloc();
-+ AVFilterInOut* inputs = avfilter_inout_alloc();
-
-- outputs->name = m_dllAvUtil.av_strdup("in");
-+ outputs->name = av_strdup("in");
- outputs->filter_ctx = m_pFilterIn;
- outputs->pad_idx = 0;
- outputs->next = NULL;
-
-- inputs->name = m_dllAvUtil.av_strdup("out");
-+ inputs->name = av_strdup("out");
- inputs->filter_ctx = m_pFilterOut;
- inputs->pad_idx = 0;
- inputs->next = NULL;
-
--#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR)
-- if ((result = m_dllAvFilter.avfilter_graph_parse_ptr(m_pFilterGraph, (const char*)m_filters.c_str(), &inputs, &outputs, NULL)) < 0)
--#else
-- if ((result = m_dllAvFilter.avfilter_graph_parse(m_pFilterGraph, (const char*)m_filters.c_str(), &inputs, &outputs, NULL)) < 0)
--#endif
-+ if ((result = avfilter_graph_parse_ptr(m_pFilterGraph, (const char*)m_filters.c_str(), &inputs, &outputs, NULL)) < 0)
- {
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_graph_parse");
- return result;
- }
-
-- m_dllAvFilter.avfilter_inout_free(&outputs);
-- m_dllAvFilter.avfilter_inout_free(&inputs);
-+ avfilter_inout_free(&outputs);
-+ avfilter_inout_free(&inputs);
- }
- else
- {
-- if ((result = m_dllAvFilter.avfilter_link(m_pFilterIn, 0, m_pFilterOut, 0)) < 0)
-+ if ((result = avfilter_link(m_pFilterIn, 0, m_pFilterOut, 0)) < 0)
- {
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_link");
- return result;
- }
- }
-
-- if ((result = m_dllAvFilter.avfilter_graph_config(m_pFilterGraph, NULL)) < 0)
-+ if ((result = avfilter_graph_config(m_pFilterGraph, NULL)) < 0)
- {
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_graph_config");
- return result;
-@@ -804,17 +764,9 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters, bool scale)
-
- void CDVDVideoCodecFFmpeg::FilterClose()
- {
--#if !defined(LIBAVFILTER_AVFRAME_BASED)
-- if(m_pBufferRef)
-- {
-- m_dllAvFilter.avfilter_unref_buffer(m_pBufferRef);
-- m_pBufferRef = NULL;
-- }
--#endif
--
- if (m_pFilterGraph)
- {
-- m_dllAvFilter.avfilter_graph_free(&m_pFilterGraph);
-+ avfilter_graph_free(&m_pFilterGraph);
-
- // Disposed by above code
- m_pFilterIn = NULL;
-@@ -828,19 +780,7 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame)
-
- if (frame)
- {
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- // API changed in:
-- // ffmpeg: commit 7e350379f87e7f74420b4813170fe808e2313911 (28 Nov 2012)
-- // not released (post 1.2)
-- // libav: commit 7e350379f87e7f74420b4813170fe808e2313911 (28 Nov 2012)
-- // release v9 (5 January 2013)
-- result = m_dllAvFilter.av_buffersrc_add_frame(m_pFilterIn, frame);
--#else
-- // API changed in:
-- // ffmpeg: commit 7bac2a78c2241df4bcc1665703bb71afd9a3e692 (28 Apr 2012)
-- // release 0.11 (25 May 2012)
-- result = m_dllAvFilter.av_buffersrc_add_frame(m_pFilterIn, frame, 0);
--#endif
-+ result = av_buffersrc_add_frame(m_pFilterIn, frame);
- if (result < 0)
- {
- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_buffersrc_add_frame");
-@@ -848,8 +788,7 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame)
- }
- }
-
--#if defined(LIBAVFILTER_AVFRAME_BASED)
-- result = m_dllAvFilter.av_buffersink_get_frame(m_pFilterOut, m_pFilterFrame);
-+ result = av_buffersink_get_frame(m_pFilterOut, m_pFilterFrame);
-
- if(result == AVERROR(EAGAIN) || result == AVERROR_EOF)
- return VC_BUFFER;
-@@ -859,54 +798,10 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame)
- return VC_ERROR;
- }
-
-- m_dllAvUtil.av_frame_unref(m_pFrame);
-- m_dllAvUtil.av_frame_move_ref(m_pFrame, m_pFilterFrame);
-+ av_frame_unref(m_pFrame);
-+ av_frame_move_ref(m_pFrame, m_pFilterFrame);
-
- return VC_PICTURE;
--#else
-- int frames;
--
-- if(m_pBufferRef)
-- {
-- m_dllAvFilter.avfilter_unref_buffer(m_pBufferRef);
-- m_pBufferRef = NULL;
-- }
--
-- if ((frames = m_dllAvFilter.av_buffersink_poll_frame(m_pFilterOut)) < 0)
-- {
-- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_buffersink_poll_frame");
-- return VC_ERROR;
-- }
--
-- if (frames > 0)
-- {
--
-- result = m_dllAvFilter.av_buffersink_get_buffer_ref(m_pFilterOut, &m_pBufferRef, 0);
-- if(!m_pBufferRef || result < 0)
-- {
-- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - cur_buf");
-- return VC_ERROR;
-- }
--
-- if(frame == NULL)
-- m_pFrame->reordered_opaque = 0;
-- else
-- m_pFrame->repeat_pict = -(frames - 1);
--
-- m_pFrame->interlaced_frame = m_pBufferRef->video->interlaced;
-- m_pFrame->top_field_first = m_pBufferRef->video->top_field_first;
--
-- memcpy(m_pFrame->linesize, m_pBufferRef->linesize, 4*sizeof(int));
-- memcpy(m_pFrame->data , m_pBufferRef->data , 4*sizeof(uint8_t*));
--
-- if(frames > 1)
-- return VC_PICTURE;
-- else
-- return VC_PICTURE | VC_BUFFER;
-- }
--
-- return VC_BUFFER;
--#endif
- }
-
- unsigned CDVDVideoCodecFFmpeg::GetConvergeCount()
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
-index 2287031..ab5e565 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
-@@ -22,12 +22,17 @@
-
- #include "DVDVideoCodec.h"
- #include "DVDResource.h"
--#include "DllAvCodec.h"
--#include "DllAvFormat.h"
--#include "DllAvUtil.h"
--#include "DllSwScale.h"
--#include "DllAvFilter.h"
--#include "DllPostProc.h"
-+#include
-+#include "utils/StdString.h"
-+
-+extern "C" {
-+#include "libavfilter/avfilter.h"
-+#include "libavcodec/avcodec.h"
-+#include "libavformat/avformat.h"
-+#include "libavutil/avutil.h"
-+#include "libswscale/swscale.h"
-+#include "libpostproc/postprocess.h"
-+}
-
- class CCriticalSection;
-
-@@ -98,11 +103,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec
- AVFilterGraph* m_pFilterGraph;
- AVFilterContext* m_pFilterIn;
- AVFilterContext* m_pFilterOut;
--#if defined(LIBAVFILTER_AVFRAME_BASED)
- AVFrame* m_pFilterFrame;
--#else
-- AVFilterBufferRef* m_pBufferRef;
--#endif
-
- int m_iPictureWidth;
- int m_iPictureHeight;
-@@ -113,12 +114,6 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec
-
- unsigned int m_uSurfacesCount;
-
-- DllAvCodec m_dllAvCodec;
-- DllAvUtil m_dllAvUtil;
-- DllSwScale m_dllSwScale;
-- DllAvFilter m_dllAvFilter;
-- DllPostProc m_dllPostProc;
--
- std::string m_name;
- bool m_bSoftware;
- bool m_isHi10p;
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
-index 134f29b..31a118d 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
-@@ -24,7 +24,7 @@
- #include "system_gl.h"
- #include "DVDVideoCodecVDA.h"
-
--#include "DllSwScale.h"
-+#include "libswscale/swscale.h"
- #include "DVDClock.h"
- #include "DVDStreamInfo.h"
- #include "cores/dvdplayer/DVDCodecs/DVDCodecUtils.h"
-@@ -137,7 +137,6 @@ CDVDVideoCodecVDA::CDVDVideoCodecVDA() : CDVDVideoCodec()
- pthread_mutex_init(&m_queue_mutex, NULL);
-
- m_bitstream = NULL;
-- m_dllSwScale = NULL;
- memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
- m_DropPictures = false;
- m_decode_async = false;
-@@ -267,13 +266,6 @@ bool CDVDVideoCodecVDA::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
-
- if (!m_use_cvBufferRef)
- {
-- m_dllSwScale = new DllSwScale;
-- if (!m_dllSwScale->Load())
-- {
-- CFRelease(avcCData);
-- return false;
-- }
--
- // allocate a YV12 DVDVideoPicture buffer.
- // first make sure all properties are reset.
- memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
-@@ -394,9 +386,6 @@ void CDVDVideoCodecVDA::Dispose()
-
- if (m_bitstream)
- delete m_bitstream, m_bitstream = NULL;
--
-- if (m_dllSwScale)
-- delete m_dllSwScale, m_dllSwScale = NULL;
- }
-
- void CDVDVideoCodecVDA::SetDropState(bool bDrop)
-@@ -553,7 +542,7 @@ void CDVDVideoCodecVDA::DisplayQueuePop(void)
- void CDVDVideoCodecVDA::UYVY422_to_YUV420P(uint8_t *yuv422_ptr, int yuv422_stride, DVDVideoPicture *picture)
- {
- // convert PIX_FMT_UYVY422 to PIX_FMT_YUV420P.
-- struct SwsContext *swcontext = m_dllSwScale->sws_getContext(
-+ struct SwsContext *swcontext = sws_getContext(
- m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_UYVY422,
- m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_YUV420P,
- SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
-@@ -565,15 +554,15 @@ void CDVDVideoCodecVDA::UYVY422_to_YUV420P(uint8_t *yuv422_ptr, int yuv422_strid
- uint8_t *dst[] = { picture->data[0], picture->data[1], picture->data[2], 0 };
- int dstStride[] = { picture->iLineSize[0], picture->iLineSize[1], picture->iLineSize[2], 0 };
-
-- m_dllSwScale->sws_scale(swcontext, src, srcStride, 0, picture->iHeight, dst, dstStride);
-- m_dllSwScale->sws_freeContext(swcontext);
-+ sws_scale(swcontext, src, srcStride, 0, picture->iHeight, dst, dstStride);
-+ sws_freeContext(swcontext);
- }
- }
-
- void CDVDVideoCodecVDA::BGRA_to_YUV420P(uint8_t *bgra_ptr, int bgra_stride, DVDVideoPicture *picture)
- {
- // convert PIX_FMT_BGRA to PIX_FMT_YUV420P.
-- struct SwsContext *swcontext = m_dllSwScale->sws_getContext(
-+ struct SwsContext *swcontext = sws_getContext(
- m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_BGRA,
- m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_YUV420P,
- SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
-@@ -585,8 +574,8 @@ void CDVDVideoCodecVDA::BGRA_to_YUV420P(uint8_t *bgra_ptr, int bgra_stride, DVDV
- uint8_t *dst[] = { picture->data[0], picture->data[1], picture->data[2], 0 };
- int dstStride[] = { picture->iLineSize[0], picture->iLineSize[1], picture->iLineSize[2], 0 };
-
-- m_dllSwScale->sws_scale(swcontext, src, srcStride, 0, picture->iHeight, dst, dstStride);
-- m_dllSwScale->sws_freeContext(swcontext);
-+ sws_scale(swcontext, src, srcStride, 0, picture->iHeight, dst, dstStride);
-+ sws_freeContext(swcontext);
- }
- }
-
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.h
-index b095778..eb9975e 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.h
-@@ -22,7 +22,6 @@
- #include "DVDVideoCodec.h"
- #include
-
--class DllSwScale;
- class CBitstreamConverter;
- struct frame_queue;
-
-@@ -66,6 +65,5 @@ class CDVDVideoCodecVDA : public CDVDVideoCodec
-
- CBitstreamConverter *m_bitstream;
-
-- DllSwScale *m_dllSwScale;
- DVDVideoPicture m_videobuffer;
- };
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
-index c7651c4..d55853a 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
-@@ -27,13 +27,16 @@
- #include "DVDStreamInfo.h"
- #include "DVDCodecUtils.h"
- #include "DVDVideoCodecVideoToolBox.h"
--#include "lib/DllSwScale.h"
--#include "lib/DllAvFormat.h"
- #include "settings/Settings.h"
- #include "utils/log.h"
- #include "utils/TimeUtils.h"
- #include "osx/DarwinUtils.h"
-
-+extern "C" {
-+#include "lib/libswscale/swscale.h"
-+#include "lib/libavformat/avformat.h"
-+}
-+
- #if defined(__cplusplus)
- extern "C"
- {
-@@ -436,7 +439,7 @@ typedef struct {
- uint8_t* decoderConfig;
- } quicktime_esds_t;
-
--int quicktime_write_mp4_descr_length(DllAvFormat *av_format_ctx, AVIOContext *pb, int length, int compact)
-+int quicktime_write_mp4_descr_length(AVIOContext *pb, int length, int compact)
- {
- int i;
- uint8_t b;
-@@ -473,45 +476,45 @@ int quicktime_write_mp4_descr_length(DllAvFormat *av_format_ctx, AVIOContext *pb
- {
- b |= 0x80;
- }
-- av_format_ctx->avio_w8(pb, b);
-+ avio_w8(pb, b);
- }
-
- return numBytes;
- }
-
--void quicktime_write_esds(DllAvFormat *av_format_ctx, AVIOContext *pb, quicktime_esds_t *esds)
-+void quicktime_write_esds(AVIOContext *pb, quicktime_esds_t *esds)
- {
-- av_format_ctx->avio_w8(pb, 0); // Version
-- av_format_ctx->avio_wb24(pb, 0); // Flags
-+ avio_w8(pb, 0); // Version
-+ avio_wb24(pb, 0); // Flags
-
- // elementary stream descriptor tag
-- av_format_ctx->avio_w8(pb, 0x03);
-- quicktime_write_mp4_descr_length(av_format_ctx, pb,
-+ avio_w8(pb, 0x03);
-+ quicktime_write_mp4_descr_length(pb,
- 3 + 5 + (13 + 5 + esds->decoderConfigLen) + 3, false);
- // 3 bytes + 5 bytes for tag
-- av_format_ctx->avio_wb16(pb, esds->esid);
-- av_format_ctx->avio_w8(pb, esds->stream_priority);
-+ avio_wb16(pb, esds->esid);
-+ avio_w8(pb, esds->stream_priority);
-
- // decoder configuration description tag
-- av_format_ctx->avio_w8(pb, 0x04);
-- quicktime_write_mp4_descr_length(av_format_ctx, pb,
-+ avio_w8(pb, 0x04);
-+ quicktime_write_mp4_descr_length(pb,
- 13 + 5 + esds->decoderConfigLen, false);
- // 13 bytes + 5 bytes for tag
-- av_format_ctx->avio_w8(pb, esds->objectTypeId); // objectTypeIndication
-- av_format_ctx->avio_w8(pb, esds->streamType); // streamType
-- av_format_ctx->avio_wb24(pb, esds->bufferSizeDB); // buffer size
-- av_format_ctx->avio_wb32(pb, esds->maxBitrate); // max bitrate
-- av_format_ctx->avio_wb32(pb, esds->avgBitrate); // average bitrate
-+ avio_w8(pb, esds->objectTypeId); // objectTypeIndication
-+ avio_w8(pb, esds->streamType); // streamType
-+ avio_wb24(pb, esds->bufferSizeDB); // buffer size
-+ avio_wb32(pb, esds->maxBitrate); // max bitrate
-+ avio_wb32(pb, esds->avgBitrate); // average bitrate
-
- // decoder specific description tag
-- av_format_ctx->avio_w8(pb, 0x05);
-- quicktime_write_mp4_descr_length(av_format_ctx, pb, esds->decoderConfigLen, false);
-- av_format_ctx->avio_write(pb, esds->decoderConfig, esds->decoderConfigLen);
-+ avio_w8(pb, 0x05);
-+ quicktime_write_mp4_descr_length(pb, esds->decoderConfigLen, false);
-+ avio_write(pb, esds->decoderConfig, esds->decoderConfigLen);
-
- // sync layer configuration descriptor tag
-- av_format_ctx->avio_w8(pb, 0x06); // tag
-- av_format_ctx->avio_w8(pb, 0x01); // length
-- av_format_ctx->avio_w8(pb, 0x7F); // no SL
-+ avio_w8(pb, 0x06); // tag
-+ avio_w8(pb, 0x01); // length
-+ avio_w8(pb, 0x7F); // no SL
-
- /* no IPI_DescrPointer */
- /* no IP_IdentificationDataSet */
-@@ -523,7 +526,7 @@ void quicktime_write_esds(DllAvFormat *av_format_ctx, AVIOContext *pb, quicktime
-
- }
-
--quicktime_esds_t* quicktime_set_esds(DllAvFormat *av_format_ctx, const uint8_t * decoderConfig, int decoderConfigLen)
-+quicktime_esds_t* quicktime_set_esds(const uint8_t * decoderConfig, int decoderConfigLen)
- {
- // ffmpeg's codec->avctx->extradata, codec->avctx->extradata_size
- // are decoderConfig/decoderConfigLen
-@@ -652,8 +655,7 @@ const uint8_t *avc_find_startcode(const uint8_t *p, const uint8_t *end)
- return out;
- }
-
--const int avc_parse_nal_units(DllAvFormat *av_format_ctx,
-- AVIOContext *pb, const uint8_t *buf_in, int size)
-+const int avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
- {
- const uint8_t *p = buf_in;
- const uint8_t *end = p + size;
-@@ -665,26 +667,25 @@ const int avc_parse_nal_units(DllAvFormat *av_format_ctx,
- {
- while (!*(nal_start++));
- nal_end = avc_find_startcode(nal_start, end);
-- av_format_ctx->avio_wb32(pb, nal_end - nal_start);
-- av_format_ctx->avio_write(pb, nal_start, nal_end - nal_start);
-+ avio_wb32(pb, nal_end - nal_start);
-+ avio_write(pb, nal_start, nal_end - nal_start);
- size += 4 + nal_end - nal_start;
- nal_start = nal_end;
- }
- return size;
- }
-
--const int avc_parse_nal_units_buf(DllAvUtil *av_util_ctx, DllAvFormat *av_format_ctx,
-- const uint8_t *buf_in, uint8_t **buf, int *size)
-+const int avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
- {
- AVIOContext *pb;
-- int ret = av_format_ctx->avio_open_dyn_buf(&pb);
-+ int ret = avio_open_dyn_buf(&pb);
- if (ret < 0)
- return ret;
-
-- avc_parse_nal_units(av_format_ctx, pb, buf_in, *size);
-+ avc_parse_nal_units(pb, buf_in, *size);
-
-- av_util_ctx->av_freep(buf);
-- *size = av_format_ctx->avio_close_dyn_buf(pb, buf);
-+ av_freep(buf);
-+ *size = avio_close_dyn_buf(pb, buf);
- return 0;
- }
-
-@@ -729,8 +730,7 @@ const int avc_parse_nal_units_buf(DllAvUtil *av_util_ctx, DllAvFormat *av_format
- field_pic_flag: 0 on the frames,
- (field_pic_flag: 1 would indicate a normal interlaced frame).
- */
--const int isom_write_avcc(DllAvUtil *av_util_ctx, DllAvFormat *av_format_ctx,
-- AVIOContext *pb, const uint8_t *data, int len)
-+const int isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
- {
- // extradata from bytestream h264, convert to avcC atom data for bitstream
- if (len > 6)
-@@ -742,7 +742,7 @@ const int isom_write_avcc(DllAvUtil *av_util_ctx, DllAvFormat *av_format_ctx,
- uint32_t sps_size=0, pps_size=0;
- uint8_t *sps=0, *pps=0;
-
-- int ret = avc_parse_nal_units_buf(av_util_ctx, av_format_ctx, data, &buf, &len);
-+ int ret = avc_parse_nal_units_buf(data, &buf, &len);
- if (ret < 0)
- return ret;
- start = buf;
-@@ -769,26 +769,26 @@ const int isom_write_avcc(DllAvUtil *av_util_ctx, DllAvFormat *av_format_ctx,
- }
- assert(sps);
-
-- av_format_ctx->avio_w8(pb, 1); /* version */
-- av_format_ctx->avio_w8(pb, sps[1]); /* profile */
-- av_format_ctx->avio_w8(pb, sps[2]); /* profile compat */
-- av_format_ctx->avio_w8(pb, sps[3]); /* level */
-- av_format_ctx->avio_w8(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */
-- av_format_ctx->avio_w8(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */
-+ avio_w8(pb, 1); /* version */
-+ avio_w8(pb, sps[1]); /* profile */
-+ avio_w8(pb, sps[2]); /* profile compat */
-+ avio_w8(pb, sps[3]); /* level */
-+ avio_w8(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */
-+ avio_w8(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */
-
-- av_format_ctx->avio_wb16(pb, sps_size);
-- av_format_ctx->avio_write(pb, sps, sps_size);
-+ avio_wb16(pb, sps_size);
-+ avio_write(pb, sps, sps_size);
- if (pps)
- {
-- av_format_ctx->avio_w8(pb, 1); /* number of pps */
-- av_format_ctx->avio_wb16(pb, pps_size);
-- av_format_ctx->avio_write(pb, pps, pps_size);
-+ avio_w8(pb, 1); /* number of pps */
-+ avio_wb16(pb, pps_size);
-+ avio_write(pb, pps, pps_size);
- }
-- av_util_ctx->av_free(start);
-+ av_free(start);
- }
- else
- {
-- av_format_ctx->avio_write(pb, data, len);
-+ avio_write(pb, data, len);
- }
- }
- return 0;
-@@ -1043,8 +1043,6 @@ CDVDVideoCodecVideoToolBox::CDVDVideoCodecVideoToolBox() : CDVDVideoCodec()
-
- m_convert_bytestream = false;
- m_convert_3byteTo4byteNALSize = false;
-- m_dllAvUtil = NULL;
-- m_dllAvFormat = NULL;
- memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
- m_DropPictures = false;
- m_sort_time_offset = 0.0;
-@@ -1060,11 +1058,6 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o
- {
- if (CSettings::Get().GetBool("videoplayer.usevideotoolbox") && !hints.software)
- {
-- m_dllAvUtil = new DllAvUtil;
-- m_dllAvFormat = new DllAvFormat;
-- if (!m_dllAvUtil->Load() || !m_dllAvFormat->Load())
-- return false;
--
- int width = hints.width;
- int height = hints.height;
- int level = hints.level;
-@@ -1103,16 +1096,16 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o
- AVIOContext *pb;
- quicktime_esds_t *esds;
-
-- if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0)
-+ if (avio_open_dyn_buf(&pb) < 0)
- return false;
-
-- esds = quicktime_set_esds(m_dllAvFormat, extradata, extrasize);
-- quicktime_write_esds(m_dllAvFormat, pb, esds);
-+ esds = quicktime_set_esds(extradata, extrasize);
-+ quicktime_write_esds(pb, esds);
-
- // unhook from ffmpeg's extradata
- extradata = NULL;
- // extract the esds atom decoderConfig from extradata
-- extrasize = m_dllAvFormat->avio_close_dyn_buf(pb, &extradata);
-+ extrasize = avio_close_dyn_buf(pb, &extradata);
- free(esds->decoderConfig);
- free(esds);
-
-@@ -1120,7 +1113,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o
- kVTFormatMPEG4Video, width, height, extradata, extrasize, 'esds');
-
- // done with the converted extradata, we MUST free using av_free
-- m_dllAvUtil->av_free(extradata);
-+ av_free(extradata);
- }
- else
- {
-@@ -1188,21 +1181,21 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o
- // NAL reformating to bitstream format required
-
- AVIOContext *pb;
-- if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0)
-+ if (avio_open_dyn_buf(&pb) < 0)
- return false;
-
- m_convert_bytestream = true;
- // create a valid avcC atom data from ffmpeg's extradata
-- isom_write_avcc(m_dllAvUtil, m_dllAvFormat, pb, extradata, extrasize);
-+ isom_write_avcc(pb, extradata, extrasize);
- // unhook from ffmpeg's extradata
- extradata = NULL;
- // extract the avcC atom data into extradata getting size into extrasize
-- extrasize = m_dllAvFormat->avio_close_dyn_buf(pb, &extradata);
-+ extrasize = avio_close_dyn_buf(pb, &extradata);
-
- // check for interlaced and get number of ref frames
- if (!validate_avcC_spc(extradata, extrasize, &m_max_ref_frames, &spsLevel, &spsProfile))
- {
-- m_dllAvUtil->av_free(extradata);
-+ av_free(extradata);
- return false;
- }
-
-@@ -1221,7 +1214,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o
- // Main@L3.2, VTB cannot handle greater than 4 ref frames (ie. flash video)
- CLog::Log(LOGNOTICE, "%s - Main@L3.2 detected, VTB cannot decode with %d ref frames",
- __FUNCTION__, m_max_ref_frames);
-- m_dllAvUtil->av_free(extradata);
-+ av_free(extradata);
- return false;
- }
-
-@@ -1230,7 +1223,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o
- kVTFormatH264, width, height, extradata, extrasize, 'avcC');
-
- // done with the new converted extradata, we MUST free using av_free
-- m_dllAvUtil->av_free(extradata);
-+ av_free(extradata);
- CLog::Log(LOGNOTICE, "%s - created avcC atom of size(%d)", __FUNCTION__, extrasize);
- }
- else
-@@ -1314,17 +1307,6 @@ void CDVDVideoCodecVideoToolBox::Dispose()
-
- while (m_queue_depth)
- DisplayQueuePop();
--
-- if (m_dllAvUtil)
-- {
-- delete m_dllAvUtil;
-- m_dllAvUtil = NULL;
-- }
-- if (m_dllAvFormat)
-- {
-- delete m_dllAvFormat;
-- m_dllAvFormat = NULL;
-- }
- }
-
- void CDVDVideoCodecVideoToolBox::SetDropState(bool bDrop)
-@@ -1348,17 +1330,17 @@ int CDVDVideoCodecVideoToolBox::Decode(uint8_t* pData, int iSize, double dts, do
- if (m_convert_bytestream)
- {
- // convert demuxer packet from bytestream (AnnexB) to bitstream
-- if(m_dllAvFormat->avio_open_dyn_buf(&pb) < 0)
-+ if(avio_open_dyn_buf(&pb) < 0)
- return VC_ERROR;
-
-- avc_parse_nal_units(m_dllAvFormat, pb, pData, iSize);
-- demux_size = m_dllAvFormat->avio_close_dyn_buf(pb, &demux_buff);
-+ avc_parse_nal_units(pb, pData, iSize);
-+ demux_size = avio_close_dyn_buf(pb, &demux_buff);
- sampleBuff = CreateSampleBufferFrom(m_fmt_desc, demux_buff, demux_size);
- }
- else if (m_convert_3byteTo4byteNALSize)
- {
- // convert demuxer packet from 3 byte NAL sizes to 4 byte
-- if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0)
-+ if (avio_open_dyn_buf(&pb) < 0)
- return VC_ERROR;
-
- uint32_t nal_size;
-@@ -1367,13 +1349,13 @@ int CDVDVideoCodecVideoToolBox::Decode(uint8_t* pData, int iSize, double dts, do
- while (nal_start < end)
- {
- nal_size = VDA_RB24(nal_start);
-- m_dllAvFormat->avio_wb32(pb, nal_size);
-+ avio_wb32(pb, nal_size);
- nal_start += 3;
-- m_dllAvFormat->avio_write(pb, nal_start, nal_size);
-+ avio_write(pb, nal_start, nal_size);
- nal_start += nal_size;
- }
-
-- demux_size = m_dllAvFormat->avio_close_dyn_buf(pb, &demux_buff);
-+ demux_size = avio_close_dyn_buf(pb, &demux_buff);
- sampleBuff = CreateSampleBufferFrom(m_fmt_desc, demux_buff, demux_size);
- }
- else
-@@ -1384,7 +1366,7 @@ int CDVDVideoCodecVideoToolBox::Decode(uint8_t* pData, int iSize, double dts, do
- if (!sampleBuff)
- {
- if (demux_size)
-- m_dllAvUtil->av_free(demux_buff);
-+ av_free(demux_buff);
- CLog::Log(LOGNOTICE, "%s - CreateSampleBufferFrom failed", __FUNCTION__);
- return VC_ERROR;
- }
-@@ -1404,7 +1386,7 @@ int CDVDVideoCodecVideoToolBox::Decode(uint8_t* pData, int iSize, double dts, do
- CFRelease(frameInfo);
- CFRelease(sampleBuff);
- if (demux_size)
-- m_dllAvUtil->av_free(demux_buff);
-+ av_free(demux_buff);
- return VC_ERROR;
- // VTDecompressionSessionDecodeFrame returned 8969 (codecBadDataErr)
- // VTDecompressionSessionDecodeFrame returned -12350
-@@ -1421,14 +1403,14 @@ int CDVDVideoCodecVideoToolBox::Decode(uint8_t* pData, int iSize, double dts, do
- CFRelease(frameInfo);
- CFRelease(sampleBuff);
- if (demux_size)
-- m_dllAvUtil->av_free(demux_buff);
-+ av_free(demux_buff);
- return VC_ERROR;
- }
-
- CFRelease(frameInfo);
- CFRelease(sampleBuff);
- if (demux_size)
-- m_dllAvUtil->av_free(demux_buff);
-+ av_free(demux_buff);
- }
-
- // TODO: queue depth is related to the number of reference frames in encoded h.264.
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.h
-index bfc083b..d320886 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.h
-@@ -39,8 +39,6 @@ typedef struct frame_queue {
- struct frame_queue *nextframe;
- } frame_queue;
-
--class DllAvUtil;
--class DllAvFormat;
- class CDVDVideoCodecVideoToolBox : public CDVDVideoCodec
- {
- public:
-@@ -80,9 +78,6 @@ class CDVDVideoCodecVideoToolBox : public CDVDVideoCodec
-
- bool m_convert_bytestream;
- bool m_convert_3byteTo4byteNALSize;
--
-- DllAvUtil *m_dllAvUtil;
-- DllAvFormat *m_dllAvFormat;
- };
-
- #endif
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp
-index f993efb..a83b7d7 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp
-@@ -20,6 +20,7 @@
-
- #include "DVDVideoPPFFmpeg.h"
- #include "utils/log.h"
-+#include "cores/FFmpeg.h"
-
- CDVDVideoPPFFmpeg::CDVDVideoPPFFmpeg(const CStdString& mType)
- {
-@@ -38,12 +39,12 @@ void CDVDVideoPPFFmpeg::Dispose()
- {
- if (m_pMode)
- {
-- m_dll.pp_free_mode(m_pMode);
-+ pp_free_mode(m_pMode);
- m_pMode = NULL;
- }
- if(m_pContext)
- {
-- m_dll.pp_free_context(m_pContext);
-+ pp_free_context(m_pContext);
- m_pContext = NULL;
- }
-
-@@ -63,14 +64,10 @@ void CDVDVideoPPFFmpeg::Dispose()
-
- m_iInitWidth = 0;
- m_iInitHeight = 0;
--
-- m_dll.Unload();
- }
-
- bool CDVDVideoPPFFmpeg::CheckInit(int iWidth, int iHeight)
- {
-- if (!m_dll.IsLoaded() && !m_dll.Load()) return false;
--
- if(m_iInitWidth != iWidth || m_iInitHeight != iHeight)
- {
- if(m_pContext || m_pMode)
-@@ -78,12 +75,12 @@ bool CDVDVideoPPFFmpeg::CheckInit(int iWidth, int iHeight)
- Dispose();
- }
-
-- m_pContext = m_dll.pp_get_context(m_pSource->iWidth, m_pSource->iHeight, PPCPUFlags() | PP_FORMAT_420);
-+ m_pContext = pp_get_context(m_pSource->iWidth, m_pSource->iHeight, PPCPUFlags() | PP_FORMAT_420);
-
- m_iInitWidth = m_pSource->iWidth;
- m_iInitHeight = m_pSource->iHeight;
-
-- m_pMode = m_dll.pp_get_mode_by_name_and_quality((char *)m_sType.c_str(), PP_QUALITY_MAX);
-+ m_pMode = pp_get_mode_by_name_and_quality((char *)m_sType.c_str(), PP_QUALITY_MAX);
- }
-
-
-@@ -134,7 +131,7 @@ bool CDVDVideoPPFFmpeg::Process(DVDVideoPicture* pPicture)
- int pict_type = (m_pSource->qscale_type != DVP_QSCALE_MPEG1) ?
- PP_PICT_TYPE_QP2 : 0;
-
-- m_dll.pp_postprocess(m_pSource->data, m_pSource->iLineSize,
-+ pp_postprocess((const uint8_t**)m_pSource->data, m_pSource->iLineSize,
- m_pTarget->data, m_pTarget->iLineSize,
- m_pSource->iWidth, m_pSource->iHeight,
- m_pSource->qscale_table, m_pSource->qscale_stride,
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.h
-index 08bc6c2..5febe0b 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.h
-@@ -21,7 +21,7 @@
- */
-
- #include "DVDVideoCodec.h"
--#include "DllPostProc.h"
-+#include "utils/StdString.h"
-
- class CDVDVideoPPFFmpeg
- {
-@@ -52,8 +52,6 @@ class CDVDVideoPPFFmpeg
- int m_iInitWidth, m_iInitHeight;
- bool CheckInit(int iWidth, int iHeight);
- bool CheckFrameBuffer(const DVDVideoPicture* pSource);
--
-- DllPostProc m_dll;
- };
-
-
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
-index 3bafe92..b0025ed 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
-@@ -19,7 +19,7 @@
- */
- #pragma once
-
--#include "DllAvCodec.h"
-+#include "libavcodec/avcodec.h"
- #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
- #include "guilib/D3DResource.h"
- #include "threads/Event.h"
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVAHD.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVAHD.h
-index 22a9d39..811841f 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVAHD.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVAHD.h
-@@ -19,7 +19,7 @@
- */
- #pragma once
-
--#include "DllAvCodec.h"
-+#include "libavcodec/avcodec.h"
- #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
- #include "guilib/D3DResource.h"
- #include "threads/Event.h"
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
-index bfefc9d..47c84e6 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
-@@ -24,6 +24,8 @@
- #include "DVDVideoCodec.h"
- #include
- #include
-+#include "utils/log.h"
-+#include "threads/SingleLock.h"
-
- #define CHECK(a) \
- do { \
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
-index a520e42..9744c80 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
-@@ -21,7 +21,7 @@
-
- #include "system_gl.h"
-
--#include "DllAvCodec.h"
-+#include "libavcodec/avcodec.h"
- #include "DVDVideoCodecFFmpeg.h"
- #include
- #include
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h
-index c5e4714..a7cd60a 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h
-@@ -21,7 +21,7 @@
-
- #include "system_gl.h"
-
--#include "DllAvCodec.h"
-+#include "libavcodec/avcodec.h"
- #include "DVDVideoCodecFFmpeg.h"
-
- struct vda_context;
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
-index 4bc5180..5993767 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
-@@ -530,9 +530,6 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned
- m_DisplayState = VDPAU_OPEN;
- m_vdpauConfigured = false;
-
-- if (!m_dllAvUtil.Load())
-- return false;
--
- m_presentPicture = 0;
-
- {
-@@ -616,11 +613,9 @@ void CDecoder::Close()
-
- if (m_hwContext.bitstream_buffers_allocated)
- {
-- m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers);
-+ av_freep(&m_hwContext.bitstream_buffers);
- }
-
-- m_dllAvUtil.Unload();
--
- if (m_vdpauConfig.context)
- m_vdpauConfig.context->Release();
- m_vdpauConfig.context = 0;
-diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
-index ccad9a6..86a1714 100644
---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
-+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
-@@ -40,19 +40,15 @@
-
- #include "system_gl.h"
-
--#include "DllAvUtil.h"
- #include "DVDVideoCodec.h"
- #include "DVDVideoCodecFFmpeg.h"
--#include "libavcodec/vdpau.h"
- #include
- #include
- #define GLX_GLXEXT_PROTOTYPES
- #include
-
--#include "DllAvUtil.h"
- #include "DVDVideoCodec.h"
- #include "DVDVideoCodecFFmpeg.h"
--#include "libavcodec/vdpau.h"
- #include "threads/CriticalSection.h"
- #include "threads/SharedSection.h"
- #include "settings/VideoSettings.h"
-@@ -61,6 +57,12 @@
- #include "threads/Thread.h"
- #include "utils/ActorProtocol.h"
- #include
-+#include