From 24ee705b6424ea6e011eaf7b9002d623b378b5d5 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 20 Aug 2013 13:52:29 +0300 Subject: [PATCH 01/23] openvpn: cleanup --- packages/network/openvpn/build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/network/openvpn/build b/packages/network/openvpn/build index d75a99afd1..c6abaff577 100755 --- a/packages/network/openvpn/build +++ b/packages/network/openvpn/build @@ -23,14 +23,21 @@ . config/options $1 cd $PKG_BUILD +ac_cv_have_decl_TUNSETPERSIST=no \ ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=/usr \ --disable-server \ --enable-password-save \ - --disable-plugin-auth-pam \ - --disable-plugin-down-root \ + --disable-plugins \ --enable-iproute2 IPROUTE="/sbin/ip" \ + --disable-management \ + --disable-socks \ + --disable-http-proxy \ + --disable-fragment \ + --disable-multihome \ + --disable-port-share \ + --disable-debug \ make From 48e29bcfd0fd919206c62db0c50d41ce2363be7a Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 20 Aug 2013 19:13:56 +0300 Subject: [PATCH 02/23] busybox: re-add 'free' applet --- packages/sysutils/busybox/config/busybox.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sysutils/busybox/config/busybox.conf b/packages/sysutils/busybox/config/busybox.conf index e52b291fdf..94beeccd83 100644 --- a/packages/sysutils/busybox/config/busybox.conf +++ b/packages/sysutils/busybox/config/busybox.conf @@ -904,7 +904,7 @@ CONFIG_FEATURE_TOP_SMP_PROCESS=y CONFIG_FEATURE_TOPMEM=y CONFIG_UPTIME=y # CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set -# CONFIG_FREE is not set +CONFIG_FREE=y CONFIG_FUSER=y CONFIG_KILL=y CONFIG_KILLALL=y From ac407c5468fc03dfa618317d326ec8ad54c58590 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 20 Aug 2013 19:15:02 +0300 Subject: [PATCH 03/23] remove package: 'procps-ng' if anyone still need it - feel free to move to unofficial-addons --- packages/sysutils/busybox/meta | 2 +- packages/sysutils/procps-ng/build | 37 ----------------------------- packages/sysutils/procps-ng/install | 35 --------------------------- packages/sysutils/procps-ng/meta | 36 ---------------------------- 4 files changed, 1 insertion(+), 109 deletions(-) delete mode 100755 packages/sysutils/procps-ng/build delete mode 100755 packages/sysutils/procps-ng/install delete mode 100644 packages/sysutils/procps-ng/meta diff --git a/packages/sysutils/busybox/meta b/packages/sysutils/busybox/meta index 7ad27bf8e3..9ca1daecfb 100644 --- a/packages/sysutils/busybox/meta +++ b/packages/sysutils/busybox/meta @@ -25,7 +25,7 @@ PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.busybox.net" PKG_URL="http://busybox.net/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2" -PKG_DEPENDS="kexec-tools hdparm dosfstools e2fsprogs speedcontrol zip pciutils usbutils less procps-ng" +PKG_DEPENDS="kexec-tools hdparm dosfstools e2fsprogs speedcontrol zip pciutils usbutils less" PKG_BUILD_DEPENDS="toolchain busybox-hosttools" PKG_PRIORITY="required" PKG_SECTION="system" diff --git a/packages/sysutils/procps-ng/build b/packages/sysutils/procps-ng/build deleted file mode 100755 index 8884177cd0..0000000000 --- a/packages/sysutils/procps-ng/build +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2013 Dag Wieers (dag@wieers.com) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/ncurses" -export LIBS="-ltinfo" - -cd $PKG_BUILD -ac_cv_func_malloc_0_nonnull=yes \ -ac_cv_func_realloc_0_nonnull=yes \ -./configure --host=$TARGET_NAME \ - --build=$HOST_NAME \ - --prefix=/usr \ - --disable-skill \ - --disable-kill - -make diff --git a/packages/sysutils/procps-ng/install b/packages/sysutils/procps-ng/install deleted file mode 100755 index e8e9439da0..0000000000 --- a/packages/sysutils/procps-ng/install +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2013 Dag Wieers (dag@wieers.com) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -mkdir -p $INSTALL/usr/lib/ - cp -P $PKG_BUILD/proc/.libs/libprocps.so* $INSTALL/usr/lib/ - -mkdir -p $INSTALL/usr/bin/ - cp $PKG_BUILD/.libs/free $INSTALL/usr/bin/ - cp $PKG_BUILD/.libs/pgrep $INSTALL/usr/bin/ - ln -sf pgrep $INSTALL/usr/bin/pkill - cp $PKG_BUILD/.libs/pmap $INSTALL/usr/bin/ - cp $PKG_BUILD/.libs/slabtop $INSTALL/usr/bin/ - cp $PKG_BUILD/.libs/vmstat $INSTALL/usr/bin/ - cp $PKG_BUILD/.libs/watch $INSTALL/usr/bin/ diff --git a/packages/sysutils/procps-ng/meta b/packages/sysutils/procps-ng/meta deleted file mode 100644 index c3fcfedcc3..0000000000 --- a/packages/sysutils/procps-ng/meta +++ /dev/null @@ -1,36 +0,0 @@ -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2013 Dag Wieers (dag@wieers.com) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -PKG_NAME="procps-ng" -PKG_VERSION="3.3.8" -PKG_REV="1" -PKG_ARCH="any" -PKG_LICENSE="GPL" -PKG_SITE="http://gitorious.org/procps/procps" -PKG_URL="$SOURCEFORGE_SRC/procps-ng/Production/$PKG_NAME-$PKG_VERSION.tar.xz" -PKG_DEPENDS="ncurses" -PKG_BUILD_DEPENDS="toolchain ncurses" -PKG_PRIORITY="optional" -PKG_SECTION="debug" -PKG_SHORTDESC="procps: Small useful utilities that give information about processes" -PKG_LONGDESC="procps is the package that has a bunch of small useful utilities that give information about processes using the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill." -PKG_IS_ADDON="no" - -PKG_AUTORECONF="yes" From 6a7ed6e3999f53e28b26e016aed041d3b8cbc6c5 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 20 Aug 2013 19:25:41 +0300 Subject: [PATCH 04/23] busybox: re-add 'less' applet --- packages/sysutils/busybox/config/busybox.conf | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/sysutils/busybox/config/busybox.conf b/packages/sysutils/busybox/config/busybox.conf index 94beeccd83..ea6551a98e 100644 --- a/packages/sysutils/busybox/config/busybox.conf +++ b/packages/sysutils/busybox/config/busybox.conf @@ -635,16 +635,16 @@ CONFIG_FEATURE_VOLUMEID_LINUXRAID=y # Miscellaneous Utilities # # CONFIG_CONSPY is not set -# CONFIG_LESS is not set -CONFIG_FEATURE_LESS_MAXLINES=0 -# CONFIG_FEATURE_LESS_BRACKETS is not set -# CONFIG_FEATURE_LESS_FLAGS is not set -# CONFIG_FEATURE_LESS_MARKS is not set -# CONFIG_FEATURE_LESS_REGEXP is not set -# CONFIG_FEATURE_LESS_WINCH is not set -# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set -# CONFIG_FEATURE_LESS_DASHCMD is not set -# CONFIG_FEATURE_LESS_LINENUMS is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=16384 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +CONFIG_FEATURE_LESS_MARKS=y +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_FEATURE_LESS_WINCH=y +CONFIG_FEATURE_LESS_ASK_TERMINAL=y +CONFIG_FEATURE_LESS_DASHCMD=y +CONFIG_FEATURE_LESS_LINENUMS=y # CONFIG_NANDWRITE is not set # CONFIG_NANDDUMP is not set CONFIG_SETSERIAL=y From 260c51162a906ca9cbd5cb584a3b8a57f670b222 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 20 Aug 2013 19:27:57 +0300 Subject: [PATCH 05/23] remove package: 'less' if anyone still need it - feel free to move to unofficial-addons --- packages/sysutils/busybox/meta | 2 +- packages/sysutils/less/build | 37 ---------------------------------- packages/sysutils/less/install | 27 ------------------------- packages/sysutils/less/meta | 35 -------------------------------- 4 files changed, 1 insertion(+), 100 deletions(-) delete mode 100755 packages/sysutils/less/build delete mode 100755 packages/sysutils/less/install delete mode 100644 packages/sysutils/less/meta diff --git a/packages/sysutils/busybox/meta b/packages/sysutils/busybox/meta index 9ca1daecfb..6d68639492 100644 --- a/packages/sysutils/busybox/meta +++ b/packages/sysutils/busybox/meta @@ -25,7 +25,7 @@ PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.busybox.net" PKG_URL="http://busybox.net/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2" -PKG_DEPENDS="kexec-tools hdparm dosfstools e2fsprogs speedcontrol zip pciutils usbutils less" +PKG_DEPENDS="kexec-tools hdparm dosfstools e2fsprogs speedcontrol zip pciutils usbutils" PKG_BUILD_DEPENDS="toolchain busybox-hosttools" PKG_PRIORITY="required" PKG_SECTION="system" diff --git a/packages/sysutils/less/build b/packages/sysutils/less/build deleted file mode 100755 index f2d771b2af..0000000000 --- a/packages/sysutils/less/build +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2013 Dag Wieers (dag@wieers.com) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -cd $PKG_BUILD - -# make sourcefiles writable and run autotools - find . -type f -exec chmod +w "{}" ";" - do_autoreconf - -./configure --host=$TARGET_NAME \ - --build=$HOST_NAME \ - --prefix=/usr \ - --bindir=/usr/bin \ - -make - diff --git a/packages/sysutils/less/install b/packages/sysutils/less/install deleted file mode 100755 index a4a8e48ae3..0000000000 --- a/packages/sysutils/less/install +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2013 Dag Wieers (dag@wieers.com) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -mkdir -p $INSTALL/usr/bin/ - cp $PKG_BUILD/less $INSTALL/usr/bin/ - diff --git a/packages/sysutils/less/meta b/packages/sysutils/less/meta deleted file mode 100644 index 3294fb3daa..0000000000 --- a/packages/sysutils/less/meta +++ /dev/null @@ -1,35 +0,0 @@ -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2013 (dag@wieers.com) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -PKG_NAME="less" -PKG_VERSION="451" -PKG_REV="1" -PKG_ARCH="any" -PKG_LICENSE="GPL" -PKG_URL="http://www.greenwoodsoftware.com/less/$PKG_NAME-$PKG_VERSION.tar.gz" -PKG_DEPENDS="ncurses" -PKG_BUILD_DEPENDS="toolchain ncurses" -PKG_PRIORITY="optional" -PKG_SECTION="system" -PKG_SHORTDESC="less: free, open-source file pager" -PKG_LONGDESC="Less is a free, open-source file pager. It can be found on most versions of Linux, Unix and Mac OS, as well as on many other operating systems." -PKG_IS_ADDON="no" - -PKG_AUTORECONF="no" From e6d258be9c7c61005b055922f041a248745c0627 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 21 Aug 2013 04:59:34 +0200 Subject: [PATCH 06/23] xbmc: update to xbmc-13.alpha-0efa87e Signed-off-by: Stephan Raue --- .../mediacenter/xbmc-theme-Confluence/meta | 2 +- packages/mediacenter/xbmc/package.mk | 2 +- ...1-texturepacker-hostflags-and-rework.patch | 0 ...HONOPTIMIZE_with_external_Python-0.1.patch | 0 ...bmc-453-add_openelec.tv_RSS_news-0.1.patch | 0 ...add_as.xml_busy_dialog_delay_control.patch | 0 ...s-mark_our_wrapped_functions_as_used.patch | 0 .../xbmc-995.01-xvba_support-e70c101.patch} | 6519 +++++++++-------- .../xbmc-995.10-disable-alt-tab.patch | 0 .../xbmc-999.02-rpipower.patch | 113 - tools/mkpkg/mkpkg_xbmc-gotham | 1 - 11 files changed, 3623 insertions(+), 3014 deletions(-) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888 => 13.alpha-0efa87e}/xbmc-321-texturepacker-hostflags-and-rework.patch (100%) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888 => 13.alpha-0efa87e}/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch (100%) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888 => 13.alpha-0efa87e}/xbmc-453-add_openelec.tv_RSS_news-0.1.patch (100%) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888 => 13.alpha-0efa87e}/xbmc-602-add_as.xml_busy_dialog_delay_control.patch (100%) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888 => 13.alpha-0efa87e}/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch (100%) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch => 13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch} (86%) rename packages/mediacenter/xbmc/patches/{13.alpha-df91888 => 13.alpha-0efa87e}/xbmc-995.10-disable-alt-tab.patch (100%) delete mode 100644 packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch diff --git a/packages/mediacenter/xbmc-theme-Confluence/meta b/packages/mediacenter/xbmc-theme-Confluence/meta index e34729ab63..2cdbe8faec 100644 --- a/packages/mediacenter/xbmc-theme-Confluence/meta +++ b/packages/mediacenter/xbmc-theme-Confluence/meta @@ -21,7 +21,7 @@ PKG_NAME="xbmc-theme-Confluence" PKG_VERSION="12.2-5ba69b6" if [ "$XBMC" = "master" ]; then - PKG_VERSION="13.alpha-df91888" + PKG_VERSION="13.alpha-0efa87e" elif [ "$XBMC" = "xbmc-aml" ]; then PKG_VERSION="aml-frodo-d9119f2" fi diff --git a/packages/mediacenter/xbmc/package.mk b/packages/mediacenter/xbmc/package.mk index f9398a22f2..1d91a91467 100644 --- a/packages/mediacenter/xbmc/package.mk +++ b/packages/mediacenter/xbmc/package.mk @@ -21,7 +21,7 @@ PKG_NAME="xbmc" PKG_VERSION="12.2-5ba69b6" if [ "$XBMC" = "master" ]; then - PKG_VERSION="13.alpha-df91888" + PKG_VERSION="13.alpha-0efa87e" elif [ "$XBMC" = "xbmc-aml" ]; then PKG_VERSION="aml-frodo-d9119f2" fi diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-321-texturepacker-hostflags-and-rework.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-321-texturepacker-hostflags-and-rework.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-321-texturepacker-hostflags-and-rework.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-321-texturepacker-hostflags-and-rework.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-453-add_openelec.tv_RSS_news-0.1.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-453-add_openelec.tv_RSS_news-0.1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-453-add_openelec.tv_RSS_news-0.1.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-453-add_openelec.tv_RSS_news-0.1.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-602-add_as.xml_busy_dialog_delay_control.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-602-add_as.xml_busy_dialog_delay_control.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-602-add_as.xml_busy_dialog_delay_control.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-602-add_as.xml_busy_dialog_delay_control.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch similarity index 86% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch index 24c5392f3c..ba73315ef1 100644 --- a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch +++ b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch @@ -1,911 +1,1483 @@ -From 6eaedd0e1d1b3bb716ea7458b9782a704bf54f1e Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Thu, 30 May 2013 10:56:06 +0200 -Subject: [PATCH 001/110] renderer: use fence for determination when a buffer - is ready for reuse +From eb767f12f803f34a841f490e58bd11629c2e7f84 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Sun, 11 Aug 2013 18:10:05 +0200 +Subject: [PATCH 001/111] AE: add planar formats to end of enum, some other + code relies on the order --- - xbmc/cores/VideoRenderers/BaseRenderer.h | 1 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 32 +++++++++++++++++++++++++++ - xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 ++ - xbmc/cores/VideoRenderers/RenderManager.cpp | 7 +++++- - 4 files changed, 41 insertions(+), 1 deletion(-) + xbmc/cores/AudioEngine/AEAudioFormat.h | 22 +++++++------ + xbmc/cores/AudioEngine/Utils/AEUtil.cpp | 57 +++++++++++++++++---------------- + 2 files changed, 42 insertions(+), 37 deletions(-) -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index a61d3cf..6acf2f3 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -92,6 +92,7 @@ class CBaseRenderer - virtual unsigned int GetMaxBufferSize() { return 0; } - virtual void SetBufferSize(int numBuffers) { } - virtual void ReleaseBuffer(int idx) { } -+ virtual bool IsProcessed(int idx) { return true; } +diff --git a/xbmc/cores/AudioEngine/AEAudioFormat.h b/xbmc/cores/AudioEngine/AEAudioFormat.h +index 64be36f..5664e6e 100644 +--- a/xbmc/cores/AudioEngine/AEAudioFormat.h ++++ b/xbmc/cores/AudioEngine/AEAudioFormat.h +@@ -31,33 +31,26 @@ enum AEDataFormat + AE_FMT_INVALID = -1, - virtual bool Supports(ERENDERFEATURE feature) { return false; } + AE_FMT_U8, +- AE_FMT_U8P, + AE_FMT_S8, -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index d52dead..962680a 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -128,6 +128,7 @@ - memset(&image , 0, sizeof(image)); - memset(&pbo , 0, sizeof(pbo)); - flipindex = 0; -+ fence = None; - #ifdef HAVE_LIBVDPAU - vdpau = NULL; - #endif -@@ -138,6 +139,8 @@ - - CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() - { -+ if(fence) -+ glDeleteSync(fence); - #ifdef HAVE_LIBVA - delete &vaapi; - #endif -@@ -1228,6 +1231,15 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) - RenderSoftware(renderBuffer, m_currentField); - VerifyGLState(); - } -+ -+ // set fence in order to determine when buffer is ready for reuse -+ // this is the case when the gl has finished processing -+ if(m_buffers[renderBuffer].fence) -+ { -+ glDeleteSync(m_buffers[renderBuffer].fence); -+ m_buffers[renderBuffer].fence = None; -+ } -+ m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } - - void CLinuxRendererGL::RenderSinglePass(int index, int field) -@@ -3426,6 +3438,26 @@ unsigned int CLinuxRendererGL::GetProcessorSize() - return 0; - } - -+bool CLinuxRendererGL::IsProcessed(int idx) -+{ -+ YUVBUFFER &buf = m_buffers[idx]; -+ if(buf.fence) -+ { -+ GLint state; -+ GLsizei length; -+ glGetSynciv(buf.fence, GL_SYNC_STATUS, 1, &length, &state); -+ if(state == GL_SIGNALED) -+ { -+ glDeleteSync(buf.fence); -+ buf.fence = None; -+ return true; -+ } -+ else -+ return false; -+ } -+ return true; -+} -+ - #ifdef HAVE_LIBVDPAU - void CLinuxRendererGL::AddProcessor(CVDPAU* vdpau, int index) - { -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index b986d93..a90a532 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -141,6 +141,7 @@ class CLinuxRendererGL : public CBaseRenderer - virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } - virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } - virtual unsigned int GetProcessorSize(); -+ virtual bool IsProcessed(int idx); - - #ifdef HAVE_LIBVDPAU - virtual void AddProcessor(CVDPAU* vdpau, int index); -@@ -278,6 +279,7 @@ class CLinuxRendererGL : public CBaseRenderer - YV12Image image; - unsigned flipindex; /* used to decide if this has been uploaded */ - GLuint pbo[MAX_PLANES]; -+ GLsync fence; - - #ifdef HAVE_LIBVDPAU - CVDPAU* vdpau; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 0d32715..6a8afff 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -374,11 +374,16 @@ void CXBMCRenderManager::FrameMove() - /* release all previous */ - for(std::deque::iterator it = m_discard.begin(); it != m_discard.end(); ) - { -- // TODO check for fence -+ if (!m_pRenderer->IsProcessed(*it)) -+ { -+ ++it; -+ continue; -+ } - m_pRenderer->ReleaseBuffer(*it); - m_overlays.Release(*it); - m_free.push_back(*it); - it = m_discard.erase(it); -+ m_presentevent.notifyAll(); - } - } - } --- -1.8.1.6 - - -From 4e82aa374e215ba627741f7a0a9ea8da770b2672 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 002/110] videoplayer: adapt lateness detection and dropping to - buffering - ---- - xbmc/cores/VideoRenderers/RenderManager.cpp | 16 +- - xbmc/cores/VideoRenderers/RenderManager.h | 12 +- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 15 +- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 31 ++++ - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 194 +++++++++++++++++---- - xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ - 7 files changed, 260 insertions(+), 38 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 6a8afff..deac94b 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -299,6 +299,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi - m_bIsStarted = true; - m_bReconfigured = true; - m_presentstep = PRESENT_IDLE; -+ m_presentpts = DVD_NOPTS_VALUE; -+ m_sleeptime = 1.0; - m_presentevent.notifyAll(); - - m_firstFlipPage = false; // tempfix -@@ -645,7 +647,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) - m_pRenderer->SetViewMode(iViewMode); - } - --void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) -+void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, double pts /* = 0 */, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) - { - { CSharedLock lock(m_sharedSection); - -@@ -713,6 +715,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - m.timestamp = timestamp; - m.presentfield = sync; - m.presentmethod = presentmethod; -+ m.pts = pts; - requeue(m_queued, m_free); - - /* signal to any waiters to check state */ -@@ -1076,6 +1079,8 @@ void CXBMCRenderManager::PrepareNextRender() - m_discard.push_back(m_presentsource); - m_presentsource = idx; - m_queued.pop_front(); -+ m_sleeptime = m_Queue[idx].timestamp - clocktime; -+ m_presentpts = m_Queue[idx].pts; - m_presentevent.notifyAll(); - } - } -@@ -1092,3 +1097,12 @@ void CXBMCRenderManager::DiscardBuffer() - m_presentstep = PRESENT_IDLE; - m_presentevent.notifyAll(); - } -+ -+bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) -+{ -+ CSingleLock lock(m_presentlock); -+ sleeptime = m_sleeptime; -+ pts = m_presentpts; -+ bufferLevel = m_queued.size() + m_discard.size(); -+ return true; -+} -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 00fe4c3..52380c1 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -97,10 +97,11 @@ class CXBMCRenderManager - * - * @param bStop reference to stop flag of calling thread - * @param timestamp of frame delivered with AddVideoPicture -+ * @param pts used for lateness detection - * @param source depreciated - * @param sync signals frame, top, or bottom field - */ -- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); -+ void FlipPage(volatile bool& bStop, double timestamp = 0.0, double pts = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); - unsigned int PreInit(); - void UnInit(); - bool Flush(); -@@ -175,6 +176,12 @@ class CXBMCRenderManager - int WaitForBuffer(volatile bool& bStop, int timeout = 100); - - /** -+ * Can be called by player for lateness detection. This is done best by -+ * looking at the end of the queue. -+ */ -+ bool GetStats(double &sleeptime, double &pts, int &bufferLevel); -+ -+ /** - * Video player call this on flush in oder to discard any queued frames - */ - void DiscardBuffer(); -@@ -221,6 +228,7 @@ class CXBMCRenderManager - - struct SPresent - { -+ double pts; - double timestamp; - EFIELDSYNC presentfield; - EPRESENTMETHOD presentmethod; -@@ -232,6 +240,8 @@ class CXBMCRenderManager - - ERenderFormat m_format; - -+ double m_sleeptime; -+ double m_presentpts; - double m_presentcorr; - double m_presenterr; - double m_errorbuff[ERRORBUFFSIZE]; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 8fc76b7..7f6d536 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -117,6 +117,10 @@ struct DVDVideoUserData - #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped - #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data - -+#define DVP_FLAG_DROPDEINT 0x00000040 // indicate that this picture was requested to have been dropped in deint stage -+#define DVP_FLAG_NO_POSTPROC 0x00000100 -+#define DVP_FLAG_DRAIN 0x00000200 -+ - // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! - - #define DVP_QSCALE_UNKNOWN 0 -@@ -134,6 +138,9 @@ struct DVDVideoUserData - #define VC_PICTURE 0x00000004 // the decoder got a picture, call Decode(NULL, 0) again to parse the rest of the data - #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data - #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again -+#define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped -+#define VC_HURRY 0x00000040 -+ - class CDVDVideoCodec - { - public: -@@ -251,10 +258,16 @@ class CDVDVideoCodec - return 0; - } + AE_FMT_S16BE, + AE_FMT_S16LE, + AE_FMT_S16NE, +- AE_FMT_S16NEP, + AE_FMT_S32BE, + AE_FMT_S32LE, + AE_FMT_S32NE, +- AE_FMT_S32NEP, - - /** - * Number of references to old pictures that are allowed to - * be retained when calling decode on the next demux packet - */ - virtual unsigned GetAllowedReferences() { return 0; } ++ + AE_FMT_S24BE4, + AE_FMT_S24LE4, + AE_FMT_S24NE4, /* S24 in 4 bytes */ +- AE_FMT_S24NE4P, + + AE_FMT_S24BE3, + AE_FMT_S24LE3, + AE_FMT_S24NE3, /* S24 in 3 bytes */ +- AE_FMT_S24NE3P, + + AE_FMT_DOUBLE, +- AE_FMT_DOUBLEP, + AE_FMT_FLOAT, +- AE_FMT_FLOATP, + + /* Bitstream formats */ + AE_FMT_AAC, +@@ -68,11 +61,20 @@ enum AEDataFormat + AE_FMT_DTSHD, + AE_FMT_LPCM, + ++ /* planar formats */ ++ AE_FMT_U8P, ++ AE_FMT_S16NEP, ++ AE_FMT_S32NEP, ++ AE_FMT_S24NE4P, ++ AE_FMT_S24NE3P, ++ AE_FMT_DOUBLEP, ++ AE_FMT_FLOATP, + -+ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) -+ { -+ return false; -+ } -+ -+ virtual void SetCodecControl(int flags) {} + AE_FMT_MAX }; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 12bad27..530dc9d 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -167,6 +167,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx - m_iLastKeyframe = 0; - m_dts = DVD_NOPTS_VALUE; - m_started = false; -+ m_decoderPts = DVD_NOPTS_VALUE; - } - CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg() -@@ -353,6 +354,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) - { - if( m_pCodecContext ) +-#define AE_IS_RAW(x) ((x) >= AE_FMT_AAC && (x) < AE_FMT_MAX) +-#define AE_IS_RAW_HD(x) ((x) >= AE_FMT_EAC3 && (x) < AE_FMT_MAX) ++#define AE_IS_RAW(x) ((x) >= AE_FMT_AAC && (x) < AE_FMT_U8P) ++#define AE_IS_RAW_HD(x) ((x) >= AE_FMT_EAC3 && (x) < AE_FMT_U8P) + + /** + * The audio format structure that fully defines a stream's audio information +diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp +index 3a5c78f..1ff44f8 100644 +--- a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp ++++ b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp +@@ -82,42 +82,43 @@ const unsigned int CAEUtil::DataFormatToBits(const enum AEDataFormat dataFormat) + static const unsigned int formats[AE_FMT_MAX] = { -+ if (bDrop && m_pHardware && m_pHardware->CanSkipDeint()) -+ { -+ m_requestSkipDeint = true; -+ bDrop = false; -+ } -+ else -+ m_requestSkipDeint = false; -+ - // i don't know exactly how high this should be set - // couldn't find any good docs on it. think it varies - // from codec to codec on what it does -@@ -554,6 +563,7 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p - void CDVDVideoCodecFFmpeg::Reset() - { - m_started = false; -+ m_decoderPts = DVD_NOPTS_VALUE; - m_iLastKeyframe = m_pCodecContext->has_b_frames; - m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext); + 8, /* U8 */ +- 8, /* U8P */ + 8, /* S8 */ -@@ -667,6 +677,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) - else - pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + 16, /* S16BE */ + 16, /* S16LE */ + 16, /* S16NE */ +- 16, /* S16NEP */ +- ++ + 32, /* S32BE */ + 32, /* S32LE */ + 32, /* S32NE */ +- 32, /* S32NEP */ +- ++ + 32, /* S24BE */ + 32, /* S24LE */ + 32, /* S24NE */ +- 32, /* S24NEP */ +- ++ + 24, /* S24BE3 */ + 24, /* S24LE3 */ + 24, /* S24NE3 */ +- 24, /* S24NE3P*/ +- ++ + sizeof(double) << 3, /* DOUBLE */ +- sizeof(double) << 3, /* DOUBLEP */ + sizeof(float ) << 3, /* FLOAT */ +- sizeof(float ) << 3, /* FLOATP */ +- ++ + 16, /* AAC */ + 16, /* AC3 */ + 16, /* DTS */ + 16, /* EAC3 */ + 16, /* TRUEHD */ + 16, /* DTS-HD */ +- 32 /* LPCM */ +- }; ++ 32, /* LPCM */ ++ ++ 8, /* U8P */ ++ 16, /* S16NEP */ ++ 32, /* S32NEP */ ++ 32, /* S24NEP */ ++ 24, /* S24NE3P*/ ++ sizeof(double) << 3, /* DOUBLEP */ ++ sizeof(float ) << 3 /* FLOATP */ ++ }; -+ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) -+ m_decoderPts = pDvdVideoPicture->pts; -+ else -+ m_decoderPts = m_dts; -+ -+ if (m_requestSkipDeint) -+ { -+ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; -+ m_skippedDeint = 1; -+ } -+ else -+ m_skippedDeint = 0; -+ -+ m_requestSkipDeint = false; -+ pDvdVideoPicture->iFlags |= m_codecControlFlags; -+ - if(!m_started) - pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; - -@@ -931,3 +957,8 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() - else - return 0; + return formats[dataFormat]; } +@@ -130,34 +131,27 @@ const char* CAEUtil::DataFormatToStr(const enum AEDataFormat dataFormat) + static const char *formats[AE_FMT_MAX] = + { + "AE_FMT_U8", +- "AE_FMT_U8P", + "AE_FMT_S8", + + "AE_FMT_S16BE", + "AE_FMT_S16LE", + "AE_FMT_S16NE", +- "AE_FMT_S16NEP", +- ++ + "AE_FMT_S32BE", + "AE_FMT_S32LE", + "AE_FMT_S32NE", +- "AE_FMT_S32NEP", +- ++ + "AE_FMT_S24BE4", + "AE_FMT_S24LE4", + "AE_FMT_S24NE4", /* S24 in 4 bytes */ +- "AE_FMT_S24NE4P", +- ++ + "AE_FMT_S24BE3", + "AE_FMT_S24LE3", + "AE_FMT_S24NE3", /* S24 in 3 bytes */ +- "AE_FMT_S24NE3P", +- ++ + "AE_FMT_DOUBLE", +- "AE_FMT_DOUBLEP", + "AE_FMT_FLOAT", +- "AE_FMT_FLOATP", +- ++ + /* for passthrough streams and the like */ + "AE_FMT_AAC", + "AE_FMT_AC3", +@@ -165,7 +159,16 @@ const char* CAEUtil::DataFormatToStr(const enum AEDataFormat dataFormat) + "AE_FMT_EAC3", + "AE_FMT_TRUEHD", + "AE_FMT_DTSHD", +- "AE_FMT_LPCM" ++ "AE_FMT_LPCM", + -+void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) -+{ -+ m_codecControlFlags = flags; -+} -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index c509339..a511806 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -46,6 +46,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual int Check (AVCodecContext* avctx) = 0; - virtual void Reset () {} - virtual unsigned GetAllowedReferences() { return 0; } -+ virtual bool CanSkipDeint() {return false; } - virtual const std::string Name() = 0; - virtual CCriticalSection* Section() { return NULL; } ++ /* planar formats */ ++ "AE_FMT_U8P", ++ "AE_FMT_S16NEP", ++ "AE_FMT_S32NEP", ++ "AE_FMT_S24NE4P", ++ "AE_FMT_S24NE3P", ++ "AE_FMT_DOUBLEP", ++ "AE_FMT_FLOATP" }; -@@ -63,6 +64,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open - virtual unsigned GetConvergeCount(); - virtual unsigned GetAllowedReferences(); -+ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} -+ virtual void SetCodecControl(int flags); - bool IsHardwareAllowed() { return !m_bSoftware; } - IHardwareDecoder * GetHardware() { return m_pHardware; }; -@@ -128,4 +131,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - double m_dts; - bool m_started; - std::vector m_formats; -+ double m_decoderPts, m_decoderInterval; -+ int m_skippedDeint; -+ bool m_requestSkipDeint; -+ int m_codecControlFlags; - }; -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 51caa05..3284332 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -323,8 +323,10 @@ void CDVDPlayerVideo::Process() + return formats[dataFormat]; +-- +1.8.1.6 + + +From a2ab55a82288080ef0fbb92f9cf5a7d4c34c8ff9 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sun, 11 Aug 2013 19:35:57 +0200 +Subject: [PATCH 002/111] AudioEngine: Add AE_IS_PLANAR(x) macro + +--- + xbmc/cores/AudioEngine/AEAudioFormat.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/AudioEngine/AEAudioFormat.h b/xbmc/cores/AudioEngine/AEAudioFormat.h +index 5664e6e..5774132 100644 +--- a/xbmc/cores/AudioEngine/AEAudioFormat.h ++++ b/xbmc/cores/AudioEngine/AEAudioFormat.h +@@ -75,6 +75,7 @@ enum AEDataFormat - int iDropped = 0; //frames dropped in a row - bool bRequestDrop = false; -+ int iDropDirective; + #define AE_IS_RAW(x) ((x) >= AE_FMT_AAC && (x) < AE_FMT_U8P) + #define AE_IS_RAW_HD(x) ((x) >= AE_FMT_EAC3 && (x) < AE_FMT_U8P) ++#define AE_IS_PLANAR(x) ((x) >= AE_FMT_U8P && (x) <= AE_FMT_FLOATP) - m_videoStats.Start(); -+ m_droppingStats.Reset(); - - while (!m_bStop) + /** + * The audio format structure that fully defines a stream's audio information +-- +1.8.1.6 + + +From 6fe6e6009ffb0ccafc270a5cacf8b3bc0c7a7ff7 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 09:08:34 +0200 +Subject: [PATCH 003/111] AE: WASAPI - fix AddPackets for the case of provided + frames are less than buffer size + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index ef43428..8a7001b 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -466,7 +466,7 @@ unsigned int CAESinkWASAPI::AddPackets(uint8_t *data, unsigned int frames, bool { -@@ -434,6 +436,7 @@ void CDVDPlayerVideo::Process() - picture.iFlags &= ~DVP_FLAG_ALLOCATED; - m_packets.clear(); - m_started = false; -+ m_droppingStats.Reset(); - } - else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) - { -@@ -446,6 +449,7 @@ void CDVDPlayerVideo::Process() - //we need to recalculate the framerate - //TODO: this needs to be set on a streamchange instead - ResetFrameRateCalc(); -+ m_droppingStats.Reset(); + memcpy(m_pBuffer+m_bufferPtr*m_format.m_frameSize, data, FramesToCopy*m_format.m_frameSize); + m_bufferPtr += FramesToCopy; +- if (frames != m_format.m_frames) ++ if (m_bufferPtr != m_format.m_frames) + return frames; + } - m_stalled = true; - m_started = false; -@@ -463,8 +467,10 @@ void CDVDPlayerVideo::Process() - m_speed = static_cast(pMsg)->m_value; - if(m_speed == DVD_PLAYSPEED_PAUSE) - m_iNrOfPicturesNotToSkip = 0; -+ - if (m_pVideoCodec) - m_pVideoCodec->SetSpeed(m_speed); -+ m_droppingStats.Reset(); - } - else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) - { -@@ -510,6 +516,28 @@ void CDVDPlayerVideo::Process() - m_iNrOfPicturesNotToSkip = 1; - } - -+ bRequestDrop = false; -+ iDropDirective = CalcDropRequirement(pts); -+ if (iDropDirective & EOS_VERYLATE) -+ { -+ if (m_bAllowDrop) -+ { -+ m_pullupCorrection.Flush(); -+ bRequestDrop = true; -+ } -+ } -+ int codecControl = 0; -+ if (iDropDirective & EOS_BUFFER_LEVEL) -+ codecControl |= DVP_FLAG_DRAIN; -+ if (m_speed > DVD_PLAYSPEED_NORMAL) -+ codecControl |= DVP_FLAG_NO_POSTPROC; -+ m_pVideoCodec->SetCodecControl(codecControl); -+ if (iDropDirective & EOS_DROPPED) -+ { -+ m_iDroppedFrames++; -+ iDropped++; -+ } -+ - if (m_messageQueue.GetDataSize() == 0 - || m_speed < 0) - { -@@ -562,15 +590,8 @@ void CDVDPlayerVideo::Process() - } - - m_videoStats.AddSampleBytes(pPacket->iSize); -- // assume decoder dropped a picture if it didn't give us any -- // picture from a demux packet, this should be reasonable -- // for libavformat as a demuxer as it normally packetizes -- // pictures when they come from demuxer -- if(bRequestDrop && !bPacketDrop && (iDecoderState & VC_BUFFER) && !(iDecoderState & VC_PICTURE)) -- { -- m_iDroppedFrames++; -- iDropped++; -- } -+ -+ bRequestDrop = false; - - // loop while no error - while (!m_bStop) -@@ -1178,33 +1199,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - m_FlipTimeStamp += max(0.0, iSleepTime); - m_FlipTimeStamp += iFrameDuration; - -- if (iSleepTime <= 0 && m_speed) -- m_iLateFrames++; -- else -- m_iLateFrames = 0; -- -- // ask decoder to drop frames next round, as we are very late -- if(m_iLateFrames > 10) -+ if ((pPicture->iFlags & DVP_FLAG_DROPPED)) +-- +1.8.1.6 + + +From beb6b84b7694a5ed50b981eab59405bf5f6ec4c0 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 09:40:38 +0200 +Subject: [PATCH 004/111] ActiveAE: engage transcode for stereo if upmix is + selected + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index bc861ae..4326729 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -1172,7 +1172,7 @@ void CActiveAE::ApplySettingsToFormat(AEAudioFormat &format, AudioSettings &sett + settings.ac3passthrough && + (!settings.multichannellpcm || (m_settings.mode != AUDIO_HDMI)) && + !m_streams.empty() && +- format.m_channelLayout.Count() > 2) ++ (format.m_channelLayout.Count() > 2 || settings.stereoupmix)) { -- if (!(pPicture->iFlags & DVP_FLAG_NOSKIP)) -- { -- //if we're calculating the framerate, -- //don't drop frames until we've calculated a stable framerate -- if (m_bAllowDrop || m_speed != DVD_PLAYSPEED_NORMAL) -- { -- result |= EOS_VERYLATE; -- m_pullupCorrection.Flush(); //dropped frames mess up the pattern, so just flush it -- } -- m_iDroppedRequest++; -- } -- } -- else + format.m_dataFormat = AE_FMT_AC3; + format.m_sampleRate = 48000; +-- +1.8.1.6 + + +From 18f24beff89d8c872962967698cd21dce715373d Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 14:59:38 +0200 +Subject: [PATCH 005/111] ActiveAE: flush engine on flush stream if only one + stream is active + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 27 ++++++++++++++++++++++ + .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 5 ++++ + .../AudioEngine/Engines/ActiveAE/ActiveAESink.h | 1 + + 3 files changed, 33 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 4326729..30af6e8 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -1077,6 +1077,33 @@ void CActiveAE::SFlushStream(CActiveAEStream *stream) + stream->m_streamPort->Purge(); + stream->m_bufferedTime = 0.0; + stream->m_paused = true; ++ ++ // flsuh the engine if we only have a single stream ++ if (m_streams.size() == 1) ++ { ++ m_sinkBuffers->Flush(); ++ m_vizBuffers->Flush(); ++ ++ // send message to sink ++ Message *reply; ++ if (m_sink.m_controlPort.SendOutMessageSync(CSinkControlProtocol::FLUSH, ++ &reply, 2000)) ++ { ++ bool success = reply->signal == CSinkControlProtocol::ACC ? true : false; ++ if (!success) ++ { ++ CLog::Log(LOGERROR, "ActiveAE::%s - returned error on flush", __FUNCTION__); ++ m_extError = true; ++ } ++ reply->Release(); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "ActiveAE::%s - failed to flush", __FUNCTION__); ++ m_extError = true; ++ } ++ m_stats.Reset(m_sinkFormat.m_sampleRate); ++ } + } + + void CActiveAE::ClearDiscardedBuffers() +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +index 82854c2..4785c76 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +@@ -167,6 +167,11 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg) + msg->Reply(CSinkControlProtocol::ACC); + return; + ++ case CSinkControlProtocol::FLUSH: ++ ReturnBuffers(); ++ msg->Reply(CSinkControlProtocol::ACC); ++ return; ++ + default: + break; + } +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h +index 559179c..e241b03 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h +@@ -50,6 +50,7 @@ class CSinkControlProtocol : public Protocol + UNCONFIGURE, + SILENCEMODE, + VOLUME, ++ FLUSH, + TIMEOUT, + }; + enum InSignal +-- +1.8.1.6 + + +From 25616c11a7f18e7d159d149f98df94c35692e203 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 15:01:09 +0200 +Subject: [PATCH 006/111] ActiveAE: check for error during playback + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 30af6e8..5f068a1 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -649,6 +649,12 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + switch (signal) + { + case CActiveAEControlProtocol::TIMEOUT: ++ if (m_extError) ++ { ++ m_state = AE_TOP_ERROR; ++ m_extTimeout = 100; ++ return; ++ } + if (RunStages()) + { + m_extTimeout = 0; +-- +1.8.1.6 + + +From 49e6399b73ad242133f8f75e48d8830eef00d788 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 15:32:50 +0200 +Subject: [PATCH 007/111] dvdplayer: flush audio on close stream in case of + nowait + +--- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +index 3c1e553..583a7f8 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +@@ -231,6 +231,11 @@ void CDVDPlayerAudio::CloseStream(bool bWaitForBuffers) + m_dvdAudio.Drain(); + m_bStop = true; + } ++ else ++ { ++ m_dvdAudio.Flush(); ++ } ++ + m_dvdAudio.Destroy(); + + // uninit queue +-- +1.8.1.6 + + +From 049909912598dcca3dc5e4113bf1da9c7dc856fd Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 15:33:49 +0200 +Subject: [PATCH 008/111] ActiveAE: faster flushing of stream + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 22 ++++++++++++---------- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 2 +- + .../Engines/ActiveAE/ActiveAEStream.cpp | 10 +--------- + 3 files changed, 14 insertions(+), 20 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 5f068a1..3ae6d9c 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -424,6 +424,11 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + m_state = AE_TOP_CONFIGURED_PLAY; + m_extTimeout = 0; + return; ++ case CActiveAEControlProtocol::FLUSHSTREAM: ++ stream = *(CActiveAEStream**)msg->data; ++ SFlushStream(stream); ++ msg->Reply(CActiveAEControlProtocol::ACC); ++ return; + case CActiveAEControlProtocol::STREAMAMP: + MsgStreamParameter *par; + par = (MsgStreamParameter*)msg->data; +@@ -541,11 +546,6 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + m_state = AE_TOP_CONFIGURED_PLAY; + msg->Reply(CActiveAEDataProtocol::ACC); + return; +- case CActiveAEDataProtocol::FLUSHSTREAM: +- stream = *(CActiveAEStream**)msg->data; +- SFlushStream(stream); +- msg->Reply(CActiveAEDataProtocol::ACC); +- return; + default: + break; + } +@@ -1084,11 +1084,13 @@ void CActiveAE::SFlushStream(CActiveAEStream *stream) + stream->m_bufferedTime = 0.0; + stream->m_paused = true; + +- // flsuh the engine if we only have a single stream ++ // flush the engine if we only have a single stream + if (m_streams.size() == 1) + { +- m_sinkBuffers->Flush(); +- m_vizBuffers->Flush(); ++ if (m_sinkBuffers) ++ m_sinkBuffers->Flush(); ++ if (m_vizBuffers) ++ m_vizBuffers->Flush(); + + // send message to sink + Message *reply; +@@ -2263,11 +2265,11 @@ IAEStream *CActiveAE::FreeStream(IAEStream *stream) + void CActiveAE::FlushStream(CActiveAEStream *stream) + { + Message *reply; +- if (m_dataPort.SendOutMessageSync(CActiveAEDataProtocol::FLUSHSTREAM, ++ if (m_controlPort.SendOutMessageSync(CActiveAEControlProtocol::FLUSHSTREAM, + &reply,1000, + &stream, sizeof(CActiveAEStream*))) + { +- bool success = reply->signal == CActiveAEDataProtocol::ACC ? true : false; ++ bool success = reply->signal == CActiveAEControlProtocol::ACC ? true : false; + reply->Release(); + if (!success) + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +index 90c7f14..e5a3e9d 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +@@ -73,6 +73,7 @@ class CActiveAEControlProtocol : public Protocol + VOLUME, + PAUSESTREAM, + RESUMESTREAM, ++ FLUSHSTREAM, + STREAMRGAIN, + STREAMVOLUME, + STREAMAMP, +@@ -106,7 +107,6 @@ class CActiveAEDataProtocol : public Protocol + FREESTREAM, + STREAMSAMPLE, + DRAINSTREAM, +- FLUSHSTREAM, + }; + enum InSignal + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp +index 3ef5d1f..ab2b10a 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp +@@ -247,15 +247,7 @@ bool CActiveAEStream::IsDrained() + + void CActiveAEStream::Flush() + { +- if (m_currentBuffer) - { -- m_iDroppedRequest = 0; +- MsgStreamSample msgData; +- m_currentBuffer->pkt->nb_samples = 0; +- msgData.buffer = m_currentBuffer; +- msgData.stream = this; +- m_streamPort->SendOutMessage(CActiveAEDataProtocol::STREAMSAMPLE, &msgData, sizeof(MsgStreamSample)); +- m_currentBuffer = NULL; - } -- -- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) -+ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); -+ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); - return result | EOS_DROPPED; ++ m_currentBuffer = NULL; + AE.FlushStream(this); + ResetFreeBuffers(); + } +-- +1.8.1.6 + + +From 2d51194c3ca1c4a62be4ca48d8edd85c7922c9b3 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Tue, 13 Aug 2013 10:55:39 +0200 +Subject: [PATCH 009/111] AE: WASAPI - fix GetDelay + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 15 ++++++++++++++- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h | 1 + + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index 8a7001b..a49e86d 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -418,7 +418,19 @@ double CAESinkWASAPI::GetDelay() + if (!m_initialized) + return 0.0; + +- return m_sinkLatency; ++ double time_played = 0.0; ++ if (m_running) ++ { ++ unsigned int now = XbmcThreads::SystemClockMillis(); ++ time_played = (double)(now-m_lastWriteToBuffer) / 1000; ++ } ++ ++ double delay = m_sinkLatency - time_played + (double)m_bufferPtr / (double)m_format.m_sampleRate; ++ ++ if (delay < 0) ++ delay = 0.0; ++ ++ return delay; + } + + double CAESinkWASAPI::GetCacheTime() +@@ -579,6 +591,7 @@ unsigned int CAESinkWASAPI::AddPackets(uint8_t *data, unsigned int frames, bool + #endif + return INT_MAX; + } ++ m_lastWriteToBuffer = XbmcThreads::SystemClockMillis(); + + if (FramesToCopy != frames) + { +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +index d9619c4..8b29f50 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +@@ -79,6 +79,7 @@ class CAESinkWASAPI : public IAESink + unsigned int m_uiBufferLen; /* wasapi endpoint buffer size, in frames */ + double m_avgTimeWaiting; /* time between next buffer of data from SoftAE and driver call for data */ + double m_sinkLatency; /* time in seconds of total duration of the two WASAPI buffers */ ++ unsigned int m_lastWriteToBuffer; + + uint8_t *m_pBuffer; + int m_bufferPtr; +-- +1.8.1.6 + + +From c04bd2950634488381ed17897fd20347b517a889 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Tue, 13 Aug 2013 13:19:48 +0200 +Subject: [PATCH 010/111] ActiveAE: do not pause stream when flushing it + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 3ae6d9c..9b3ff00 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -428,6 +428,8 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + stream = *(CActiveAEStream**)msg->data; + SFlushStream(stream); + msg->Reply(CActiveAEControlProtocol::ACC); ++ m_state = AE_TOP_CONFIGURED_PLAY; ++ m_extTimeout = 0; + return; + case CActiveAEControlProtocol::STREAMAMP: + MsgStreamParameter *par; +@@ -1082,7 +1084,7 @@ void CActiveAE::SFlushStream(CActiveAEStream *stream) + stream->m_resampleBuffers->Flush(); + stream->m_streamPort->Purge(); + stream->m_bufferedTime = 0.0; +- stream->m_paused = true; ++ stream->m_paused = false; + + // flush the engine if we only have a single stream + if (m_streams.size() == 1) +-- +1.8.1.6 + + +From 6188a2c1d3b5613eaba8338fba32b6e1f9544c68 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Wed, 14 Aug 2013 08:11:05 +0200 +Subject: [PATCH 011/111] AE: adapt limiter to planar formats + +--- + xbmc/cores/AudioEngine/Utils/AELimiter.cpp | 9 ++++++--- + xbmc/cores/AudioEngine/Utils/AELimiter.h | 2 +- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Utils/AELimiter.cpp b/xbmc/cores/AudioEngine/Utils/AELimiter.cpp +index 77af320..5ea0884 100644 +--- a/xbmc/cores/AudioEngine/Utils/AELimiter.cpp ++++ b/xbmc/cores/AudioEngine/Utils/AELimiter.cpp +@@ -34,12 +34,15 @@ + m_increase = 0.0f; + } + +-float CAELimiter::Run(float* frame, int channels) ++float CAELimiter::Run(float* frame, int channels, int stride /*= 1*/) + { +- float* end = frame + channels; ++ float* end = frame + channels*stride; + float highest = 0.0f; + while (frame != end) +- highest = std::max(highest, fabsf(*(frame++))); ++ { ++ highest = std::max(highest, fabsf(*(frame))); ++ frame += stride; + } - // set fieldsync if picture is interlaced - EFIELDSYNC mDisplayField = FS_NONE; -@@ -1237,7 +1237,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - if (index < 0) - return EOS_DROPPED; + float sample = highest * m_amplify; + if (sample * m_attenuation > 1.0f) +diff --git a/xbmc/cores/AudioEngine/Utils/AELimiter.h b/xbmc/cores/AudioEngine/Utils/AELimiter.h +index ef46d0c..9507e71 100644 +--- a/xbmc/cores/AudioEngine/Utils/AELimiter.h ++++ b/xbmc/cores/AudioEngine/Utils/AELimiter.h +@@ -48,5 +48,5 @@ class CAELimiter + m_samplerate = (float)samplerate; + } -- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); -+ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, pts, -1, mDisplayField); +- float Run(float* frame, int channels); ++ float Run(float* frame, int channels, int stride = 1); + }; +-- +1.8.1.6 + + +From 8b77985e390eeb90a17ef4198b0177d03a910406 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Wed, 14 Aug 2013 08:11:42 +0200 +Subject: [PATCH 012/111] ActiveAE: fix volume amplification + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 36 +++++++++------------- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 1 - + 2 files changed, 15 insertions(+), 22 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 9b3ff00..db331dc 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -972,6 +972,9 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) + } + if (m_mode == MODE_TRANSCODE || m_streams.size() > 1) + (*it)->m_resampleBuffers->m_fillPackets = true; ++ ++ // amplification ++ (*it)->m_limiter.SetSamplerate(outputFormat.m_sampleRate); + } - return result; - #else -@@ -1537,3 +1537,127 @@ void CDVDPlayerVideo::CalcFrameRate() - m_iFrameRateCount = 0; + // buffers for viz +@@ -1165,19 +1168,6 @@ void CActiveAE::DiscardSound(CActiveAESound *sound) } } -+ -+int CDVDPlayerVideo::CalcDropRequirement(double pts) -+{ -+ int result = 0; -+ double iSleepTime; -+ double iDecoderPts, iRenderPts; -+ double iInterval; -+ int interlaced; -+ double iGain; -+ double iLateness; -+ bool bNewFrame; -+ int iSkippedDeint = 0; -+ int iBufferLevel; -+ -+ // get decoder stats -+ if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) -+ iDecoderPts = pts; -+ if (iDecoderPts == DVD_NOPTS_VALUE) -+ iDecoderPts = pts; -+ -+ // get render stats -+ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); -+ -+ if (iBufferLevel < 0) -+ result |= EOS_BUFFER_LEVEL; -+ else if (iBufferLevel < 2) -+ { -+ result |= EOS_BUFFER_LEVEL; -+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - hurry: %d", iBufferLevel); -+ } -+ -+ bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts; -+ -+ if (interlaced) -+ iInterval = 2/m_fFrameRate*(double)DVD_TIME_BASE; -+ else -+ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; -+ -+ if (m_droppingStats.m_lastDecoderPts > 0 -+ && bNewFrame -+ && m_bAllowDrop -+ && m_droppingStats.m_dropRequests > 0) -+ { -+ iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE; -+ if (iSkippedDeint) -+ { -+ CDroppingStats::CGain gain; -+ gain.gain = 1/m_fFrameRate; -+ gain.pts = iDecoderPts; -+ m_droppingStats.m_gain.push_back(gain); -+ m_droppingStats.m_totalGain += gain.gain; -+ result |= EOS_DROPPED; -+ m_droppingStats.m_dropRequests = 0; -+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: %f, Bufferlevel: %d", iSleepTime, iBufferLevel); -+ } -+ else if (iGain > 1/m_fFrameRate) -+ { -+ CDroppingStats::CGain gain; -+ gain.gain = iGain; -+ gain.pts = iDecoderPts; -+ m_droppingStats.m_gain.push_back(gain); -+ m_droppingStats.m_totalGain += iGain; -+ result |= EOS_DROPPED; -+ m_droppingStats.m_dropRequests = 0; -+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); -+ } -+ } -+ m_droppingStats.m_lastDecoderPts = iDecoderPts; -+ -+ // subtract gains -+ while (!m_droppingStats.m_gain.empty() && -+ iRenderPts >= m_droppingStats.m_gain.front().pts) -+ { -+ m_droppingStats.m_totalGain -= m_droppingStats.m_gain.front().gain; -+ m_droppingStats.m_gain.pop_front(); -+ } -+ -+ // calculate lateness -+ iLateness = iSleepTime + m_droppingStats.m_totalGain; -+ if (iLateness < 0 && m_speed) -+ { -+ if (bNewFrame) -+ m_droppingStats.m_lateFrames++; -+ -+ // if lateness is smaller than frametime, we observe this state -+ // for 10 cycles -+ if (m_droppingStats.m_lateFrames > 10 || iLateness < -2/m_fFrameRate) -+ { -+ // is frame allowed to skip -+ if (m_iNrOfPicturesNotToSkip <= 0) -+ { -+ result |= EOS_VERYLATE; -+ if (bNewFrame) -+ m_droppingStats.m_dropRequests++; -+ } -+ } -+ } -+ else -+ { -+ m_droppingStats.m_dropRequests = 0; -+ m_droppingStats.m_lateFrames = 0; -+ } -+ m_droppingStats.m_lastRenderPts = iRenderPts; -+ return result; -+} -+ -+void CDroppingStats::Reset() -+{ -+ m_gain.clear(); -+ m_totalGain = 0; -+ m_lastDecoderPts = 0; -+ m_lastRenderPts = 0; -+ m_lateFrames = 0; -+ m_dropRequests = 0; -+} -+ -+void CDroppingStats::AddOutputDropGain(double pts, double frametime) -+{ -+ CDroppingStats::CGain gain; -+ gain.gain = frametime; -+ gain.pts = pts; -+ m_gain.push_back(gain); -+ m_totalGain += frametime; -+} -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -index f8ad541..186e271 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -@@ -36,6 +36,25 @@ - #define VIDEO_PICTURE_QUEUE_SIZE 1 - -+class CDroppingStats -+{ -+public: -+ void Reset(); -+ void AddOutputDropGain(double pts, double frametime); -+ struct CGain -+ { -+ double gain; -+ double pts; -+ }; -+ std::deque m_gain; -+ double m_totalGain; -+ double m_lastDecoderPts; -+ double m_lastRenderPts; -+ unsigned int m_lateFrames; -+ unsigned int m_dropRequests; -+}; -+ -+ - class CDVDPlayerVideo : public CThread +-float CActiveAE::CalcStreamAmplification(CActiveAEStream *stream, CSampleBuffer *buf) +-{ +- float amp = 1.0f; +- int nb_floats = buf->pkt->nb_samples * buf->pkt->config.channels / buf->pkt->planes; +- float tamp; +- for(int i=0; ipkt->planes; i++) +- { +- tamp = stream->m_limiter.Run((float*)buf->pkt->data[i], nb_floats); +- amp = std::min(amp, tamp); +- } +- return amp; +-} +- + void CActiveAE::ChangeResampleQuality() { - public: -@@ -104,6 +123,7 @@ class CDVDPlayerVideo : public CThread - #define EOS_ABORT 1 - #define EOS_DROPPED 2 - #define EOS_VERYLATE 4 -+#define EOS_BUFFER_LEVEL 8 + std::list::iterator it; +@@ -1488,12 +1478,10 @@ bool CActiveAE::RunStages() + out = (*it)->m_resampleBuffers->m_outputSamples.front(); + (*it)->m_resampleBuffers->m_outputSamples.pop_front(); - void AutoCrop(DVDVideoPicture* pPicture); - void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); -@@ -129,6 +149,7 @@ class CDVDPlayerVideo : public CThread +- // volume for stream +- float amp = (*it)->m_rgain * CalcStreamAmplification((*it), out); +- + int nb_floats = out->pkt->nb_samples * out->pkt->config.channels / out->pkt->planes; + int nb_loops = 1; + float fadingStep = 0.0f; ++ int stride = 1; - void ResetFrameRateCalc(); - void CalcFrameRate(); -+ int CalcDropRequirement(double pts); - - double m_fFrameRate; //framerate of the video currently playing - bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps -@@ -182,5 +203,7 @@ class CDVDPlayerVideo : public CThread - CPullupCorrection m_pullupCorrection; - - std::list m_packets; + // fading + if ((*it)->m_fadingSamples == -1) +@@ -1508,6 +1496,7 @@ bool CActiveAE::RunStages() + float delta = (*it)->m_fadingTarget - (*it)->m_fadingBase; + int samples = m_internalFormat.m_sampleRate * (float)(*it)->m_fadingTime / 1000.0f; + fadingStep = delta / samples; ++ stride = out->pkt->planes > 1 ? out->pkt->linesize : 1; + } + for(int i=0; im_streamFading = false; + } + } +- float volume = (*it)->m_volume * amp; + -+ CDroppingStats m_droppingStats; - }; ++ // volume for stream ++ float volume = (*it)->m_volume * (*it)->m_rgain * ++ (*it)->m_limiter.Run((float*)out->pkt->data[0]+i*nb_floats, out->pkt->config.channels, stride); + for(int j=0; jpkt->planes; j++) + { +@@ -1543,12 +1535,10 @@ bool CActiveAE::RunStages() + mix = (*it)->m_resampleBuffers->m_outputSamples.front(); + (*it)->m_resampleBuffers->m_outputSamples.pop_front(); + +- // volume for stream +- float amp = (*it)->m_volume * (*it)->m_rgain * CalcStreamAmplification((*it), mix); +- + int nb_floats = mix->pkt->nb_samples * mix->pkt->config.channels / mix->pkt->planes; + int nb_loops = 1; + float fadingStep = 0.0f; ++ int stride = 1; + + // fading + if ((*it)->m_fadingSamples == -1) +@@ -1563,6 +1553,7 @@ bool CActiveAE::RunStages() + float delta = (*it)->m_fadingTarget - (*it)->m_fadingBase; + int samples = m_internalFormat.m_sampleRate * (float)(*it)->m_fadingTime / 1000.0f; + fadingStep = delta / samples; ++ stride = out->pkt->planes > 1 ? out->pkt->linesize : 1; + } + for(int i=0; im_streamFading = false; + } + } +- float volume = (*it)->m_volume * amp; ++ ++ // volume for stream ++ float volume = (*it)->m_volume * (*it)->m_rgain * ++ (*it)->m_limiter.Run((float*)out->pkt->data[0]+i*nb_floats, out->pkt->config.channels, stride); + + for(int j=0; jpkt->planes && jpkt->planes; j++) + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +index e5a3e9d..9b4c243 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +@@ -258,7 +258,6 @@ class CActiveAE : public IAE, private CThread + void ClearDiscardedBuffers(); + void SStopSound(CActiveAESound *sound); + void DiscardSound(CActiveAESound *sound); +- float CalcStreamAmplification(CActiveAEStream *stream, CSampleBuffer *buf); + void ChangeResampleQuality(); + + bool RunStages(); -- 1.8.1.6 -From 33ea71cda1fc4767c047865112f2e2a245bcdb50 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 003/110] video player: present correct pts to user for a/v - sync (after buffering in renderer) +From 2f9784b5419e70e3c19271a071ffc17c968922b1 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 08:22:03 +0200 +Subject: [PATCH 013/111] AESinkOSS: Implement Drain() --- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 25 +++++++++++++++++++++++++ - xbmc/cores/dvdplayer/DVDPlayerVideo.h | 2 +- - 2 files changed, 26 insertions(+), 1 deletion(-) + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 3284332..4970675 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1457,6 +1457,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() - g_advancedSettings.m_videoFpsDetect == 0; +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index 7986c60..6612dc2 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -435,7 +435,10 @@ void CAESinkOSS::Drain() + if (m_fd == -1) + return; + +- // ??? ++ if(ioctl(m_fd, SNDCTL_DSP_SYNC, NULL) == -1) ++ { ++ CLog::Log(LOGERROR, "CAESinkOSS::Drain - Draining the Sink failed"); ++ } } -+double CDVDPlayerVideo::GetCurrentPts() -+{ -+ double iSleepTime, iRenderPts; -+ int iBufferLevel; -+ -+ // get render stats -+ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); -+ -+ if( m_stalled ) -+ iRenderPts = DVD_NOPTS_VALUE; -+ else -+ iRenderPts = iRenderPts - max(0.0, iSleepTime); -+ -+ return iRenderPts; -+} -+ - #define MAXFRAMERATEDIFF 0.01 - #define MAXFRAMESERR 1000 - -@@ -1575,6 +1591,15 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) - else - iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; - -+ -+ m_FlipTimeStamp = m_pClock->GetAbsoluteClock() + max(0.0, iSleepTime) + iInterval; -+ -+ if( m_stalled ) -+ m_iCurrentPts = DVD_NOPTS_VALUE; -+ else -+ m_iCurrentPts = iRenderPts - max(0.0, iSleepTime); -+ -+ - if (m_droppingStats.m_lastDecoderPts > 0 - && bNewFrame - && m_bAllowDrop -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -index 186e271..59c7f09 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -@@ -100,7 +100,7 @@ class CDVDPlayerVideo : public CThread - - bool InitializedOutputDevice(); - -- double GetCurrentPts() { return m_iCurrentPts; } -+ double GetCurrentPts(); - int GetPullupCorrection() { return m_pullupCorrection.GetPatternLength(); } - - double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ + void CAESinkOSS::EnumerateDevicesEx(AEDeviceInfoList &list, bool force) -- 1.8.1.6 -From 10a7f371c9c49afcbdbc302380c406bdbb126308 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 16 Feb 2013 18:25:53 +0100 -Subject: [PATCH 004/110] videoplayer: some rework and documentation +From 908abe4c4b5a9470168b0f8b71dfe042243349eb Mon Sep 17 00:00:00 2001 +From: unknown +Date: Wed, 14 Aug 2013 09:14:36 +0200 +Subject: [PATCH 014/111] ActiveAE: make sure GetDalay returns no negative + values --- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 29 ++++++++++++++++++++-- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 11 ++++++++ - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 2 +- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 4 files changed, 40 insertions(+), 4 deletions(-) + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 3 +++ + 1 file changed, 3 insertions(+) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 7f6d536..2ccae41 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -139,7 +139,6 @@ struct DVDVideoUserData - #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data - #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again - #define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped --#define VC_HURRY 0x00000040 +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index db331dc..2a3e49c 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -83,6 +83,9 @@ float CEngineStats::GetDelay() + float delay = m_sinkDelay - (double)(now-m_sinkUpdate) / 1000; + delay += (float)m_bufferedSamples / m_sinkSampleRate; - class CDVDVideoCodec ++ if (delay < 0) ++ delay = 0.0; ++ + return delay; + } + +-- +1.8.1.6 + + +From f77b9d7d24aba628e9a2a13045ec7d1712c493c3 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 09:16:25 +0200 +Subject: [PATCH 015/111] AESinkOSS: Make sink usable in blocking mode + +--- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 22 +++++++++++++++------- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.h | 1 + + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index 6612dc2..60df54d 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -66,6 +66,7 @@ + CAESinkOSS::CAESinkOSS() { -@@ -264,10 +263,36 @@ class CDVDVideoCodec - */ - virtual unsigned GetAllowedReferences() { return 0; } + m_fd = 0; ++ m_blockingNeedsUpdate = true; + } -- virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) -+ /** -+ * For calculation of dropping requirements player asks for some information. -+ * -+ * - pts : right after decoder, used to detect gaps (dropped frames in decoder) -+ * - skippedDeint : indicates if decoder has just skipped a deinterlacing cycle -+ * instead of dropping a full frame -+ * - interlaced : when detecting gaps in pts, player needs to know whether -+ * it's interlaced or not -+ * -+ * If codec does not implement this method, pts of decoded frame at input -+ * video player is used. In case coded does post-proc and de-interlacing there -+ * may be quite some frames queued up between exit decoder and entry player. -+ */ -+ virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced) - { + CAESinkOSS::~CAESinkOSS() +@@ -321,13 +322,6 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device) return false; } -+ /** -+ * Codec can be informed by player with the following flags: -+ * -+ * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off -+ * postprocessing and de-interlacing -+ * -+ * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. -+ * If video buffers in RenderManager are about to run dry, -+ * this is signaled to codec. Codec can wait for post-proc -+ * to be finished instead of returning empty and getting another -+ * packet. -+ * -+ */ - virtual void SetCodecControl(int flags) {} - }; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 530dc9d..e5748df 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -958,6 +958,17 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() - return 0; +- if (fcntl(m_fd, F_SETFL, fcntl(m_fd, F_GETFL, 0) | O_NONBLOCK) == -1) +- { +- close(m_fd); +- CLog::Log(LOGERROR, "CAESinkOSS::Initialize - Failed to set non blocking writes"); +- return false; +- } +- + format.m_sampleRate = oss_sr; + format.m_frameSize = (CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3) * format.m_channelLayout.Count(); + format.m_frames = bi.fragsize / format.m_frameSize; +@@ -344,6 +338,8 @@ void CAESinkOSS::Deinitialize() + + if (m_fd != -1) + close(m_fd); ++ ++ m_blockingNeedsUpdate = true; } -+bool CDVDVideoCodecFFmpeg::GetCodecStats(double &pts, int &skippedDeint, int &interlaced) -+{ -+ pts = m_decoderPts; -+ skippedDeint = m_skippedDeint; -+ if (m_pFrame) -+ interlaced = m_pFrame->interlaced_frame; -+ else -+ interlaced = 0; -+ return true; -+} + inline CAEChannelInfo CAESinkOSS::GetChannelLayout(AEAudioFormat format) +@@ -417,6 +413,18 @@ unsigned int CAESinkOSS::AddPackets(uint8_t *data, unsigned int frames, bool has + return INT_MAX; + } + ++ if(m_blockingNeedsUpdate) ++ { ++ if(!blocking) ++ { ++ if (fcntl(m_fd, F_SETFL, fcntl(m_fd, F_GETFL, 0) | O_NONBLOCK) == -1) ++ { ++ CLog::Log(LOGERROR, "CAESinkOSS::Initialize - Failed to set non blocking writes"); ++ } ++ } ++ m_blockingNeedsUpdate = false; ++ } + - void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) - { - m_codecControlFlags = flags; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index a511806..0436108 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -64,7 +64,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open - virtual unsigned GetConvergeCount(); - virtual unsigned GetAllowedReferences(); -- virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} -+ virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced); - virtual void SetCodecControl(int flags); - - bool IsHardwareAllowed() { return !m_bSoftware; } -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 4970675..2e76ff5 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1568,7 +1568,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) - int iBufferLevel; - - // get decoder stats -- if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) -+ if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iSkippedDeint, interlaced)) - iDecoderPts = pts; - if (iDecoderPts == DVD_NOPTS_VALUE) - iDecoderPts = pts; + int wrote = write(m_fd, data, size); + if (wrote < 0) + { +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h +index 1131dc7..2f9a1ee 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h +@@ -46,6 +46,7 @@ class CAESinkOSS : public IAESink + static void EnumerateDevicesEx(AEDeviceInfoList &list, bool force = false); + private: + int m_fd; ++ bool m_blockingNeedsUpdate; + std::string m_device; + AEAudioFormat m_initFormat; + AEAudioFormat m_format; -- 1.8.1.6 -From 5dd41a12cb592e81866245da375541f97d77b861 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 7 Apr 2012 09:19:00 +0200 -Subject: [PATCH 005/110] vdpau: redesign +From ff9570ce226025fd8c2b40d27893d90c692406a7 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 15:19:45 +0200 +Subject: [PATCH 016/111] AESinkOSS: Set required format for passthrough --- - language/English/strings.po | 14 +- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index 60df54d..d9524f7 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -150,7 +150,10 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device) + else if ((format.m_dataFormat == AE_FMT_U8 ) && (format_mask & AFMT_U8 )) + oss_fmt = AFMT_U8; + else if ((AE_IS_RAW(format.m_dataFormat) ) && (format_mask & AFMT_AC3 )) ++ { + oss_fmt = AFMT_AC3; ++ format.m_dataFormat = AE_FMT_S16NE; ++ } + else if (AE_IS_RAW(format.m_dataFormat)) + { + close(m_fd); +-- +1.8.1.6 + + +From 7454c2ef78b76825b99d5c99d7cee9d253b4bdcc Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 16:46:42 +0200 +Subject: [PATCH 017/111] AESinkOSS: Missed one reuse of format.m_dataFormat in + 4c536e960dfa5610bd62968feff1eebaada17c6d + +--- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index d9524f7..1f88326 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -262,7 +262,7 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device) + + #if defined(TARGET_FREEBSD) + /* fix hdmi 8 channels order */ +- if (!AE_IS_RAW(format.m_dataFormat) && 8 == oss_ch) ++ if ((oss_fmt != AFMT_AC3) && 8 == oss_ch) + { + unsigned long long order = 0x0000000087346521ULL; + +-- +1.8.1.6 + + +From b762c57174277e73ae0e562b3a679810b1761d79 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Thu, 15 Aug 2013 16:06:49 +0200 +Subject: [PATCH 018/111] ActiveAE: Fix refcounting with viz + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 25 +++++++++++++--------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 2a3e49c..43fc085 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -1596,6 +1596,7 @@ bool CActiveAE::RunStages() + } + + // process output buffer, gui sounds, encode, viz ++ CSampleBuffer *viz = NULL; + if (out) + { + // mix gui sounds +@@ -1603,21 +1604,17 @@ bool CActiveAE::RunStages() + if (!m_sinkHasVolume) + Deamplify(*(out->pkt)); + +- // encode ++ // encode and backup out buffer for viz ++ viz = out; + if (m_mode == MODE_TRANSCODE && m_encoder) + { + CSampleBuffer *buf = m_encoderBuffers->GetFreeBuffer(); + m_encoder->Encode(out->pkt->data[0], out->pkt->planes*out->pkt->linesize, + buf->pkt->data[0], buf->pkt->planes*buf->pkt->linesize); + buf->pkt->nb_samples = buf->pkt->max_nb_samples; +- out->Return(); + out = buf; + } + +- // update stats +- m_stats.AddSamples(out->pkt->nb_samples, m_streams); +- m_sinkBuffers->m_inputSamples.push_back(out); +- + busy = true; + } + +@@ -1632,13 +1629,13 @@ bool CActiveAE::RunStages() + m_vizInitialized = true; + } + +- // if viz has no free buffer, it won't return current buffer "out" ++ // if viz has no free buffer, it won't return current buffer "viz" + if (!m_vizBuffers->m_freeSamples.empty()) + { +- if (out) ++ if (viz) + { +- out->Acquire(); +- m_vizBuffers->m_inputSamples.push_back(out); ++ viz->Acquire(); ++ m_vizBuffers->m_inputSamples.push_back(viz); + } + } + else +@@ -1669,6 +1666,14 @@ bool CActiveAE::RunStages() + else if (m_vizBuffers) + m_vizBuffers->Flush(); + } ++ // update stats ++ if(out) ++ { ++ m_stats.AddSamples(out->pkt->nb_samples, m_streams); ++ m_sinkBuffers->m_inputSamples.push_back(out); ++ if(viz && (viz != out)) ++ viz->Return(); ++ } + } + // pass through + else +-- +1.8.1.6 + + +From e2242bc9bb34f5b9b1ad6570d448bbb8cbc98162 Mon Sep 17 00:00:00 2001 +From: wsoltys +Date: Thu, 15 Aug 2013 19:41:12 +0200 +Subject: [PATCH 019/111] [WASAPI] fixed: return the right channel layout + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index a49e86d..e4022e3 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -1150,6 +1150,7 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format) + initialize: + + AEChannelsFromSpeakerMask(wfxex.dwChannelMask); ++ format.m_channelLayout = m_channelLayout; + + /* When the stream is raw, the values in the format structure are set to the link */ + /* parameters, so store the encoded stream values here for the IsCompatible function */ +-- +1.8.1.6 + + +From 1f7c7f5848cbd6b63c4bf8b33fae9d09545263ee Mon Sep 17 00:00:00 2001 +From: wsoltys +Date: Thu, 15 Aug 2013 20:00:22 +0200 +Subject: [PATCH 020/111] [WASAPI] fixed: use the more accurate GetDelay() for + Drain(). + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 7 ++----- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h | 1 - + 2 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index e4022e3..dbfc071 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -193,8 +193,7 @@ CStdStringA localWideToUtf(LPCWSTR wstr) + m_avgTimeWaiting(50), + m_sinkLatency(0.0), + m_pBuffer(NULL), +- m_bufferPtr(0), +- m_hnsRequestedDuration(0) ++ m_bufferPtr(0) + { + m_channelLayout.Reset(); + } +@@ -1196,8 +1195,6 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format) + hr = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_EXCLUSIVE, AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST, + audioSinkBufferDurationMsec, audioSinkBufferDurationMsec, &wfxex.Format, NULL); + +- m_hnsRequestedDuration = audioSinkBufferDurationMsec; +- + if (hr == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED) + { + /* WASAPI requires aligned buffer */ +@@ -1333,7 +1330,7 @@ void CAESinkWASAPI::Drain() + if(!m_pAudioClient) + return; + +- Sleep( (DWORD)(m_hnsRequestedDuration / 10000)); ++ Sleep( (DWORD)(GetDelay()*50) ); + + if (m_running) + { +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +index 8b29f50..144bad3 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +@@ -83,5 +83,4 @@ class CAESinkWASAPI : public IAESink + + uint8_t *m_pBuffer; + int m_bufferPtr; +- REFERENCE_TIME m_hnsRequestedDuration; + }; +-- +1.8.1.6 + + +From ac99b47888fdd232351ff48482eae66aa3473ce9 Mon Sep 17 00:00:00 2001 +From: wsoltys +Date: Fri, 16 Aug 2013 23:35:39 +0200 +Subject: [PATCH 021/111] [WASAPI] fixed: wrong multiplicator (thanks + Voyager1). + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index dbfc071..2aa7362 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -1330,7 +1330,7 @@ void CAESinkWASAPI::Drain() + if(!m_pAudioClient) + return; + +- Sleep( (DWORD)(GetDelay()*50) ); ++ Sleep( (DWORD)(GetDelay()*500) ); + + if (m_running) + { +-- +1.8.1.6 + + +From 729154f830f60aabd3bc85ebacacda444b52b27b Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sun, 18 Aug 2013 22:32:12 +0200 +Subject: [PATCH 022/111] ActiveAE: check for valid ac3 sampling rates, fixes + no sound for flac 96khz when transcoding + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 43fc085..78f9eee 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -893,6 +893,14 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) + CLog::Log(LOGINFO, "CActiveAE::Configure - Forcing samplerate to %d", inputFormat.m_sampleRate); + } + ++ // check for valid sampling rates ++ if (inputFormat.m_sampleRate != 48000 || ++ inputFormat.m_sampleRate != 41000 || ++ inputFormat.m_sampleRate != 32000) ++ { ++ outputFormat.m_sampleRate = 48000; ++ } ++ + // setup encoder + if (!m_encoder) + { +-- +1.8.1.6 + + +From e3655dd63f7a324c92acac376a5f8cd8b25426a9 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 2 Aug 2013 18:55:56 +0200 +Subject: [PATCH 023/111] linuxrenderer: do not render if upload texture fails + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 39 ++++++++++++++++----------- + xbmc/cores/VideoRenderers/LinuxRendererGL.h | 16 +++++------ + 2 files changed, 31 insertions(+), 24 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index 56b54cf..2f3ed4a 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -515,14 +515,14 @@ void CLinuxRendererGL::LoadPlane( YUVPLANE& plane, int type, unsigned flipindex + plane.flipindex = flipindex; + } + +-void CLinuxRendererGL::UploadYV12Texture(int source) ++bool CLinuxRendererGL::UploadYV12Texture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags&IMAGE_FLAG_READY)) +- return; ++ return false; + bool deinterlacing; + if (m_currentField == FIELD_FULL) + deinterlacing = false; +@@ -587,6 +587,7 @@ void CLinuxRendererGL::UploadYV12Texture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); ++ return true; + } + + void CLinuxRendererGL::Reset() +@@ -1183,7 +1184,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) + m_currentField = FIELD_FULL; + + // call texture load function +- (this->*m_textureUpload)(renderBuffer); ++ if (!(this->*m_textureUpload)(renderBuffer)) ++ return; + + if (m_renderMethod & RENDER_GLSL) + { +@@ -2026,14 +2028,14 @@ bool CLinuxRendererGL::CreateYV12Texture(int index) + //******************************************************************************************************** + // NV12 Texture loading, creation and deletion + //******************************************************************************************************** +-void CLinuxRendererGL::UploadNV12Texture(int source) ++bool CLinuxRendererGL::UploadNV12Texture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags & IMAGE_FLAG_READY)) +- return; ++ return false; + bool deinterlacing; + if (m_currentField == FIELD_FULL) + deinterlacing = false; +@@ -2086,6 +2088,7 @@ void CLinuxRendererGL::UploadNV12Texture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); ++ return true; + } + + bool CLinuxRendererGL::CreateNV12Texture(int index) +@@ -2338,11 +2341,12 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + return true; + } + +-void CLinuxRendererGL::UploadVDPAUTexture(int index) ++bool CLinuxRendererGL::UploadVDPAUTexture(int index) + { + #ifdef HAVE_LIBVDPAU + glPixelStorei(GL_UNPACK_ALIGNMENT,1); //what's this for? + #endif ++ return true; + } + + +@@ -2406,7 +2410,7 @@ bool CLinuxRendererGL::CreateVAAPITexture(int index) + return true; + } + +-void CLinuxRendererGL::UploadVAAPITexture(int index) ++bool CLinuxRendererGL::UploadVAAPITexture(int index) + { + #ifdef HAVE_LIBVA + YUVPLANE &plane = m_buffers[index].fields[0][0]; +@@ -2414,7 +2418,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + VAStatus status; + + if(!va.surface) +- return; ++ return false; + + if(va.display && va.surface->m_display != va.display) + { +@@ -2426,7 +2430,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + CSingleLock lock(*va.display); + + if(va.display->lost()) +- return; ++ return false; + + if(!va.surfglx) + { +@@ -2439,7 +2443,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + if(status != VA_STATUS_SUCCESS) + { + CLog::Log(LOGERROR, "CLinuxRendererGL::UploadVAAPITexture - failed to create vaapi glx surface (%d)", status); +- return; ++ return false; + } + va.surfglx = VAAPI::CSurfaceGLPtr(new VAAPI::CSurfaceGL(surface, va.display)); + } +@@ -2487,12 +2491,13 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + CLog::Log(LOGERROR, "CLinuxRendererGL::UploadVAAPITexture - failed to copy surface to glx %d - %s", status, vaErrorStr(status)); + + #endif ++ return true; + } + + //******************************************************************************************************** + // CoreVideoRef Texture creation, deletion, copying + clearing + //******************************************************************************************************** +-void CLinuxRendererGL::UploadCVRefTexture(int index) ++bool CLinuxRendererGL::UploadCVRefTexture(int index) + { + #ifdef TARGET_DARWIN + CVBufferRef cvBufferRef = m_buffers[index].cvBufferRef; +@@ -2554,6 +2559,7 @@ void CLinuxRendererGL::UploadCVRefTexture(int index) + glDisable(m_textureTarget); + + #endif ++ return true; + } + + void CLinuxRendererGL::DeleteCVRefTexture(int index) +@@ -2615,14 +2621,14 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) + return true; + } + +-void CLinuxRendererGL::UploadYUV422PackedTexture(int source) ++bool CLinuxRendererGL::UploadYUV422PackedTexture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags & IMAGE_FLAG_READY)) +- return; ++ return false; + + bool deinterlacing; + if (m_currentField == FIELD_FULL) +@@ -2659,7 +2665,7 @@ void CLinuxRendererGL::UploadYUV422PackedTexture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); +- ++ return true; + } + + void CLinuxRendererGL::DeleteYUV422PackedTexture(int index) +@@ -3045,14 +3051,14 @@ void CLinuxRendererGL::SetupRGBBuffer() + m_rgbBuffer = new BYTE[m_rgbBufferSize]; + } + +-void CLinuxRendererGL::UploadRGBTexture(int source) ++bool CLinuxRendererGL::UploadRGBTexture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags&IMAGE_FLAG_READY)) +- return; ++ return false; + + bool deinterlacing; + if (m_currentField == FIELD_FULL) +@@ -3155,6 +3161,7 @@ void CLinuxRendererGL::UploadRGBTexture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); ++ return true; + } + + void CLinuxRendererGL::SetTextureFilter(GLenum method) +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h +index b986d93..b5c4dec 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h +@@ -178,35 +178,35 @@ class CLinuxRendererGL : public CBaseRenderer + void UpdateVideoFilter(); + + // textures +- void (CLinuxRendererGL::*m_textureUpload)(int index); ++ bool (CLinuxRendererGL::*m_textureUpload)(int index); + void (CLinuxRendererGL::*m_textureDelete)(int index); + bool (CLinuxRendererGL::*m_textureCreate)(int index); + +- void UploadYV12Texture(int index); ++ bool UploadYV12Texture(int index); + void DeleteYV12Texture(int index); + bool CreateYV12Texture(int index); + +- void UploadNV12Texture(int index); ++ bool UploadNV12Texture(int index); + void DeleteNV12Texture(int index); + bool CreateNV12Texture(int index); + +- void UploadVDPAUTexture(int index); ++ bool UploadVDPAUTexture(int index); + void DeleteVDPAUTexture(int index); + bool CreateVDPAUTexture(int index); + +- void UploadVAAPITexture(int index); ++ bool UploadVAAPITexture(int index); + void DeleteVAAPITexture(int index); + bool CreateVAAPITexture(int index); + +- void UploadCVRefTexture(int index); ++ bool UploadCVRefTexture(int index); + void DeleteCVRefTexture(int index); + bool CreateCVRefTexture(int index); + +- void UploadYUV422PackedTexture(int index); ++ bool UploadYUV422PackedTexture(int index); + void DeleteYUV422PackedTexture(int index); + bool CreateYUV422PackedTexture(int index); + +- void UploadRGBTexture(int index); ++ bool UploadRGBTexture(int index); + void ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsigned flipIndexBuf); + void ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, unsigned flipIndexPlaneBot, unsigned flipIndexBuf); + void SetupRGBBuffer(); +-- +1.8.1.6 + + +From 50714278e46ea4565c68eadc40c94f7544b63d6f Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sat, 7 Apr 2012 09:19:00 +0200 +Subject: [PATCH 024/111] vdpau: redesign + +--- + language/English/strings.po | 21 +- system/settings/settings.xml | 10 + system/shaders/yuv2rgb_basic.glsl | 12 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 225 +- - xbmc/cores/VideoRenderers/LinuxRendererGL.h | 13 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 218 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.h | 12 +- xbmc/cores/VideoRenderers/RenderFormats.h | 1 + xbmc/cores/VideoRenderers/RenderManager.cpp | 3 +- xbmc/cores/VideoRenderers/RenderManager.h | 2 +- @@ -913,20 +1485,20 @@ Subject: [PATCH 005/110] vdpau: redesign .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 4 +- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 6 +- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 1 - - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3843 ++++++++++++++------ - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 675 +++- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3917 +++++++++++++++----- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 681 +++- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + xbmc/settings/AdvancedSettings.cpp | 8 +- xbmc/settings/AdvancedSettings.h | 4 +- xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 2 +- xbmc/windowing/X11/WinSystemX11.h | 1 + - 19 files changed, 3597 insertions(+), 1230 deletions(-) + 19 files changed, 3670 insertions(+), 1236 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index ec3ee5f..a6b0297 100644 +index 0042682..4a10f5d 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5775,7 +5775,17 @@ msgctxt "#13436" +@@ -5784,7 +5784,17 @@ msgctxt "#13436" msgid "Allow hardware acceleration (libstagefright)" msgstr "" @@ -945,7 +1517,7 @@ index ec3ee5f..a6b0297 100644 #: system/settings/settings.xml msgctxt "#13500" -@@ -6850,7 +6860,7 @@ msgid "Software Blend" +@@ -6867,7 +6877,7 @@ msgid "Software Blend" msgstr "" msgctxt "#16325" @@ -954,15 +1526,29 @@ index ec3ee5f..a6b0297 100644 msgstr "" #empty strings from id 16326 to 16399 +@@ -14179,7 +14189,12 @@ msgctxt "#36420" + msgid "No info available yet." + msgstr "" + +-#empty strings from id 36421 to 36499 ++#: system/settings/settings.xml ++msgctxt "#36421" ++msgid "Bypassing VDPAU mixer saves resources on low power systems but slightly reduces picture quality" ++msgstr "" ++ ++#empty strings from id 36422 to 36499 + #end reservation + + #: system/settings/settings.xml diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index d1e5eff..56d637d 100644 +index 2bad9bb..04c521d 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -375,6 +375,16 @@ 2 true -+ ++ + HAVE_LIBVDPAU + 2 + true @@ -973,13 +1559,13 @@ index d1e5eff..56d637d 100644 + + - HAVE_LIBVA + HAVE_LIBVA 2 diff --git a/system/shaders/yuv2rgb_basic.glsl b/system/shaders/yuv2rgb_basic.glsl -index c8c8a2e..0799a4b 100644 +index 2ce65a1..92b9be7 100644 --- a/system/shaders/yuv2rgb_basic.glsl +++ b/system/shaders/yuv2rgb_basic.glsl -@@ -70,6 +70,18 @@ void main() +@@ -69,6 +69,18 @@ void main() rgb.a = gl_Color.a; gl_FragColor = rgb; @@ -999,10 +1585,10 @@ index c8c8a2e..0799a4b 100644 #if(XBMC_texture_rectangle) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 962680a..388d778 100644 +index 2f3ed4a..42b47e5 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -702,6 +702,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -698,6 +698,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -1021,7 +1607,7 @@ index 962680a..388d778 100644 else Render(flags, index); -@@ -782,11 +794,6 @@ void CLinuxRendererGL::FlipPage(int source) +@@ -778,11 +790,6 @@ void CLinuxRendererGL::FlipPage(int source) m_buffers[m_iYV12RenderBuffer].flipindex = ++m_flipindex; @@ -1033,7 +1619,7 @@ index 962680a..388d778 100644 return; } -@@ -1113,6 +1120,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1109,6 +1116,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateVDPAUTexture; m_textureDelete = &CLinuxRendererGL::DeleteVDPAUTexture; } @@ -1046,18 +1632,7 @@ index 962680a..388d778 100644 else if (m_format == RENDER_FMT_VAAPI) { m_textureUpload = &CLinuxRendererGL::UploadVAAPITexture; -@@ -1188,7 +1201,10 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) - m_currentField = FIELD_FULL; - - // call texture load function -+ m_skipRender = false; - (this->*m_textureUpload)(renderBuffer); -+ if (m_skipRender) -+ return; - - if (m_renderMethod & RENDER_GLSL) - { -@@ -1563,17 +1579,12 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1551,17 +1564,12 @@ void CLinuxRendererGL::RenderFromFBO() void CLinuxRendererGL::RenderVDPAU(int index, int field) { #ifdef HAVE_LIBVDPAU @@ -1066,7 +1641,7 @@ index 962680a..388d778 100644 - - if (!vdpau) - return; -+ YUVPLANE &plane = m_buffers[index].fields[0][1]; ++ YUVPLANE &plane = m_buffers[index].fields[FIELD_FULL][0]; glEnable(m_textureTarget); glActiveTextureARB(GL_TEXTURE0); @@ -1077,7 +1652,7 @@ index 962680a..388d778 100644 // make sure we know the correct texture size GetPlaneTextureSize(plane); -@@ -1635,8 +1646,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) +@@ -1623,8 +1631,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) if (m_pVideoFilterShader) m_pVideoFilterShader->Disable(); @@ -1086,23 +1661,40 @@ index 962680a..388d778 100644 glBindTexture (m_textureTarget, 0); glDisable(m_textureTarget); #endif -@@ -2317,12 +2326,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index) +@@ -2305,12 +2311,10 @@ void CLinuxRendererGL::DeleteNV12Texture(int index) + void CLinuxRendererGL::DeleteVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU - YUVPLANE &plane = m_buffers[index].fields[0][0]; -+ YUVFIELDS &fields = m_buffers[index].fields; +- YUVPLANE &plane = m_buffers[index].fields[0][0]; ++ YUVPLANE &plane = m_buffers[index].fields[FIELD_FULL][0]; SAFE_RELEASE(m_buffers[index].vdpau); - if(plane.id && glIsTexture(plane.id)) - glDeleteTextures(1, &plane.id); +- if(plane.id && glIsTexture(plane.id)) +- glDeleteTextures(1, &plane.id); plane.id = 0; -+ fields[0][1].id = 0; #endif } +@@ -2320,7 +2324,7 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + #ifdef HAVE_LIBVDPAU + YV12Image &im = m_buffers[index].image; + YUVFIELDS &fields = m_buffers[index].fields; +- YUVPLANE &plane = fields[0][0]; ++ YUVPLANE &plane = fields[FIELD_FULL][0]; -@@ -2355,10 +2366,172 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) - void CLinuxRendererGL::UploadVDPAUTexture(int index) + DeleteVDPAUTexture(index); + +@@ -2335,7 +2339,7 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + plane.pixpertex_x = 1; + plane.pixpertex_y = 1; + +- glGenTextures(1, &plane.id); ++ plane.id = 1; + + #endif + return true; +@@ -2344,11 +2348,163 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + bool CLinuxRendererGL::UploadVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU - glPixelStorei(GL_UNPACK_ALIGNMENT,1); //what's this for? @@ -1111,19 +1703,15 @@ index 962680a..388d778 100644 + unsigned int flipindex = m_buffers[index].flipindex; + YV12Image &im = m_buffers[index].image; + YUVFIELDS &fields = m_buffers[index].fields; -+ YUVPLANE &plane = fields[0][1]; ++ YUVPLANE &plane = fields[FIELD_FULL][0]; + + if (!vdpau || !vdpau->valid) + { -+ m_skipRender = true; -+ return; ++ return false; + } + + plane.id = vdpau->texture[0]; + -+ plane.pixpertex_x = 1; -+ plane.pixpertex_y = 1; -+ + plane.rect = m_sourceRect; + plane.width = im.width; + plane.height = im.height; @@ -1145,20 +1733,18 @@ index 962680a..388d778 100644 + plane.rect.x2 /= plane.texwidth; + } + -+#endif -+} -+ + #endif + return true; + } + +void CLinuxRendererGL::DeleteVDPAUTexture420(int index) +{ +#ifdef HAVE_LIBVDPAU -+ YUVPLANE &plane = m_buffers[index].fields[0][0]; + YUVFIELDS &fields = m_buffers[index].fields; + + SAFE_RELEASE(m_buffers[index].vdpau); + -+ if(plane.id && glIsTexture(plane.id)) -+ glDeleteTextures(1, &plane.id); -+ plane.id = 0; ++ fields[0][0].id = 0; + fields[1][0].id = 0; + fields[1][1].id = 0; + fields[2][0].id = 0; @@ -1187,20 +1773,18 @@ index 962680a..388d778 100644 + im.plane[1] = NULL; + im.plane[2] = NULL; + -+ for(int p = 0;p<3;p++) ++ for(int p=0; p<3; p++) + { + pbo[p] = None; + } + -+ glEnable(m_textureTarget); -+ glGenTextures(1, &plane.id); -+ glDisable(m_textureTarget); ++ plane.id = 1; + - #endif ++#endif + return true; - } - -+void CLinuxRendererGL::UploadVDPAUTexture420(int index) ++} ++ ++bool CLinuxRendererGL::UploadVDPAUTexture420(int index) +{ +#ifdef HAVE_LIBVDPAU + VDPAU::CVdpauRenderPicture *vdpau = m_buffers[index].vdpau; @@ -1208,25 +1792,22 @@ index 962680a..388d778 100644 + + unsigned int flipindex = m_buffers[index].flipindex; + YUVFIELDS &fields = m_buffers[index].fields; -+ YUVPLANE &plane = fields[0][0]; + + if (!vdpau || !vdpau->valid) + { -+ m_skipRender = true; -+ return; ++ return false; + } + + im.height = vdpau->texHeight; + im.width = vdpau->texWidth; + + // YUV -+ for (int f = FIELD_FULL; f<=FIELD_BOT ; f++) ++ for (int f = FIELD_TOP; f<=FIELD_BOT ; f++) + { -+ int fieldshift = (f==FIELD_FULL) ? 0 : 1; + YUVPLANES &planes = fields[f]; + + planes[0].texwidth = im.width; -+ planes[0].texheight = im.height >> fieldshift; ++ planes[0].texheight = im.height >> 1; + + planes[1].texwidth = planes[0].texwidth >> im.cshift_x; + planes[1].texheight = planes[0].texheight >> im.cshift_y; @@ -1248,13 +1829,15 @@ index 962680a..388d778 100644 + // set textures + fields[1][0].id = vdpau->texture[0]; + fields[1][1].id = vdpau->texture[2]; ++ fields[1][2].id = vdpau->texture[2]; + fields[2][0].id = vdpau->texture[1]; + fields[2][1].id = vdpau->texture[3]; ++ fields[2][2].id = vdpau->texture[3]; + + glEnable(m_textureTarget); -+ for (int f = 1; f < 3; f++) ++ for (int f = FIELD_TOP; f <= FIELD_BOT; f++) + { -+ for (int p=0;p<2;p++) ++ for (int p=0; p<2; p++) + { + glBindTexture(m_textureTarget,fields[f][p].id); + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -1265,17 +1848,17 @@ index 962680a..388d778 100644 + glBindTexture(m_textureTarget,0); + VerifyGLState(); + } -+ fields[f][2].id = fields[f][1].id; + } + CalculateTextureSourceRects(index, 3); + glDisable(m_textureTarget); + +#endif ++ return true; +} void CLinuxRendererGL::DeleteVAAPITexture(int index) { -@@ -3281,12 +3454,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3274,12 +3430,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) if(method == VS_INTERLACEMETHOD_AUTO) return true; @@ -1293,7 +1876,7 @@ index 962680a..388d778 100644 #endif return false; } -@@ -3379,14 +3553,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() +@@ -3372,14 +3529,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() return VS_INTERLACEMETHOD_NONE; if(m_renderMethod & RENDER_VDPAU) @@ -1308,7 +1891,7 @@ index 962680a..388d778 100644 if(Supports(VS_INTERLACEMETHOD_RENDER_BOB)) return VS_INTERLACEMETHOD_RENDER_BOB; -@@ -3431,6 +3598,7 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) +@@ -3424,6 +3574,7 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) unsigned int CLinuxRendererGL::GetProcessorSize() { if(m_format == RENDER_FMT_VDPAU @@ -1316,7 +1899,7 @@ index 962680a..388d778 100644 || m_format == RENDER_FMT_VAAPI || m_format == RENDER_FMT_CVBREF) return 1; -@@ -3459,11 +3627,12 @@ bool CLinuxRendererGL::IsProcessed(int idx) +@@ -3432,11 +3583,12 @@ unsigned int CLinuxRendererGL::GetProcessorSize() } #ifdef HAVE_LIBVDPAU @@ -1332,7 +1915,7 @@ index 962680a..388d778 100644 #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index a90a532..fdda2ed 100644 +index b5c4dec..8daf72c 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -39,12 +39,11 @@ @@ -1349,8 +1932,8 @@ index a90a532..fdda2ed 100644 #undef ALIGN #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) -@@ -144,7 +143,7 @@ class CLinuxRendererGL : public CBaseRenderer - virtual bool IsProcessed(int idx); +@@ -143,7 +142,7 @@ class CLinuxRendererGL : public CBaseRenderer + virtual unsigned int GetProcessorSize(); #ifdef HAVE_LIBVDPAU - virtual void AddProcessor(CVDPAU* vdpau, int index); @@ -1358,18 +1941,18 @@ index a90a532..fdda2ed 100644 #endif #ifdef HAVE_LIBVA virtual void AddProcessor(VAAPI::CHolder& holder, int index); -@@ -195,6 +194,10 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -194,6 +193,10 @@ class CLinuxRendererGL : public CBaseRenderer void DeleteVDPAUTexture(int index); bool CreateVDPAUTexture(int index); -+ void UploadVDPAUTexture420(int index); ++ bool UploadVDPAUTexture420(int index); + void DeleteVDPAUTexture420(int index); + bool CreateVDPAUTexture420(int index); + - void UploadVAAPITexture(int index); + bool UploadVAAPITexture(int index); void DeleteVAAPITexture(int index); bool CreateVAAPITexture(int index); -@@ -221,6 +224,7 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -220,6 +223,7 @@ class CLinuxRendererGL : public CBaseRenderer void RenderSinglePass(int renderBuffer, int field); // single pass glsl renderer void RenderSoftware(int renderBuffer, int field); // single pass s/w yuv2rgb renderer void RenderVDPAU(int renderBuffer, int field); // render using vdpau hardware @@ -1377,8 +1960,8 @@ index a90a532..fdda2ed 100644 void RenderVAAPI(int renderBuffer, int field); // render using vdpau hardware struct -@@ -282,7 +286,7 @@ class CLinuxRendererGL : public CBaseRenderer - GLsync fence; +@@ -280,7 +284,7 @@ class CLinuxRendererGL : public CBaseRenderer + GLuint pbo[MAX_PLANES]; #ifdef HAVE_LIBVDPAU - CVDPAU* vdpau; @@ -1386,14 +1969,6 @@ index a90a532..fdda2ed 100644 #endif #ifdef HAVE_LIBVA VAAPI::CHolder& vaapi; -@@ -327,6 +331,7 @@ class CLinuxRendererGL : public CBaseRenderer - bool m_nonLinStretch; - bool m_nonLinStretchGui; - float m_pixelRatio; -+ bool m_skipRender; - }; - - diff --git a/xbmc/cores/VideoRenderers/RenderFormats.h b/xbmc/cores/VideoRenderers/RenderFormats.h index 29d45e0..3b09194 100644 --- a/xbmc/cores/VideoRenderers/RenderFormats.h @@ -1407,10 +1982,10 @@ index 29d45e0..3b09194 100644 RENDER_FMT_UYVY422, RENDER_FMT_YUYV422, diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index deac94b..a1c2fc7 100644 +index 0d32715..fbc2aae 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -925,7 +925,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -917,7 +917,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) CDVDCodecUtils::CopyDXVA2Picture(&image, &pic); } #ifdef HAVE_LIBVDPAU @@ -1421,7 +1996,7 @@ index deac94b..a1c2fc7 100644 #endif #ifdef HAVE_LIBOPENMAX diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 52380c1..befd851 100644 +index 00fe4c3..28596cf 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h @@ -35,7 +35,7 @@ @@ -1447,7 +2022,7 @@ index ad1940c..48302ff 100644 CLog::Log(LOGERROR, "GL: BaseYUV2RGBGLSLShader - unsupported format %d", m_format); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 2ccae41..0dd29c3 100644 +index a16ac4b..87edaa5 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -34,7 +34,7 @@ @@ -1469,7 +2044,7 @@ index 2ccae41..0dd29c3 100644 struct { VAAPI::CHolder* vaapi; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index e5748df..aa2d1e4 100644 +index b09ac29..143675a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -75,11 +75,11 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx @@ -1488,7 +2063,7 @@ index e5748df..aa2d1e4 100644 ctx->SetHardware(vdp); return *cur; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 0436108..c0ce198 100644 +index c509339..2287031 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -29,7 +29,6 @@ @@ -1500,7 +2075,7 @@ index 0436108..c0ce198 100644 class CDVDVideoCodecFFmpeg : public CDVDVideoCodec diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 5ca0803..4844469 100644 +index f830f61..1e4b0b7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -33,11 +33,16 @@ @@ -1521,31 +2096,23 @@ index 5ca0803..4844469 100644 {"MPEG1", VDP_DECODER_PROFILE_MPEG1}, {"MPEG2_SIMPLE", VDP_DECODER_PROFILE_MPEG2_SIMPLE}, {"MPEG2_MAIN", VDP_DECODER_PROFILE_MPEG2_MAIN}, -@@ -51,14 +56,16 @@ +@@ -51,14 +56,7 @@ {"MPEG4_PART2_ASP", VDP_DECODER_PROFILE_MPEG4_PART2_ASP}, #endif }; -const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CVDPAU::Desc); -+const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); - +- -static float studioCSC[3][4] = -{ - { 1.0f, 0.0f, 1.57480000f,-0.78740000f}, - { 1.0f,-0.18737736f,-0.46813736f, 0.32775736f}, - { 1.0f, 1.85556000f, 0.0f,-0.92780000f} -}; -+//static float studioCSC[3][4] = -+//{ -+// { 1.0f, 0.0f, 1.57480000f,-0.78740000f}, -+// { 1.0f,-0.18737736f,-0.46813736f, 0.32775736f}, -+// { 1.0f, 1.85556000f, 0.0f,-0.92780000f} -+//}; -+static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} -+static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} ++const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); static struct SInterlaceMapping { -@@ -69,114 +76,30 @@ +@@ -69,114 +67,34 @@ , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_HALF , VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL} , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL , VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL} , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL_HALF, VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL} @@ -1554,19 +2121,17 @@ index 5ca0803..4844469 100644 , {VS_INTERLACEMETHOD_NONE , (VdpVideoMixerFeature)-1} }; ++static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} ++static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} ++ //since libvdpau 0.4, vdp_device_create_x11() installs a callback on the Display*, //if we unload libvdpau with dlclose(), we segfault on XCloseDisplay, //so we just keep a static handle to libvdpau around -void* CVDPAU::dl_handle; +void* CDecoder::dl_handle; -+ -+//----------------------------------------------------------------------------- -+// CVDPAU -+//----------------------------------------------------------------------------- -CVDPAU::CVDPAU() -+CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent) - { +-{ - glXBindTexImageEXT = NULL; - glXReleaseTexImageEXT = NULL; - vdp_device = VDP_INVALID_HANDLE; @@ -1576,9 +2141,9 @@ index 5ca0803..4844469 100644 - m_DisplayState = VDPAU_OPEN; - m_mixerfield = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME; - m_mixerstep = 0; -+ m_vdpauConfig.vdpDevice = VDP_INVALID_HANDLE; -+ m_vdpauConfig.videoSurfaces = &m_videoSurfaces; -+ m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; ++//----------------------------------------------------------------------------- ++// CVDPAU ++//----------------------------------------------------------------------------- - m_glPixmap = 0; - m_Pixmap = 0; @@ -1586,9 +2151,11 @@ index 5ca0803..4844469 100644 - glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glXGetProcAddress((GLubyte *) "glXBindTexImageEXT"); - if (!glXReleaseTexImageEXT) - glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glXGetProcAddress((GLubyte *) "glXReleaseTexImageEXT"); -+ m_vdpauConfigured = false; -+ m_DisplayState = VDPAU_OPEN; -+} ++CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent) ++{ ++ m_vdpauConfig.vdpDevice = VDP_INVALID_HANDLE; ++ m_vdpauConfig.videoSurfaces = &m_videoSurfaces; ++ m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; - totalAvailableOutputSurfaces = 0; - outputSurface = presentSurface = VDP_INVALID_HANDLE; @@ -1666,15 +2233,17 @@ index 5ca0803..4844469 100644 - vdp_video_mixer_query_feature_support = NULL; - vdp_video_mixer_destroy = NULL; - vdp_video_mixer_render = NULL; -- m_hwContext.bitstream_buffers_allocated = 0; --} -- ++ m_vdpauConfigured = false; + m_hwContext.bitstream_buffers_allocated = 0; ++ m_DisplayState = VDPAU_OPEN; + } + -bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces) +bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces) { if(avctx->coded_width == 0 || avctx->coded_height == 0) -@@ -184,6 +107,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -184,6 +102,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su CLog::Log(LOGWARNING,"(VDPAU) no width/height available, can't init"); return false; } @@ -1683,7 +2252,7 @@ index 5ca0803..4844469 100644 if ((avctx->codec_id == AV_CODEC_ID_MPEG4) && !g_advancedSettings.m_videoAllowMpeg4VDPAU) return false; -@@ -198,8 +123,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -198,8 +118,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su error = "dlerror() returned NULL"; CLog::Log(LOGNOTICE,"(VDPAU) Unable to get handle to libvdpau: %s", error); @@ -1692,7 +2261,7 @@ index 5ca0803..4844469 100644 return false; } } -@@ -208,8 +131,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -208,8 +126,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; InitVDPAUProcs(); @@ -1703,7 +2272,7 @@ index 5ca0803..4844469 100644 { SpewHardwareAvailable(); -@@ -227,28 +151,26 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -227,28 +146,26 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su /* attempt to create a decoder with this width/height, some sizes are not supported by hw */ VdpStatus vdp_st; @@ -1739,7 +2308,7 @@ index 5ca0803..4844469 100644 avctx->slice_flags=SLICE_FLAG_CODED_ORDER|SLICE_FLAG_ALLOW_FIELD; avctx->hwaccel_context = &m_hwContext; avctx->thread_count = 1; -@@ -259,17 +181,20 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -259,17 +176,22 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; } @@ -1754,6 +2323,8 @@ index 5ca0803..4844469 100644 { CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__); ++ g_Windowing.Unregister(this); ++ + CSingleLock lock(m_DecoderSection); + FiniVDPAUOutput(); @@ -1762,16 +2333,11 @@ index 5ca0803..4844469 100644 while (!m_videoSurfaces.empty()) { -@@ -287,191 +212,120 @@ void CVDPAU::Close() +@@ -286,192 +208,114 @@ void CVDPAU::Close() + m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); } - g_Windowing.Unregister(this); -+ -+ if (m_hwContext.bitstream_buffers_allocated) -+ { -+ m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); -+ } -+ +- g_Windowing.Unregister(this); m_dllAvUtil.Unload(); } @@ -1854,7 +2420,7 @@ index 5ca0803..4844469 100644 + } } - XFree(fbConfigs); -+ IHardwareDecoder::Release(); ++ return IHardwareDecoder::Release(); +} - return true; @@ -2017,7 +2583,7 @@ index 5ca0803..4844469 100644 state = m_DisplayState; } -@@ -485,16 +339,13 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -485,16 +329,13 @@ int CVDPAU::Check(AVCodecContext* avctx) } else { @@ -2036,7 +2602,7 @@ index 5ca0803..4844469 100644 FiniVDPAUOutput(); FiniVDPAUProcs(); -@@ -509,7 +360,7 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -509,7 +350,7 @@ int CVDPAU::Check(AVCodecContext* avctx) return 0; } @@ -2045,7 +2611,7 @@ index 5ca0803..4844469 100644 { if (format == AV_PIX_FMT_VDPAU) return true; -@@ -517,90 +368,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) +@@ -517,90 +358,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) return false; } @@ -2147,7 +2713,7 @@ index 5ca0803..4844469 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -609,162 +398,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) +@@ -609,162 +388,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) return false; } @@ -2313,7 +2879,7 @@ index 5ca0803..4844469 100644 { char* error; -@@ -774,151 +413,115 @@ void CVDPAU::InitVDPAUProcs() +@@ -774,151 +403,115 @@ void CVDPAU::InitVDPAUProcs() if (error) { CLog::Log(LOGERROR,"(VDPAU) - %s in %s",error,__FUNCTION__); @@ -2510,11 +3076,11 @@ index 5ca0803..4844469 100644 return; - decoder = VDP_INVALID_HANDLE; + m_vdpauConfig.vdpDecoder = VDP_INVALID_HANDLE; -+ -+ CSingleLock lock(m_videoSurfaceSec); -+ CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", (int)m_videoSurfaces.size()); - for (unsigned int i = 0; i < m_videoSurfaces.size(); ++i) ++ CSingleLock lock(m_videoSurfaceSec); ++ CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", (int)m_videoSurfaces.size()); ++ + for(unsigned int i = 0; i < m_videoSurfaces.size(); ++i) { vdpau_render_state *render = m_videoSurfaces[i]; @@ -2525,7 +3091,7 @@ index 5ca0803..4844469 100644 render->surface = VDP_INVALID_HANDLE; } if (CheckStatus(vdp_st, __LINE__)) -@@ -926,10 +529,9 @@ void CVDPAU::FiniVDPAUOutput() +@@ -926,10 +519,9 @@ void CVDPAU::FiniVDPAUOutput() } } @@ -2539,7 +3105,7 @@ index 5ca0803..4844469 100644 { switch (codec) { -@@ -941,7 +543,7 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -941,7 +533,7 @@ void CVDPAU::ReadFormatOf( AVCodecID codec vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; @@ -2548,7 +3114,7 @@ index 5ca0803..4844469 100644 vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; -@@ -953,12 +555,10 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -953,12 +545,10 @@ void CVDPAU::ReadFormatOf( AVCodecID codec vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; @@ -2561,7 +3127,7 @@ index 5ca0803..4844469 100644 default: vdp_decoder_profile = 0; vdp_chroma_type = 0; -@@ -966,170 +566,78 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -966,170 +556,78 @@ void CVDPAU::ReadFormatOf( AVCodecID codec } } @@ -2780,7 +3346,7 @@ index 5ca0803..4844469 100644 { VdpStatus rv; CLog::Log(LOGNOTICE,"VDPAU Decoder capabilities:"); -@@ -1139,7 +647,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1139,7 +637,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L { VdpBool is_supported = false; uint32_t max_level, max_macroblocks, max_width, max_height; @@ -2789,7 +3355,7 @@ index 5ca0803..4844469 100644 &is_supported, &max_level, &max_macroblocks, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { -@@ -1148,13 +656,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1148,13 +646,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } } CLog::Log(LOGNOTICE,"------------------------------------"); @@ -2806,7 +3372,7 @@ index 5ca0803..4844469 100644 } \ } while(false) -@@ -1178,7 +686,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1178,7 +676,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } @@ -2815,7 +3381,7 @@ index 5ca0803..4844469 100644 { // find render state in queue bool found(false); -@@ -1205,34 +713,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) +@@ -1205,34 +703,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) return true; } @@ -2865,7 +3431,7 @@ index 5ca0803..4844469 100644 } } -@@ -1241,21 +748,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1241,21 +738,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) { // create a new surface VdpDecoderProfile profile; @@ -2891,7 +3457,7 @@ index 5ca0803..4844469 100644 avctx->coded_width, avctx->coded_height, &render->surface); -@@ -1277,18 +785,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1274,18 +772,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) pic->linesize[0] = pic->linesize[1] = pic->linesize[2] = 0; @@ -2910,7 +3476,7 @@ index 5ca0803..4844469 100644 pic->type= FF_BUFFER_TYPE_USER; render->state |= FF_VDPAU_STATE_USED_FOR_REFERENCE; -@@ -1296,15 +792,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1293,15 +779,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) return 0; } @@ -2930,7 +3496,7 @@ index 5ca0803..4844469 100644 render=(vdpau_render_state*)pic->data[0]; if(!render) -@@ -1313,6 +810,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1310,6 +797,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) return; } @@ -2939,7 +3505,7 @@ index 5ca0803..4844469 100644 for(i=0; i<4; i++) pic->data[i]= NULL; -@@ -1326,29 +825,26 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1323,29 +812,26 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) render->state &= ~FF_VDPAU_STATE_USED_FOR_REFERENCE; } @@ -2978,7 +3544,7 @@ index 5ca0803..4844469 100644 if(src->linesize[0] || src->linesize[1] || src->linesize[2] || offset[0] || offset[1] || offset[2]) -@@ -1378,67 +874,50 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, +@@ -1375,67 +861,50 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, if(s->codec_id == AV_CODEC_ID_H264) max_refs = vdp->m_hwContext.info.h264.num_ref_frames; @@ -2994,7 +3560,7 @@ index 5ca0803..4844469 100644 } - vdp_st = vdp->vdp_decoder_render(vdp->decoder, -+ uint64_t startTime = CurrentHostCounter(); ++// uint64_t startTime = CurrentHostCounter(); + uint16_t decoded, processed, rend; + vdp->m_bufferStats.Get(decoded, processed, rend); + vdp_st = vdp->m_vdpauConfig.vdpProcs.vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder, @@ -3003,9 +3569,9 @@ index 5ca0803..4844469 100644 vdp->m_hwContext.bitstream_buffers_used, vdp->m_hwContext.bitstream_buffers); vdp->CheckStatus(vdp_st, __LINE__); -+ uint64_t diff = CurrentHostCounter() - startTime; -+ if (diff*1000/CurrentHostFrequency() > 30) -+ CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); ++// uint64_t diff = CurrentHostCounter() - startTime; ++// if (diff*1000/CurrentHostFrequency() > 30) ++// CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); + } @@ -3065,7 +3631,7 @@ index 5ca0803..4844469 100644 // ffmpeg vc-1 decoder does not flush, make sure the data buffer is still valid if (!IsSurfaceValid(render)) -@@ -1447,258 +926,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -1444,258 +913,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) return VC_BUFFER; } @@ -3434,7 +4000,7 @@ index 5ca0803..4844469 100644 if(m_DisplayState == VDPAU_OPEN) { -@@ -1716,4 +1103,2424 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) +@@ -1713,4 +1090,2508 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) return false; } @@ -3444,7 +4010,7 @@ index 5ca0803..4844469 100644 + +CVdpauRenderPicture* CVdpauRenderPicture::Acquire() +{ -+ CSingleLock lock(*renderPicSection); ++ CSingleLock lock(renderPicSection); + + if (refCount == 0) + vdpau->Acquire(); @@ -3455,7 +4021,7 @@ index 5ca0803..4844469 100644 + +long CVdpauRenderPicture::Release() +{ -+ CSingleLock lock(*renderPicSection); ++ CSingleLock lock(renderPicSection); + + refCount--; + if (refCount > 0) @@ -3470,7 +4036,7 @@ index 5ca0803..4844469 100644 + +void CVdpauRenderPicture::ReturnUnused() +{ -+ { CSingleLock lock(*renderPicSection); ++ { CSingleLock lock(renderPicSection); + if (refCount > 0) + return; + } @@ -3508,6 +4074,11 @@ index 5ca0803..4844469 100644 + m_dataPort.Purge(); +} + ++bool CMixer::IsActive() ++{ ++ return IsRunning(); ++} ++ +void CMixer::OnStartup() +{ + CLog::Log(LOGNOTICE, "CMixer::OnStartup: Output Thread created"); @@ -3764,8 +4335,8 @@ index 5ca0803..4844469 100644 + +void CMixer::Process() +{ -+ Message *msg; -+ Protocol *port; ++ Message *msg = NULL; ++ Protocol *port = NULL; + bool gotMsg; + + m_state = M_TOP_UNCONFIGURED; @@ -3870,7 +4441,6 @@ index 5ca0803..4844469 100644 + +void CMixer::InitCSCMatrix(int Width) +{ -+ VdpStatus vdp_st; + m_Procamp.struct_version = VDP_PROCAMP_VERSION; + m_Procamp.brightness = 0.0; + m_Procamp.contrast = 1.0; @@ -3968,7 +4538,6 @@ index 5ca0803..4844469 100644 + DisableHQScaling(); +} + -+ +bool CMixer::GenerateStudioCSCMatrix(VdpColorStandard colorStandard, VdpCSCMatrix &studioCSCMatrix) +{ + // instead use studioCSCKCoeffs601[3], studioCSCKCoeffs709[3] to generate float[3][4] matrix (float studioCSC[3][4]) @@ -4068,6 +4637,7 @@ index 5ca0803..4844469 100644 + void const * pm_CSCMatix[] = { &m_CSCMatrix }; + vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); + } ++ + CheckStatus(vdp_st, __LINE__); +} + @@ -4711,6 +5281,31 @@ index 5ca0803..4844469 100644 +} + +//----------------------------------------------------------------------------- ++// Buffer Pool ++//----------------------------------------------------------------------------- ++ ++VdpauBufferPool::VdpauBufferPool() ++{ ++ CVdpauRenderPicture *pic; ++ for (unsigned int i = 0; i < NUM_RENDER_PICS; i++) ++ { ++ pic = new CVdpauRenderPicture(renderPicSec); ++ allRenderPics.push_back(pic); ++ } ++} ++ ++VdpauBufferPool::~VdpauBufferPool() ++{ ++ CVdpauRenderPicture *pic; ++ for (unsigned int i = 0; i < NUM_RENDER_PICS; i++) ++ { ++ pic = allRenderPics[i]; ++ delete pic; ++ } ++ allRenderPics.clear(); ++} ++ ++//----------------------------------------------------------------------------- +// Output +//----------------------------------------------------------------------------- +COutput::COutput(CEvent *inMsgEvent) : @@ -4721,16 +5316,9 @@ index 5ca0803..4844469 100644 +{ + m_inMsgEvent = inMsgEvent; + -+ CVdpauRenderPicture pic; -+ pic.renderPicSection = &m_bufferPool.renderPicSec; -+ pic.refCount = 0; -+ for (unsigned int i = 0; i < NUM_RENDER_PICS; i++) -+ { -+ m_bufferPool.allRenderPics.push_back(pic); -+ } + for (unsigned int i = 0; i < m_bufferPool.allRenderPics.size(); ++i) + { -+ m_bufferPool.freeRenderPics.push_back(&m_bufferPool.allRenderPics[i]); ++ m_bufferPool.freeRenderPics.push_back(i); + } +} + @@ -4745,7 +5333,6 @@ index 5ca0803..4844469 100644 + + m_bufferPool.freeRenderPics.clear(); + m_bufferPool.usedRenderPics.clear(); -+ m_bufferPool.allRenderPics.clear(); +} + +void COutput::Dispose() @@ -4883,6 +5470,7 @@ index 5ca0803..4844469 100644 + return; + case COutputControlProtocol::PRECLEANUP: + Flush(); ++ PreCleanup(); + msg->Reply(COutputControlProtocol::ACC); + return; + default: @@ -4937,9 +5525,6 @@ index 5ca0803..4844469 100644 + switch (signal) + { + case COutputControlProtocol::TIMEOUT: -+// uint16_t decoded, processed, render; -+// m_config.stats->Get(decoded, processed, render); -+// CLog::Log(LOGDEBUG, "CVDPAU::COutput - timeout idle: decoded: %d, proc: %d, render: %d", decoded, processed, render); + return; + default: + break; @@ -4986,8 +5571,8 @@ index 5ca0803..4844469 100644 + +void COutput::Process() +{ -+ Message *msg; -+ Protocol *port; ++ Message *msg = NULL; ++ Protocol *port = NULL; + bool gotMsg; + + m_state = O_TOP_UNCONFIGURED; @@ -5089,15 +5674,18 @@ index 5ca0803..4844469 100644 + +void COutput::Flush() +{ -+ Message *reply; -+ if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, ++ if (m_mixer.IsActive()) ++ { ++ Message *reply; ++ if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, + &reply, + 2000)) -+ { -+ reply->Release(); ++ { ++ reply->Release(); ++ } ++ else ++ CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); + } -+ else -+ CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); + + Message *msg; + while (m_mixer.m_dataPort.ReceiveInMessage(&msg)) @@ -5144,13 +5732,14 @@ index 5ca0803..4844469 100644 + } + + // reset used render flag which was cleared on mixer flush -+ std::deque::iterator it; ++ std::deque::iterator it; + for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) + { -+ if ((*it)->DVDPic.format == RENDER_FMT_VDPAU_420) ++ CVdpauRenderPicture *pic = m_bufferPool.allRenderPics[*it]; ++ if (pic->DVDPic.format == RENDER_FMT_VDPAU_420) + { + std::map::iterator it2; -+ it2 = m_bufferPool.glVideoSurfaceMap.find((*it)->sourceIdx); ++ it2 = m_bufferPool.glVideoSurfaceMap.find(pic->sourceIdx); + if (it2 == m_bufferPool.glVideoSurfaceMap.end()) + { + CLog::Log(LOGDEBUG, "COutput::Flush - gl surface not found"); @@ -5183,7 +5772,7 @@ index 5ca0803..4844469 100644 + +CVdpauRenderPicture* COutput::ProcessMixerPicture() +{ -+ CVdpauRenderPicture *retPic = 0; ++ CVdpauRenderPicture *retPic = NULL; + + if (m_config.usePixmaps) + { @@ -5197,8 +5786,7 @@ index 5ca0803..4844469 100644 + pixmap->surface = pic.outputSurface; + pixmap->DVDPic = pic.DVDPic; + pixmap->id = i; -+ m_bufferPool.notVisiblePixmaps.push_back(pixmap); -+ VdpStatus vdp_st; ++ m_bufferPool.notVisiblePixmaps.push_back(i); + m_config.vdpProcs.vdp_presentation_queue_display(pixmap->vdp_flip_queue, + pixmap->surface,0,0,0); + } @@ -5207,15 +5795,17 @@ index 5ca0803..4844469 100644 + VdpStatus vdp_st; + VdpTime time; + VdpPresentationQueueStatus status; -+ VdpauBufferPool::Pixmaps *pixmap = m_bufferPool.notVisiblePixmaps.front(); ++ int idx = m_bufferPool.notVisiblePixmaps.front(); ++ VdpauBufferPool::Pixmaps *pixmap = &m_bufferPool.pixmaps[idx]; + vdp_st = m_config.vdpProcs.vdp_presentation_queue_query_surface_status( + pixmap->vdp_flip_queue, pixmap->surface, &status, &time); + + if (vdp_st == VDP_STATUS_OK && status == VDP_PRESENTATION_QUEUE_STATUS_VISIBLE) + { -+ retPic = m_bufferPool.freeRenderPics.front(); ++ int idx = m_bufferPool.freeRenderPics.front(); ++ retPic = m_bufferPool.allRenderPics[idx]; + m_bufferPool.freeRenderPics.pop_front(); -+ m_bufferPool.usedRenderPics.push_back(retPic); ++ m_bufferPool.usedRenderPics.push_back(idx); + retPic->sourceIdx = pixmap->id; + retPic->DVDPic = pixmap->DVDPic; + retPic->valid = true; @@ -5228,9 +5818,10 @@ index 5ca0803..4844469 100644 + } // pixmap + else if (!m_bufferPool.processedPics.empty() && !m_bufferPool.freeRenderPics.empty()) + { -+ retPic = m_bufferPool.freeRenderPics.front(); ++ int idx = m_bufferPool.freeRenderPics.front(); ++ retPic = m_bufferPool.allRenderPics[idx]; + m_bufferPool.freeRenderPics.pop_front(); -+ m_bufferPool.usedRenderPics.push_back(retPic); ++ m_bufferPool.usedRenderPics.push_back(idx); + CVdpauProcessedPicture procPic = m_bufferPool.processedPics.front(); + m_bufferPool.processedPics.pop(); + @@ -5266,15 +5857,22 @@ index 5ca0803..4844469 100644 + +void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) +{ -+ std::deque::iterator it; -+ it = std::find(m_bufferPool.usedRenderPics.begin(), m_bufferPool.usedRenderPics.end(), pic); ++ std::deque::iterator it; ++ for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) ++ { ++ if (m_bufferPool.allRenderPics[*it] == pic) ++ { ++ break; ++ } ++ } ++ + if (it == m_bufferPool.usedRenderPics.end()) + { + CLog::Log(LOGWARNING, "COutput::ProcessReturnPicture - pic not found"); + return; + } ++ m_bufferPool.freeRenderPics.push_back(*it); + m_bufferPool.usedRenderPics.erase(it); -+ m_bufferPool.freeRenderPics.push_back(pic); + if (!pic->valid) + { + CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); @@ -5356,7 +5954,7 @@ index 5ca0803..4844469 100644 + { + // create pixmpas + VdpauBufferPool::Pixmaps pixmap; -+ int numPixmaps = NUM_RENDER_PICS; ++ unsigned int numPixmaps = NUM_RENDER_PICS; + for (unsigned int i = 0; i < numPixmaps; i++) + { + pixmap.pixmap = None; @@ -5432,10 +6030,63 @@ index 5ca0803..4844469 100644 + // invalidate all used render pictures + for (unsigned int i = 0; i < m_bufferPool.usedRenderPics.size(); ++i) + { -+ m_bufferPool.usedRenderPics[i]->valid = false; ++ m_bufferPool.allRenderPics[m_bufferPool.usedRenderPics[i]]->valid = false; + } +} + ++void COutput::PreCleanup() ++{ ++ ++ VdpStatus vdp_st; ++ ++ m_mixer.Dispose(); ++ ++ CSingleLock lock(m_bufferPool.renderPicSec); ++ for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) ++ { ++ if (m_bufferPool.outputSurfaces[i] == VDP_INVALID_HANDLE) ++ continue; ++ ++ // check if output surface is in use ++ bool used = false; ++ std::deque::iterator it; ++ CVdpauRenderPicture *pic; ++ for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) ++ { ++ pic = m_bufferPool.allRenderPics[*it]; ++ if ((pic->sourceIdx == m_bufferPool.outputSurfaces[i]) && pic->valid) ++ { ++ used = true; ++ break; ++ } ++ } ++ if (used) ++ continue; ++ ++#ifdef GL_NV_vdpau_interop ++ // unmap surface ++ std::map::iterator it_map; ++ it_map = m_bufferPool.glOutputSurfaceMap.find(m_bufferPool.outputSurfaces[i]); ++ if (it_map == m_bufferPool.glOutputSurfaceMap.end()) ++ { ++ CLog::Log(LOGERROR, "%s - could not find gl surface", __FUNCTION__); ++ continue; ++ } ++ glVDPAUUnregisterSurfaceNV(it_map->second.glVdpauSurface); ++ glDeleteTextures(1, it_map->second.texture); ++ m_bufferPool.glOutputSurfaceMap.erase(it_map); ++#endif ++ ++ vdp_st = m_config.vdpProcs.vdp_output_surface_destroy(m_bufferPool.outputSurfaces[i]); ++ CheckStatus(vdp_st, __LINE__); ++ ++ m_bufferPool.outputSurfaces[i] = VDP_INVALID_HANDLE; ++ ++ CLog::Log(LOGDEBUG, "VDPAU::PreCleanup - released output surface"); ++ } ++ ++} ++ +void COutput::InitMixer() +{ + for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) @@ -5611,7 +6262,7 @@ index 5ca0803..4844469 100644 + if (m_config.videoSurfaces->size() != m_bufferPool.glVideoSurfaceMap.size()) + { + CSingleLock lock(*m_config.videoSurfaceSec); -+ for (int i = 0; i < m_config.videoSurfaces->size(); i++) ++ for (unsigned int i = 0; i < m_config.videoSurfaces->size(); i++) + { + if ((*m_config.videoSurfaces)[i]->surface == VDP_INVALID_HANDLE) + continue; @@ -5659,7 +6310,7 @@ index 5ca0803..4844469 100644 + if (m_bufferPool.glOutputSurfaceMap.size() != m_bufferPool.numOutputSurfaces) + { + VdpauBufferPool::GLVideoSurface glSurface; -+ for (int i=m_bufferPool.glOutputSurfaceMap.size(); i allRenderPics; + unsigned short numOutputSurfaces; + std::vector pixmaps; + std::vector outputSurfaces; -+ std::deque notVisiblePixmaps; -+ std::vector allRenderPics; ++ std::deque notVisiblePixmaps; + std::map glVideoSurfaceMap; + std::map glOutputSurfaceMap; + std::queue processedPics; -+ std::deque usedRenderPics; -+ std::deque freeRenderPics; ++ std::deque usedRenderPics; ++ std::deque freeRenderPics; + CCriticalSection renderPicSec; +}; + @@ -6439,6 +7094,7 @@ index e760f28..1c21535 100644 + bool DestroyGlxContext(); + bool EnsureBufferPool(); + void ReleaseBufferPool(); ++ void PreCleanup(); + void InitMixer(); + bool GLInit(); + void GLMapSurfaces(); @@ -6575,7 +7231,7 @@ index e760f28..1c21535 100644 // OnLostDevice triggers transition from all states to LOST // internal errors trigger transition from OPEN to RESET -@@ -254,9 +581,25 @@ class CVDPAU +@@ -254,9 +587,25 @@ class CVDPAU , VDPAU_LOST , VDPAU_ERROR } m_DisplayState; @@ -6606,10 +7262,10 @@ index e760f28..1c21535 100644 + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 2e76ff5..8ed34f9 100644 +index bcfd27c..d35751c 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1010,6 +1010,7 @@ static std::string GetRenderFormatName(ERenderFormat format) +@@ -992,6 +992,7 @@ static std::string GetRenderFormatName(ERenderFormat format) case RENDER_FMT_UYVY422: return "UYVY"; case RENDER_FMT_YUYV422: return "YUY2"; case RENDER_FMT_VDPAU: return "VDPAU"; @@ -6618,7 +7274,7 @@ index 2e76ff5..8ed34f9 100644 case RENDER_FMT_VAAPI: return "VAAPI"; case RENDER_FMT_OMXEGL: return "OMXEGL"; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 3ec25c1..6541f65 100644 +index 5feaf8a..f611bb6 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -161,7 +161,7 @@ void CAdvancedSettings::Initialize() @@ -6639,7 +7295,7 @@ index 3ec25c1..6541f65 100644 m_DXVACheckCompatibility = false; m_DXVACheckCompatibilityPresent = false; m_DXVAForceProcessorRenderer = true; -@@ -590,7 +592,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -594,7 +596,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetString(pElement,"cleandatetime", m_videoCleanDateTimeRegExp); XMLUtils::GetString(pElement,"ppffmpegdeinterlacing",m_videoPPFFmpegDeint); XMLUtils::GetString(pElement,"ppffmpegpostprocessing",m_videoPPFFmpegPostProc); @@ -6648,7 +7304,7 @@ index 3ec25c1..6541f65 100644 XMLUtils::GetFloat(pElement, "nonlinearstretchratio", m_videoNonLinStretchRatio, 0.01f, 1.0f); XMLUtils::GetBoolean(pElement,"enablehighqualityhwscalers", m_videoEnableHighQualityHwScalers); XMLUtils::GetFloat(pElement,"autoscalemaxfps",m_videoAutoScaleMaxFps, 0.0f, 1000.0f); -@@ -599,6 +601,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -603,6 +605,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -6658,7 +7314,7 @@ index 3ec25c1..6541f65 100644 TiXmlElement* pStagefrightElem = pElement->FirstChildElement("stagefright"); if (pStagefrightElem) diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 224268a..310db76 100644 +index 72716ee..df5b028 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -158,6 +158,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -6708,10 +7364,10 @@ index a0f7bba..b6b6ec4 100644 1.8.1.6 -From 64a3764653d8021becc1ba27cb1b9900ab581ff5 Mon Sep 17 00:00:00 2001 +From 3c0d159b590e6489fac9a47955b18cbad1826484 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 09:52:17 +0100 -Subject: [PATCH 006/110] vdpau: make interop gl default and remove setting, +Subject: [PATCH 025/111] vdpau: make interop gl default and remove setting, rename and intvert interop yuv --- @@ -6720,10 +7376,10 @@ Subject: [PATCH 006/110] vdpau: make interop gl default and remove setting, 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index a6b0297..fae2505 100644 +index 4a10f5d..0e900ad 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5777,15 +5777,10 @@ msgstr "" +@@ -5786,15 +5786,10 @@ msgstr "" #: system/settings/settings.xml msgctxt "#13437" @@ -6742,10 +7398,10 @@ index a6b0297..fae2505 100644 #: system/settings/settings.xml msgctxt "#13500" diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 4844469..fc95760 100644 +index 1e4b0b7..c3af67a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -384,12 +384,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) +@@ -374,12 +374,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) || method == VS_INTERLACEMETHOD_AUTO) return true; @@ -6762,7 +7418,7 @@ index 4844469..fc95760 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -1869,7 +1872,7 @@ void CMixer::SetDeinterlacing() +@@ -1860,7 +1863,7 @@ void CMixer::SetDeinterlacing() SetDeintSkipChroma(); @@ -6771,7 +7427,7 @@ index 4844469..fc95760 100644 } void CMixer::SetDeintSkipChroma() -@@ -2061,7 +2064,7 @@ void CMixer::Init() +@@ -2052,7 +2055,7 @@ void CMixer::Init() m_vdpError = false; m_config.upscale = g_advancedSettings.m_videoVDPAUScaling; @@ -6780,7 +7436,7 @@ index 4844469..fc95760 100644 CreateVdpauMixer(); } -@@ -2171,11 +2174,12 @@ void CMixer::InitCycle() +@@ -2162,11 +2165,12 @@ void CMixer::InitCycle() DVP_FLAG_INTERLACED); m_config.useInteropYuv = false; } @@ -6794,7 +7450,7 @@ index 4844469..fc95760 100644 } else { -@@ -3207,7 +3211,7 @@ bool COutput::GLInit() +@@ -3279,7 +3283,7 @@ bool COutput::GLInit() glVDPAUGetSurfaceivNV = NULL; #endif @@ -6803,7 +7459,7 @@ index 4844469..fc95760 100644 #ifdef GL_NV_vdpau_interop if (glewIsSupported("GL_NV_vdpau_interop")) -@@ -3239,8 +3243,7 @@ bool COutput::GLInit() +@@ -3311,8 +3315,7 @@ bool COutput::GLInit() #endif { m_config.usePixmaps = true; @@ -6817,165 +7473,10 @@ index 4844469..fc95760 100644 1.8.1.6 -From 9288e2009b64f9ceebda4c27a98a412c07ee8cbf Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Wed, 12 Dec 2012 18:34:47 +0100 -Subject: [PATCH 007/110] vdpau: drop studio level conversion - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 94 ++------------------------ - 2 files changed, 6 insertions(+), 92 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 388d778..2de63b8 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3370,7 +3370,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - { - if(feature == RENDERFEATURE_BRIGHTNESS) - { -- if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) -+ if (m_renderMethod & RENDER_VDPAU) - return true; - - if (m_renderMethod & RENDER_VAAPI) -@@ -3383,7 +3383,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - - if(feature == RENDERFEATURE_CONTRAST) - { -- if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) -+ if (m_renderMethod & RENDER_VDPAU) - return true; - - if (m_renderMethod & RENDER_VAAPI) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index fc95760..07af62a 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -58,15 +58,6 @@ - }; - const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); - --//static float studioCSC[3][4] = --//{ --// { 1.0f, 0.0f, 1.57480000f,-0.78740000f}, --// { 1.0f,-0.18737736f,-0.46813736f, 0.32775736f}, --// { 1.0f, 1.85556000f, 0.0f,-0.92780000f} --//}; --static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} --static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} -- - static struct SInterlaceMapping - { - const EINTERLACEMETHOD method; -@@ -1636,74 +1627,6 @@ void CMixer::PostProcOff() - DisableHQScaling(); - } - -- --bool CMixer::GenerateStudioCSCMatrix(VdpColorStandard colorStandard, VdpCSCMatrix &studioCSCMatrix) --{ -- // instead use studioCSCKCoeffs601[3], studioCSCKCoeffs709[3] to generate float[3][4] matrix (float studioCSC[3][4]) -- // m00 = mRY = red: luma factor (contrast factor) (1.0) -- // m10 = mGY = green: luma factor (contrast factor) (1.0) -- // m20 = mBY = blue: luma factor (contrast factor) (1.0) -- // -- // m01 = mRB = red: blue color diff coeff (0.0) -- // m11 = mGB = green: blue color diff coeff (-2Kb(1-Kb)/(Kg)) -- // m21 = mBB = blue: blue color diff coeff ((1-Kb)/0.5) -- // -- // m02 = mRR = red: red color diff coeff ((1-Kr)/0.5) -- // m12 = mGR = green: red color diff coeff (-2Kr(1-Kr)/(Kg)) -- // m22 = mBR = blue: red color diff coeff (0.0) -- // -- // m03 = mRC = red: colour zero offset (brightness factor) (-(1-Kr)/0.5 * (128/255)) -- // m13 = mGC = green: colour zero offset (brightness factor) ((256/255) * (Kb(1-Kb) + Kr(1-Kr)) / Kg) -- // m23 = mBC = blue: colour zero offset (brightness factor) (-(1-Kb)/0.5 * (128/255)) -- -- // columns -- int Y = 0; -- int Cb = 1; -- int Cr = 2; -- int C = 3; -- // rows -- int R = 0; -- int G = 1; -- int B = 2; -- // colour standard coefficients for red, geen, blue -- double Kr, Kg, Kb; -- // colour diff zero position (use standard 8-bit coding precision) -- double CDZ = 128; //256*0.5 -- // range excursion (use standard 8-bit coding precision) -- double EXC = 255; //256-1 -- -- if (colorStandard == VDP_COLOR_STANDARD_ITUR_BT_601) -- { -- Kr = studioCSCKCoeffs601[0]; -- Kg = studioCSCKCoeffs601[1]; -- Kb = studioCSCKCoeffs601[2]; -- } -- else // assume VDP_COLOR_STANDARD_ITUR_BT_709 -- { -- Kr = studioCSCKCoeffs709[0]; -- Kg = studioCSCKCoeffs709[1]; -- Kb = studioCSCKCoeffs709[2]; -- } -- // we keep luma unscaled to retain the levels present in source so that 16-235 luma is converted to RGB 16-235 -- studioCSCMatrix[R][Y] = 1.0; -- studioCSCMatrix[G][Y] = 1.0; -- studioCSCMatrix[B][Y] = 1.0; -- -- studioCSCMatrix[R][Cb] = 0.0; -- studioCSCMatrix[G][Cb] = (double)-2 * Kb * (1 - Kb) / Kg; -- studioCSCMatrix[B][Cb] = (double)(1 - Kb) / 0.5; -- -- studioCSCMatrix[R][Cr] = (double)(1 - Kr) / 0.5; -- studioCSCMatrix[G][Cr] = (double)-2 * Kr * (1 - Kr) / Kg; -- studioCSCMatrix[B][Cr] = 0.0; -- -- studioCSCMatrix[R][C] = (double)-1 * studioCSCMatrix[R][Cr] * CDZ/EXC; -- studioCSCMatrix[G][C] = (double)-1 * (studioCSCMatrix[G][Cb] + studioCSCMatrix[G][Cr]) * CDZ/EXC; -- studioCSCMatrix[B][C] = (double)-1 * studioCSCMatrix[B][Cb] * CDZ/EXC; -- -- return true; --} -- - void CMixer::SetColor() - { - VdpStatus vdp_st; -@@ -1723,19 +1646,10 @@ void CMixer::SetColor() - //vdp_st = vdp_generate_csc_matrix(&m_Procamp, VDP_COLOR_STANDARD_ITUR_BT_601, &m_CSCMatrix); - - VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; -- if (CSettings::Get().GetBool("videoscreen.limitedrange")) -- { -- float studioCSC[3][4]; -- GenerateStudioCSCMatrix(colorStandard, studioCSC); -- void const * pm_CSCMatix[] = { &studioCSC }; -- vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -- } -- else -- { -- vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -- void const * pm_CSCMatix[] = { &m_CSCMatrix }; -- vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -- } -+ vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -+ void const * pm_CSCMatix[] = { &m_CSCMatrix }; -+ vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ - CheckStatus(vdp_st, __LINE__); - } - --- -1.8.1.6 - - -From 471ec30394381baccd0d7c6fe24efc834a1e9d25 Mon Sep 17 00:00:00 2001 +From 81a040e60363479ee026aa33d19da1ea4b235425 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 20:28:49 +0100 -Subject: [PATCH 008/110] vdpau: observe ffmpeg tags for color space +Subject: [PATCH 026/111] vdpau: observe ffmpeg tags for color space --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 38 ++++++++++++++++++-------- @@ -6983,10 +7484,10 @@ Subject: [PATCH 008/110] vdpau: observe ffmpeg tags for color space 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 07af62a..7ecc2cf 100644 +index c3af67a..2d8b8e2 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -929,6 +929,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -925,6 +925,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); pic.render = render; @@ -7020,7 +7521,7 @@ index 07af62a..7ecc2cf 100644 } if (m_NoiseReduction != CMediaSettings::Get().GetCurrentVideoSettings().m_NoiseReduction) { -@@ -1637,13 +1636,27 @@ void CMixer::SetColor() +@@ -1704,13 +1703,27 @@ void CMixer::SetColor() m_Procamp.contrast = (float)((CMediaSettings::Get().GetCurrentVideoSettings().m_Contrast)+50) / 100; VdpColorStandard colorStandard; @@ -7054,8 +7555,8 @@ index 07af62a..7ecc2cf 100644 + } VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; - vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -@@ -1974,6 +1987,7 @@ void CMixer::Init() + if (CSettings::Get().GetBool("videoscreen.limitedrange")) +@@ -2051,6 +2064,7 @@ void CMixer::Init() m_Sharpness = 0.0; m_DeintMode = 0; m_Deint = 0; @@ -7064,10 +7565,10 @@ index 07af62a..7ecc2cf 100644 m_vdpError = false; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index 1c21535..674571b 100644 +index aae4173..8845a16 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -@@ -334,6 +334,7 @@ class CMixer : private CThread +@@ -337,6 +337,7 @@ class CMixer : private CThread int m_DeintMode; int m_Deint; int m_Upscale; @@ -7079,20 +7580,20 @@ index 1c21535..674571b 100644 1.8.1.6 -From 0d627c2dfe93bc9cbde2f0c45b209b24ae3afcf6 Mon Sep 17 00:00:00 2001 +From 550eb77b91beb31fcb70a480451da977755e1d8d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 27 Jan 2013 12:10:19 +0100 -Subject: [PATCH 009/110] vdpau: switch off de-interlacing on ff +Subject: [PATCH 027/111] vdpau: switch off de-interlacing on ff --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 7ecc2cf..3cc02ee 100644 +index 2d8b8e2..7a9dfc9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2065,8 +2065,9 @@ void CMixer::InitCycle() +@@ -2142,8 +2142,9 @@ void CMixer::InitCycle() EINTERLACEMETHOD method = GetDeinterlacingMethod(); bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; @@ -7108,200 +7609,10 @@ index 7ecc2cf..3cc02ee 100644 1.8.1.6 -From 9bd37f8dce8f15c2b7db6d998b7637645345f432 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Feb 2013 13:17:09 +0100 -Subject: [PATCH 010/110] vdpau: fix mp4 part2 decoding, activate by default - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3 +-- - xbmc/settings/AdvancedSettings.cpp | 2 +- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 3cc02ee..d90df12 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -131,10 +131,9 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int - VdpDecoderProfile profile = 0; - if(avctx->codec_id == AV_CODEC_ID_H264) - profile = VDP_DECODER_PROFILE_H264_HIGH; --#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_ASP - else if(avctx->codec_id == AV_CODEC_ID_MPEG4) - profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; --#endif -+ - if(profile) - { - if (!CDVDCodecUtils::IsVP3CompatibleWidth(avctx->coded_width)) -diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 6541f65..8287651 100644 ---- a/xbmc/settings/AdvancedSettings.cpp -+++ b/xbmc/settings/AdvancedSettings.cpp -@@ -165,7 +165,7 @@ void CAdvancedSettings::Initialize() - m_videoNonLinStretchRatio = 0.5f; - m_videoEnableHighQualityHwScalers = false; - m_videoAutoScaleMaxFps = 30.0f; -- m_videoAllowMpeg4VDPAU = false; -+ m_videoAllowMpeg4VDPAU = true; - m_videoAllowMpeg4VAAPI = false; - m_videoDisableBackgroundDeinterlace = false; - m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect --- -1.8.1.6 - - -From 084d9ac176408dd4240edb14b144f67a884eda5e Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Mar 2013 15:19:19 +0100 -Subject: [PATCH 011/110] vdpau: re-add limited range conversion - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 86 +++++++++++++++++++++++++- - 2 files changed, 85 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 2de63b8..388d778 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3370,7 +3370,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - { - if(feature == RENDERFEATURE_BRIGHTNESS) - { -- if (m_renderMethod & RENDER_VDPAU) -+ if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) - return true; - - if (m_renderMethod & RENDER_VAAPI) -@@ -3383,7 +3383,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - - if(feature == RENDERFEATURE_CONTRAST) - { -- if (m_renderMethod & RENDER_VDPAU) -+ if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) - return true; - - if (m_renderMethod & RENDER_VAAPI) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index d90df12..62cd72e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -71,6 +71,9 @@ - , {VS_INTERLACEMETHOD_NONE , (VdpVideoMixerFeature)-1} - }; - -+static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} -+static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} -+ - //since libvdpau 0.4, vdp_device_create_x11() installs a callback on the Display*, - //if we unload libvdpau with dlclose(), we segfault on XCloseDisplay, - //so we just keep a static handle to libvdpau around -@@ -1625,6 +1628,73 @@ void CMixer::PostProcOff() - DisableHQScaling(); - } - -+bool CMixer::GenerateStudioCSCMatrix(VdpColorStandard colorStandard, VdpCSCMatrix &studioCSCMatrix) -+{ -+ // instead use studioCSCKCoeffs601[3], studioCSCKCoeffs709[3] to generate float[3][4] matrix (float studioCSC[3][4]) -+ // m00 = mRY = red: luma factor (contrast factor) (1.0) -+ // m10 = mGY = green: luma factor (contrast factor) (1.0) -+ // m20 = mBY = blue: luma factor (contrast factor) (1.0) -+ // -+ // m01 = mRB = red: blue color diff coeff (0.0) -+ // m11 = mGB = green: blue color diff coeff (-2Kb(1-Kb)/(Kg)) -+ // m21 = mBB = blue: blue color diff coeff ((1-Kb)/0.5) -+ // -+ // m02 = mRR = red: red color diff coeff ((1-Kr)/0.5) -+ // m12 = mGR = green: red color diff coeff (-2Kr(1-Kr)/(Kg)) -+ // m22 = mBR = blue: red color diff coeff (0.0) -+ // -+ // m03 = mRC = red: colour zero offset (brightness factor) (-(1-Kr)/0.5 * (128/255)) -+ // m13 = mGC = green: colour zero offset (brightness factor) ((256/255) * (Kb(1-Kb) + Kr(1-Kr)) / Kg) -+ // m23 = mBC = blue: colour zero offset (brightness factor) (-(1-Kb)/0.5 * (128/255)) -+ -+ // columns -+ int Y = 0; -+ int Cb = 1; -+ int Cr = 2; -+ int C = 3; -+ // rows -+ int R = 0; -+ int G = 1; -+ int B = 2; -+ // colour standard coefficients for red, geen, blue -+ double Kr, Kg, Kb; -+ // colour diff zero position (use standard 8-bit coding precision) -+ double CDZ = 128; //256*0.5 -+ // range excursion (use standard 8-bit coding precision) -+ double EXC = 255; //256-1 -+ -+ if (colorStandard == VDP_COLOR_STANDARD_ITUR_BT_601) -+ { -+ Kr = studioCSCKCoeffs601[0]; -+ Kg = studioCSCKCoeffs601[1]; -+ Kb = studioCSCKCoeffs601[2]; -+ } -+ else // assume VDP_COLOR_STANDARD_ITUR_BT_709 -+ { -+ Kr = studioCSCKCoeffs709[0]; -+ Kg = studioCSCKCoeffs709[1]; -+ Kb = studioCSCKCoeffs709[2]; -+ } -+ // we keep luma unscaled to retain the levels present in source so that 16-235 luma is converted to RGB 16-235 -+ studioCSCMatrix[R][Y] = 1.0; -+ studioCSCMatrix[G][Y] = 1.0; -+ studioCSCMatrix[B][Y] = 1.0; -+ -+ studioCSCMatrix[R][Cb] = 0.0; -+ studioCSCMatrix[G][Cb] = (double)-2 * Kb * (1 - Kb) / Kg; -+ studioCSCMatrix[B][Cb] = (double)(1 - Kb) / 0.5; -+ -+ studioCSCMatrix[R][Cr] = (double)(1 - Kr) / 0.5; -+ studioCSCMatrix[G][Cr] = (double)-2 * Kr * (1 - Kr) / Kg; -+ studioCSCMatrix[B][Cr] = 0.0; -+ -+ studioCSCMatrix[R][C] = (double)-1 * studioCSCMatrix[R][Cr] * CDZ/EXC; -+ studioCSCMatrix[G][C] = (double)-1 * (studioCSCMatrix[G][Cb] + studioCSCMatrix[G][Cr]) * CDZ/EXC; -+ studioCSCMatrix[B][C] = (double)-1 * studioCSCMatrix[B][Cb] * CDZ/EXC; -+ -+ return true; -+} -+ - void CMixer::SetColor() - { - VdpStatus vdp_st; -@@ -1658,9 +1728,19 @@ void CMixer::SetColor() - } - - VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; -- vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -- void const * pm_CSCMatix[] = { &m_CSCMatrix }; -- vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ if (CSettings::Get().GetBool("videoscreen.limitedrange")) -+ { -+ float studioCSC[3][4]; -+ GenerateStudioCSCMatrix(colorStandard, studioCSC); -+ void const * pm_CSCMatix[] = { &studioCSC }; -+ vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ } -+ else -+ { -+ vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -+ void const * pm_CSCMatix[] = { &m_CSCMatrix }; -+ vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ } - - CheckStatus(vdp_st, __LINE__); - } --- -1.8.1.6 - - -From 4b7e68462033d60522677cb8abd3472ffe0734f0 Mon Sep 17 00:00:00 2001 +From 760abbbfdd0f77c63adb22d4ea3cf2950cf4ce2c Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 12:14:15 +0200 -Subject: [PATCH 012/110] linuxrenderer: drop method RenderMultiPass +Subject: [PATCH 028/111] linuxrenderer: drop method RenderMultiPass --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 9 ++------- @@ -7309,10 +7620,10 @@ Subject: [PATCH 012/110] linuxrenderer: drop method RenderMultiPass 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 388d778..e8ae9df 100644 +index 42b47e5..daadcd6 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1218,7 +1218,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1212,7 +1212,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) break; case RQ_MULTIPASS: @@ -7322,7 +7633,7 @@ index 388d778..e8ae9df 100644 VerifyGLState(); break; } -@@ -1350,12 +1351,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1335,12 +1336,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -7336,10 +7647,10 @@ index 388d778..e8ae9df 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index fdda2ed..1a3a6cf 100644 +index 8daf72c..b086bae 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -218,7 +218,6 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -217,7 +217,6 @@ class CLinuxRendererGL : public CBaseRenderer void CalculateTextureSourceRects(int source, int num_planes); // renderers @@ -7351,21 +7662,21 @@ index fdda2ed..1a3a6cf 100644 1.8.1.6 -From b92169b126e26347156b617be5c7c7ac7a9ed191 Mon Sep 17 00:00:00 2001 +From 81ca23124841b2f9c0be794f71449f6d7ed60e7a Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 13:20:47 +0200 -Subject: [PATCH 013/110] linuxrenderer: implement progressive weave for vdpau +Subject: [PATCH 029/111] linuxrenderer: implement progressive weave for vdpau --- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 55 +++++++++++++++++++-------- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 56 +++++++++++++++++++-------- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 4 +- - 2 files changed, 41 insertions(+), 18 deletions(-) + 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index e8ae9df..6807df7 100644 +index daadcd6..1dbb670 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -702,18 +702,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -698,18 +698,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -7384,7 +7695,7 @@ index e8ae9df..6807df7 100644 else Render(flags, index); -@@ -1213,13 +1201,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1207,13 +1195,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) { case RQ_LOW: case RQ_SINGLEPASS: @@ -7409,7 +7720,7 @@ index e8ae9df..6807df7 100644 VerifyGLState(); break; } -@@ -1351,7 +1347,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1336,7 +1332,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -7418,7 +7729,7 @@ index e8ae9df..6807df7 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; -@@ -1453,6 +1449,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) +@@ -1438,6 +1434,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) } m_fbo.width *= planes[0].pixpertex_x; m_fbo.height *= planes[0].pixpertex_y; @@ -7427,15 +7738,16 @@ index e8ae9df..6807df7 100644 // 1st Pass to video frame size glBegin(GL_QUADS); -@@ -1571,6 +1569,31 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1556,6 +1554,32 @@ void CLinuxRendererGL::RenderFromFBO() VerifyGLState(); } +void CLinuxRendererGL::RenderProgressiveWeave(int index, int field) +{ -+ bool scaleUp = (int)m_sourceHeight < g_graphicsContext.GetHeight() || (int)m_sourceWidth < g_graphicsContext.GetWidth(); ++ bool scale = (int)m_sourceHeight != m_destRect.Height() || ++ (int)m_sourceWidth != m_destRect.Width(); + -+ if (m_fbo.fbo.IsSupported() && (scaleUp || m_renderQuality == RQ_MULTIPASS)) ++ if (m_fbo.fbo.IsSupported() && (scale || m_renderQuality == RQ_MULTIPASS)) + { + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_weave); @@ -7460,10 +7772,10 @@ index e8ae9df..6807df7 100644 { #ifdef HAVE_LIBVDPAU diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 1a3a6cf..258a598 100644 +index b086bae..966733e 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -218,12 +218,12 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -217,12 +217,12 @@ class CLinuxRendererGL : public CBaseRenderer void CalculateTextureSourceRects(int source, int num_planes); // renderers @@ -7482,250 +7794,10 @@ index 1a3a6cf..258a598 100644 1.8.1.6 -From 43a1ea8a43bc950f3f60bdeb02adf0d2a117273f Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Thu, 28 Mar 2013 10:38:37 +0100 -Subject: [PATCH 014/110] VDPAU: silence compiler warnings - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 19 ++++++++----------- - 1 file changed, 8 insertions(+), 11 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 62cd72e..a0ccd9f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -252,7 +252,7 @@ long CDecoder::Release() - } - } - } -- IHardwareDecoder::Release(); -+ return IHardwareDecoder::Release(); - } - - long CDecoder::ReleasePicReference() -@@ -1426,8 +1426,8 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg) - - void CMixer::Process() - { -- Message *msg; -- Protocol *port; -+ Message *msg = NULL; -+ Protocol *port = NULL; - bool gotMsg; - - m_state = M_TOP_UNCONFIGURED; -@@ -1532,7 +1532,6 @@ void CMixer::CreateVdpauMixer() - - void CMixer::InitCSCMatrix(int Width) - { -- VdpStatus vdp_st; - m_Procamp.struct_version = VDP_PROCAMP_VERSION; - m_Procamp.brightness = 0.0; - m_Procamp.contrast = 1.0; -@@ -2663,8 +2662,8 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) - - void COutput::Process() - { -- Message *msg; -- Protocol *port; -+ Message *msg = NULL; -+ Protocol *port = NULL; - bool gotMsg; - - m_state = O_TOP_UNCONFIGURED; -@@ -2875,7 +2874,6 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() - pixmap->DVDPic = pic.DVDPic; - pixmap->id = i; - m_bufferPool.notVisiblePixmaps.push_back(pixmap); -- VdpStatus vdp_st; - m_config.vdpProcs.vdp_presentation_queue_display(pixmap->vdp_flip_queue, - pixmap->surface,0,0,0); - } -@@ -3033,7 +3031,7 @@ bool COutput::EnsureBufferPool() - { - // create pixmpas - VdpauBufferPool::Pixmaps pixmap; -- int numPixmaps = NUM_RENDER_PICS; -+ unsigned int numPixmaps = NUM_RENDER_PICS; - for (unsigned int i = 0; i < numPixmaps; i++) - { - pixmap.pixmap = None; -@@ -3287,7 +3285,7 @@ void COutput::GLMapSurfaces() - if (m_config.videoSurfaces->size() != m_bufferPool.glVideoSurfaceMap.size()) - { - CSingleLock lock(*m_config.videoSurfaceSec); -- for (int i = 0; i < m_config.videoSurfaces->size(); i++) -+ for (unsigned int i = 0; i < m_config.videoSurfaces->size(); i++) - { - if ((*m_config.videoSurfaces)[i]->surface == VDP_INVALID_HANDLE) - continue; -@@ -3335,7 +3333,7 @@ void COutput::GLMapSurfaces() - if (m_bufferPool.glOutputSurfaceMap.size() != m_bufferPool.numOutputSurfaces) - { - VdpauBufferPool::GLVideoSurface glSurface; -- for (int i=m_bufferPool.glOutputSurfaceMap.size(); i -Date: Mon, 25 Feb 2013 08:47:10 +0100 -Subject: [PATCH 015/110] vdpau: release more resources on pre-cleanup - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 72 +++++++++++++++++++++++--- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 2 + - 2 files changed, 68 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index a0ccd9f..89ffc6e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1170,6 +1170,11 @@ void CMixer::Dispose() - m_dataPort.Purge(); - } - -+bool CMixer::IsActive() -+{ -+ return IsRunning(); -+} -+ - void CMixer::OnStartup() - { - CLog::Log(LOGNOTICE, "CMixer::OnStartup: Output Thread created"); -@@ -2559,6 +2564,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) - return; - case COutputControlProtocol::PRECLEANUP: - Flush(); -+ PreCleanup(); - msg->Reply(COutputControlProtocol::ACC); - return; - default: -@@ -2765,15 +2771,18 @@ bool COutput::Uninit() - - void COutput::Flush() - { -- Message *reply; -- if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, -+ if (m_mixer.IsActive()) -+ { -+ Message *reply; -+ if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, - &reply, - 2000)) -- { -- reply->Release(); -+ { -+ reply->Release(); -+ } -+ else -+ CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); - } -- else -- CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); - - Message *msg; - while (m_mixer.m_dataPort.ReceiveInMessage(&msg)) -@@ -3111,6 +3120,57 @@ void COutput::ReleaseBufferPool() - } - } - -+void COutput::PreCleanup() -+{ -+ -+ VdpStatus vdp_st; -+ -+ m_mixer.Dispose(); -+ -+ CSingleLock lock(m_bufferPool.renderPicSec); -+ for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) -+ { -+ if (m_bufferPool.outputSurfaces[i] == VDP_INVALID_HANDLE) -+ continue; -+ -+ // check if output surface is in use -+ bool used = false; -+ std::deque::iterator it; -+ for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) -+ { -+ if (((*it)->sourceIdx == m_bufferPool.outputSurfaces[i]) && (*it)->valid) -+ { -+ used = true; -+ break; -+ } -+ } -+ if (used) -+ continue; -+ -+#ifdef GL_NV_vdpau_interop -+ // unmap surface -+ std::map::iterator it_map; -+ it_map = m_bufferPool.glOutputSurfaceMap.find(m_bufferPool.outputSurfaces[i]); -+ if (it_map == m_bufferPool.glOutputSurfaceMap.end()) -+ { -+ CLog::Log(LOGERROR, "%s - could not find gl surface", __FUNCTION__); -+ continue; -+ } -+ glVDPAUUnregisterSurfaceNV(it_map->second.glVdpauSurface); -+ glDeleteTextures(1, it_map->second.texture); -+ m_bufferPool.glOutputSurfaceMap.erase(it_map); -+#endif -+ -+ vdp_st = m_config.vdpProcs.vdp_output_surface_destroy(m_bufferPool.outputSurfaces[i]); -+ CheckStatus(vdp_st, __LINE__); -+ -+ m_bufferPool.outputSurfaces[i] = VDP_INVALID_HANDLE; -+ -+ CLog::Log(LOGDEBUG, "VDPAU::PreCleanup - released output surface"); -+ } -+ -+} -+ - void COutput::InitMixer() - { - for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index 674571b..c0835cf 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -@@ -286,6 +286,7 @@ class CMixer : private CThread - virtual ~CMixer(); - void Start(); - void Dispose(); -+ bool IsActive(); - CMixerControlProtocol m_controlPort; - CMixerDataProtocol m_dataPort; - protected: -@@ -454,6 +455,7 @@ class COutput : private CThread - bool DestroyGlxContext(); - bool EnsureBufferPool(); - void ReleaseBufferPool(); -+ void PreCleanup(); - void InitMixer(); - bool GLInit(); - void GLMapSurfaces(); --- -1.8.1.6 - - -From dd49526d8216e4544ec56101f62f85a5b92ee2e0 Mon Sep 17 00:00:00 2001 +From d02fb09931eb70af6b1f7ee4ecd18af7420af1e1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 6 Mar 2013 07:35:10 +0100 -Subject: [PATCH 016/110] vdpau: set deinterlacing method to auto, if default +Subject: [PATCH 030/111] vdpau: set deinterlacing method to auto, if default method not supported --- @@ -7733,10 +7805,10 @@ Subject: [PATCH 016/110] vdpau: set deinterlacing method to auto, if default 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 89ffc6e..b23f530 100644 +index 7a9dfc9..a2e2ab9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2195,13 +2195,15 @@ void CMixer::InitCycle() +@@ -2189,13 +2189,15 @@ void CMixer::InitCycle() } else { @@ -7757,58 +7829,1236 @@ index 89ffc6e..b23f530 100644 1.8.1.6 -From c5785dcbd029102df0e3bcd0e3ef071105ed6954 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 21 Apr 2013 09:19:34 +0200 -Subject: [PATCH 017/110] vdpau: fix deadlock if decoder is closed while - refresh rate changes +From 4d3cf498b807eb38f21e2a4907a5f82ea7f8e21a Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 14 Jun 2013 09:23:22 +0200 +Subject: [PATCH 031/111] vdpau: calculate timestamp of second field when doing + deinterlacing --- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index b23f530..2fdcf37 100644 +index a2e2ab9..3dd6343 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -183,6 +183,8 @@ void CDecoder::Close() - { - CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__); +@@ -2312,7 +2312,9 @@ void CMixer::ProcessPicture() + futu_surfaces[0] = m_mixerInput[1].render->surface; + futu_surfaces[1] = m_mixerInput[1].render->surface; -+ g_Windowing.Unregister(this); -+ - CSingleLock lock(m_DecoderSection); +- m_processPicture.DVDPic.pts = DVD_NOPTS_VALUE; ++ m_processPicture.DVDPic.pts = m_mixerInput[1].DVDPic.pts + ++ (m_mixerInput[0].DVDPic.pts - ++ m_mixerInput[1].DVDPic.pts) / 2; + m_processPicture.DVDPic.dts = DVD_NOPTS_VALUE; + } + m_processPicture.DVDPic.iRepeatPicture = 0.0; +-- +1.8.1.6 + + +From ca6eb6900dca7e7d1ae074847b8f2c33460f844e Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 2 Aug 2013 13:57:47 +0200 +Subject: [PATCH 032/111] vdpau: comment some features that will be added later + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index 3dd6343..e73b059 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -929,7 +929,8 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + m_bufferStats.IncDecoded(); + m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); - FiniVDPAUOutput(); -@@ -204,13 +206,6 @@ void CDecoder::Close() - m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); +- m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); ++ //TODO ++ // m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); + } + + int retval = 0; +@@ -984,7 +985,8 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + msg->Release(); + } + +- if ((m_codecControl & DVP_FLAG_DRAIN)) ++ // TODO ++ if (1) //(m_codecControl & DVP_FLAG_DRAIN)) + { + if (decoded + processed + render < 4) + { +@@ -2131,7 +2133,8 @@ void CMixer::InitCycle() + int flags; + m_config.stats->GetParams(latency, flags); + latency = (latency*1000)/CurrentHostFrequency(); +- if (flags & DVP_FLAG_NO_POSTPROC) ++ // TODO ++ if (0) //flags & DVP_FLAG_NO_POSTPROC) + SetPostProcFeatures(false); + else + SetPostProcFeatures(true); +@@ -2142,7 +2145,8 @@ void CMixer::InitCycle() + EINTERLACEMETHOD method = GetDeinterlacingMethod(); + bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; + +- if (!(flags & DVP_FLAG_NO_POSTPROC) && ++ // TODO ++ if (//!(flags & DVP_FLAG_NO_POSTPROC) && + (mode == VS_DEINTERLACEMODE_FORCE || + (mode == VS_DEINTERLACEMODE_AUTO && interlaced))) + { +@@ -2164,7 +2168,8 @@ void CMixer::InitCycle() + m_config.stats->SetCanSkipDeint(true); + } + +- if (m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) ++ // TODO ++ if (0) //m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) + { + m_mixersteps = 1; + } +-- +1.8.1.6 + + +From 035e6b2965408d1bed9decb1c4883d2b6c52d3c3 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Tue, 6 Aug 2013 10:37:37 +0200 +Subject: [PATCH 033/111] renderer: protect against div by zero + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index 1dbb670..fb065ea 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -445,6 +445,13 @@ void CLinuxRendererGL::CalculateTextureSourceRects(int source, int num_planes) + p.rect.y2 /= 1 << im->cshift_y; + } + ++ // protect against division by zero ++ if (p.texheight == 0 || p.texwidth == 0 || ++ p.pixpertex_x == 0 || p.pixpertex_y == 0) ++ { ++ continue; ++ } ++ + p.height /= p.pixpertex_y; + p.rect.y1 /= p.pixpertex_y; + p.rect.y2 /= p.pixpertex_y; +-- +1.8.1.6 + + +From 1b6c3ea6e6a258598bb3594266b2a50b008f9367 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 9 Aug 2013 09:52:46 +0200 +Subject: [PATCH 034/111] vdpau: add fence for detecting when a buffer can be + reused + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 11 ++ + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 155 +++++++++++++++++++++++-- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 8 +- + 3 files changed, 161 insertions(+), 13 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index fb065ea..7bfd892 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -1245,6 +1245,17 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) + RenderSoftware(renderBuffer, m_currentField); + VerifyGLState(); + } ++ ++#ifdef HAVE_LIBVDPAU ++ if (m_format == RENDER_FMT_VDPAU || m_format == RENDER_FMT_VDPAU_420) ++ { ++ YUVBUFFER &buf = m_buffers[renderBuffer]; ++ if (buf.vdpau) ++ { ++ buf.vdpau->Sync(); ++ } ++ } ++#endif + } + + void CLinuxRendererGL::RenderSinglePass(int index, int field) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index e73b059..7f0fbd0 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -1135,6 +1135,23 @@ void CVdpauRenderPicture::ReturnUnused() + if (vdpau) + vdpau->ReturnRenderPicture(this); + } ++ ++void CVdpauRenderPicture::Sync() ++{ ++#ifdef GL_ARB_sync ++ CSingleLock lock(renderPicSection); ++ if (usefence) ++ { ++ if(glIsSync(fence)) ++ { ++ glDeleteSync(fence); ++ fence = None; ++ } ++ fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); ++ } ++#endif ++} ++ + //----------------------------------------------------------------------------- + // Mixer + //----------------------------------------------------------------------------- +@@ -2516,7 +2533,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + case COutputDataProtocol::RETURNPIC: + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + return; + default: + break; +@@ -2607,7 +2624,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + case COutputDataProtocol::RETURNPIC: + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + m_controlPort.SendInMessage(COutputControlProtocol::STATS); + m_state = O_TOP_CONFIGURED_WORK; + m_extTimeout = 0; +@@ -2639,6 +2656,10 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + switch (signal) + { + case COutputControlProtocol::TIMEOUT: ++ if (ProcessSyncPicture()) ++ m_extTimeout = 10; ++ else ++ m_extTimeout = 100; + return; + default: + break; +@@ -2830,7 +2851,7 @@ void COutput::Flush() + { + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + } + msg->Release(); + } +@@ -2841,7 +2862,7 @@ void COutput::Flush() + { + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + } + } + +@@ -2969,7 +2990,7 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() + return retPic; + } + +-void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) ++void COutput::QueueReturnPicture(CVdpauRenderPicture *pic) + { + std::deque::iterator it; + for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) +@@ -2982,17 +3003,84 @@ void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) + + if (it == m_bufferPool.usedRenderPics.end()) + { +- CLog::Log(LOGWARNING, "COutput::ProcessReturnPicture - pic not found"); ++ CLog::Log(LOGWARNING, "COutput::QueueReturnPicture - pic not found"); + return; + } +- m_bufferPool.freeRenderPics.push_back(*it); +- m_bufferPool.usedRenderPics.erase(it); +- if (!pic->valid) ++ ++ // check if already queued ++ std::deque::iterator it2 = find(m_bufferPool.syncRenderPics.begin(), ++ m_bufferPool.syncRenderPics.end(), ++ *it); ++ if (it2 == m_bufferPool.syncRenderPics.end()) + { +- CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); +- return; ++ m_bufferPool.syncRenderPics.push_back(*it); + } + ++ ProcessSyncPicture(); ++} ++ ++bool COutput::ProcessSyncPicture() ++{ ++ CVdpauRenderPicture *pic; ++ bool busy = false; ++ ++ std::deque::iterator it; ++ for (it = m_bufferPool.syncRenderPics.begin(); it != m_bufferPool.syncRenderPics.end(); ) ++ { ++ pic = m_bufferPool.allRenderPics[*it]; ++ ++#ifdef GL_ARB_sync ++ if (pic->usefence) ++ { ++ if (glIsSync(pic->fence)) ++ { ++ GLint state; ++ GLsizei length; ++ glGetSynciv(pic->fence, GL_SYNC_STATUS, 1, &length, &state); ++ if(state == GL_SIGNALED) ++ { ++ glDeleteSync(pic->fence); ++ pic->fence = None; ++ } ++ else ++ { ++ busy = true; ++ ++it; ++ continue; ++ } ++ } ++ } ++#endif ++ ++ m_bufferPool.freeRenderPics.push_back(*it); ++ ++ std::deque::iterator it2 = find(m_bufferPool.usedRenderPics.begin(), ++ m_bufferPool.usedRenderPics.end(), ++ *it); ++ if (it2 == m_bufferPool.usedRenderPics.end()) ++ { ++ CLog::Log(LOGERROR, "COutput::ProcessSyncPicture - pic not found in queue"); ++ } ++ else ++ { ++ m_bufferPool.usedRenderPics.erase(it2); ++ } ++ it = m_bufferPool.syncRenderPics.erase(it); ++ ++ if (pic->valid) ++ { ++ ProcessReturnPicture(pic); ++ } ++ else ++ { ++ CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); ++ } ++ } ++ return busy; ++} ++ ++void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) ++{ + if (m_config.usePixmaps) + { + m_bufferPool.pixmaps[pic->sourceIdx].used = false; +@@ -3141,10 +3229,43 @@ void COutput::ReleaseBufferPool() + } + m_bufferPool.outputSurfaces.clear(); + ++ // wait for all fences ++ XbmcThreads::EndTime timeout(1000); ++ for (int i = 0; i < m_bufferPool.allRenderPics.size(); i++) ++ { ++ CVdpauRenderPicture *pic = m_bufferPool.allRenderPics[i]; ++ if (pic->usefence) ++ { ++#ifdef GL_ARB_sync ++ while (glIsSync(pic->fence)) ++ { ++ GLint state; ++ GLsizei length; ++ glGetSynciv(pic->fence, GL_SYNC_STATUS, 1, &length, &state); ++ if(state == GL_SIGNALED || timeout.IsTimePast()) ++ { ++ glDeleteSync(pic->fence); ++ } ++ else ++ { ++ Sleep(5); ++ } ++ } ++ pic->fence = None; ++#endif ++ } ++ } ++ if (timeout.IsTimePast()) ++ { ++ CLog::Log(LOGERROR, "COutput::%s - timeout waiting for fence", __FUNCTION__); ++ } ++ ProcessSyncPicture(); ++ + // invalidate all used render pictures + for (unsigned int i = 0; i < m_bufferPool.usedRenderPics.size(); ++i) + { +- m_bufferPool.allRenderPics[m_bufferPool.usedRenderPics[i]]->valid = false; ++ CVdpauRenderPicture *pic = m_bufferPool.allRenderPics[m_bufferPool.usedRenderPics[i]]; ++ pic->valid = false; + } + } + +@@ -3154,6 +3275,7 @@ void COutput::PreCleanup() + VdpStatus vdp_st; + + m_mixer.Dispose(); ++ ProcessSyncPicture(); + + CSingleLock lock(m_bufferPool.renderPicSec); + for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) +@@ -3360,6 +3482,15 @@ bool COutput::GLInit() + CLog::Log(LOGNOTICE, "VDPAU::COutput: vdpau gl interop initialized"); + } + #endif ++ ++#ifdef GL_ARB_sync ++ bool hasfence = glewIsSupported("GL_ARB_sync"); ++ for (unsigned int i = 0; i < m_bufferPool.allRenderPics.size(); i++) ++ { ++ m_bufferPool.allRenderPics[i]->usefence = hasfence; ++ } ++#endif ++ + return true; + } + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +index 8845a16..c555d2d 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +@@ -224,7 +224,8 @@ class CVdpauRenderPicture + friend class COutput; + public: + CVdpauRenderPicture(CCriticalSection §ion) +- : renderPicSection(section), refCount(0) {} ++ : renderPicSection(section), refCount(0) { fence = None; } ++ void Sync(); + DVDVideoPicture DVDPic; + int texWidth, texHeight; + CRect crop; +@@ -236,6 +237,8 @@ class CVdpauRenderPicture + long Release(); + private: + void ReturnUnused(); ++ bool usefence; ++ GLsync fence; + int refCount; + CCriticalSection &renderPicSection; + }; +@@ -391,6 +394,7 @@ struct VdpauBufferPool + std::queue processedPics; + std::deque usedRenderPics; + std::deque freeRenderPics; ++ std::deque syncRenderPics; + CCriticalSection renderPicSec; + }; + +@@ -450,7 +454,9 @@ class COutput : private CThread + void StateMachine(int signal, Protocol *port, Message *msg); + bool HasWork(); + CVdpauRenderPicture *ProcessMixerPicture(); ++ void QueueReturnPicture(CVdpauRenderPicture *pic); + void ProcessReturnPicture(CVdpauRenderPicture *pic); ++ bool ProcessSyncPicture(); + int FindFreePixmap(); + bool Init(); + bool Uninit(); +-- +1.8.1.6 + + +From 522296f5fccdd7297e30a97dbb9ebe83f05a8236 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Mon, 28 May 2012 10:34:39 +0200 +Subject: [PATCH 035/111] videoplayer: adapt lateness detection and dropping to + buffering + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 16 +- + xbmc/cores/VideoRenderers/RenderManager.h | 12 +- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 15 +- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 31 ++++ + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 194 +++++++++++++++++---- + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ + 7 files changed, 260 insertions(+), 38 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index fbc2aae..ae610ca 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -299,6 +299,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + m_bIsStarted = true; + m_bReconfigured = true; + m_presentstep = PRESENT_IDLE; ++ m_presentpts = DVD_NOPTS_VALUE; ++ m_sleeptime = 1.0; + m_presentevent.notifyAll(); + + m_firstFlipPage = false; // tempfix +@@ -640,7 +642,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) + m_pRenderer->SetViewMode(iViewMode); + } + +-void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) ++void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, double pts /* = 0 */, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) + { + { CSharedLock lock(m_sharedSection); + +@@ -708,6 +710,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + m.timestamp = timestamp; + m.presentfield = sync; + m.presentmethod = presentmethod; ++ m.pts = pts; + requeue(m_queued, m_free); + + /* signal to any waiters to check state */ +@@ -1072,6 +1075,8 @@ void CXBMCRenderManager::PrepareNextRender() + m_discard.push_back(m_presentsource); + m_presentsource = idx; + m_queued.pop_front(); ++ m_sleeptime = m_Queue[idx].timestamp - clocktime; ++ m_presentpts = m_Queue[idx].pts; + m_presentevent.notifyAll(); + } + } +@@ -1088,3 +1093,12 @@ void CXBMCRenderManager::DiscardBuffer() + m_presentstep = PRESENT_IDLE; + m_presentevent.notifyAll(); + } ++ ++bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) ++{ ++ CSingleLock lock(m_presentlock); ++ sleeptime = m_sleeptime; ++ pts = m_presentpts; ++ bufferLevel = m_queued.size() + m_discard.size(); ++ return true; ++} +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index 28596cf..befd851 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -97,10 +97,11 @@ class CXBMCRenderManager + * + * @param bStop reference to stop flag of calling thread + * @param timestamp of frame delivered with AddVideoPicture ++ * @param pts used for lateness detection + * @param source depreciated + * @param sync signals frame, top, or bottom field + */ +- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); ++ void FlipPage(volatile bool& bStop, double timestamp = 0.0, double pts = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); + unsigned int PreInit(); + void UnInit(); + bool Flush(); +@@ -175,6 +176,12 @@ class CXBMCRenderManager + int WaitForBuffer(volatile bool& bStop, int timeout = 100); + + /** ++ * Can be called by player for lateness detection. This is done best by ++ * looking at the end of the queue. ++ */ ++ bool GetStats(double &sleeptime, double &pts, int &bufferLevel); ++ ++ /** + * Video player call this on flush in oder to discard any queued frames + */ + void DiscardBuffer(); +@@ -221,6 +228,7 @@ class CXBMCRenderManager + + struct SPresent + { ++ double pts; + double timestamp; + EFIELDSYNC presentfield; + EPRESENTMETHOD presentmethod; +@@ -232,6 +240,8 @@ class CXBMCRenderManager + + ERenderFormat m_format; + ++ double m_sleeptime; ++ double m_presentpts; + double m_presentcorr; + double m_presenterr; + double m_errorbuff[ERRORBUFFSIZE]; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +index 87edaa5..eaac7fd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -117,6 +117,10 @@ struct DVDVideoUserData + #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped + #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data + ++#define DVP_FLAG_DROPDEINT 0x00000040 // indicate that this picture was requested to have been dropped in deint stage ++#define DVP_FLAG_NO_POSTPROC 0x00000100 ++#define DVP_FLAG_DRAIN 0x00000200 ++ + // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! + + #define DVP_QSCALE_UNKNOWN 0 +@@ -134,6 +138,9 @@ struct DVDVideoUserData + #define VC_PICTURE 0x00000004 // the decoder got a picture, call Decode(NULL, 0) again to parse the rest of the data + #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data + #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again ++#define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped ++#define VC_HURRY 0x00000040 ++ + class CDVDVideoCodec + { + public: +@@ -251,10 +258,16 @@ class CDVDVideoCodec + return 0; } -- g_Windowing.Unregister(this); - -- if (m_hwContext.bitstream_buffers_allocated) + /** + * Number of references to old pictures that are allowed to + * be retained when calling decode on the next demux packet + */ + virtual unsigned GetAllowedReferences() { return 0; } ++ ++ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) ++ { ++ return false; ++ } ++ ++ virtual void SetCodecControl(int flags) {} + }; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 143675a..b53c17a 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -167,6 +167,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx + m_iLastKeyframe = 0; + m_dts = DVD_NOPTS_VALUE; + m_started = false; ++ m_decoderPts = DVD_NOPTS_VALUE; + } + + CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg() +@@ -353,6 +354,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) + { + if( m_pCodecContext ) + { ++ if (bDrop && m_pHardware && m_pHardware->CanSkipDeint()) ++ { ++ m_requestSkipDeint = true; ++ bDrop = false; ++ } ++ else ++ m_requestSkipDeint = false; ++ + // i don't know exactly how high this should be set + // couldn't find any good docs on it. think it varies + // from codec to codec on what it does +@@ -554,6 +563,7 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p + void CDVDVideoCodecFFmpeg::Reset() + { + m_started = false; ++ m_decoderPts = DVD_NOPTS_VALUE; + m_iLastKeyframe = m_pCodecContext->has_b_frames; + m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext); + +@@ -663,6 +673,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + else + pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + ++ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) ++ m_decoderPts = pDvdVideoPicture->pts; ++ else ++ m_decoderPts = m_dts; ++ ++ if (m_requestSkipDeint) ++ { ++ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; ++ m_skippedDeint = 1; ++ } ++ else ++ m_skippedDeint = 0; ++ ++ m_requestSkipDeint = false; ++ pDvdVideoPicture->iFlags |= m_codecControlFlags; ++ + if(!m_started) + pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; + +@@ -924,3 +950,8 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() + else + return 0; + } ++ ++void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) ++{ ++ m_codecControlFlags = flags; ++} +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +index 2287031..8376f72 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -45,6 +45,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual int Check (AVCodecContext* avctx) = 0; + virtual void Reset () {} + virtual unsigned GetAllowedReferences() { return 0; } ++ virtual bool CanSkipDeint() {return false; } + virtual const std::string Name() = 0; + virtual CCriticalSection* Section() { return NULL; } + }; +@@ -62,6 +63,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open + virtual unsigned GetConvergeCount(); + virtual unsigned GetAllowedReferences(); ++ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} ++ virtual void SetCodecControl(int flags); + + bool IsHardwareAllowed() { return !m_bSoftware; } + IHardwareDecoder * GetHardware() { return m_pHardware; }; +@@ -127,4 +130,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + double m_dts; + bool m_started; + std::vector m_formats; ++ double m_decoderPts, m_decoderInterval; ++ int m_skippedDeint; ++ bool m_requestSkipDeint; ++ int m_codecControlFlags; + }; +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index d35751c..487ca01 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -39,6 +39,7 @@ + #include "DVDCodecs/DVDCodecs.h" + #include "DVDCodecs/Overlay/DVDOverlayCodecCC.h" + #include "DVDCodecs/Overlay/DVDOverlaySSA.h" ++#include "guilib/GraphicContext.h" + #include + #include + #include +@@ -323,8 +324,10 @@ void CDVDPlayerVideo::Process() + + int iDropped = 0; //frames dropped in a row + bool bRequestDrop = false; ++ int iDropDirective; + + m_videoStats.Start(); ++ m_droppingStats.Reset(); + + while (!m_bStop) + { +@@ -434,6 +437,7 @@ void CDVDPlayerVideo::Process() + picture.iFlags &= ~DVP_FLAG_ALLOCATED; + m_packets.clear(); + m_started = false; ++ m_droppingStats.Reset(); + } + else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) + { +@@ -446,6 +450,7 @@ void CDVDPlayerVideo::Process() + //we need to recalculate the framerate + //TODO: this needs to be set on a streamchange instead + ResetFrameRateCalc(); ++ m_droppingStats.Reset(); + + m_stalled = true; + m_started = false; +@@ -463,8 +468,10 @@ void CDVDPlayerVideo::Process() + m_speed = static_cast(pMsg)->m_value; + if(m_speed == DVD_PLAYSPEED_PAUSE) + m_iNrOfPicturesNotToSkip = 0; ++ + if (m_pVideoCodec) + m_pVideoCodec->SetSpeed(m_speed); ++ m_droppingStats.Reset(); + } + else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) + { +@@ -510,6 +517,28 @@ void CDVDPlayerVideo::Process() + m_iNrOfPicturesNotToSkip = 1; + } + ++ bRequestDrop = false; ++ iDropDirective = CalcDropRequirement(pts); ++ if (iDropDirective & EOS_VERYLATE) ++ { ++ if (m_bAllowDrop) ++ { ++ m_pullupCorrection.Flush(); ++ bRequestDrop = true; ++ } ++ } ++ int codecControl = 0; ++ if (iDropDirective & EOS_BUFFER_LEVEL) ++ codecControl |= DVP_FLAG_DRAIN; ++ if (m_speed > DVD_PLAYSPEED_NORMAL) ++ codecControl |= DVP_FLAG_NO_POSTPROC; ++ m_pVideoCodec->SetCodecControl(codecControl); ++ if (iDropDirective & EOS_DROPPED) ++ { ++ m_iDroppedFrames++; ++ iDropped++; ++ } ++ + if (m_messageQueue.GetDataSize() == 0 + || m_speed < 0) + { +@@ -562,15 +591,7 @@ void CDVDPlayerVideo::Process() + } + + m_videoStats.AddSampleBytes(pPacket->iSize); +- // assume decoder dropped a picture if it didn't give us any +- // picture from a demux packet, this should be reasonable +- // for libavformat as a demuxer as it normally packetizes +- // pictures when they come from demuxer +- if(bRequestDrop && !bPacketDrop && (iDecoderState & VC_BUFFER) && !(iDecoderState & VC_PICTURE)) +- { +- m_iDroppedFrames++; +- iDropped++; +- } ++ + // reset the request, the following while loop may break before + // setting the flag to a new value + bRequestDrop = false; +@@ -1182,33 +1203,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + m_FlipTimeStamp += max(0.0, iSleepTime); + m_FlipTimeStamp += iFrameDuration; + +- if (iSleepTime <= 0 && m_speed) +- m_iLateFrames++; +- else +- m_iLateFrames = 0; +- +- // ask decoder to drop frames next round, as we are very late +- if(m_iLateFrames > 10) ++ if ((pPicture->iFlags & DVP_FLAG_DROPPED)) + { +- if (!(pPicture->iFlags & DVP_FLAG_NOSKIP)) +- { +- //if we're calculating the framerate, +- //don't drop frames until we've calculated a stable framerate +- if (m_bAllowDrop || m_speed != DVD_PLAYSPEED_NORMAL) +- { +- result |= EOS_VERYLATE; +- m_pullupCorrection.Flush(); //dropped frames mess up the pattern, so just flush it +- } +- m_iDroppedRequest++; +- } +- } +- else - { -- m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); +- m_iDroppedRequest = 0; - } - - m_dllAvUtil.Unload(); +- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) ++ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); ++ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); + return result | EOS_DROPPED; ++ } + + // set fieldsync if picture is interlaced + EFIELDSYNC mDisplayField = FS_NONE; +@@ -1241,7 +1241,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + if (index < 0) + return EOS_DROPPED; + +- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); ++ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, pts, -1, mDisplayField); + + return result; + #else +@@ -1541,3 +1541,127 @@ void CDVDPlayerVideo::CalcFrameRate() + m_iFrameRateCount = 0; + } } ++ ++int CDVDPlayerVideo::CalcDropRequirement(double pts) ++{ ++ int result = 0; ++ double iSleepTime; ++ double iDecoderPts, iRenderPts; ++ double iInterval; ++ int interlaced; ++ double iGain; ++ double iLateness; ++ bool bNewFrame; ++ int iSkippedDeint = 0; ++ int iBufferLevel; ++ ++ // get decoder stats ++ if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) ++ iDecoderPts = pts; ++ if (iDecoderPts == DVD_NOPTS_VALUE) ++ iDecoderPts = pts; ++ ++ // get render stats ++ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); ++ ++ if (iBufferLevel < 0) ++ result |= EOS_BUFFER_LEVEL; ++ else if (iBufferLevel < 2) ++ { ++ result |= EOS_BUFFER_LEVEL; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - hurry: %d", iBufferLevel); ++ } ++ ++ bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts; ++ ++ if (interlaced) ++ iInterval = 2/m_fFrameRate*(double)DVD_TIME_BASE; ++ else ++ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; ++ ++ if (m_droppingStats.m_lastDecoderPts > 0 ++ && bNewFrame ++ && m_bAllowDrop ++ && m_droppingStats.m_dropRequests > 0) ++ { ++ iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE; ++ if (iSkippedDeint) ++ { ++ CDroppingStats::CGain gain; ++ gain.gain = 1/m_fFrameRate; ++ gain.pts = iDecoderPts; ++ m_droppingStats.m_gain.push_back(gain); ++ m_droppingStats.m_totalGain += gain.gain; ++ result |= EOS_DROPPED; ++ m_droppingStats.m_dropRequests = 0; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: %f, Bufferlevel: %d", iSleepTime, iBufferLevel); ++ } ++ else if (iGain > 1/m_fFrameRate) ++ { ++ CDroppingStats::CGain gain; ++ gain.gain = iGain; ++ gain.pts = iDecoderPts; ++ m_droppingStats.m_gain.push_back(gain); ++ m_droppingStats.m_totalGain += iGain; ++ result |= EOS_DROPPED; ++ m_droppingStats.m_dropRequests = 0; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); ++ } ++ } ++ m_droppingStats.m_lastDecoderPts = iDecoderPts; ++ ++ // subtract gains ++ while (!m_droppingStats.m_gain.empty() && ++ iRenderPts >= m_droppingStats.m_gain.front().pts) ++ { ++ m_droppingStats.m_totalGain -= m_droppingStats.m_gain.front().gain; ++ m_droppingStats.m_gain.pop_front(); ++ } ++ ++ // calculate lateness ++ iLateness = iSleepTime + m_droppingStats.m_totalGain; ++ if (iLateness < 0 && m_speed) ++ { ++ if (bNewFrame) ++ m_droppingStats.m_lateFrames++; ++ ++ // if lateness is smaller than frametime, we observe this state ++ // for 10 cycles ++ if (m_droppingStats.m_lateFrames > 10 || iLateness < -2/m_fFrameRate) ++ { ++ // is frame allowed to skip ++ if (m_iNrOfPicturesNotToSkip <= 0) ++ { ++ result |= EOS_VERYLATE; ++ if (bNewFrame) ++ m_droppingStats.m_dropRequests++; ++ } ++ } ++ } ++ else ++ { ++ m_droppingStats.m_dropRequests = 0; ++ m_droppingStats.m_lateFrames = 0; ++ } ++ m_droppingStats.m_lastRenderPts = iRenderPts; ++ return result; ++} ++ ++void CDroppingStats::Reset() ++{ ++ m_gain.clear(); ++ m_totalGain = 0; ++ m_lastDecoderPts = 0; ++ m_lastRenderPts = 0; ++ m_lateFrames = 0; ++ m_dropRequests = 0; ++} ++ ++void CDroppingStats::AddOutputDropGain(double pts, double frametime) ++{ ++ CDroppingStats::CGain gain; ++ gain.gain = frametime; ++ gain.pts = pts; ++ m_gain.push_back(gain); ++ m_totalGain += frametime; ++} +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +index f8ad541..186e271 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -36,6 +36,25 @@ + + #define VIDEO_PICTURE_QUEUE_SIZE 1 + ++class CDroppingStats ++{ ++public: ++ void Reset(); ++ void AddOutputDropGain(double pts, double frametime); ++ struct CGain ++ { ++ double gain; ++ double pts; ++ }; ++ std::deque m_gain; ++ double m_totalGain; ++ double m_lastDecoderPts; ++ double m_lastRenderPts; ++ unsigned int m_lateFrames; ++ unsigned int m_dropRequests; ++}; ++ ++ + class CDVDPlayerVideo : public CThread + { + public: +@@ -104,6 +123,7 @@ class CDVDPlayerVideo : public CThread + #define EOS_ABORT 1 + #define EOS_DROPPED 2 + #define EOS_VERYLATE 4 ++#define EOS_BUFFER_LEVEL 8 + + void AutoCrop(DVDVideoPicture* pPicture); + void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); +@@ -129,6 +149,7 @@ class CDVDPlayerVideo : public CThread + + void ResetFrameRateCalc(); + void CalcFrameRate(); ++ int CalcDropRequirement(double pts); + + double m_fFrameRate; //framerate of the video currently playing + bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps +@@ -182,5 +203,7 @@ class CDVDPlayerVideo : public CThread + CPullupCorrection m_pullupCorrection; + + std::list m_packets; ++ ++ CDroppingStats m_droppingStats; + }; -- 1.8.1.6 -From a8f89679a150db3f6d9e11dbe214de888b373546 Mon Sep 17 00:00:00 2001 +From 76318b7f4bc0202f545a39563f1f72dc1eeaf5f4 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sun, 2 Sep 2012 16:05:21 +0200 +Subject: [PATCH 036/111] video player: present correct pts to user for a/v + sync (after buffering in renderer) + +--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 25 +++++++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 2 +- + 2 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 487ca01..99c8b3c 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -1461,6 +1461,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() + g_advancedSettings.m_videoFpsDetect == 0; + } + ++double CDVDPlayerVideo::GetCurrentPts() ++{ ++ double iSleepTime, iRenderPts; ++ int iBufferLevel; ++ ++ // get render stats ++ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); ++ ++ if( m_stalled ) ++ iRenderPts = DVD_NOPTS_VALUE; ++ else ++ iRenderPts = iRenderPts - max(0.0, iSleepTime); ++ ++ return iRenderPts; ++} ++ + #define MAXFRAMERATEDIFF 0.01 + #define MAXFRAMESERR 1000 + +@@ -1579,6 +1595,15 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) + else + iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; + ++ ++ m_FlipTimeStamp = m_pClock->GetAbsoluteClock() + max(0.0, iSleepTime) + iInterval; ++ ++ if( m_stalled ) ++ m_iCurrentPts = DVD_NOPTS_VALUE; ++ else ++ m_iCurrentPts = iRenderPts - max(0.0, iSleepTime); ++ ++ + if (m_droppingStats.m_lastDecoderPts > 0 + && bNewFrame + && m_bAllowDrop +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +index 186e271..59c7f09 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -100,7 +100,7 @@ class CDVDPlayerVideo : public CThread + + bool InitializedOutputDevice(); + +- double GetCurrentPts() { return m_iCurrentPts; } ++ double GetCurrentPts(); + int GetPullupCorrection() { return m_pullupCorrection.GetPatternLength(); } + + double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ +-- +1.8.1.6 + + +From 2c978a3390d2cfcd0b728efcb977485b329b6568 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sat, 16 Feb 2013 18:25:53 +0100 +Subject: [PATCH 037/111] videoplayer: some rework and documentation + +--- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 29 ++++++++++++++++++++-- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 11 ++++++++ + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 2 +- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- + 4 files changed, 40 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +index eaac7fd..d358777 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -139,7 +139,6 @@ struct DVDVideoUserData + #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data + #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again + #define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped +-#define VC_HURRY 0x00000040 + + class CDVDVideoCodec + { +@@ -264,10 +263,36 @@ class CDVDVideoCodec + */ + virtual unsigned GetAllowedReferences() { return 0; } + +- virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) ++ /** ++ * For calculation of dropping requirements player asks for some information. ++ * ++ * - pts : right after decoder, used to detect gaps (dropped frames in decoder) ++ * - skippedDeint : indicates if decoder has just skipped a deinterlacing cycle ++ * instead of dropping a full frame ++ * - interlaced : when detecting gaps in pts, player needs to know whether ++ * it's interlaced or not ++ * ++ * If codec does not implement this method, pts of decoded frame at input ++ * video player is used. In case coded does post-proc and de-interlacing there ++ * may be quite some frames queued up between exit decoder and entry player. ++ */ ++ virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced) + { + return false; + } + ++ /** ++ * Codec can be informed by player with the following flags: ++ * ++ * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off ++ * postprocessing and de-interlacing ++ * ++ * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. ++ * If video buffers in RenderManager are about to run dry, ++ * this is signaled to codec. Codec can wait for post-proc ++ * to be finished instead of returning empty and getting another ++ * packet. ++ * ++ */ + virtual void SetCodecControl(int flags) {} + }; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index b53c17a..9f1fc03 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -951,6 +951,17 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() + return 0; + } + ++bool CDVDVideoCodecFFmpeg::GetCodecStats(double &pts, int &skippedDeint, int &interlaced) ++{ ++ pts = m_decoderPts; ++ skippedDeint = m_skippedDeint; ++ if (m_pFrame) ++ interlaced = m_pFrame->interlaced_frame; ++ else ++ interlaced = 0; ++ return true; ++} ++ + void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) + { + m_codecControlFlags = flags; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +index 8376f72..c0ce198 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -63,7 +63,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open + virtual unsigned GetConvergeCount(); + virtual unsigned GetAllowedReferences(); +- virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} ++ virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced); + virtual void SetCodecControl(int flags); + + bool IsHardwareAllowed() { return !m_bSoftware; } +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 99c8b3c..be3d511 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -1572,7 +1572,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) + int iBufferLevel; + + // get decoder stats +- if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) ++ if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iSkippedDeint, interlaced)) + iDecoderPts = pts; + if (iDecoderPts == DVD_NOPTS_VALUE) + iDecoderPts = pts; +-- +1.8.1.6 + + +From d2886a5d3e6a639e828eadc44bcf84f3fd09325b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 1 Jun 2013 11:21:19 +0200 -Subject: [PATCH 018/110] renderer: bump buffers to 5 +Subject: [PATCH 038/111] renderer: bump buffers to 5 --- xbmc/cores/VideoRenderers/BaseRenderer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 6acf2f3..f44024c 100644 +index a61d3cf..df5fe0e 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h @@ -29,7 +29,7 @@ @@ -7824,10 +9074,10 @@ index 6acf2f3..f44024c 100644 1.8.1.6 -From 152844f66eeca185da6982d9e7e66a2ae5a502da Mon Sep 17 00:00:00 2001 +From 5d2b6497e63d417e2547ca9e32a7dcc639c9911c Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 019/110] videoplayer: update frametime, it might change due to +Subject: [PATCH 039/111] videoplayer: update frametime, it might change due to fps detection --- @@ -7835,10 +9085,10 @@ Subject: [PATCH 019/110] videoplayer: update frametime, it might change due to 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 8ed34f9..bc049bd 100644 +index be3d511..dbbd11b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -708,6 +708,8 @@ void CDVDPlayerVideo::Process() +@@ -711,6 +711,8 @@ void CDVDPlayerVideo::Process() int iResult = OutputPicture(&picture, pts); @@ -7851,10 +9101,10 @@ index 8ed34f9..bc049bd 100644 1.8.1.6 -From 4375b9a0c7e7e12f5f7d5d7dfd8319b26c4f1490 Mon Sep 17 00:00:00 2001 +From 7a7479ea9632e37579d09511cdafb936d326b2f0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 020/110] videoplayer: give streams with invalid fps a chance +Subject: [PATCH 040/111] videoplayer: give streams with invalid fps a chance for fps detection --- @@ -7862,10 +9112,10 @@ Subject: [PATCH 020/110] videoplayer: give streams with invalid fps a chance 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bc049bd..21d023e 100644 +index dbbd11b..eb443af 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1500,7 +1500,7 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1503,7 +1503,7 @@ void CDVDPlayerVideo::CalcFrameRate() double frameduration = m_pullupCorrection.GetFrameDuration(); if (frameduration == DVD_NOPTS_VALUE || @@ -7878,10 +9128,10 @@ index bc049bd..21d023e 100644 1.8.1.6 -From a217254277fdd441c31713bcdad816d72263da4e Mon Sep 17 00:00:00 2001 +From 9ba3949b7c7d86ae5d16587d36d954b628a0db24 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 021/110] dvdplayer: allow rewinding at end of stream, do a +Subject: [PATCH 041/111] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -7889,10 +9139,10 @@ Subject: [PATCH 021/110] dvdplayer: allow rewinding at end of stream, do a 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 27e9ff1..1bd122b 100644 +index d12121f..06c9439 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1556,7 +1556,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1559,7 +1559,7 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 @@ -7901,7 +9151,7 @@ index 27e9ff1..1bd122b 100644 && m_SpeedState.lastpts != m_dvdPlayerVideo.GetCurrentPts() && m_SpeedState.lasttime != GetTime()) { -@@ -2222,6 +2222,12 @@ void CDVDPlayer::HandleMessages() +@@ -2225,6 +2225,12 @@ void CDVDPlayer::HandleMessages() pvrinputstream->Pause( speed == 0 ); } @@ -7918,10 +9168,10 @@ index 27e9ff1..1bd122b 100644 1.8.1.6 -From 1e02fb0d7f844b722743ea37f2984f5595b38e3a Mon Sep 17 00:00:00 2001 +From cc9082cea16fe56f6ef2a09349784f0070ca14bc Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:22:05 +0200 -Subject: [PATCH 022/110] X11: ditch SDL for video and window events +Subject: [PATCH 042/111] X11: ditch SDL for video and window events --- xbmc/Application.cpp | 2 +- @@ -7937,10 +9187,10 @@ Subject: [PATCH 022/110] X11: ditch SDL for video and window events create mode 100644 xbmc/windowing/WinEventsX11.h diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index b4fa73b..55a2685 100644 +index 57aa100..92e467d 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -845,7 +845,7 @@ bool CApplication::CreateGUI() +@@ -855,7 +855,7 @@ bool CApplication::CreateGUI() uint32_t sdlFlags = 0; @@ -9405,10 +10655,10 @@ index b6b6ec4..448a1bb 100644 1.8.1.6 -From 629aa294a77faa2a9165909ee7750039d997396e Mon Sep 17 00:00:00 2001 +From 00e253a6d5ac1702d59f5c1616fbc38972e2f68a Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:24:22 +0200 -Subject: [PATCH 023/110] X11: Add xbmc icon +Subject: [PATCH 043/111] X11: Add xbmc icon --- xbmc/windowing/X11/WinSystemX11.cpp | 126 +++++++++++++++++++++++++++++++++++- @@ -9597,10 +10847,10 @@ index 448a1bb..e618268 100644 1.8.1.6 -From aa580c081b65e5697123a70c128c35a32701ec0b Mon Sep 17 00:00:00 2001 +From dff100069b17cc5d595d542da1b0fe69f9ede738 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 14:11:26 +0200 -Subject: [PATCH 024/110] X11: add SDL joystick until we have a better solution +Subject: [PATCH 044/111] X11: add SDL joystick until we have a better solution --- xbmc/windowing/WinEventsX11.cpp | 26 ++++++++++++++++++++++++++ @@ -9654,10 +10904,10 @@ index 5a8bbb8..5bc1de0 100644 1.8.1.6 -From d7ec27990c479ef980236e7a20a40bb8f7be791a Mon Sep 17 00:00:00 2001 +From e57226830ca3639cde456f782c3eeaeb89042cf0 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 12:35:55 +0200 -Subject: [PATCH 025/110] X11: factor out code handling device reset +Subject: [PATCH 045/111] X11: factor out code handling device reset notification --- @@ -9721,10 +10971,10 @@ index e618268..c4d4b76 100644 1.8.1.6 -From 7a15d6da19afaa671225156f8364b289a78ad677 Mon Sep 17 00:00:00 2001 +From c63da366bbbbb77484758d20b4d1008d5b2de2a8 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:02:00 +0200 -Subject: [PATCH 026/110] X11: move xrandr events to WinEventsX11 +Subject: [PATCH 046/111] X11: move xrandr events to WinEventsX11 --- xbmc/windowing/WinEventsX11.cpp | 42 +++++++++++++++++++++++++++++++++++++ @@ -9868,10 +11118,10 @@ index c5938af..9f74dd5 100644 1.8.1.6 -From c3f7dcc65a38d830f80937011e03aa936ab459a8 Mon Sep 17 00:00:00 2001 +From 78313aa1729974e0e3306213ff71b8671b2d4b3b Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 12 Apr 2012 15:43:56 +0200 -Subject: [PATCH 027/110] xrandr: remove method RestoreState +Subject: [PATCH 047/111] xrandr: remove method RestoreState --- xbmc/windowing/X11/WinSystemX11.cpp | 13 +++++++++++-- @@ -9950,10 +11200,10 @@ index 0aec487..00b49dc 100644 1.8.1.6 -From 15e2791c6a56f086182134662fca12e2b6ce7bcc Mon Sep 17 00:00:00 2001 +From d7d3e323aedad05c8f318a4b3dc429175a70873a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 13:17:10 +0200 -Subject: [PATCH 028/110] xrandr: observe orientation +Subject: [PATCH 048/111] xrandr: observe orientation --- xbmc/windowing/X11/WinSystemX11.cpp | 89 ++++++++++++++++++++++++++++++------- @@ -10168,10 +11418,10 @@ index 00b49dc..508604d 100644 1.8.1.6 -From 4211de0e0358648ef50f9449c496757081b7671a Mon Sep 17 00:00:00 2001 +From bc51bb36ca7fbe2626f244767cfd58dc5b22c235 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:54:15 +0200 -Subject: [PATCH 029/110] xrandr: allow getting info for multiple screen's +Subject: [PATCH 049/111] xrandr: allow getting info for multiple screen's Refactored by: Joakim Plate --- @@ -10346,10 +11596,10 @@ index 508604d..d37838a 100644 1.8.1.6 -From 752269938c1f15620b39d7473236252eaf8a9ebf Mon Sep 17 00:00:00 2001 +From 11a6b3ebd99e492bcac8072e2daf114fea33d2c1 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:44:00 +0200 -Subject: [PATCH 030/110] X11: fix multi-head setups +Subject: [PATCH 050/111] X11: fix multi-head setups --- language/English/strings.po | 4 +- @@ -10364,7 +11614,7 @@ Subject: [PATCH 030/110] X11: fix multi-head setups 9 files changed, 229 insertions(+), 116 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index fae2505..ce56914 100644 +index 0e900ad..90fb3fd 100644 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -999,7 +999,9 @@ msgctxt "#245" @@ -10379,10 +11629,10 @@ index fae2505..ce56914 100644 msgctxt "#247" msgid "Scripts" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 56d637d..f99ba9c 100644 +index 04c521d..a0a1a5b 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -1863,6 +1863,15 @@ +@@ -1870,6 +1870,15 @@
@@ -10398,7 +11648,7 @@ index 56d637d..f99ba9c 100644 0 0 -@@ -1884,6 +1893,7 @@ +@@ -1891,6 +1900,7 @@ -1 @@ -10406,7 +11656,7 @@ index 56d637d..f99ba9c 100644 -@@ -1901,6 +1911,7 @@ +@@ -1908,6 +1918,7 @@ -1 @@ -10533,10 +11783,10 @@ index cc4002b..d80f1dc 100644 protected: CDisplaySettings(); diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index c1d6443..1de1ac6 100644 +index 486a26c..dfa3774 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp -@@ -381,6 +381,7 @@ void CSettings::Uninitialize() +@@ -380,6 +380,7 @@ void CSettings::Uninitialize() m_settingsManager->UnregisterSettingOptionsFiller("screens"); m_settingsManager->UnregisterSettingOptionsFiller("stereoscopicmodes"); m_settingsManager->UnregisterSettingOptionsFiller("preferedstereoscopicviewmodes"); @@ -10544,7 +11794,7 @@ index c1d6443..1de1ac6 100644 m_settingsManager->UnregisterSettingOptionsFiller("shutdownstates"); m_settingsManager->UnregisterSettingOptionsFiller("startupwindows"); m_settingsManager->UnregisterSettingOptionsFiller("streamlanguages"); -@@ -688,6 +689,7 @@ void CSettings::InitializeOptionFillers() +@@ -687,6 +688,7 @@ void CSettings::InitializeOptionFillers() m_settingsManager->RegisterSettingOptionsFiller("screens", CDisplaySettings::SettingOptionsScreensFiller); m_settingsManager->RegisterSettingOptionsFiller("stereoscopicmodes", CDisplaySettings::SettingOptionsStereoscopicModesFiller); m_settingsManager->RegisterSettingOptionsFiller("preferedstereoscopicviewmodes", CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller); @@ -10552,7 +11802,7 @@ index c1d6443..1de1ac6 100644 m_settingsManager->RegisterSettingOptionsFiller("shutdownstates", CPowerManager::SettingOptionsShutdownStatesFiller); m_settingsManager->RegisterSettingOptionsFiller("startupwindows", ADDON::CSkinInfo::SettingOptionsStartupWindowsFiller); m_settingsManager->RegisterSettingOptionsFiller("streamlanguages", CLangInfo::SettingOptionsStreamLanguagesFiller); -@@ -715,6 +717,9 @@ void CSettings::InitializeConditions() +@@ -714,6 +716,9 @@ void CSettings::InitializeConditions() #ifdef HAS_GL m_settingsManager->AddCondition("has_gl"); #endif @@ -10562,7 +11812,7 @@ index c1d6443..1de1ac6 100644 #ifdef HAS_GLES m_settingsManager->AddCondition("has_gles"); #endif -@@ -857,6 +862,7 @@ void CSettings::InitializeISettingCallbacks() +@@ -856,6 +861,7 @@ void CSettings::InitializeISettingCallbacks() settingSet.insert("videoscreen.screen"); settingSet.insert("videoscreen.resolution"); settingSet.insert("videoscreen.screenmode"); @@ -11118,10 +12368,10 @@ index 0727bb9..b1eb278 100644 1.8.1.6 -From 9626121cde1743a8d2ef2d51cf92592523ab8b7b Mon Sep 17 00:00:00 2001 +From 79782dac98b48a16bc5f6c7eb1c1a98bba798a56 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:36:32 +0200 -Subject: [PATCH 031/110] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 051/111] X11: remove all DefaultScreen and RootWindow macros --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -11189,10 +12439,10 @@ index 095012f..60a6878 100644 1.8.1.6 -From 5d281408e8eb37184e44c1f6aebf3dea09c9b952 Mon Sep 17 00:00:00 2001 +From a54ab5a3cfb1203bf5923bbedc62eb7f17bcd973 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:45:22 +0200 -Subject: [PATCH 032/110] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 052/111] X11: remove all DefaultScreen and RootWindow macros (VideoRefClock) Note this is on a separate display connection. @@ -11264,10 +12514,10 @@ index 5bf3656..0b9e7b3 100644 1.8.1.6 -From 583087348aa3e019f13df994090cadc7dd1bfbf3 Mon Sep 17 00:00:00 2001 +From 695958ee7db334a3e28b54ed210be4e6944a4311 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 20 Jun 2012 17:37:11 +0200 -Subject: [PATCH 033/110] X11: recreate gl context after output has changed +Subject: [PATCH 053/111] X11: recreate gl context after output has changed --- xbmc/windowing/X11/WinSystemX11.cpp | 24 ++++++++++++++---------- @@ -11418,10 +12668,10 @@ index 60a6878..d6ba80a 100644 1.8.1.6 -From fe9ee4c66e08f11d514b94d61b0fc0585626796e Mon Sep 17 00:00:00 2001 +From dd3b14222b04dbf9fd6021ff87334decc7c63d30 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:06:25 +0200 -Subject: [PATCH 034/110] X11: hook video reference clock in windowing +Subject: [PATCH 054/111] X11: hook video reference clock in windowing --- xbmc/video/VideoReferenceClock.cpp | 71 +++++++++++++++++++++++++++----------- @@ -11626,10 +12876,10 @@ index dd65a1b..afd71fc 100644 1.8.1.6 -From 7cd90575e2e7ba0cba25f8882828a03eedd3fa9a Mon Sep 17 00:00:00 2001 +From bc4b5f595c21c8037c584a24de4361d37c7c0cf4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 21 Jun 2012 17:26:51 +0200 -Subject: [PATCH 035/110] X11: fix video calibrations +Subject: [PATCH 055/111] X11: fix video calibrations --- xbmc/windowing/WinSystem.h | 1 + @@ -11638,7 +12888,7 @@ Subject: [PATCH 035/110] X11: fix video calibrations 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h -index fc467f1..608b1e1 100644 +index 00a2d24..c0db210 100644 --- a/xbmc/windowing/WinSystem.h +++ b/xbmc/windowing/WinSystem.h @@ -103,6 +103,7 @@ class CWinSystemBase @@ -11721,10 +12971,10 @@ index 05aa60e..95672d1 100644 1.8.1.6 -From 53d7b5b81553e08dd98c6bd8b7fa47b2407e3eb6 Mon Sep 17 00:00:00 2001 +From a61e1e7b866ae6799725a3cee7055947fd2b7b02 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:00:26 +0200 -Subject: [PATCH 036/110] X11: deactivate screen saver on startup +Subject: [PATCH 056/111] X11: deactivate screen saver on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 29 +++++++++++++++++++++++++++++ @@ -11794,10 +13044,10 @@ index 95672d1..51ac314 100644 1.8.1.6 -From b5864a4dc3b1c84fddb4d9f2bbaf51fc365c51af Mon Sep 17 00:00:00 2001 +From 7b5eeda44e844f39d026abc306fb530dc74410db Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:10:09 +0200 -Subject: [PATCH 037/110] X11: change method of going full-screen +Subject: [PATCH 057/111] X11: change method of going full-screen --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -11841,10 +13091,10 @@ index 14a4307..66b91fd 100644 1.8.1.6 -From c815c5039786c0edfb5a008346f6400be5e8ec29 Mon Sep 17 00:00:00 2001 +From c9966a2bc75891d7f2962424946957cd3840a46f Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Jun 2012 19:12:39 +0200 -Subject: [PATCH 038/110] X11: reset key repeat and key modifier on focus lost +Subject: [PATCH 058/111] X11: reset key repeat and key modifier on focus lost and gain --- @@ -11876,10 +13126,10 @@ index c58067b..c9f8a20 100644 1.8.1.6 -From 18d3da75416f79bb9482c79d00a8449105690bea Mon Sep 17 00:00:00 2001 +From 0f1c51b14d98a525cddfe80122e15837fd4739ae Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:18:46 +0200 -Subject: [PATCH 039/110] X11: replace custom utf8 to unicode with charset +Subject: [PATCH 059/111] X11: replace custom utf8 to unicode with charset convertor (squash to x11 events) --- @@ -12096,10 +13346,10 @@ index 6100933..72955ad 100644 1.8.1.6 -From 7de91f91cb2686e468206bd646d303ce65fe8b98 Mon Sep 17 00:00:00 2001 +From 02972d370ad7e5cd498690bf26d176d34c0bc70e Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:23:54 +0200 -Subject: [PATCH 040/110] X11: fixed invalid usage of sizeof() (squash into x11 +Subject: [PATCH 060/111] X11: fixed invalid usage of sizeof() (squash into x11 changes) --- @@ -12163,10 +13413,10 @@ index 72955ad..102a076 100644 1.8.1.6 -From 81b0fe7a671d9c366eae577e4be00f52d3d9c435 Mon Sep 17 00:00:00 2001 +From 262f4b16ae84bce0348da566c3760d111e908acc Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 9 Jun 2012 18:23:53 +0200 -Subject: [PATCH 041/110] add missing keys to xbmc keytable +Subject: [PATCH 061/111] add missing keys to xbmc keytable --- xbmc/input/XBMC_keytable.cpp | 2 ++ @@ -12189,10 +13439,10 @@ index b430f55..246164b 100644 1.8.1.6 -From a610a6c24039fb885956894fbcfd19b3b35df3db Mon Sep 17 00:00:00 2001 +From d63ae68338fc4da0e774e016698f7fb62a04d9a0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 16 Mar 2012 15:57:51 +0100 -Subject: [PATCH 042/110] videorefclock: temp deactivate of nv settings +Subject: [PATCH 062/111] videorefclock: temp deactivate of nv settings --- xbmc/video/VideoReferenceClock.cpp | 2 +- @@ -12215,10 +13465,10 @@ index 3bd8133..59f924c 100644 1.8.1.6 -From 1492ea88c9b9659d8e0345fd8d18580cb9ceb259 Mon Sep 17 00:00:00 2001 +From 1b502562a8a1e00a0be4d6ccb0f39be9c2c77511 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 09:09:09 +0200 -Subject: [PATCH 043/110] videorefclock: ask graphics context for refresh rate +Subject: [PATCH 063/111] videorefclock: ask graphics context for refresh rate --- xbmc/video/VideoReferenceClock.cpp | 3 ++- @@ -12249,10 +13499,10 @@ index 59f924c..2f8bc69 100644 1.8.1.6 -From df1cfeff10a2e8e766925da2f60bf06f635da404 Mon Sep 17 00:00:00 2001 +From eb42185640059d34fd1fc3e77f65e1743f760d5f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 9 Jul 2012 14:00:18 +0200 -Subject: [PATCH 044/110] X11: fix icon texture after +Subject: [PATCH 064/111] X11: fix icon texture after cc5ed3c2474084ebc0373a3046410e6f766e03f4 --- @@ -12360,10 +13610,10 @@ index 66b91fd..b00eddc 100644 1.8.1.6 -From 33a8571e84fb01fd33a6cb3ae72b6feaf23d6776 Mon Sep 17 00:00:00 2001 +From c4b8d1cd002ca52a18a1f871157ccd598f62475c Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 10 Jul 2012 11:14:12 +0200 -Subject: [PATCH 045/110] X11: check for window manager +Subject: [PATCH 065/111] X11: check for window manager --- xbmc/windowing/X11/WinSystemX11.cpp | 74 ++++++++++++++++++++++++++++++++++++- @@ -12484,10 +13734,10 @@ index 51ac314..ce3c289 100644 1.8.1.6 -From 12c401980ef933b8f8c1cba6b7eee11118ca48d3 Mon Sep 17 00:00:00 2001 +From a9dc1666ab76cc5fc46fa07e8b2d8a6278530128 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Jul 2012 11:11:47 +0200 -Subject: [PATCH 046/110] X11: dont set window on xrandr if no mode available +Subject: [PATCH 066/111] X11: dont set window on xrandr if no mode available --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++----- @@ -12524,10 +13774,10 @@ index 05279ad..9697cbb 100644 1.8.1.6 -From ca53c5cdd2b3b9067f750cd47f1789e00f1436c6 Mon Sep 17 00:00:00 2001 +From 657ef9713d20db3fed7787bc1b933c40d2528b0c Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 26 Jul 2012 09:34:28 +0200 -Subject: [PATCH 047/110] X11: fix crash after a resolution change on startup +Subject: [PATCH 067/111] X11: fix crash after a resolution change on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 3 ++- @@ -12551,10 +13801,10 @@ index 9697cbb..868071c 100644 1.8.1.6 -From a2a2730899584fdfe5c8eb9888076941cb9502e8 Mon Sep 17 00:00:00 2001 +From 33480af67d2e02f415a8bc967573b22b894d5fad Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 15 Sep 2012 18:27:29 +0200 -Subject: [PATCH 048/110] X11: lock graphics context in NotifyXRREvent +Subject: [PATCH 068/111] X11: lock graphics context in NotifyXRREvent --- xbmc/windowing/X11/WinSystemX11.cpp | 2 ++ @@ -12577,25 +13827,27 @@ index 868071c..9ff947c 100644 1.8.1.6 -From 8b0a7d7533a3b77e5673b31f5b0493aeb0718b0a Mon Sep 17 00:00:00 2001 +From 5f9c99545002127cd03b8e66b2fbacb05c80aac1 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 8 Oct 2011 16:45:13 +0200 -Subject: [PATCH 049/110] ffmpeg: add xvba hwaccel +Subject: [PATCH 069/111] ffmpeg: add xvba hwaccel, co-author @fritsch --- lib/ffmpeg/configure | 11 ++ lib/ffmpeg/libavcodec/Makefile | 6 ++ lib/ffmpeg/libavcodec/allcodecs.c | 4 + - lib/ffmpeg/libavcodec/h264.c | 3 + - lib/ffmpeg/libavcodec/xvba.c | 66 ++++++++++++ - lib/ffmpeg/libavcodec/xvba.h | 71 +++++++++++++ - lib/ffmpeg/libavcodec/xvba_h264.c | 192 ++++++++++++++++++++++++++++++++++ - lib/ffmpeg/libavcodec/xvba_internal.h | 24 +++++ + lib/ffmpeg/libavcodec/h263dec.c | 3 + + lib/ffmpeg/libavcodec/h264.c | 6 ++ + lib/ffmpeg/libavcodec/vc1dec.c | 3 + + lib/ffmpeg/libavcodec/xvba.c | 77 ++++++++++++++ + lib/ffmpeg/libavcodec/xvba.h | 72 +++++++++++++ + lib/ffmpeg/libavcodec/xvba_h264.c | 194 ++++++++++++++++++++++++++++++++++ + lib/ffmpeg/libavcodec/xvba_internal.h | 25 +++++ lib/ffmpeg/libavcodec/xvba_mpeg2.c | 52 +++++++++ - lib/ffmpeg/libavcodec/xvba_vc1.c | 190 +++++++++++++++++++++++++++++++++ + lib/ffmpeg/libavcodec/xvba_vc1.c | 193 +++++++++++++++++++++++++++++++++ lib/ffmpeg/libavutil/pixdesc.c | 6 ++ lib/ffmpeg/libavutil/pixfmt.h | 1 + - 12 files changed, 626 insertions(+) + 14 files changed, 653 insertions(+) create mode 100644 lib/ffmpeg/libavcodec/xvba.c create mode 100644 lib/ffmpeg/libavcodec/xvba.h create mode 100644 lib/ffmpeg/libavcodec/xvba_h264.c @@ -12751,8 +14003,22 @@ index 584446f..7a8f61c 100644 /* video codecs */ REGISTER_ENCODER(A64MULTI, a64multi); +diff --git a/lib/ffmpeg/libavcodec/h263dec.c b/lib/ffmpeg/libavcodec/h263dec.c +index e231b08..6fcd2a0 100644 +--- a/lib/ffmpeg/libavcodec/h263dec.c ++++ b/lib/ffmpeg/libavcodec/h263dec.c +@@ -769,6 +769,9 @@ int ff_h263_decode_frame(AVCodecContext *avctx, + #if CONFIG_VDPAU + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_XVBA ++ AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE + }; diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c -index 85f2372..02d0a26 100644 +index 85f2372..4f09c67 100644 --- a/lib/ffmpeg/libavcodec/h264.c +++ b/lib/ffmpeg/libavcodec/h264.c @@ -81,6 +81,9 @@ @@ -12761,16 +14027,40 @@ index 85f2372..02d0a26 100644 #endif +#if CONFIG_H264_XVBA_HWACCEL + AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE + }; +@@ -98,6 +101,9 @@ + #if CONFIG_H264_VDPAU_HWACCEL + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_H264_XVBA_HWACCEL ++ AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_NONE + }; +diff --git a/lib/ffmpeg/libavcodec/vc1dec.c b/lib/ffmpeg/libavcodec/vc1dec.c +index 2130c74..4d611f9 100644 +--- a/lib/ffmpeg/libavcodec/vc1dec.c ++++ b/lib/ffmpeg/libavcodec/vc1dec.c +@@ -5807,6 +5807,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, + #if CONFIG_VDPAU + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_XVBA ++ AV_PIX_FMT_XVBA_VLD, +#endif AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c new file mode 100644 -index 0000000..be29e5d +index 0000000..c6ff2fe --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -0,0 +1,66 @@ +@@ -0,0 +1,77 @@ +/* + * HW decode acceleration for MPEG-2, H.264 and VC-1 + * @@ -12804,6 +14094,7 @@ index 0000000..be29e5d +#include "xvba.h" +#include "xvba_internal.h" +#include "avcodec.h" ++#include "mpegvideo.h" + +int ff_xvba_translate_profile(int profile) { + @@ -12823,6 +14114,16 @@ index 0000000..be29e5d + return -1; +} + ++// See page 25 of the documentation ++int ff_xvba_translate_picture_structure(int picture_structure) { ++ if(picture_structure == PICT_BOTTOM_FIELD) ++ return 0; ++ else if (picture_structure == PICT_TOP_FIELD) ++ return 1; ++ else //PICT_FRAME by default ++ return 3; ++} ++ +void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size) { + + render->buffers = av_fast_realloc( @@ -12839,10 +14140,10 @@ index 0000000..be29e5d + diff --git a/lib/ffmpeg/libavcodec/xvba.h b/lib/ffmpeg/libavcodec/xvba.h new file mode 100644 -index 0000000..9f9ff0c +index 0000000..e590faf --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba.h -@@ -0,0 +1,71 @@ +@@ -0,0 +1,72 @@ +/* + * HW decode acceleration for MPEG-2, H.264 and VC-1 + * @@ -12911,15 +14212,16 @@ index 0000000..9f9ff0c + unsigned int num_slices; + struct xvba_bitstream_buffers *buffers; + uint32_t buffers_alllocated; ++ int psf; +}; + +#endif /* AVCODEC_XVBA_H */ diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c new file mode 100644 -index 0000000..ae45f3a +index 0000000..20ba2f2 --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -0,0 +1,192 @@ +@@ -0,0 +1,194 @@ +/* + * H.264 HW decode acceleration through XVBA + * @@ -13009,7 +14311,9 @@ index 0000000..ae45f3a + pic_descriptor->level = avctx->level; + pic_descriptor->width_in_mb = h->mb_width; + pic_descriptor->height_in_mb = h->mb_height; -+ pic_descriptor->picture_structure = h->picture_structure; ++ ++ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(h->picture_structure); ++ + pic_descriptor->chroma_format = h->chroma_format_idc ? h->chroma_format_idc : 1; + pic_descriptor->avc_intra_flag = (h->slice_type == AV_PICTURE_TYPE_I) ? 1 : 0; + pic_descriptor->avc_reference = (h->cur_pic_ptr->f.reference & 3) ? 1 : 0; @@ -13082,7 +14386,7 @@ index 0000000..ae45f3a + h->got_first_iframe = 1; + } + -+ ff_draw_horiz_band(h->avctx, &h->dsp, h->cur_pic_ptr, NULL, 0, h->avctx->height, h->picture_structure, h->first_field, 0, 0, 0, 0); ++ ff_h264_draw_horiz_band(h, 0, h->avctx->height); + + return 0; +} @@ -13114,10 +14418,10 @@ index 0000000..ae45f3a +}; diff --git a/lib/ffmpeg/libavcodec/xvba_internal.h b/lib/ffmpeg/libavcodec/xvba_internal.h new file mode 100644 -index 0000000..9653f85 +index 0000000..18faa3e --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba_internal.h -@@ -0,0 +1,24 @@ +@@ -0,0 +1,25 @@ +/* + * HW decode acceleration for MPEG-2, H.264 and VC-1 + * @@ -13141,6 +14445,7 @@ index 0000000..9653f85 + */ + +int ff_xvba_translate_profile(int profile); ++int ff_xvba_translate_picture_structure(int picture_structure); +void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size); diff --git a/lib/ffmpeg/libavcodec/xvba_mpeg2.c b/lib/ffmpeg/libavcodec/xvba_mpeg2.c new file mode 100644 @@ -13202,10 +14507,10 @@ index 0000000..0fc7d78 +}; diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c new file mode 100644 -index 0000000..bf3d9c2 +index 0000000..e7a85a7 --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -0,0 +1,190 @@ +@@ -0,0 +1,193 @@ +/* + * VC-1 HW decode acceleration through XVBA + * @@ -13286,7 +14591,9 @@ index 0000000..bf3d9c2 + pic_descriptor->width_in_mb = s->mb_width; + pic_descriptor->height_in_mb = s->mb_height; + } -+ pic_descriptor->picture_structure = s->picture_structure; ++ ++ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(s->picture_structure); ++ + // xvba-video set this to 1 only 4:2:0 supported + // doc says: if not set, choose 1 - we try this + pic_descriptor->chroma_format = 1; @@ -13307,7 +14614,7 @@ index 0000000..bf3d9c2 + pic_descriptor->sps_info.vc1.psf = v->psf; + // what about if it is a frame (page 31) + // looked at xvba-driver -+ pic_descriptor->sps_info.vc1.second_field = !s->first_field; ++ pic_descriptor->sps_info.vc1.second_field = v->interlace && v->second_field && (v->fcm == ILACE_FIELD); + pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; + + // VC-1 explicit parameters see page 30 of sdk @@ -13349,8 +14656,9 @@ index 0000000..bf3d9c2 + pic_descriptor->future_surface = last->surface; + break; + } ++ render->psf = v->psf; + -+ ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr, s->last_picture_ptr, 0, s->avctx->height, s->picture_structure, s->first_field, (s->unrestricted_mv && !s->intra_only), s->low_delay, s->v_edge_pos, s->h_edge_pos); ++ ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); + + return 0; +} @@ -13429,36 +14737,38 @@ index 1c00ac4..6437e29 100644 1.8.1.6 -From 6e42c0d587b54da3ea6af2afab48f8b5d50457c8 Mon Sep 17 00:00:00 2001 +From 598d3e850b950f2f47352047e2ff70f5e51525cb Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Apr 2012 12:09:31 +0200 -Subject: [PATCH 050/110] xvba: add decoder +Subject: [PATCH 070/111] xvba: add decoder, co-author @fritsch --- configure.in | 47 + language/English/strings.po | 13 +- system/settings/settings.xml | 5 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 218 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 217 +- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 15 +- xbmc/cores/VideoRenderers/RenderFormats.h | 1 + xbmc/cores/VideoRenderers/RenderManager.cpp | 8 +- + xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 5 + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 4 + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 16 + xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 4 + - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 2367 ++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 2375 ++++++++++++++++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h | 383 ++++ xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + + xbmc/settings/Settings.cpp | 3 + xbmc/settings/VideoSettings.h | 2 + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 1 + - 15 files changed, 3076 insertions(+), 9 deletions(-) + 17 files changed, 3091 insertions(+), 9 deletions(-) create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h diff --git a/configure.in b/configure.in -index d63d13d..e145d43 100644 +index 66e679f..558126f 100644 --- a/configure.in +++ b/configure.in -@@ -143,6 +143,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" +@@ -144,6 +144,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" vaapi_disabled="== VAAPI support manually disabled. ==" crystalhd_not_found="== Could not find libcrystalhd. CrystalHD support disabled. ==" crystalhd_disabled="== CrystalHD support manually disabled. ==" @@ -13467,7 +14777,7 @@ index d63d13d..e145d43 100644 vtbdecoder_enabled="== VTBDecoder support enabled. ==" vtbdecoder_disabled="== VTBDecoder support manually disabled. ==" openmax_disabled="== OpenMax support manually disabled. ==" -@@ -262,6 +264,12 @@ AC_ARG_ENABLE([crystalhd], +@@ -263,6 +265,12 @@ AC_ARG_ENABLE([crystalhd], [enable CrystalHD decoding (default is auto)])], [use_crystalhd=$enableval], [use_crystalhd=auto]) @@ -13480,7 +14790,7 @@ index d63d13d..e145d43 100644 AC_ARG_ENABLE([vtbdecoder], [AS_HELP_STRING([--enable-vtbdecoder], -@@ -1780,6 +1788,37 @@ else +@@ -1776,6 +1784,37 @@ else USE_CRYSTALHD=0 fi @@ -13518,7 +14828,7 @@ index d63d13d..e145d43 100644 # VTBDecoder if test "x$use_vtbdecoder" != "xno"; then if test "$host_vendor" = "apple" ; then -@@ -1982,6 +2021,12 @@ else +@@ -1978,6 +2017,12 @@ else final_message="$final_message\n CrystalHD:\tNo" fi @@ -13531,7 +14841,7 @@ index d63d13d..e145d43 100644 if test "x$use_vtbdecoder" != "xno"; then final_message="$final_message\n VTBDecoder:\tYes" else -@@ -2452,6 +2497,7 @@ AC_SUBST(USE_OPENGLES) +@@ -2450,6 +2495,7 @@ AC_SUBST(USE_OPENGLES) AC_SUBST(USE_VDPAU) AC_SUBST(USE_VAAPI) AC_SUBST(USE_CRYSTALHD) @@ -13539,7 +14849,7 @@ index d63d13d..e145d43 100644 AC_SUBST(USE_LIBSMBCLIENT) AC_SUBST(USE_LIBNFS) AC_SUBST(USE_LIBAFPCLIENT) -@@ -2636,6 +2682,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ +@@ -2634,6 +2680,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ `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` \ @@ -13548,10 +14858,10 @@ index d63d13d..e145d43 100644 --enable-pthreads \ --enable-runtime-cpudetect \ diff --git a/language/English/strings.po b/language/English/strings.po -index ce56914..fc1f5ec4d 100644 +index 90fb3fd..6e87bc7 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5782,7 +5782,12 @@ msgctxt "#13437" +@@ -5791,7 +5791,12 @@ msgctxt "#13437" msgid "Prefer VDPAU Video Mixer" msgstr "" @@ -13565,7 +14875,7 @@ index ce56914..fc1f5ec4d 100644 #: system/settings/settings.xml msgctxt "#13500" -@@ -6860,7 +6865,11 @@ msgctxt "#16325" +@@ -6877,7 +6882,11 @@ msgctxt "#16325" msgid "VDPAU - Bob" msgstr "" @@ -13579,7 +14889,7 @@ index ce56914..fc1f5ec4d 100644 msgctxt "#16400" msgid "Post-processing" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index f99ba9c..ac87a69 100644 +index a0a1a5b..a1c7833 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -410,6 +410,11 @@ @@ -13592,10 +14902,10 @@ index f99ba9c..ac87a69 100644 + true + - HAVE_LIBSTAGEFRIGHTDECODER + HAVE_LIBSTAGEFRIGHTDECODER 2 diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 6807df7..b2beb2e 100644 +index 7bfd892..696c3f1 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp @@ -65,6 +65,9 @@ @@ -13608,7 +14918,7 @@ index 6807df7..b2beb2e 100644 #ifdef TARGET_DARWIN #include "osx/CocoaInterface.h" -@@ -135,6 +138,9 @@ +@@ -134,6 +137,9 @@ #ifdef TARGET_DARWIN_OSX cvBufferRef = NULL; #endif @@ -13618,7 +14928,7 @@ index 6807df7..b2beb2e 100644 } CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() -@@ -621,12 +627,15 @@ void CLinuxRendererGL::Flush() +@@ -624,12 +630,15 @@ void CLinuxRendererGL::Flush() void CLinuxRendererGL::ReleaseBuffer(int idx) { @@ -13635,7 +14945,7 @@ index 6807df7..b2beb2e 100644 #ifdef HAVE_LIBVA buf.vaapi.surface.reset(); #endif -@@ -892,7 +901,7 @@ void CLinuxRendererGL::UpdateVideoFilter() +@@ -895,7 +904,7 @@ void CLinuxRendererGL::UpdateVideoFilter() case VS_SCALINGMETHOD_LINEAR: SetTextureFilter(m_scalingMethod == VS_SCALINGMETHOD_NEAREST ? GL_NEAREST : GL_LINEAR); m_renderQuality = RQ_SINGLEPASS; @@ -13644,7 +14954,7 @@ index 6807df7..b2beb2e 100644 { m_pVideoFilterShader = new StretchFilterShader(); if (!m_pVideoFilterShader->CompileAndLink()) -@@ -978,6 +987,11 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -981,6 +990,11 @@ void CLinuxRendererGL::LoadShaders(int field) CLog::Log(LOGNOTICE, "GL: Using CVBREF render method"); m_renderMethod = RENDER_CVREF; } @@ -13656,7 +14966,7 @@ index 6807df7..b2beb2e 100644 else { int requestedMethod = CSettings::Get().GetInt("videoplayer.rendermethod"); -@@ -1126,6 +1140,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1129,6 +1143,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateCVRefTexture; m_textureDelete = &CLinuxRendererGL::DeleteCVRefTexture; } @@ -13669,7 +14979,7 @@ index 6807df7..b2beb2e 100644 else { // setup default YV12 texture handlers -@@ -1238,6 +1258,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1239,6 +1259,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) RenderVAAPI(renderBuffer, m_currentField); } #endif @@ -13683,7 +14993,7 @@ index 6807df7..b2beb2e 100644 else { // RENDER_CVREF uses the same render as the default case -@@ -1762,6 +1789,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) +@@ -1766,6 +1793,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) #endif } @@ -13761,7 +15071,7 @@ index 6807df7..b2beb2e 100644 void CLinuxRendererGL::RenderSoftware(int index, int field) { // used for textues uploaded from rgba or CVPixelBuffers. -@@ -2820,6 +2918,88 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) +@@ -2814,6 +2912,87 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) return true; } @@ -13798,7 +15108,7 @@ index 6807df7..b2beb2e 100644 + return true; +} + -+void CLinuxRendererGL::UploadXVBATexture(int index) ++bool CLinuxRendererGL::UploadXVBATexture(int index) +{ +#ifdef HAVE_LIBXVBA + XVBA::CXvbaRenderPicture *xvba = m_buffers[index].xvba; @@ -13809,8 +15119,7 @@ index 6807df7..b2beb2e 100644 + + if (!xvba || !xvba->valid) + { -+ m_skipRender = true; -+ return; ++ return false; + } + + plane.id = xvba->texture; @@ -13843,14 +15152,14 @@ index 6807df7..b2beb2e 100644 + plane.rect.x1 /= plane.texwidth; + plane.rect.x2 /= plane.texwidth; + } -+ +#endif ++ return true; +} + - void CLinuxRendererGL::UploadYUV422PackedTexture(int source) + bool CLinuxRendererGL::UploadYUV422PackedTexture(int source) { YUVBUFFER& buf = m_buffers[source]; -@@ -3394,6 +3574,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3389,6 +3568,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -13860,7 +15169,7 @@ index 6807df7..b2beb2e 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3407,6 +3590,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3402,6 +3584,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -13870,7 +15179,7 @@ index 6807df7..b2beb2e 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3430,7 +3616,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3425,7 +3610,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (feature == RENDERFEATURE_NONLINSTRETCH) { if (((m_renderMethod & RENDER_GLSL) && !(m_renderMethod & RENDER_POT)) || @@ -13880,7 +15189,7 @@ index 6807df7..b2beb2e 100644 return true; } -@@ -3502,6 +3689,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3497,6 +3683,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) return false; } @@ -13897,7 +15206,7 @@ index 6807df7..b2beb2e 100644 #ifdef TARGET_DARWIN // YADIF too slow for HD but we have no methods to fall back // to something that works so just turn it off. -@@ -3551,7 +3748,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) +@@ -3546,7 +3742,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) return false; if ((glewIsSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL)) || @@ -13906,7 +15215,7 @@ index 6807df7..b2beb2e 100644 { // spline36 and lanczos3 are only allowed through advancedsettings.xml if(method != VS_SCALINGMETHOD_SPLINE36 -@@ -3618,7 +3815,8 @@ unsigned int CLinuxRendererGL::GetProcessorSize() +@@ -3613,7 +3809,8 @@ unsigned int CLinuxRendererGL::GetProcessorSize() if(m_format == RENDER_FMT_VDPAU || m_format == RENDER_FMT_VDPAU_420 || m_format == RENDER_FMT_VAAPI @@ -13916,7 +15225,7 @@ index 6807df7..b2beb2e 100644 return 1; else return 0; -@@ -3674,4 +3872,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) +@@ -3649,4 +3846,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) } #endif @@ -13932,7 +15241,7 @@ index 6807df7..b2beb2e 100644 + #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 258a598..6fa1dbc 100644 +index 966733e..0377fcf 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -44,6 +44,8 @@ @@ -13952,7 +15261,7 @@ index 258a598..6fa1dbc 100644 }; enum RenderQuality -@@ -151,7 +154,9 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -150,7 +153,9 @@ class CLinuxRendererGL : public CBaseRenderer #ifdef TARGET_DARWIN virtual void AddProcessor(struct __CVBuffer *cvBufferRef, int index); #endif @@ -13963,18 +15272,18 @@ index 258a598..6fa1dbc 100644 virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); // Feature support -@@ -210,6 +215,10 @@ class CLinuxRendererGL : public CBaseRenderer - void DeleteYUV422PackedTexture(int index); - bool CreateYUV422PackedTexture(int index); +@@ -205,6 +210,10 @@ class CLinuxRendererGL : public CBaseRenderer + void DeleteCVRefTexture(int index); + bool CreateCVRefTexture(int index); -+ void UploadXVBATexture(int index); ++ bool UploadXVBATexture(int index); + void DeleteXVBATexture(int index); + bool CreateXVBATexture(int index); + - void UploadRGBTexture(int index); - void ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsigned flipIndexBuf); - void ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, unsigned flipIndexPlaneBot, unsigned flipIndexBuf); -@@ -225,6 +234,7 @@ class CLinuxRendererGL : public CBaseRenderer + bool UploadYUV422PackedTexture(int index); + void DeleteYUV422PackedTexture(int index); + bool CreateYUV422PackedTexture(int index); +@@ -224,6 +233,7 @@ class CLinuxRendererGL : public CBaseRenderer void RenderVDPAU(int renderBuffer, int field); // render using vdpau hardware void RenderProgressiveWeave(int renderBuffer, int field); // render using vdpau hardware void RenderVAAPI(int renderBuffer, int field); // render using vdpau hardware @@ -13982,7 +15291,7 @@ index 258a598..6fa1dbc 100644 struct { -@@ -293,6 +303,9 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -291,6 +301,9 @@ class CLinuxRendererGL : public CBaseRenderer #ifdef TARGET_DARWIN_OSX struct __CVBuffer *cvBufferRef; #endif @@ -14005,10 +15314,10 @@ index 3b09194..b193c24 100644 #endif diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index a1c2fc7..5056100 100644 +index ae610ca..08d6230 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -941,11 +941,17 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -936,11 +936,17 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) else if(pic.format == RENDER_FMT_VAAPI) m_pRenderer->AddProcessor(*pic.vaapi, index); #endif @@ -14027,8 +15336,24 @@ index a1c2fc7..5056100 100644 m_pRenderer->ReleaseImage(index, false); return index; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +index 514a5e1..614afdd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +@@ -183,6 +183,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne + #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) + hwSupport += "VAAPI:no "; + #endif ++#if defined(HAVE_LIBXVBA) && defined(TARGET_LINUX) ++ hwSupport += "XVBA:yes "; ++#elif defined(TARGET_LINUX) ++ hwSupport += "XVBA:no "; ++#endif + + CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); + #if !defined(HAS_LIBAMCODEC) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 0dd29c3..b346d26 100644 +index d358777..35516d7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -35,6 +35,7 @@ @@ -14050,7 +15375,7 @@ index 0dd29c3..b346d26 100644 struct { COpenMax *openMax; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index aa2d1e4..cd48f4e 100644 +index 9f1fc03..7e01ef0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -60,6 +60,9 @@ @@ -14100,10 +15425,10 @@ index 86b0a89..7bc4065 100644 SRCS += DVDVideoCodecAmlogic.cpp diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp new file mode 100644 -index 0000000..43a331f +index 0000000..5845dbf --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -0,0 +1,2367 @@ +@@ -0,0 +1,2375 @@ +/* + * Copyright (C) 2005-2011 Team XBMC + * http://www.xbmc.org @@ -14446,10 +15771,12 @@ index 0000000..43a331f + // it seems that xvba does not support anything > 2k + // return false, for files that are larger + // if you are unlucky, this would kill your decoder -+ // we limit to 2048x1536(+8) now - as this was tested working ++ // we limit to 2048x1152 now - as this was reported by ckoenig the UVD OSS ++ // engineer to be the maximum technically possible for all hardware with UVD. ++ // Some chips can do a bit more, but we use the safe default. + int surfaceWidth = (avctx->coded_width+15) & ~15; + int surfaceHeight = (avctx->coded_height+15) & ~15; -+ if(surfaceHeight > 1544 || surfaceWidth > 2048) ++ if(surfaceHeight > 1152 || surfaceWidth > 2048) + { + CLog::Log(LOGERROR, "Surface too large, decoder skipped: surfaceWidth %u, surfaceHeight %u", + surfaceWidth, surfaceHeight); @@ -14493,7 +15820,7 @@ index 0000000..43a331f + } + + int match = -1; -+ if (avctx->codec_id == CODEC_ID_H264) ++ if (avctx->codec_id == AV_CODEC_ID_H264) + { + // search for profile high + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -14510,7 +15837,7 @@ index 0000000..43a331f + CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_H264_HIGH not found"); + } + } -+ else if (avctx->codec_id == CODEC_ID_VC1) ++ else if (avctx->codec_id == AV_CODEC_ID_VC1) + { + // search for profile advanced + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -14527,7 +15854,7 @@ index 0000000..43a331f + CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_VC1_ADVANCED not found"); + } + } -+ else if (avctx->codec_id == CODEC_ID_MPEG2VIDEO) ++ else if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) + { + // search for profile high + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -14544,7 +15871,7 @@ index 0000000..43a331f + CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_MPEG2_VLD not found"); + } + } -+ else if (avctx->codec_id == CODEC_ID_WMV3) ++ else if (avctx->codec_id == AV_CODEC_ID_WMV3) + { + // search for profile high + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -15071,7 +16398,7 @@ index 0000000..43a331f + picInput.buffer_list = list; + list[0] = xvba->m_xvbaBufferPool.picture_descriptor_buffer; + picInput.num_of_buffers_in_list = 1; -+ if (avctx->codec_id == CODEC_ID_H264) ++ if (avctx->codec_id == AV_CODEC_ID_H264) + { + list[1] = xvba->m_xvbaBufferPool.iq_matrix_buffer; + picInput.num_of_buffers_in_list = 2; @@ -15095,17 +16422,20 @@ index 0000000..43a331f + { + int startCodeSize = 0; + uint8_t startCode[] = {0x00,0x00,0x01}; -+ if (avctx->codec_id == CODEC_ID_H264) ++ if (avctx->codec_id == AV_CODEC_ID_H264) + { + startCodeSize = 3; + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, + startCode, 3); + } -+ else if (avctx->codec_id == CODEC_ID_VC1 && ++ else if (avctx->codec_id == AV_CODEC_ID_VC1 && + (memcmp(render->buffers[j].buffer, startCode, 3) != 0)) + { + startCodeSize = 4; + uint8_t sdf = 0x0d; ++ if (render->picture_descriptor->sps_info.vc1.second_field) ++ sdf = 0x0c; ++ + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, + startCode, 3); + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location+3, @@ -15284,6 +16614,7 @@ index 0000000..43a331f + + render->state |= FF_XVBA_STATE_USED_FOR_REFERENCE; + render->state &= ~FF_XVBA_STATE_DECODED; ++ render->psf = 0; + pic->reordered_opaque= avctx->reordered_opaque; + + return 0; @@ -15328,6 +16659,8 @@ index 0000000..43a331f + memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); + ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); + pic.render = render; ++ if (render->psf) ++ pic.DVDPic.iFlags &= ~DVP_FLAG_INTERLACED; + m_bufferStats.IncDecoded(); + m_xvbaOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); + @@ -16861,10 +18194,10 @@ index 0000000..3bd0cea + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 21d023e..f35419f 100644 +index eb443af..c2808c3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1019,6 +1019,7 @@ static std::string GetRenderFormatName(ERenderFormat format) +@@ -1022,6 +1022,7 @@ static std::string GetRenderFormatName(ERenderFormat format) case RENDER_FMT_CVBREF: return "BGRA"; case RENDER_FMT_EGLIMG: return "EGLIMG"; case RENDER_FMT_BYPASS: return "BYPASS"; @@ -16872,6 +18205,20 @@ index 21d023e..f35419f 100644 case RENDER_FMT_NONE: return "NONE"; } return "UNKNOWN"; +diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp +index dfa3774..2557dfe 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -757,6 +757,9 @@ void CSettings::InitializeConditions() + #ifdef HAVE_LIBVDPAU + m_settingsManager->AddCondition("have_libvdpau"); + #endif ++#ifdef HAVE_LIBXVBA ++ m_settingsManager->AddCondition("have_libxvba"); ++#endif + #ifdef HAVE_VIDEOTOOLBOXDECODER + m_settingsManager->AddCondition("have_videotoolboxdecoder"); + if (g_sysinfo.HasVideoToolBoxDecoder()) diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h index 293f363..3db70fb 100644 --- a/xbmc/settings/VideoSettings.h @@ -16901,47 +18248,17 @@ index 8f30248..db58075 100644 1.8.1.6 -From 21b33a37ba677c4b62a15cb02182b44c542b7613 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sun, 4 Nov 2012 16:24:10 +0100 -Subject: [PATCH 051/110] xvba: add string for available decoders - we are - important so make sure we are there - ---- - xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index ab3696e..329b6f0 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -@@ -183,6 +183,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne - #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) - hwSupport += "VAAPI:no "; - #endif -+#if defined(HAVE_LIBXVBA) && defined(TARGET_LINUX) -+ hwSupport += "XVBA:yes "; -+#elif defined(TARGET_LINUX) -+ hwSupport += "XVBA:no "; -+#endif - - CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); - #if !defined(HAS_LIBAMCODEC) --- -1.8.1.6 - - -From 6bbda006ed9e8b2503d69908e571391fbff90532 Mon Sep 17 00:00:00 2001 +From c8f44c6aeca2d7b420a576cada451931c1e8ce71 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Jun 2012 12:46:30 +0200 -Subject: [PATCH 052/110] xvba: do not use vaapi if xvba is present +Subject: [PATCH 071/111] xvba: do not use vaapi if xvba is present --- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index 52b356d..6ed0fc5 100644 +index 2d59b09..aa83875 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -261,6 +261,15 @@ void CDecoder::Close() @@ -16964,47 +18281,47 @@ index 52b356d..6ed0fc5 100644 1.8.1.6 -From c6d9d1aeaa7905066d354d6182df6da8dcee58b6 Mon Sep 17 00:00:00 2001 +From 62a049ada0e780211a53cf5e0a315a0cc5f9f824 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 23 Aug 2012 19:39:49 +0200 -Subject: [PATCH 053/110] ffmpeg: add av_find_default_stream_index to interface +Subject: [PATCH 072/111] ffmpeg: add av_find_default_stream_index to interface --- lib/DllAvFormat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h -index ee41fa8..56605cb 100644 +index 0016c0b..3514856 100644 --- a/lib/DllAvFormat.h +++ b/lib/DllAvFormat.h -@@ -100,6 +100,7 @@ class DllAvFormatInterface - 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; +@@ -106,6 +106,7 @@ class DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + virtual AVRational av_stream_get_r_frame_rate(const AVStream *s)=0; + #endif + virtual int av_find_default_stream_index(AVFormatContext *s)=0; }; #if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) -@@ -157,6 +158,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface - 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); } +@@ -166,6 +167,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + #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 + virtual int av_find_default_stream_index(AVFormatContext *s) { return ::av_find_default_stream_index(s); } // DLL faking. virtual bool ResolveExports() { return true; } -@@ -225,6 +227,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface - 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)) +@@ -237,6 +239,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + DEFINE_METHOD1(AVRational, av_stream_get_r_frame_rate, (const AVStream *p1)) + #endif + DEFINE_METHOD1(int, av_find_default_stream_index, (AVFormatContext *p1)) 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) -@@ -261,6 +264,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface - RESOLVE_METHOD(avformat_write_header) - RESOLVE_METHOD(av_write_trailer) - RESOLVE_METHOD(av_write_frame) +@@ -276,6 +279,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + RESOLVE_METHOD(av_stream_get_r_frame_rate) + #endif + RESOLVE_METHOD(av_find_default_stream_index) END_METHOD_RESOLVE() @@ -17013,393 +18330,10 @@ index ee41fa8..56605cb 100644 1.8.1.6 -From 17456e4ad8737d27ae084dfae0045ed3eb9da577 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 11:30:39 +0200 -Subject: [PATCH 054/110] XVBA: revisit draw functions - ---- - lib/ffmpeg/libavcodec/xvba_h264.c | 2 +- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c -index ae45f3a..309d928 100644 ---- a/lib/ffmpeg/libavcodec/xvba_h264.c -+++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -160,7 +160,7 @@ static int end_frame(AVCodecContext *avctx) - h->got_first_iframe = 1; - } - -- ff_draw_horiz_band(h->avctx, &h->dsp, h->cur_pic_ptr, NULL, 0, h->avctx->height, h->picture_structure, h->first_field, 0, 0, 0, 0); -+ ff_h264_draw_horiz_band(h, 0, h->avctx->height); - - return 0; - } -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index bf3d9c2..ff35a28 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -142,7 +142,7 @@ static int end_frame(AVCodecContext *avctx) - break; - } - -- ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr, s->last_picture_ptr, 0, s->avctx->height, s->picture_structure, s->first_field, (s->unrestricted_mv && !s->intra_only), s->low_delay, s->v_edge_pos, s->h_edge_pos); -+ ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - - return 0; - } --- -1.8.1.6 - - -From 898c52bb46e3ad80cf64d7db7c60d5b2d338563b Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 12:06:02 +0200 -Subject: [PATCH 055/110] (ffmpeg): Make XVBA codec available - ---- - lib/ffmpeg/libavcodec/vc1dec.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/ffmpeg/libavcodec/vc1dec.c b/lib/ffmpeg/libavcodec/vc1dec.c -index 2130c74..4d611f9 100644 ---- a/lib/ffmpeg/libavcodec/vc1dec.c -+++ b/lib/ffmpeg/libavcodec/vc1dec.c -@@ -5807,6 +5807,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, - #if CONFIG_VDPAU - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_XVBA -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }; --- -1.8.1.6 - - -From 3b952bf28abbd43949c303b858be9a27ebf864d2 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 16:38:50 +0200 -Subject: [PATCH 056/110] ffmpeg: XVBA-VC1 use v->second_field instead of - !s->first_field to make VC1 interlaced working - ---- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index ff35a28..04e7983 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->sps_info.vc1.psf = v->psf; - // what about if it is a frame (page 31) - // looked at xvba-driver -- pic_descriptor->sps_info.vc1.second_field = !s->first_field; -+ pic_descriptor->sps_info.vc1.second_field = v->second_field; - pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; - - // VC-1 explicit parameters see page 30 of sdk --- -1.8.1.6 - - -From 80e05a1fdafc66ab25364cd661f4839df4d16a1a Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 27 Apr 2013 17:36:15 +0200 -Subject: [PATCH 057/110] XVBA: Only set second_field when we are interlaced - and an interlaced field - ---- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index 04e7983..eb90c12 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->sps_info.vc1.psf = v->psf; - // what about if it is a frame (page 31) - // looked at xvba-driver -- pic_descriptor->sps_info.vc1.second_field = v->second_field; -+ pic_descriptor->sps_info.vc1.second_field = v->interlace && v->second_field && (v->fcm == ILACE_FIELD); - pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; - - // VC-1 explicit parameters see page 30 of sdk --- -1.8.1.6 - - -From fdd88b6e39dd8ec7cf5899276dc583b7eb4237fd Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 27 Apr 2013 22:08:50 +0200 -Subject: [PATCH 058/110] xvba: translate picture_structure to a value xvba - understands - ---- - lib/ffmpeg/libavcodec/xvba.c | 11 +++++++++++ - lib/ffmpeg/libavcodec/xvba_h264.c | 4 +++- - lib/ffmpeg/libavcodec/xvba_internal.h | 1 + - lib/ffmpeg/libavcodec/xvba_vc1.c | 4 +++- - 4 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c -index be29e5d..566922e 100644 ---- a/lib/ffmpeg/libavcodec/xvba.c -+++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -31,6 +31,7 @@ - #include "xvba.h" - #include "xvba_internal.h" - #include "avcodec.h" -+#include "mpegvideo.h" - - int ff_xvba_translate_profile(int profile) { - -@@ -50,6 +51,16 @@ int ff_xvba_translate_profile(int profile) { - return -1; - } - -+// See page 25 of the documentation -+int ff_xvba_translate_picture_structure(int picture_structure) { -+ if(picture_structure == PICT_TOP_FIELD) -+ return 0; -+ else if (picture_structure == PICT_BOTTOM_FIELD) -+ return 1; -+ else //PICT_FRAME by default -+ return 3; -+} -+ - void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size) { - - render->buffers = av_fast_realloc( -diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c -index 309d928..20ba2f2 100644 ---- a/lib/ffmpeg/libavcodec/xvba_h264.c -+++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -87,7 +87,9 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->level = avctx->level; - pic_descriptor->width_in_mb = h->mb_width; - pic_descriptor->height_in_mb = h->mb_height; -- pic_descriptor->picture_structure = h->picture_structure; -+ -+ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(h->picture_structure); -+ - pic_descriptor->chroma_format = h->chroma_format_idc ? h->chroma_format_idc : 1; - pic_descriptor->avc_intra_flag = (h->slice_type == AV_PICTURE_TYPE_I) ? 1 : 0; - pic_descriptor->avc_reference = (h->cur_pic_ptr->f.reference & 3) ? 1 : 0; -diff --git a/lib/ffmpeg/libavcodec/xvba_internal.h b/lib/ffmpeg/libavcodec/xvba_internal.h -index 9653f85..18faa3e 100644 ---- a/lib/ffmpeg/libavcodec/xvba_internal.h -+++ b/lib/ffmpeg/libavcodec/xvba_internal.h -@@ -21,4 +21,5 @@ - */ - - int ff_xvba_translate_profile(int profile); -+int ff_xvba_translate_picture_structure(int picture_structure); - void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size); -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index eb90c12..c98dba5 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -78,7 +78,9 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->width_in_mb = s->mb_width; - pic_descriptor->height_in_mb = s->mb_height; - } -- pic_descriptor->picture_structure = s->picture_structure; -+ -+ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(s->picture_structure); -+ - // xvba-video set this to 1 only 4:2:0 supported - // doc says: if not set, choose 1 - we try this - pic_descriptor->chroma_format = 1; --- -1.8.1.6 - - -From 98b0def969e92f7c8075f8401cd2bb107b0e79b1 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:18:55 +0200 -Subject: [PATCH 059/110] ffmpeg xvba: fix vc1 field interlace - ---- - lib/ffmpeg/libavcodec/xvba.c | 4 ++-- - lib/ffmpeg/libavcodec/xvba.h | 1 + - lib/ffmpeg/libavcodec/xvba_vc1.c | 1 + - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c -index 566922e..c6ff2fe 100644 ---- a/lib/ffmpeg/libavcodec/xvba.c -+++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -53,9 +53,9 @@ int ff_xvba_translate_profile(int profile) { - - // See page 25 of the documentation - int ff_xvba_translate_picture_structure(int picture_structure) { -- if(picture_structure == PICT_TOP_FIELD) -+ if(picture_structure == PICT_BOTTOM_FIELD) - return 0; -- else if (picture_structure == PICT_BOTTOM_FIELD) -+ else if (picture_structure == PICT_TOP_FIELD) - return 1; - else //PICT_FRAME by default - return 3; -diff --git a/lib/ffmpeg/libavcodec/xvba.h b/lib/ffmpeg/libavcodec/xvba.h -index 9f9ff0c..e590faf 100644 ---- a/lib/ffmpeg/libavcodec/xvba.h -+++ b/lib/ffmpeg/libavcodec/xvba.h -@@ -66,6 +66,7 @@ struct xvba_render_state { - unsigned int num_slices; - struct xvba_bitstream_buffers *buffers; - uint32_t buffers_alllocated; -+ int psf; - }; - - #endif /* AVCODEC_XVBA_H */ -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index c98dba5..e7a85a7 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -143,6 +143,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->future_surface = last->surface; - break; - } -+ render->psf = v->psf; - - ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - --- -1.8.1.6 - - -From a2d3dec001d3876d74a8838744050648eff45724 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:19:07 +0200 -Subject: [PATCH 060/110] xvba: fix vc1 field interlace - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 43a331f..568632f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -1000,6 +1000,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - { - startCodeSize = 4; - uint8_t sdf = 0x0d; -+ if (render->picture_descriptor->sps_info.vc1.second_field) -+ sdf = 0x0c; -+ - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, - startCode, 3); - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location+3, --- -1.8.1.6 - - -From 0199079932e05c87a5166d190bd9f414a85eada3 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:40:55 +0200 -Subject: [PATCH 061/110] xvba: vc1 - honor psf - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 568632f..1db9363 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -1181,6 +1181,7 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) - - render->state |= FF_XVBA_STATE_USED_FOR_REFERENCE; - render->state &= ~FF_XVBA_STATE_DECODED; -+ render->psf = 0; - pic->reordered_opaque= avctx->reordered_opaque; - - return 0; -@@ -1225,6 +1226,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) - memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); - ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); - pic.render = render; -+ if (render->psf) -+ pic.DVDPic.iFlags &= ~DVP_FLAG_INTERLACED; - m_bufferStats.IncDecoded(); - m_xvbaOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); - --- -1.8.1.6 - - -From 5903b207c8fd52c5bee549612c0c35d86ebef1eb Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 4 May 2013 10:31:32 +0200 -Subject: [PATCH 062/110] xvba: squash me, settings - ---- - xbmc/settings/Settings.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 1de1ac6..1174659 100644 ---- a/xbmc/settings/Settings.cpp -+++ b/xbmc/settings/Settings.cpp -@@ -758,6 +758,9 @@ void CSettings::InitializeConditions() - #ifdef HAVE_LIBVDPAU - m_settingsManager->AddCondition("have_libvdpau"); - #endif -+#ifdef HAVE_LIBXVBA -+ m_settingsManager->AddCondition("have_libxvba"); -+#endif - #ifdef HAVE_VIDEOTOOLBOXDECODER - m_settingsManager->AddCondition("have_videotoolboxdecoder"); - if (g_sysinfo.HasVideoToolBoxDecoder()) --- -1.8.1.6 - - -From 03a51a564d6a80f53c67d1204737bb61b3265c2f Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Fri, 24 May 2013 12:02:02 +0200 -Subject: [PATCH 063/110] XVBA: Limit video to 2048x1152 as this is the max all - blocks can handle - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 1db9363..54d7aea 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -340,10 +340,12 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - // it seems that xvba does not support anything > 2k - // return false, for files that are larger - // if you are unlucky, this would kill your decoder -- // we limit to 2048x1536(+8) now - as this was tested working -+ // we limit to 2048x1152 now - as this was reported by ckoenig the UVD OSS -+ // engineer to be the maximum technically possible for all hardware with UVD. -+ // Some chips can do a bit more, but we use the safe default. - int surfaceWidth = (avctx->coded_width+15) & ~15; - int surfaceHeight = (avctx->coded_height+15) & ~15; -- if(surfaceHeight > 1544 || surfaceWidth > 2048) -+ if(surfaceHeight > 1152 || surfaceWidth > 2048) - { - CLog::Log(LOGERROR, "Surface too large, decoder skipped: surfaceWidth %u, surfaceHeight %u", - surfaceWidth, surfaceHeight); --- -1.8.1.6 - - -From bc55f265667c12b21f24f443f434a9541d8871fc Mon Sep 17 00:00:00 2001 +From 345117b7bb8287000dc771151d1a34f14b465c19 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 064/110] dvdplayer: observe pts counter overflow +Subject: [PATCH 073/111] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 198 ++++++++++++++++++++- @@ -17407,7 +18341,7 @@ Subject: [PATCH 064/110] dvdplayer: observe pts counter overflow 2 files changed, 201 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 4e7ca89..4a21438 100644 +index 8afeebe..cd02087 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -18,7 +18,6 @@ @@ -17686,10 +18620,10 @@ index aef5ab1..35abbdf 100644 1.8.1.6 -From 1ef2e98ecd3c9f22c66c7b0abb2def18559fd114 Mon Sep 17 00:00:00 2001 +From c9faeb54dec08b3ff07c8064dcf3310248455005 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 065/110] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 074/111] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -17697,10 +18631,10 @@ Subject: [PATCH 065/110] dvdplayer: avoid short screen flicker caused by 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index f35419f..61aa709 100644 +index c2808c3..5d487f4 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1062,7 +1062,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1065,7 +1065,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) || ( m_output.height != pPicture->iHeight ) || ( m_output.dwidth != pPicture->iDisplayWidth ) || ( m_output.dheight != pPicture->iDisplayHeight ) @@ -17709,7 +18643,7 @@ index f35419f..61aa709 100644 || ( m_output.color_format != (unsigned int)pPicture->format ) || ( m_output.extended_format != pPicture->extended_format ) || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -@@ -1118,7 +1118,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1121,7 +1121,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) m_output.height = pPicture->iHeight; m_output.dwidth = pPicture->iDisplayWidth; m_output.dheight = pPicture->iDisplayHeight; @@ -17722,10 +18656,10 @@ index f35419f..61aa709 100644 1.8.1.6 -From d54a67b705e0cb0febdb7acb7cee45b77975c2a2 Mon Sep 17 00:00:00 2001 +From c38283b4394ce4dcaea0421b29a1491a6c715ccb Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 066/110] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 075/111] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -17734,10 +18668,10 @@ Subject: [PATCH 066/110] vdpau: advanced settings for auto deinterlacing 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 2fdcf37..2805613 100644 +index 7f0fbd0..b6f3b83 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1800,10 +1800,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) +@@ -1818,10 +1818,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) if (method == VS_INTERLACEMETHOD_AUTO) { int deint = -1; @@ -17753,7 +18687,7 @@ index 2fdcf37..2805613 100644 if (deint != -1) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 8287651..79d4f90 100644 +index f611bb6..bae5466 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -169,6 +169,8 @@ void CAdvancedSettings::Initialize() @@ -17765,7 +18699,7 @@ index 8287651..79d4f90 100644 m_videoVDPAUtelecine = false; m_videoVDPAUdeintSkipChromaHD = false; m_DXVACheckCompatibility = false; -@@ -601,6 +603,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -605,6 +607,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -17775,7 +18709,7 @@ index 8287651..79d4f90 100644 XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 310db76..830a241 100644 +index df5b028..82057bf 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -158,6 +158,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -17791,10 +18725,10 @@ index 310db76..830a241 100644 1.8.1.6 -From 46d6b77751fa93a9868bba4086250e8841d939db Mon Sep 17 00:00:00 2001 +From 695161587d0744b427548511fe7b0ed631741bf5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 067/110] player: fix rewind +Subject: [PATCH 076/111] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- @@ -17842,10 +18776,10 @@ index 2ea8b8f..e8274f9 100644 class CDVDMsgPlayerSeekChapter : public CDVDMsg diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 1bd122b..99f0042 100644 +index 06c9439..1ca0de2 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1557,11 +1557,13 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1560,11 +1560,13 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 && (m_CurrentVideo.inited == true || GetPlaySpeed() < 0) // allow rewind at end of file @@ -17860,7 +18794,7 @@ index 1bd122b..99f0042 100644 // check how much off clock video is when ff/rw:ing // a problem here is that seeking isn't very accurate // and since the clock will be resynced after seek -@@ -1580,7 +1582,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1583,7 +1585,7 @@ void CDVDPlayer::HandlePlaySpeed() { CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); @@ -17869,7 +18803,7 @@ index 1bd122b..99f0042 100644 } } } -@@ -2068,7 +2070,7 @@ void CDVDPlayer::HandleMessages() +@@ -2071,7 +2073,7 @@ void CDVDPlayer::HandleMessages() else m_StateInput.dts = start; @@ -17878,7 +18812,7 @@ index 1bd122b..99f0042 100644 } else CLog::Log(LOGWARNING, "error while seeking"); -@@ -2207,9 +2209,10 @@ void CDVDPlayer::HandleMessages() +@@ -2210,9 +2212,10 @@ void CDVDPlayer::HandleMessages() double offset; offset = CDVDClock::GetAbsoluteClock() - m_State.timestamp; offset *= m_playSpeed / DVD_PLAYSPEED_NORMAL; @@ -17890,7 +18824,7 @@ index 1bd122b..99f0042 100644 m_State.timestamp = CDVDClock::GetAbsoluteClock(); } -@@ -2225,7 +2228,8 @@ void CDVDPlayer::HandleMessages() +@@ -2228,7 +2231,8 @@ void CDVDPlayer::HandleMessages() // do a seek after rewind, clock is not in sync with current pts if (m_playSpeed < 0 && speed >= 0) { @@ -17900,7 +18834,7 @@ index 1bd122b..99f0042 100644 } // if playspeed is different then DVD_PLAYSPEED_NORMAL or DVD_PLAYSPEED_PAUSE -@@ -3177,7 +3181,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) +@@ -3180,7 +3184,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) return true; } @@ -17909,7 +18843,7 @@ index 1bd122b..99f0042 100644 { double startpts; if(accurate) -@@ -3189,19 +3193,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3192,19 +3196,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) if(startpts != DVD_NOPTS_VALUE) startpts -= m_offset_pts; @@ -17937,7 +18871,7 @@ index 1bd122b..99f0042 100644 m_CurrentTeletext.dts = DVD_NOPTS_VALUE; m_CurrentTeletext.startpts = startpts; -@@ -3245,7 +3253,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3248,7 +3256,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) m_CurrentTeletext.started = false; } @@ -17972,10 +18906,10 @@ index 237aba4d..9e54bc8 100644 int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 61aa709..e668d29 100644 +index 5d487f4..8ebe591 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1471,7 +1471,7 @@ double CDVDPlayerVideo::GetCurrentPts() +@@ -1474,7 +1474,7 @@ double CDVDPlayerVideo::GetCurrentPts() if( m_stalled ) iRenderPts = DVD_NOPTS_VALUE; @@ -17984,7 +18918,7 @@ index 61aa709..e668d29 100644 iRenderPts = iRenderPts - max(0.0, iSleepTime); return iRenderPts; -@@ -1571,6 +1571,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1574,6 +1574,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) int iSkippedDeint = 0; int iBufferLevel; @@ -18009,10 +18943,10 @@ index 59c7f09..65dea76 100644 1.8.1.6 -From 9dd0b7d5f46e62f4868f414a599bc8c7bbc7a8b8 Mon Sep 17 00:00:00 2001 +From ad0e6973d2a300143c701de14bdbe8b08f26d1a3 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 23 Nov 2012 17:41:12 +0100 -Subject: [PATCH 068/110] xrandr: fix query for multiple screens +Subject: [PATCH 077/111] xrandr: fix query for multiple screens --- xbmc/windowing/X11/XRandR.cpp | 10 ++++++---- @@ -18053,10 +18987,10 @@ index 9e181f2..ce0a02b 100644 1.8.1.6 -From 8e619e069765d3ee80e17c92d5e4f9ef395046ee Mon Sep 17 00:00:00 2001 +From 746c5a49798137e3c4b209b9e9f0ca0b7bd66d9e Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Dec 2012 15:46:55 +0100 -Subject: [PATCH 069/110] X11: add debug log to print out refresh after xrr +Subject: [PATCH 078/111] X11: add debug log to print out refresh after xrr event --- @@ -18084,10 +19018,10 @@ index 9ff947c..a3394e6 100644 1.8.1.6 -From e9039e88331e391396b445120472b15f8e782cb3 Mon Sep 17 00:00:00 2001 +From b7bfc1df08a3713d8b7d97f33d09bd8bfc447616 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 11 Dec 2012 11:08:13 +0100 -Subject: [PATCH 070/110] X11: dont call XCloseDisplay on shutdown, it crashes +Subject: [PATCH 079/111] X11: dont call XCloseDisplay on shutdown, it crashes when powered doen by cec on ATI --- @@ -18112,10 +19046,10 @@ index a3394e6..b941c14 100644 1.8.1.6 -From 1e2b5a08eac009b3972c62c58a7f9ed92ce827a0 Mon Sep 17 00:00:00 2001 +From 029656493f159d1ff6c300a2e7cad40e05d90c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Coutant?= Date: Wed, 12 Dec 2012 19:49:47 +0100 -Subject: [PATCH 071/110] x11: support for multiple x screens +Subject: [PATCH 080/111] x11: support for multiple x screens --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -18138,10 +19072,10 @@ index ce0a02b..aa27d2b 100644 1.8.1.6 -From 55e7a139566a3d3d00ba6119deffb0f39c4ef911 Mon Sep 17 00:00:00 2001 +From 452fade6666016d2932a6b2eb6ad560bcddfc77f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 24 Dec 2012 16:02:42 +0100 -Subject: [PATCH 072/110] pvr: increase changes counter of stream on stream +Subject: [PATCH 081/111] pvr: increase changes counter of stream on stream change, cosmetics after dd307930d39d92f145a01a16600cd00e01ec39be --- @@ -18149,7 +19083,7 @@ Subject: [PATCH 072/110] pvr: increase changes counter of stream on stream 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp -index 7e35581..7adfa27 100644 +index 62fbb41..a80c789 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp @@ -339,9 +339,7 @@ void CDVDDemuxPVRClient::RequestStreams() @@ -18175,10 +19109,10 @@ index 7e35581..7adfa27 100644 1.8.1.6 -From 3897839d0a960e56b0fb2428fac1b6b984c8aa33 Mon Sep 17 00:00:00 2001 +From 047d50ff03dc0e13b386edda99d5d185f449037c Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 17 Jan 2013 16:03:22 +0100 -Subject: [PATCH 073/110] X11: add keymapping for XF86XK_Sleep +Subject: [PATCH 082/111] X11: add keymapping for XF86XK_Sleep --- xbmc/windowing/WinEventsX11.cpp | 1 + @@ -18200,20 +19134,20 @@ index 4a5aab4..da5d412 100644 1.8.1.6 -From 05b4672c598d37ff47e07839e3329fcbe2756c14 Mon Sep 17 00:00:00 2001 +From b1a2fc5e223085fb9f465ba1ce73a583579402ec Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 21 Jan 2013 09:00:19 +0100 -Subject: [PATCH 074/110] X11: remove toggle full screen after resume +Subject: [PATCH 083/111] X11: remove toggle full screen after resume --- xbmc/powermanagement/PowerManager.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index d658a97..7f12a5d 100644 +index 2033574..c79bbc1 100644 --- a/xbmc/powermanagement/PowerManager.cpp +++ b/xbmc/powermanagement/PowerManager.cpp -@@ -260,11 +260,6 @@ void CPowerManager::OnWake() +@@ -268,11 +268,6 @@ void CPowerManager::OnWake() #if defined(TARGET_WINDOWS) ShowWindow(g_hWnd,SW_RESTORE); SetForegroundWindow(g_hWnd); @@ -18229,10 +19163,10 @@ index d658a97..7f12a5d 100644 1.8.1.6 -From fcab0158f441c5f7ee06bb360a2d56a14ab79b77 Mon Sep 17 00:00:00 2001 +From 21c12b87da8a2eef346b6249b2980d7d316d8ae5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:02 +0100 -Subject: [PATCH 075/110] xrandr: set screen on mode change command +Subject: [PATCH 084/111] xrandr: set screen on mode change command --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -18255,10 +19189,10 @@ index aa27d2b..67bf6ca 100644 1.8.1.6 -From 3c978a401c2624ec0391b25cc66633e247255cd5 Mon Sep 17 00:00:00 2001 +From 4385222d8becf806704305ae839f1b70160b33da Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:39 +0100 -Subject: [PATCH 076/110] X11: recreate glx context when output changes +Subject: [PATCH 085/111] X11: recreate glx context when output changes --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -18309,10 +19243,10 @@ index ce3c289..311e4cc 100644 1.8.1.6 -From 6cddfccd77d365c81a384512a5cfee3b00f9b15c Mon Sep 17 00:00:00 2001 +From 3e971e46fa6e016c76e807c8d00af449d258f719 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 14 Dec 2012 14:19:15 +0100 -Subject: [PATCH 077/110] pvr: do not show selection dialog for a single menu +Subject: [PATCH 086/111] pvr: do not show selection dialog for a single menu hook --- @@ -18320,7 +19254,7 @@ Subject: [PATCH 077/110] pvr: do not show selection dialog for a single menu 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp -index c84bd4d..a39584b 100644 +index aab6345..a880778 100644 --- a/xbmc/pvr/addons/PVRClients.cpp +++ b/xbmc/pvr/addons/PVRClients.cpp @@ -729,6 +729,7 @@ void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, const CF @@ -18350,10 +19284,10 @@ index c84bd4d..a39584b 100644 1.8.1.6 -From 2f7e8b17ab53a312588d4895cae2fa678760e069 Mon Sep 17 00:00:00 2001 +From 933978ae6ca200d2739d36c417fa3459c3ea392f Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 3 Feb 2013 08:17:16 +0100 -Subject: [PATCH 078/110] X11: use default screen parameters if no output +Subject: [PATCH 087/111] X11: use default screen parameters if no output connected --- @@ -18457,10 +19391,10 @@ index c84e793..5215f4d 100644 1.8.1.6 -From f15251c6dabb64a50cec28eb745534be103437db Mon Sep 17 00:00:00 2001 +From 635080d09a9552a4900ffa2fd504946879851af6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 23 Mar 2013 15:13:32 +0100 -Subject: [PATCH 079/110] X11: create parent window +Subject: [PATCH 088/111] X11: create parent window --- xbmc/windowing/X11/WinSystemX11.cpp | 69 +++++++++++++++++++++++-------------- @@ -18726,10 +19660,10 @@ index 311e4cc..49365a8 100644 1.8.1.6 -From fdbc56ee223bb0ab998470b5ceb897ac82519530 Mon Sep 17 00:00:00 2001 +From cc5af656ee061060547df565c9d7fd62b3153a2d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 12:30:12 +0100 -Subject: [PATCH 080/110] X11: use system key repeat rate instead of hardcoded +Subject: [PATCH 089/111] X11: use system key repeat rate instead of hardcoded one, taken from 58fd64b194e38b73b5f3132744bab35e994e7441 --- @@ -18931,10 +19865,10 @@ index 102a076..5b1f3fa 100644 1.8.1.6 -From a70c2e4a776c5be440a1b6c65824d4b36402574f Mon Sep 17 00:00:00 2001 +From 5bf17c84b9dd8e2e03b90e2a418ad2a1f018856a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 16:04:48 +0100 -Subject: [PATCH 081/110] linux: use CLOCK_MONOTONIC_RAW as this is not subject +Subject: [PATCH 090/111] linux: use CLOCK_MONOTONIC_RAW as this is not subject to NTP --- @@ -18972,21 +19906,21 @@ index c06b8c5..4390d2e 100644 1.8.1.6 -From a79350b43a1c60dc162868475da99421863c74bc Mon Sep 17 00:00:00 2001 +From 52392e8e6b9b2359de01f0a6708a121196641622 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 15:18:53 +0100 -Subject: [PATCH 082/110] OMXPlayer: some caching fixes for pvr +Subject: [PATCH 091/111] OMXPlayer: some caching fixes for pvr --- xbmc/cores/omxplayer/OMXPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 31b690c..9d24622 100644 +index 1bfbdaf..11dd1cc 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp @@ -2460,7 +2460,8 @@ void COMXPlayer::HandleMessages() - m_messenger.Put(new CDVDMsgPlayerSeek(DVD_TIME_TO_MSEC(m_clock.GetClock()), (speed < 0), true, false, false, true)); + m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), (speed < 0), true, false, false, true)); m_playSpeed = speed; - m_caching = CACHESTATE_DONE; @@ -18999,20 +19933,20 @@ index 31b690c..9d24622 100644 1.8.1.6 -From c36206ab65b88bee3d9216d09382f523f470635c Mon Sep 17 00:00:00 2001 +From 49bae3f230d681d6890d2ee706ef68ce72f504bf Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 083/110] fix incorrect display of fps when dr kicks in +Subject: [PATCH 092/111] fix incorrect display of fps when dr kicks in --- xbmc/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 55a2685..c864770 100644 +index 92e467d..525402c 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2174,10 +2174,11 @@ void CApplication::Render() +@@ -2184,10 +2184,11 @@ void CApplication::Render() if (frameTime < singleFrameTime) Sleep(singleFrameTime - frameTime); } @@ -19029,73 +19963,10 @@ index 55a2685..c864770 100644 1.8.1.6 -From 26f9d7c84392476cd83eb25fae0cd467478d5300 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 8 Apr 2013 11:18:31 +0200 -Subject: [PATCH 084/110] squash to dropping control - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index e668d29..3474fe6 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -39,6 +39,7 @@ - #include "DVDCodecs/DVDCodecs.h" - #include "DVDCodecs/Overlay/DVDOverlayCodecCC.h" - #include "DVDCodecs/Overlay/DVDOverlaySSA.h" -+#include "guilib/GraphicContext.h" - #include - #include - #include --- -1.8.1.6 - - -From be88e4fbe0b07c5604e1e8a548b09f55b67f02ae Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Thu, 11 Apr 2013 12:33:46 +0200 -Subject: [PATCH 085/110] pvr: try SwtichChannel when selecting a channel via - EPG - ---- - xbmc/pvr/windows/GUIWindowPVRGuide.cpp | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -index 8616980..198b074 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -@@ -427,15 +427,16 @@ bool CGUIWindowPVRGuide::PlayEpgItem(CFileItem *item) - return false; - - CLog::Log(LOGDEBUG, "play channel '%s'", channel->ChannelName().c_str()); -- PlayBackRet ret = g_application.PlayFile(CFileItem(*channel)); -- if (ret == PLAYBACK_FAIL) -+ CFileItem channelItem = CFileItem(*channel); -+ bool bReturn = PlayFile(&channelItem); -+ if (!bReturn) - { - CStdString msg; - msg.Format(g_localizeStrings.Get(19035).c_str(), channel->ChannelName().c_str()); // CHANNELNAME could not be played. Check the log for details. - CGUIDialogOK::ShowAndGetInput(19033, 0, msg, 0); - } - -- return ret == PLAYBACK_OK; -+ return bReturn; - } - - bool CGUIWindowPVRGuide::OnContextButtonPlay(CFileItem *item, CONTEXT_BUTTON button) --- -1.8.1.6 - - -From 51814a1e2c8a562395544a5424fb514a3cda8883 Mon Sep 17 00:00:00 2001 +From 25be31f0e6ffc174c415f0a9bdcd9c38f48bdf01 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 13 Apr 2013 08:32:06 +0200 -Subject: [PATCH 086/110] X11: fix mouse coverage +Subject: [PATCH 093/111] X11: fix mouse coverage --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++++--- @@ -19161,10 +20032,10 @@ index 49365a8..924af1d 100644 1.8.1.6 -From 72e48eb8dbcd4e9d6463a5bfaf32bb8eb03aa8c3 Mon Sep 17 00:00:00 2001 +From 7a1d8137b3ed2e7a2ddfe7be1963615b462926b6 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 8 May 2013 13:14:58 +0200 -Subject: [PATCH 087/110] X11: fix incorrectly used screen num in desktop +Subject: [PATCH 094/111] X11: fix incorrectly used screen num in desktop resolution --- @@ -19199,10 +20070,10 @@ index 186a28e..66955b8 100644 1.8.1.6 -From 5f7c989345a0bc874dab7985e5b1dd7f524b743d Mon Sep 17 00:00:00 2001 +From b13292942c269723de9d5ad1c1a346cd660ae9e1 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 9 May 2013 12:07:09 +0200 -Subject: [PATCH 088/110] X11: do not overwrite user selected monitor with +Subject: [PATCH 095/111] X11: do not overwrite user selected monitor with fallback --- @@ -19327,10 +20198,10 @@ index 924af1d..2fb9e0f 100644 1.8.1.6 -From 4df886974f2671a5879f43f5154d7204f8b4f11b Mon Sep 17 00:00:00 2001 +From 4e2bee476f5ff41e71c8841e4d37c162e84f309c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 12 May 2013 10:50:30 +0200 -Subject: [PATCH 089/110] xrandr: add turn on/off to wrapper +Subject: [PATCH 096/111] xrandr: add turn on/off to wrapper --- xbmc/windowing/X11/XRandR.cpp | 78 +++++++++++++++++++++++++++++++++++++++---- @@ -19496,10 +20367,10 @@ index d37838a..059062f 100644 1.8.1.6 -From 48754be0ac3f25931cef14a72090a775536d1443 Mon Sep 17 00:00:00 2001 +From fc2f08443b4e7dbaeb97ecfe3ef86ecf0c0540ac Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 19 May 2013 12:55:35 +0200 -Subject: [PATCH 090/110] xrandr: add GetPreferredMode to wrapper +Subject: [PATCH 097/111] xrandr: add GetPreferredMode to wrapper --- xbmc/windowing/X11/XRandR.cpp | 23 +++++++++++++++++++++++ @@ -19556,10 +20427,10 @@ index 059062f..ab7cc63 100644 1.8.1.6 -From 667eb31e549880a80aaf1ccd983e010ddc833eae Mon Sep 17 00:00:00 2001 +From 31a16ec843d58847c3e1e3418f1a13481555b950 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 11 May 2013 17:12:12 +0200 -Subject: [PATCH 091/110] X11: multi-head improvement - poll for desired output +Subject: [PATCH 098/111] X11: multi-head improvement - poll for desired output if we do not get an xrr event --- @@ -19574,10 +20445,10 @@ Subject: [PATCH 091/110] X11: multi-head improvement - poll for desired output 8 files changed, 105 insertions(+), 12 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index fc1f5ec4d..645d7be 100644 +index 6e87bc7..b9aefe3 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -6242,7 +6242,7 @@ msgctxt "#14071" +@@ -6251,7 +6251,7 @@ msgctxt "#14071" msgid "Allow file renaming and deletion" msgstr "" @@ -19586,7 +20457,7 @@ index fc1f5ec4d..645d7be 100644 msgctxt "#14074" msgid "Set timezone" -@@ -6374,7 +6374,12 @@ msgctxt "#14100" +@@ -6383,7 +6383,12 @@ msgctxt "#14100" msgid "Stop ripping CD" msgstr "" @@ -19601,10 +20472,10 @@ index fc1f5ec4d..645d7be 100644 #: xbmc/dialogs/GUIDialogFavourites.cpp msgctxt "#15015" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index ac87a69..688964e 100644 +index a1c7833..a737dc2 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -1877,6 +1877,11 @@ +@@ -1884,6 +1884,11 @@ @@ -19616,7 +20487,7 @@ index ac87a69..688964e 100644 0 0 -@@ -1928,6 +1933,7 @@ +@@ -1935,6 +1940,7 @@ @@ -19640,7 +20511,7 @@ index 1a85651..46895d2 100644 return true; } diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 9caeabf..879d8f2 100644 +index 9caeabf..6ddaead 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -204,6 +204,7 @@ bool CWinEventsX11::Init(Display *dpy, Window win) @@ -19655,7 +20526,7 @@ index 9caeabf..879d8f2 100644 g_Windowing.NotifyXRREvent(); WinEvents->m_xrrEventPending = false; } -+ else if (!g_application.IsPlaying() && WinEvents && WinEvents->m_xrrPollTimer.IsTimePast()) ++ else if (!g_application.m_pPlayer->IsPlaying() && WinEvents && WinEvents->m_xrrPollTimer.IsTimePast()) + { + g_Windowing.NotifyXRREvent(true); + WinEvents->m_xrrPollTimer.Set(3000); @@ -19840,17 +20711,17 @@ index 4809821..1ad26b2 100644 1.8.1.6 -From b83db2b42b1f940544e4c353439a97d43379cd73 Mon Sep 17 00:00:00 2001 +From b32ea3e1cb503ac97ecdf361a238b74ab436ea4c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 15 May 2013 09:14:34 +0200 -Subject: [PATCH 092/110] X11: ignore mouse move event form other windows +Subject: [PATCH 099/111] X11: ignore mouse move event form other windows --- xbmc/windowing/WinEventsX11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 879d8f2..2ec9b6f 100644 +index 6ddaead..e4451fe 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -319,7 +319,7 @@ bool CWinEventsX11::MessagePump() @@ -19875,74 +20746,10 @@ index 879d8f2..2ec9b6f 100644 1.8.1.6 -From f8633b3687ef65d4467e0779854ba2f6b6a853b1 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sun, 2 Jun 2013 14:53:45 +0200 -Subject: [PATCH 093/110] vdpau: fix segfault caused by uninitialized member - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 2805613..cdfceb7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -90,6 +90,7 @@ - m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; - - m_vdpauConfigured = false; -+ m_hwContext.bitstream_buffers_allocated = 0; - m_DisplayState = VDPAU_OPEN; - } - --- -1.8.1.6 - - -From d1884a4dade9ce7e7e6a90a15fdcc13b789f23b0 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Tue, 11 Jun 2013 16:13:45 +0200 -Subject: [PATCH 094/110] vdpau: sync video mixer - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index cdfceb7..75ac6f0 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2350,6 +2350,21 @@ void CMixer::ProcessPicture() - NULL); - CheckStatus(vdp_st, __LINE__); - -+ // sync mixer, read blocks until output surface is written -+ { -+ uint32_t data[16]; -+ VdpRect rect; -+ rect.x0 = rect.y0 = 0; -+ rect.x1 = rect.y1 = 1; -+ uint32_t *pdata[] = {data}; -+ uint32_t pitches[] = {4}; -+ -+ vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, -+ &rect, -+ (void**)pdata, -+ pitches); -+ } -+ - if (m_mixerfield != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME) - { - // in order to clip top and bottom lines when de-interlacing --- -1.8.1.6 - - -From 01311ab34796feff00c771a3ac357b650ef340e6 Mon Sep 17 00:00:00 2001 +From 31dc0a9d086769a0e920c0ddf926b876f6ed7015 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Jun 2013 16:20:29 +0200 -Subject: [PATCH 095/110] renderer: allow some lateness within vblank interval +Subject: [PATCH 100/111] renderer: allow some lateness within vblank interval --- xbmc/cores/VideoRenderers/RenderManager.cpp | 12 ++++++++++-- @@ -19950,10 +20757,10 @@ Subject: [PATCH 095/110] renderer: allow some lateness within vblank interval 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 5056100..97fed9a 100644 +index 08d6230..d8eaac9 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -398,6 +398,8 @@ void CXBMCRenderManager::FrameFinish() +@@ -393,6 +393,8 @@ void CXBMCRenderManager::FrameFinish() if(g_graphicsContext.IsFullScreenVideo()) WaitPresentTime(m.timestamp); @@ -19962,7 +20769,7 @@ index 5056100..97fed9a 100644 { CSingleLock lock(m_presentlock); if(m_presentstep == PRESENT_FRAME) -@@ -1050,6 +1052,12 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1045,6 +1047,12 @@ void CXBMCRenderManager::PrepareNextRender() double clocktime = GetPresentTime(); double frametime = 1.0 / GetMaximumFPS(); @@ -19975,7 +20782,7 @@ index 5056100..97fed9a 100644 /* see if any future queued frames are already due */ std::deque::reverse_iterator curr, prev; -@@ -1058,8 +1066,8 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1053,8 +1061,8 @@ void CXBMCRenderManager::PrepareNextRender() ++prev; while (prev != m_queued.rend()) { @@ -20002,85 +20809,17 @@ index befd851..27283ec 100644 1.8.1.6 -From caa6819211e3709d0b07a243769efd98713abf7d Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Fri, 14 Jun 2013 09:23:22 +0200 -Subject: [PATCH 096/110] vdpau: calculate timestamp of second field when doing - deinterlacing - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 75ac6f0..67b6cf2 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2314,7 +2314,9 @@ void CMixer::ProcessPicture() - futu_surfaces[0] = m_mixerInput[1].render->surface; - futu_surfaces[1] = m_mixerInput[1].render->surface; - -- m_processPicture.DVDPic.pts = DVD_NOPTS_VALUE; -+ m_processPicture.DVDPic.pts = m_mixerInput[1].DVDPic.pts + -+ (m_mixerInput[0].DVDPic.pts - -+ m_mixerInput[1].DVDPic.pts) / 2; - m_processPicture.DVDPic.dts = DVD_NOPTS_VALUE; - } - m_processPicture.DVDPic.iRepeatPicture = 0.0; --- -1.8.1.6 - - -From e25ff6fc6ca096549e9a8be0d87b63d4dd9bc45c Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Fri, 14 Jun 2013 10:46:58 +0200 -Subject: [PATCH 097/110] vdpau: comment debug log: long decoding time - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 67b6cf2..55430a6 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -874,7 +874,7 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, - return; - } - -- uint64_t startTime = CurrentHostCounter(); -+// uint64_t startTime = CurrentHostCounter(); - uint16_t decoded, processed, rend; - vdp->m_bufferStats.Get(decoded, processed, rend); - vdp_st = vdp->m_vdpauConfig.vdpProcs.vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder, -@@ -883,9 +883,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, - vdp->m_hwContext.bitstream_buffers_used, - vdp->m_hwContext.bitstream_buffers); - vdp->CheckStatus(vdp_st, __LINE__); -- uint64_t diff = CurrentHostCounter() - startTime; -- if (diff*1000/CurrentHostFrequency() > 30) -- CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); -+// uint64_t diff = CurrentHostCounter() - startTime; -+// if (diff*1000/CurrentHostFrequency() > 30) -+// CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); - - } - --- -1.8.1.6 - - -From 9fe7fd83414c3963a10fe333c439203d6b34873e Mon Sep 17 00:00:00 2001 +From 2cb5380ec3bffaaa968462afbe09484581355889 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 16 Jun 2013 13:22:58 +0200 -Subject: [PATCH 098/110] X11: another fix for mouse coverage +Subject: [PATCH 101/111] X11: another fix for mouse coverage --- xbmc/windowing/WinEventsX11.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 2ec9b6f..4ed978c 100644 +index e4451fe..582b9f5 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -506,14 +506,16 @@ bool CWinEventsX11::MessagePump() @@ -20106,159 +20845,10 @@ index 2ec9b6f..4ed978c 100644 1.8.1.6 -From cb8babb62b2adb4ec05722d67a23982516a5c3f0 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 16 Jun 2013 13:23:19 +0200 -Subject: [PATCH 099/110] renderer: delete fence on uninit - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index b2beb2e..2613083 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1187,7 +1187,12 @@ void CLinuxRendererGL::UnInit() - - // YV12 textures - for (int i = 0; i < NUM_BUFFERS; ++i) -+ { - (this->*m_textureDelete)(i); -+ if (m_buffers[i].fence) -+ glDeleteSync(m_buffers[i].fence); -+ m_buffers[i].fence = None; -+ } - - // cleanup framebuffer object if it was in use - m_fbo.fbo.Cleanup(); --- -1.8.1.6 - - -From adc3b53ae2357465184d38409c9dc5f2d61dc007 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sun, 16 Jun 2013 14:28:01 +0200 -Subject: [PATCH 100/110] renderer: limit fence to vdpau - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 2613083..9337ee6 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1277,14 +1277,17 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) - VerifyGLState(); - } - -- // set fence in order to determine when buffer is ready for reuse -- // this is the case when the gl has finished processing -- if(m_buffers[renderBuffer].fence) -+ if (m_format == RENDER_FMT_VDPAU || m_format == RENDER_FMT_VDPAU_420) - { -- glDeleteSync(m_buffers[renderBuffer].fence); -- m_buffers[renderBuffer].fence = None; -+ // set fence in order to determine when buffer is ready for reuse -+ // this is the case when the gl has finished processing -+ if(m_buffers[renderBuffer].fence) -+ { -+ glDeleteSync(m_buffers[renderBuffer].fence); -+ m_buffers[renderBuffer].fence = None; -+ } -+ m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } -- m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } - - void CLinuxRendererGL::RenderSinglePass(int index, int field) --- -1.8.1.6 - - -From 69b3991f1c8f45295dbd62f42f3af0e153337980 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Thu, 4 Jul 2013 16:38:26 +0200 -Subject: [PATCH 101/110] XVBA: replace CODEC_IS with AV_CODEC_ID - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 54d7aea..5845dbf 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -389,7 +389,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - } - - int match = -1; -- if (avctx->codec_id == CODEC_ID_H264) -+ if (avctx->codec_id == AV_CODEC_ID_H264) - { - // search for profile high - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -406,7 +406,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_H264_HIGH not found"); - } - } -- else if (avctx->codec_id == CODEC_ID_VC1) -+ else if (avctx->codec_id == AV_CODEC_ID_VC1) - { - // search for profile advanced - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -423,7 +423,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_VC1_ADVANCED not found"); - } - } -- else if (avctx->codec_id == CODEC_ID_MPEG2VIDEO) -+ else if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) - { - // search for profile high - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -440,7 +440,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_MPEG2_VLD not found"); - } - } -- else if (avctx->codec_id == CODEC_ID_WMV3) -+ else if (avctx->codec_id == AV_CODEC_ID_WMV3) - { - // search for profile high - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -967,7 +967,7 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - picInput.buffer_list = list; - list[0] = xvba->m_xvbaBufferPool.picture_descriptor_buffer; - picInput.num_of_buffers_in_list = 1; -- if (avctx->codec_id == CODEC_ID_H264) -+ if (avctx->codec_id == AV_CODEC_ID_H264) - { - list[1] = xvba->m_xvbaBufferPool.iq_matrix_buffer; - picInput.num_of_buffers_in_list = 2; -@@ -991,13 +991,13 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - { - int startCodeSize = 0; - uint8_t startCode[] = {0x00,0x00,0x01}; -- if (avctx->codec_id == CODEC_ID_H264) -+ if (avctx->codec_id == AV_CODEC_ID_H264) - { - startCodeSize = 3; - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, - startCode, 3); - } -- else if (avctx->codec_id == CODEC_ID_VC1 && -+ else if (avctx->codec_id == AV_CODEC_ID_VC1 && - (memcmp(render->buffers[j].buffer, startCode, 3) != 0)) - { - startCodeSize = 4; --- -1.8.1.6 - - -From 07d82699f9aff83d4228e1cea4a5da05460f8717 Mon Sep 17 00:00:00 2001 +From 57726ab8ccb995463bbb76a566638aa8fd751751 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 5 Jul 2013 12:14:00 +0200 -Subject: [PATCH 102/110] X11: set windows class name +Subject: [PATCH 102/111] X11: set windows class name --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -20300,79 +20890,10 @@ index 7e4b637..44e40a3 100644 1.8.1.6 -From 4a6c2229447b4dfbbadaa0fa8005d2278ee52353 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sat, 13 Jul 2013 20:00:45 +0200 -Subject: [PATCH 103/110] VDPAU: revert sync mixer, does a busy wait - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 31 +++++++++++++------------- - 1 file changed, 16 insertions(+), 15 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 55430a6..aac0646 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1139,7 +1139,7 @@ void CVdpauRenderPicture::ReturnUnused() - // Mixer - //----------------------------------------------------------------------------- - CMixer::CMixer(CEvent *inMsgEvent) : -- CThread("Vdpau Mixer Thread"), -+ CThread("Vdpau Mixer"), - m_controlPort("ControlPort", inMsgEvent, &m_outMsgEvent), - m_dataPort("DataPort", inMsgEvent, &m_outMsgEvent) - { -@@ -2353,19 +2353,20 @@ void CMixer::ProcessPicture() - CheckStatus(vdp_st, __LINE__); - - // sync mixer, read blocks until output surface is written -- { -- uint32_t data[16]; -- VdpRect rect; -- rect.x0 = rect.y0 = 0; -- rect.x1 = rect.y1 = 1; -- uint32_t *pdata[] = {data}; -- uint32_t pitches[] = {4}; -- -- vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, -- &rect, -- (void**)pdata, -- pitches); -- } -+ // this does a busy wait :( -+// { -+// uint32_t data[16]; -+// VdpRect rect; -+// rect.x0 = rect.y0 = 0; -+// rect.x1 = rect.y1 = 1; -+// uint32_t *pdata[] = {data}; -+// uint32_t pitches[] = {4}; -+// -+// vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, -+// &rect, -+// (void**)pdata, -+// pitches); -+// } - - if (m_mixerfield != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME) - { -@@ -2410,7 +2411,7 @@ bool CMixer::CheckStatus(VdpStatus vdp_st, int line) - // Output - //----------------------------------------------------------------------------- - COutput::COutput(CEvent *inMsgEvent) : -- CThread("Vdpau Output Thread"), -+ CThread("Vdpau Output"), - m_controlPort("OutputControlPort", inMsgEvent, &m_outMsgEvent), - m_dataPort("OutputDataPort", inMsgEvent, &m_outMsgEvent), - m_mixer(&m_outMsgEvent) --- -1.8.1.6 - - -From 810827650de3ad9c682d6c40bb275c8549c093f7 Mon Sep 17 00:00:00 2001 +From 002808de57386d6f7edf2e352d1d86199db3545d Mon Sep 17 00:00:00 2001 From: fritsch Date: Sun, 14 Jul 2013 14:21:52 +0200 -Subject: [PATCH 104/110] ActiveAE: Make ActiveAE default Audio Engine to get +Subject: [PATCH 103/111] ActiveAE: Make ActiveAE default Audio Engine to get it tested via ppa --- @@ -20380,7 +20901,7 @@ Subject: [PATCH 104/110] ActiveAE: Make ActiveAE default Audio Engine to get 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/AudioEngine/AEFactory.cpp b/xbmc/cores/AudioEngine/AEFactory.cpp -index 50a309c..8ce02d7 100644 +index 6a5808c..fc38090 100644 --- a/xbmc/cores/AudioEngine/AEFactory.cpp +++ b/xbmc/cores/AudioEngine/AEFactory.cpp @@ -97,7 +97,7 @@ bool CAEFactory::LoadEngine() @@ -20396,62 +20917,20 @@ index 50a309c..8ce02d7 100644 1.8.1.6 -From 13d61226017eede4aae9e48edcbb6c8fa90dc42a Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 21 Jul 2013 13:03:45 +0200 -Subject: [PATCH 105/110] ffmpeg: xvba - add missing pix formats for xvba - ---- - lib/ffmpeg/libavcodec/h263dec.c | 3 +++ - lib/ffmpeg/libavcodec/h264.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/lib/ffmpeg/libavcodec/h263dec.c b/lib/ffmpeg/libavcodec/h263dec.c -index e231b08..6fcd2a0 100644 ---- a/lib/ffmpeg/libavcodec/h263dec.c -+++ b/lib/ffmpeg/libavcodec/h263dec.c -@@ -769,6 +769,9 @@ int ff_h263_decode_frame(AVCodecContext *avctx, - #if CONFIG_VDPAU - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_XVBA -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }; -diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c -index 02d0a26..4f09c67 100644 ---- a/lib/ffmpeg/libavcodec/h264.c -+++ b/lib/ffmpeg/libavcodec/h264.c -@@ -101,6 +101,9 @@ - #if CONFIG_H264_VDPAU_HWACCEL - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_H264_XVBA_HWACCEL -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUVJ420P, - AV_PIX_FMT_NONE - }; --- -1.8.1.6 - - -From db09e815ec42cca91d13ef48479f05d4abed9c24 Mon Sep 17 00:00:00 2001 +From 6659a6c0436b4f00494612e1d96c8b9d842160a9 Mon Sep 17 00:00:00 2001 From: spiff Date: Tue, 16 Jul 2013 14:34:04 +0200 -Subject: [PATCH 106/110] fixed: typo +Subject: [PATCH 104/111] fixed: typo --- language/English/strings.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 645d7be..7cc5c3b 100644 +index b9aefe3..0c5a8dd 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -6376,7 +6376,7 @@ msgstr "" +@@ -6385,7 +6385,7 @@ msgstr "" #: xbmc/settings/settings.xml msgctxt "#14101" @@ -20464,17 +20943,17 @@ index 645d7be..7cc5c3b 100644 1.8.1.6 -From e0368f17203eda08ea68b6c4665ced323c37852a Mon Sep 17 00:00:00 2001 +From 9b0b4c425a6d1f547565226b3815c3709048b5f9 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 25 Jul 2013 17:18:13 +0200 -Subject: [PATCH 107/110] ActiveAE: slightly reduce buffer size +Subject: [PATCH 105/111] ActiveAE: slightly reduce buffer size --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 31aa3c0..fd4d7c5 100644 +index 78f9eee..961adc8 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -30,8 +30,8 @@ @@ -20490,3 +20969,247 @@ index 31aa3c0..fd4d7c5 100644 { -- 1.8.1.6 + + +From bda6c8230b4740b032553eabd3f4309d57b668c1 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sun, 4 Aug 2013 10:11:16 +0200 +Subject: [PATCH 106/111] Revert "vdpau: comment some features that will be + added later" + +This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index b6f3b83..5f62189 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -929,8 +929,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + m_bufferStats.IncDecoded(); + m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); + +- //TODO +- // m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); ++ m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); + } + + int retval = 0; +@@ -985,8 +984,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + msg->Release(); + } + +- // TODO +- if (1) //(m_codecControl & DVP_FLAG_DRAIN)) ++ if ((m_codecControl & DVP_FLAG_DRAIN)) + { + if (decoded + processed + render < 4) + { +@@ -2150,8 +2148,7 @@ void CMixer::InitCycle() + int flags; + m_config.stats->GetParams(latency, flags); + latency = (latency*1000)/CurrentHostFrequency(); +- // TODO +- if (0) //flags & DVP_FLAG_NO_POSTPROC) ++ if (flags & DVP_FLAG_NO_POSTPROC) + SetPostProcFeatures(false); + else + SetPostProcFeatures(true); +@@ -2162,8 +2159,7 @@ void CMixer::InitCycle() + EINTERLACEMETHOD method = GetDeinterlacingMethod(); + bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; + +- // TODO +- if (//!(flags & DVP_FLAG_NO_POSTPROC) && ++ if (!(flags & DVP_FLAG_NO_POSTPROC) && + (mode == VS_DEINTERLACEMODE_FORCE || + (mode == VS_DEINTERLACEMODE_AUTO && interlaced))) + { +@@ -2185,8 +2181,7 @@ void CMixer::InitCycle() + m_config.stats->SetCanSkipDeint(true); + } + +- // TODO +- if (0) //m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) ++ if (m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) + { + m_mixersteps = 1; + } +-- +1.8.1.6 + + +From 85c36804624f9fbceae85c5e82e757b066d21cb7 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 9 Aug 2013 18:01:40 +0200 +Subject: [PATCH 107/111] X11: fix keysyms + +--- + xbmc/windowing/WinEventsX11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp +index 582b9f5..ca31278 100644 +--- a/xbmc/windowing/WinEventsX11.cpp ++++ b/xbmc/windowing/WinEventsX11.cpp +@@ -452,7 +452,7 @@ bool CWinEventsX11::MessagePump() + if (keys.length() > 0) + { + newEvent.key.keysym.scancode = xevent.xkey.keycode; +- xkeysym = XLookupKeysym(&xevent.xkey, 0); ++ XLookupString(&xevent.xkey, NULL, 0, &xkeysym, NULL); + newEvent.key.keysym.sym = LookupXbmcKeySym(xkeysym); + newEvent.key.keysym.unicode = keys[keys.length() - 1]; + newEvent.key.state = xevent.xkey.state; +-- +1.8.1.6 + + +From cc051edca6fd3bf6430a0503aab29d564f2e77af Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 9 Aug 2013 18:42:36 +0200 +Subject: [PATCH 108/111] X11: fix keysym for non-IM + +--- + xbmc/windowing/WinEventsX11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp +index ca31278..db50d3c 100644 +--- a/xbmc/windowing/WinEventsX11.cpp ++++ b/xbmc/windowing/WinEventsX11.cpp +@@ -399,7 +399,7 @@ bool CWinEventsX11::MessagePump() + { + static XComposeStatus state; + char keybuf[32]; +- xkeysym = XLookupKeysym(&xevent.xkey, 0); ++ XLookupString(&xevent.xkey, NULL, 0, &xkeysym, NULL); + newEvent.key.keysym.sym = LookupXbmcKeySym(xkeysym); + newEvent.key.keysym.scancode = xevent.xkey.keycode; + newEvent.key.state = xevent.xkey.state; +-- +1.8.1.6 + + +From 6b45549f6174112896c51108315a68d410579cbe Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 10 Aug 2013 11:18:16 +0200 +Subject: [PATCH 109/111] add some missing multi media keys + +--- + system/keymaps/keyboard.xml | 3 +++ + xbmc/input/XBMC_keytable.cpp | 4 ++++ + xbmc/input/XBMC_vkeys.h | 3 +++ + 3 files changed, 10 insertions(+) + +diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml +index ae5cf96..ba5510e 100644 +--- a/system/keymaps/keyboard.xml ++++ b/system/keymaps/keyboard.xml +@@ -118,6 +118,9 @@ + SkipPrevious + Stop + Pause ++ FastForward ++ Rewind ++ + + XBMC.ActivateWindow(MyMusic) + ActivateWindow(MyPrograms) +diff --git a/xbmc/input/XBMC_keytable.cpp b/xbmc/input/XBMC_keytable.cpp +index 246164b..9be22c9 100644 +--- a/xbmc/input/XBMC_keytable.cpp ++++ b/xbmc/input/XBMC_keytable.cpp +@@ -181,6 +181,10 @@ + , { XBMCK_LAUNCH_MEDIA_CENTER, 0, 0, XBMCVK_LAUNCH_MEDIA_CENTER, "launch_media_center" } + , { XBMCK_PLAY, 0, 0, XBMCVK_MEDIA_PLAY_PAUSE, "play_pause" } + , { XBMCK_STOP, 0, 0, XBMCVK_MEDIA_STOP, "stop" } ++, { XBMCK_REWIND, 0, 0, XBMCVK_MEDIA_REWIND, "rewind" } ++, { XBMCK_FASTFORWARD, 0, 0, XBMCVK_MEDIA_FASTFORWARD, "fastforward" } ++, { XBMCK_RECORD, 0, 0, XBMCVK_MEDIA_RECORD, "record" } ++ + + // Function keys + , { XBMCK_F1, 0, 0, XBMCVK_F1, "f1"} +diff --git a/xbmc/input/XBMC_vkeys.h b/xbmc/input/XBMC_vkeys.h +index ee6bb69..364b45a 100644 +--- a/xbmc/input/XBMC_vkeys.h ++++ b/xbmc/input/XBMC_vkeys.h +@@ -188,6 +188,9 @@ + XBMCVK_LAUNCH_APP2 = 0xC1, + XBMCVK_LAUNCH_FILE_BROWSER = 0xC2, + XBMCVK_LAUNCH_MEDIA_CENTER = 0xC3, ++ XBMCVK_MEDIA_RECORD = 0xC4, ++ XBMCVK_MEDIA_REWIND = 0xC5, ++ XBMCVK_MEDIA_FASTFORWARD = 0xC6, + + XBMCVK_LCONTROL = 0xD0, + XBMCVK_RCONTROL = 0xD1, +-- +1.8.1.6 + + +From 6b9ecbb8956eb6bdc59eeae79f628bf511be52b8 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 10 Aug 2013 15:32:06 +0200 +Subject: [PATCH 110/111] CWinSystemBase: keep RES_DESKTOP untouched at pos 0, + fixes toggle fullscreen + +--- + xbmc/windowing/WinSystem.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xbmc/windowing/WinSystem.cpp b/xbmc/windowing/WinSystem.cpp +index b3add75..6294965 100644 +--- a/xbmc/windowing/WinSystem.cpp ++++ b/xbmc/windowing/WinSystem.cpp +@@ -136,7 +136,8 @@ static void AddResolution(vector &resolutions, unsigned int addi + // check if the refresh rate of this resolution is better suited than + // the refresh rate of the resolution with the same width/height/interlaced + // property and if so replace it +- if (bestRefreshrate > 0.0 && refreshrate == bestRefreshrate) ++ // don't touch RES_DESKTOP ++ if (idx != 0 && bestRefreshrate > 0.0 && refreshrate == bestRefreshrate) + resolutions[idx].ResInfo_Index = addindex; + + // no need to add the resolution again +@@ -166,7 +167,8 @@ static bool resSortPredicate(RESOLUTION_WHR i, RESOLUTION_WHR j) + } + + // Can't assume a sort order +- sort(resolutions.begin(), resolutions.end(), resSortPredicate); ++ // don't touch RES_DESKTOP which is index 0 ++ sort(resolutions.begin()+1, resolutions.end(), resSortPredicate); + + return resolutions; + } +-- +1.8.1.6 + + +From e70c101a28981a2e5e238654bdbc05e7ee5132fe Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 10 Aug 2013 15:53:45 +0200 +Subject: [PATCH 111/111] X11: squash multi + +--- + xbmc/windowing/X11/WinSystemX11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp +index 44e40a3..a00481e 100644 +--- a/xbmc/windowing/X11/WinSystemX11.cpp ++++ b/xbmc/windowing/X11/WinSystemX11.cpp +@@ -435,7 +435,7 @@ void CWinSystemX11::GetConnectedOutputs(std::vector *outputs) + + bool CWinSystemX11::IsCurrentOutput(CStdString output) + { +- return m_currentOutput.Equals(output); ++ return output.Equals("Default") || m_currentOutput.Equals(output); + } + + bool CWinSystemX11::IsSuitableVisual(XVisualInfo *vInfo) +-- +1.8.1.6 + diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.10-disable-alt-tab.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.10-disable-alt-tab.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.10-disable-alt-tab.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.10-disable-alt-tab.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch b/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch deleted file mode 100644 index 5153c26caa..0000000000 --- a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 3c27e947a2c52c7b124b1bcf32f554b82b60f690 Mon Sep 17 00:00:00 2001 -From: Stephan Raue -Date: Fri, 2 Aug 2013 01:32:03 +0200 -Subject: [PATCH] Disable Hibernate and Suspend related power options for - Raspberry & Co. without (working) Upower/HAL/CK/Systemd support. Usually this - devices dont support Suspend & Hibernate. - ---- - xbmc/powermanagement/PowerManager.cpp | 21 ++++++++---- - xbmc/powermanagement/linux/FallbackPowerSyscall.h | 39 +++++++++++++++++++++++ - 2 files changed, 53 insertions(+), 7 deletions(-) - create mode 100644 xbmc/powermanagement/linux/FallbackPowerSyscall.h - -diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index d658a97..993477e 100644 ---- a/xbmc/powermanagement/PowerManager.cpp -+++ b/xbmc/powermanagement/PowerManager.cpp -@@ -40,14 +40,17 @@ - #include "osx/CocoaPowerSyscall.h" - #elif defined(TARGET_ANDROID) - #include "android/AndroidPowerSyscall.h" --#elif defined(TARGET_POSIX) && defined(HAS_DBUS) -+#elif defined(TARGET_POSIX) -+#include "linux/FallbackPowerSyscall.h" -+#if defined(HAS_DBUS) - #include "linux/ConsoleUPowerSyscall.h" - #include "linux/ConsoleDeviceKitPowerSyscall.h" - #include "linux/LogindUPowerSyscall.h" - #include "linux/UPowerSyscall.h" --#ifdef HAS_HAL -+#if defined(HAS_HAL) - #include "linux/HALPowerSyscall.h" --#endif -+#endif // HAS_HAL -+#endif // HAS_DBUS - #elif defined(TARGET_WINDOWS) - #include "powermanagement/windows/Win32PowerSyscall.h" - extern HWND g_hWnd; -@@ -73,7 +76,8 @@ void CPowerManager::Initialize() - m_instance = new CCocoaPowerSyscall(); - #elif defined(TARGET_ANDROID) - m_instance = new CAndroidPowerSyscall(); --#elif defined(TARGET_POSIX) && defined(HAS_DBUS) -+#elif defined(TARGET_POSIX) -+#if defined(HAS_DBUS) - if (CConsoleUPowerSyscall::HasConsoleKitAndUPower()) - m_instance = new CConsoleUPowerSyscall(); - else if (CConsoleDeviceKitPowerSyscall::HasDeviceConsoleKit()) -@@ -82,10 +86,13 @@ void CPowerManager::Initialize() - m_instance = new CLogindUPowerSyscall(); - else if (CUPowerSyscall::HasUPower()) - m_instance = new CUPowerSyscall(); --#ifdef HAS_HAL -- else -+#if defined(HAS_HAL) -+ else if(1) - m_instance = new CHALPowerSyscall(); --#endif -+#endif // HAS_HAL -+ else -+#endif // HAS_DBUS -+ m_instance = new CFallbackPowerSyscall(); - #elif defined(TARGET_WINDOWS) - m_instance = new CWin32PowerSyscall(); - #endif -diff --git a/xbmc/powermanagement/linux/FallbackPowerSyscall.h b/xbmc/powermanagement/linux/FallbackPowerSyscall.h -new file mode 100644 -index 0000000..a6ed27b ---- /dev/null -+++ b/xbmc/powermanagement/linux/FallbackPowerSyscall.h -@@ -0,0 +1,39 @@ -+/* -+ * 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 -+ * . -+ * -+ */ -+#pragma once -+#include "powermanagement/IPowerSyscall.h" -+#include "system.h" -+#if defined(TARGET_POSIX) -+ -+class CFallbackPowerSyscall : public CPowerSyscallWithoutEvents -+{ -+public: -+ virtual bool Powerdown() {return true; } -+ virtual bool Suspend() {return false; } -+ virtual bool Hibernate() {return false; } -+ virtual bool Reboot() {return true; } -+ -+ virtual bool CanPowerdown() {return true; } -+ virtual bool CanSuspend() {return false; } -+ virtual bool CanHibernate() {return false; } -+ virtual bool CanReboot() {return true; } -+ virtual int BatteryLevel() {return 0; } -+}; -+#endif --- -1.8.1.6 - diff --git a/tools/mkpkg/mkpkg_xbmc-gotham b/tools/mkpkg/mkpkg_xbmc-gotham index ea170e32cc..1bddce318f 100755 --- a/tools/mkpkg/mkpkg_xbmc-gotham +++ b/tools/mkpkg/mkpkg_xbmc-gotham @@ -57,7 +57,6 @@ echo "cleaning sources..." rm -rf $PKG_NAME-$PKG_VERSION/visualisations rm -rf $PKG_NAME-$PKG_VERSION/lib/libSDL-* rm -rf $PKG_NAME-$PKG_VERSION/lib/libcurl-* - rm -rf $PKG_NAME-$PKG_VERSION/project for i in "Changelog" "Fake\ Episode\ Maker" "MingwBuildEnvironment" \ "PackageMaker" "Translator" "XBMCLive" "XprPack" \ From 10ae0b4b4f7606acab22dac6f17db9355ffbbcec Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 17 Aug 2013 20:43:36 +0200 Subject: [PATCH 07/23] installer: rework buildscript Signed-off-by: Stephan Raue --- packages/tools/installer/package.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/tools/installer/package.mk b/packages/tools/installer/package.mk index b99c8f0a2c..3b412c40b4 100644 --- a/packages/tools/installer/package.mk +++ b/packages/tools/installer/package.mk @@ -49,6 +49,11 @@ make_target() { } makeinstall_target() { + : # nothing to install here +} + + +post_install() { mkdir -p $INSTALL/usr/bin cp $PKG_DIR/scripts/installer $INSTALL/usr/bin From c77b075d42766d955e42eb84c0377f8020b992d6 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Wed, 21 Aug 2013 19:48:03 +0300 Subject: [PATCH 08/23] udisks: mount-disks: logging.. --- packages/sysutils/udisks/init.d/31_mount-disks | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/sysutils/udisks/init.d/31_mount-disks b/packages/sysutils/udisks/init.d/31_mount-disks index a16d4cc89b..8abed33af6 100644 --- a/packages/sysutils/udisks/init.d/31_mount-disks +++ b/packages/sysutils/udisks/init.d/31_mount-disks @@ -29,11 +29,13 @@ wait_for_dbus for DEVICE in `ls /sys/class/block/sd*/removable 2>/dev/null`; do + progress "automount : DEVICE $DEVICE" if [ "$(cat $DEVICE)" = "0" ]; then DISK=$(echo "$DEVICE" | sed -e "s,/sys/class/block,/dev," -e "s,/removable,,") for PART in $(ls "$DISK"[0-9]*);do - udisks --mount "$PART" >/dev/null + progress "automount : PART $PART" + udisks --mount "$PART" | logger -s -t automount done fi - done + done &>/dev/null )& From 2c2214b058ca032585fa88d2b69026a47ca9b8f8 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Wed, 21 Aug 2013 20:42:57 +0300 Subject: [PATCH 09/23] fix previous commit --- packages/sysutils/udisks/init.d/31_mount-disks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sysutils/udisks/init.d/31_mount-disks b/packages/sysutils/udisks/init.d/31_mount-disks index 8abed33af6..4fa2945235 100644 --- a/packages/sysutils/udisks/init.d/31_mount-disks +++ b/packages/sysutils/udisks/init.d/31_mount-disks @@ -34,7 +34,7 @@ DISK=$(echo "$DEVICE" | sed -e "s,/sys/class/block,/dev," -e "s,/removable,,") for PART in $(ls "$DISK"[0-9]*);do progress "automount : PART $PART" - udisks --mount "$PART" | logger -s -t automount + udisks --mount "$PART" 2>&1 | logger -s -t automount done fi done &>/dev/null From b31da42a1022d26b1abdd70c797374b8523da889 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Wed, 21 Aug 2013 21:05:18 +0300 Subject: [PATCH 10/23] dbus: start as daemon. wait more in wait_for_dbus --- packages/sysutils/dbus/init.d/14_dbus | 8 ++------ packages/sysutils/dbus/profile.d/14-dbus.conf | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/sysutils/dbus/init.d/14_dbus b/packages/sysutils/dbus/init.d/14_dbus index c2442b487a..311061517f 100644 --- a/packages/sysutils/dbus/init.d/14_dbus +++ b/packages/sysutils/dbus/init.d/14_dbus @@ -25,9 +25,5 @@ ( progress "Starting D-BUS" - while true; do - dbus-daemon --system --nofork &>/dev/null - rm /var/run/dbus/pid &>/dev/null - usleep 500000 - done -)& + dbus-daemon --system &>/dev/null +) diff --git a/packages/sysutils/dbus/profile.d/14-dbus.conf b/packages/sysutils/dbus/profile.d/14-dbus.conf index bc736928a5..0e11e556f8 100644 --- a/packages/sysutils/dbus/profile.d/14-dbus.conf +++ b/packages/sysutils/dbus/profile.d/14-dbus.conf @@ -22,7 +22,7 @@ wait_for_dbus () { while [ ! -e /var/run/dbus/system_bus_socket ]; do - usleep 200000 + usleep 1000000 done } From e5a6e2e177b1ded4fc92a986d7f0e0c2f0a0430c Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 04:43:07 +0200 Subject: [PATCH 11/23] linux: update to linux-3.10.9 Signed-off-by: Stephan Raue --- packages/linux/meta | 2 +- .../patches/{3.10.7 => 3.10.9}/linux-003-no_dev_console.patch | 0 .../{3.10.7 => 3.10.9}/linux-010-perf_crosscompiling.patch | 0 .../{3.10.7 => 3.10.9}/linux-052-XBOX_remote_support.patch | 0 .../{3.10.7 => 3.10.9}/linux-053-spinelplus-remote-0.2.patch | 0 ...ton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch | 0 .../linux-055-add_Formosa_eHome_Infrared_Receiver.patch | 0 .../linux-056-add_Adaptec_eHome_Infrared_Receiver.patch | 0 ...57-Removed-MCE-customer-code-restriction-in-rc6-decode.patch | 0 .../linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch | 0 .../linux-058.01-HID-Sony-upstream_patches.patch | 0 .../linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch | 0 .../{3.10.7 => 3.10.9}/linux-058.06-hid_sony-add_SMK_link.patch | 0 .../linux-059-remove_some_xpad_pids-0.2.patch | 0 .../{3.10.7 => 3.10.9}/linux-060-add_AUGUST_DVB-T205.patch | 0 .../linux-203-stb0899_enable_low_symbol_rate.patch | 0 .../linux/patches/{3.10.7 => 3.10.9}/linux-210-dvbsky.patch | 0 .../linux-212-mantis_stb0899_faster_lock.patch | 0 .../patches/{3.10.7 => 3.10.9}/linux-221-ngene-octopus.patch | 0 .../{3.10.7 => 3.10.9}/linux-222-stb0899_signal_quality.patch | 0 .../linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch | 0 .../patches/{3.10.7 => 3.10.9}/linux-700-jmicron_1_0_8_5.patch | 0 .../{3.10.7 => 3.10.9}/linux-701-linksys_aes2500_brcmfmac.patch | 0 .../linux-702-Support-for-cheap-Ralink-3070-WiFi-plug.patch | 0 .../{3.10.7 => 3.10.9}/linux-703-macmini2012-ethernet.patch | 0 .../patches/{3.10.7 => 3.10.9}/linux-900-hide_tsc_error.patch | 0 .../linux-950-saa716x_PCIe_interface_chipset.patch | 0 ...990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch | 0 .../{3.10.7 => 3.10.9}/linux-995-CX24120-13Z_frontend.patch | 0 .../linux-997-disable-rc6-on-sandybridge-gt1.patch | 0 ...pufreq-revert-9d3ce4af3be0235d4cf41ea9fd774205a32e58a2.patch | 0 31 files changed, 1 insertion(+), 1 deletion(-) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-003-no_dev_console.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-010-perf_crosscompiling.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-052-XBOX_remote_support.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-053-spinelplus-remote-0.2.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-055-add_Formosa_eHome_Infrared_Receiver.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-058.01-HID-Sony-upstream_patches.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-058.06-hid_sony-add_SMK_link.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-059-remove_some_xpad_pids-0.2.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-060-add_AUGUST_DVB-T205.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-203-stb0899_enable_low_symbol_rate.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-210-dvbsky.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-212-mantis_stb0899_faster_lock.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-221-ngene-octopus.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-222-stb0899_signal_quality.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-700-jmicron_1_0_8_5.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-701-linksys_aes2500_brcmfmac.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-702-Support-for-cheap-Ralink-3070-WiFi-plug.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-703-macmini2012-ethernet.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-900-hide_tsc_error.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-950-saa716x_PCIe_interface_chipset.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-995-CX24120-13Z_frontend.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-997-disable-rc6-on-sandybridge-gt1.patch (100%) rename packages/linux/patches/{3.10.7 => 3.10.9}/linux-998.01-cpufreq-revert-9d3ce4af3be0235d4cf41ea9fd774205a32e58a2.patch (100%) diff --git a/packages/linux/meta b/packages/linux/meta index 7c4db5ff22..49abf870e7 100644 --- a/packages/linux/meta +++ b/packages/linux/meta @@ -34,7 +34,7 @@ case "$LINUX" in PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2" ;; *) - PKG_VERSION="3.10.7" + PKG_VERSION="3.10.9" PKG_URL="http://www.kernel.org/pub/linux/kernel/v3.x/$PKG_NAME-$PKG_VERSION.tar.xz" ;; esac diff --git a/packages/linux/patches/3.10.7/linux-003-no_dev_console.patch b/packages/linux/patches/3.10.9/linux-003-no_dev_console.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-003-no_dev_console.patch rename to packages/linux/patches/3.10.9/linux-003-no_dev_console.patch diff --git a/packages/linux/patches/3.10.7/linux-010-perf_crosscompiling.patch b/packages/linux/patches/3.10.9/linux-010-perf_crosscompiling.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-010-perf_crosscompiling.patch rename to packages/linux/patches/3.10.9/linux-010-perf_crosscompiling.patch diff --git a/packages/linux/patches/3.10.7/linux-052-XBOX_remote_support.patch b/packages/linux/patches/3.10.9/linux-052-XBOX_remote_support.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-052-XBOX_remote_support.patch rename to packages/linux/patches/3.10.9/linux-052-XBOX_remote_support.patch diff --git a/packages/linux/patches/3.10.7/linux-053-spinelplus-remote-0.2.patch b/packages/linux/patches/3.10.9/linux-053-spinelplus-remote-0.2.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-053-spinelplus-remote-0.2.patch rename to packages/linux/patches/3.10.9/linux-053-spinelplus-remote-0.2.patch diff --git a/packages/linux/patches/3.10.7/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch b/packages/linux/patches/3.10.9/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch rename to packages/linux/patches/3.10.9/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch diff --git a/packages/linux/patches/3.10.7/linux-055-add_Formosa_eHome_Infrared_Receiver.patch b/packages/linux/patches/3.10.9/linux-055-add_Formosa_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-055-add_Formosa_eHome_Infrared_Receiver.patch rename to packages/linux/patches/3.10.9/linux-055-add_Formosa_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/3.10.7/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch b/packages/linux/patches/3.10.9/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch rename to packages/linux/patches/3.10.9/linux-056-add_Adaptec_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/3.10.7/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch b/packages/linux/patches/3.10.9/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch rename to packages/linux/patches/3.10.9/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch diff --git a/packages/linux/patches/3.10.7/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch b/packages/linux/patches/3.10.9/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch rename to packages/linux/patches/3.10.9/linux-057-add_SMK_Manufacturing_Inc_Infrared_Receiver.patch diff --git a/packages/linux/patches/3.10.7/linux-058.01-HID-Sony-upstream_patches.patch b/packages/linux/patches/3.10.9/linux-058.01-HID-Sony-upstream_patches.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-058.01-HID-Sony-upstream_patches.patch rename to packages/linux/patches/3.10.9/linux-058.01-HID-Sony-upstream_patches.patch diff --git a/packages/linux/patches/3.10.7/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch b/packages/linux/patches/3.10.9/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch rename to packages/linux/patches/3.10.9/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch diff --git a/packages/linux/patches/3.10.7/linux-058.06-hid_sony-add_SMK_link.patch b/packages/linux/patches/3.10.9/linux-058.06-hid_sony-add_SMK_link.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-058.06-hid_sony-add_SMK_link.patch rename to packages/linux/patches/3.10.9/linux-058.06-hid_sony-add_SMK_link.patch diff --git a/packages/linux/patches/3.10.7/linux-059-remove_some_xpad_pids-0.2.patch b/packages/linux/patches/3.10.9/linux-059-remove_some_xpad_pids-0.2.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-059-remove_some_xpad_pids-0.2.patch rename to packages/linux/patches/3.10.9/linux-059-remove_some_xpad_pids-0.2.patch diff --git a/packages/linux/patches/3.10.7/linux-060-add_AUGUST_DVB-T205.patch b/packages/linux/patches/3.10.9/linux-060-add_AUGUST_DVB-T205.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-060-add_AUGUST_DVB-T205.patch rename to packages/linux/patches/3.10.9/linux-060-add_AUGUST_DVB-T205.patch diff --git a/packages/linux/patches/3.10.7/linux-203-stb0899_enable_low_symbol_rate.patch b/packages/linux/patches/3.10.9/linux-203-stb0899_enable_low_symbol_rate.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-203-stb0899_enable_low_symbol_rate.patch rename to packages/linux/patches/3.10.9/linux-203-stb0899_enable_low_symbol_rate.patch diff --git a/packages/linux/patches/3.10.7/linux-210-dvbsky.patch b/packages/linux/patches/3.10.9/linux-210-dvbsky.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-210-dvbsky.patch rename to packages/linux/patches/3.10.9/linux-210-dvbsky.patch diff --git a/packages/linux/patches/3.10.7/linux-212-mantis_stb0899_faster_lock.patch b/packages/linux/patches/3.10.9/linux-212-mantis_stb0899_faster_lock.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-212-mantis_stb0899_faster_lock.patch rename to packages/linux/patches/3.10.9/linux-212-mantis_stb0899_faster_lock.patch diff --git a/packages/linux/patches/3.10.7/linux-221-ngene-octopus.patch b/packages/linux/patches/3.10.9/linux-221-ngene-octopus.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-221-ngene-octopus.patch rename to packages/linux/patches/3.10.9/linux-221-ngene-octopus.patch diff --git a/packages/linux/patches/3.10.7/linux-222-stb0899_signal_quality.patch b/packages/linux/patches/3.10.9/linux-222-stb0899_signal_quality.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-222-stb0899_signal_quality.patch rename to packages/linux/patches/3.10.9/linux-222-stb0899_signal_quality.patch diff --git a/packages/linux/patches/3.10.7/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch b/packages/linux/patches/3.10.9/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch rename to packages/linux/patches/3.10.9/linux-223-Fix-video-artifacts-with-tt-3600-s2-usb.patch diff --git a/packages/linux/patches/3.10.7/linux-700-jmicron_1_0_8_5.patch b/packages/linux/patches/3.10.9/linux-700-jmicron_1_0_8_5.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-700-jmicron_1_0_8_5.patch rename to packages/linux/patches/3.10.9/linux-700-jmicron_1_0_8_5.patch diff --git a/packages/linux/patches/3.10.7/linux-701-linksys_aes2500_brcmfmac.patch b/packages/linux/patches/3.10.9/linux-701-linksys_aes2500_brcmfmac.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-701-linksys_aes2500_brcmfmac.patch rename to packages/linux/patches/3.10.9/linux-701-linksys_aes2500_brcmfmac.patch diff --git a/packages/linux/patches/3.10.7/linux-702-Support-for-cheap-Ralink-3070-WiFi-plug.patch b/packages/linux/patches/3.10.9/linux-702-Support-for-cheap-Ralink-3070-WiFi-plug.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-702-Support-for-cheap-Ralink-3070-WiFi-plug.patch rename to packages/linux/patches/3.10.9/linux-702-Support-for-cheap-Ralink-3070-WiFi-plug.patch diff --git a/packages/linux/patches/3.10.7/linux-703-macmini2012-ethernet.patch b/packages/linux/patches/3.10.9/linux-703-macmini2012-ethernet.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-703-macmini2012-ethernet.patch rename to packages/linux/patches/3.10.9/linux-703-macmini2012-ethernet.patch diff --git a/packages/linux/patches/3.10.7/linux-900-hide_tsc_error.patch b/packages/linux/patches/3.10.9/linux-900-hide_tsc_error.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-900-hide_tsc_error.patch rename to packages/linux/patches/3.10.9/linux-900-hide_tsc_error.patch diff --git a/packages/linux/patches/3.10.7/linux-950-saa716x_PCIe_interface_chipset.patch b/packages/linux/patches/3.10.9/linux-950-saa716x_PCIe_interface_chipset.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-950-saa716x_PCIe_interface_chipset.patch rename to packages/linux/patches/3.10.9/linux-950-saa716x_PCIe_interface_chipset.patch diff --git a/packages/linux/patches/3.10.7/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch b/packages/linux/patches/3.10.9/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch rename to packages/linux/patches/3.10.9/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch diff --git a/packages/linux/patches/3.10.7/linux-995-CX24120-13Z_frontend.patch b/packages/linux/patches/3.10.9/linux-995-CX24120-13Z_frontend.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-995-CX24120-13Z_frontend.patch rename to packages/linux/patches/3.10.9/linux-995-CX24120-13Z_frontend.patch diff --git a/packages/linux/patches/3.10.7/linux-997-disable-rc6-on-sandybridge-gt1.patch b/packages/linux/patches/3.10.9/linux-997-disable-rc6-on-sandybridge-gt1.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-997-disable-rc6-on-sandybridge-gt1.patch rename to packages/linux/patches/3.10.9/linux-997-disable-rc6-on-sandybridge-gt1.patch diff --git a/packages/linux/patches/3.10.7/linux-998.01-cpufreq-revert-9d3ce4af3be0235d4cf41ea9fd774205a32e58a2.patch b/packages/linux/patches/3.10.9/linux-998.01-cpufreq-revert-9d3ce4af3be0235d4cf41ea9fd774205a32e58a2.patch similarity index 100% rename from packages/linux/patches/3.10.7/linux-998.01-cpufreq-revert-9d3ce4af3be0235d4cf41ea9fd774205a32e58a2.patch rename to packages/linux/patches/3.10.9/linux-998.01-cpufreq-revert-9d3ce4af3be0235d4cf41ea9fd774205a32e58a2.patch From b9018e1c95a331e524eee9424b3bb6058a77d507 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 14:28:25 +0200 Subject: [PATCH 12/23] new package: add package 'udevil' Signed-off-by: Stephan Raue --- packages/sysutils/udevil/config/udevil.conf | 330 ++++++++++++++++++ packages/sysutils/udevil/package.mk | 54 +++ .../udevil/udev.d/95-udevil-mount.rules | 12 + projects/ARCTIC_MC/options | 5 + projects/ATV/options | 5 + projects/Fusion/options | 5 + projects/Generic/options | 5 + projects/Generic_OSS/options | 5 + projects/ION/options | 5 + projects/Intel/options | 5 + projects/RPi/options | 5 + projects/Virtual/options | 5 + scripts/image | 1 + tools/mkpkg/mkpkg_udevil | 44 +++ 14 files changed, 486 insertions(+) create mode 100644 packages/sysutils/udevil/config/udevil.conf create mode 100644 packages/sysutils/udevil/package.mk create mode 100644 packages/sysutils/udevil/udev.d/95-udevil-mount.rules create mode 100755 tools/mkpkg/mkpkg_udevil diff --git a/packages/sysutils/udevil/config/udevil.conf b/packages/sysutils/udevil/config/udevil.conf new file mode 100644 index 0000000000..b4fb5e6b88 --- /dev/null +++ b/packages/sysutils/udevil/config/udevil.conf @@ -0,0 +1,330 @@ +############################################################################## +# +# udevil configuration file /etc/udevil/udevil.conf +# +# This file controls what devices, networks, and files users may mount and +# unmount via udevil (set suid). +# +# IMPORTANT: IT IS POSSIBLE TO CREATE SERIOUS SECURITY PROBLEMS IF THIS FILE +# IS MISCONFIGURED - EDIT WITH CARE +# +# Note: For greater control for specific users, including root, copy this +# file to /etc/udevil/udevil-user-USERNAME.conf replacing USERNAME with the +# desired username (eg /etc/udevil/udevil-user-jim.conf). +# +# Format: +# OPTION = VALUE[, VALUE, ...] +# +# DO NOT USE QUOTES except literally +# Lines beginning with # are ignored +# +############################################################################## + + +# To log all uses of udevil, set log_file to a file path: +# log_file = /var/log/udevil.log + +# Approximate number of days to retain log entries (0=forever, max=60): +log_keep_days = 10 + + +# allowed_types determines what fstypes can be passed by a user to the u/mount +# program, what device filesystems may be un/mounted implicitly, and what +# network filesystems may be un/mounted. +# It may also include the 'file' keyword, indicating that the user is allowed +# to mount files (eg an ISO file). The $KNOWN_FILESYSTEMS variable may +# be included to include common local filesystems as well as those listed in +# /etc/filesystems and /proc/filesystems. +# allowed_types_USERNAME, if present, is used to override allowed_types for +# the specific user 'USERNAME'. For example, to allow user 'jim' to mount +# only vfat filesystems, add: +# allowed_types_jim = vfat +# Setting allowed_types = * does NOT allow all types, as this is a security +# risk, but does allow all recognized types. +# allowed_types = $KNOWN_FILESYSTEMS, file, cifs, smbfs, nfs, curlftpfs, ftpfs, sshfs, davfs, tmpfs, ramfs +allowed_types = $KNOWN_FILESYSTEMS, hfsplus, hfs + + +# allowed_users is a list of users permitted to mount and unmount with udevil. +# Wildcards (* or ?) may be used in the usernames. To allow all users, +# specify "allowed_users=*". UIDs may be included using the form UID=1000. +# For example: allowed_users = carl, UID=1000, pre* +# Also note that permission to execute udevil may be limited to users belonging +# to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage', +# depending on installation. +# allowed_users_FSTYPE, if present, is used to override allowed_users when +# mounting or unmounting a specific fstype (eg nfs, ext3, file). +# Note that when mounting a file, fstype will always be 'file' regardless of +# the internal fstype of the file. +# For example, to allow only user 'bob' to mount nfs shares, add: +# allowed_users_nfs = bob +# The root user is NOT automatically allowed to use udevil in some cases unless +# listed here (except for unmounting anything or mounting fstab devices). +allowed_users = * + + +# allowed_groups is a list of groups permitted to mount and unmount with +# udevil. The user MUST belong to at least one of these groups. Wildcards +# or GIDs may NOT be used in group names, but a single * may be used to allow +# all groups. +# Also note that permission to execute udevil may be limited to users belonging +# to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage', +# depending on installation. +# allowed_groups_FSTYPE, if present, is used to override allowed_groups when +# mounting or unmounting a specific fstype (eg nfs, ext3, file). For example, +# to allow only members of the 'network' group to mount smb and nfs shares, +# use both of these lines: +# allowed_groups_smbfs = network +# allowed_groups_nfs = network +# The root user is NOT automatically allowed to use udevil in some cases unless +# listed here (except for unmounting anything or mounting fstab devices). +allowed_groups = * + + +# allowed_media_dirs specifies the media directories in which user mount points +# may be located. The first directory which exists and does not contain a +# wildcard will be used as the default media directory (normally /media or +# /run/media/$USER). +# The $USER variable, if included, will be replaced with the username of the +# user running udevil. Wildcards may also be used in any directory EXCEPT the +# default. Wildcards will not match a / +# allowed_media_dirs_FSTYPE, if present, is used to override allowed_media_dirs +# when mounting or unmounting a specific fstype (eg ext2, nfs). For example, +# to cause /media/network to be used as the default media directory for +# nfs and ftpfs mounts, use these two lines: +# allowed_media_dirs_nfs = /media/network, /media, /run/media/$USER +# allowed_media_dirs_ftpfs = /media/network, /media, /run/media/$USER +# NOTE: If you want only the user who mounted a device to have access to it +# and be allowed to unmount it, specify /run/media/$USER as the first +# allowed media directory. +# IMPORTANT: If an allowed file is mounted to a media directory, the user may +# be permitted to unmount its associated loop device even though internal. +# INCLUDING /MNT HERE IS NOT RECOMMENDED. ALL ALLOWED MEDIA DIRECTORIES +# SHOULD BE OWNED AND WRITABLE ONLY BY ROOT. +allowed_media_dirs = /media, /run/media/$USER + + +# allowed_devices is the first criteria for what block devices users may mount +# or unmount. If a device is not listed in allowed_devices, it cannot be +# un/mounted (unless in fstab). However, even if a device is listed, other +# factors may prevent its use. For example, access to system internal devices +# will be denied to normal users even if they are included in allowed_devices. +# allowed_devices_FSTYPE, if present, is used to override allowed_devices when +# mounting or unmounting a specific fstype (eg ext3, ntfs). For example, to +# prevent all block devices containing an ext4 filesystem from being +# un/mounted use: +# allowed_devices_ext4 = +# Note: Wildcards may be used, but a wildcard will never match a /, except +# for "allowed_devices=*" which allows any device. The recommended setting is +# allowed_devices = /dev/* +# WARNING: ALLOWING USERS TO MOUNT DEVICES OUTSIDE OF /dev CAN CAUSE SERIOUS +# SECURITY PROBLEMS. DO NOT ALLOW DEVICES IN /dev/shm +allowed_devices = /dev/* + + +# allowed_internal_devices causes udevil to treat any listed block devices as +# removable, thus allowing normal users to un/mount them (providing they are +# also listed in allowed_devices). +# allowed_internal_devices_FSTYPE, if present, is used to override +# allowed_internal_devices when mounting or unmounting a specific fstype +# (eg ext3, ntfs). For example, to allow block devices containing a vfat +# filesystem to be un/mounted even if they are system internal devices, use: +# allowed_internal_devices_vfat = /dev/sdb* +# Some removable esata drives look like internal drives to udevil. To avoid +# this problem, they can be treated as removable with this setting. +# WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS. +# allowed_internal_devices = /dev/sd* + + +# allowed_internal_uuids and allowed_internal_uuids_FSTYPE work similarly to +# allowed_internal_devices, except that UUIDs are specified instead of devices. +# For example, to allow un/mounting of an internal filesystem based on UUID: +# allowed_internal_uuids = cc0c4489-8def-1e5b-a304-ab87c3cb626c0 +# WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS. +# allowed_internal_uuids = + + +# forbidden_devices is used to prevent block devices from being un/mounted +# even if other settings would allow them (except devices in fstab). +# forbidden_devices_FSTYPE, if present, is used to override +# forbidden_devices when mounting or unmounting a specific fstype +# (eg ext3, ntfs). For example, to prevent device /dev/sdd1 from being +# mounted when it contains an ntfs filesystem, use: +# forbidden_devices_ntfs = /dev/sdd1 +# NOTE: device node paths are canonicalized before being tested, so forbidding +# a link to a device will have no effect. +forbidden_devices = + + +# allowed_networks determines what hosts may be un/mounted by udevil users when +# using nfs, cifs, smbfs, curlftpfs, ftpfs, or sshfs. Hosts may be specified +# using a hostname (eg myserver.com) or IP address (192.168.1.100). +# Wildcards may be used in hostnames and IP addresses, but CIDR notation +# (192.168.1.0/16) is NOT supported. IP v6 is supported. For example: +# allowed_networks = 127.0.0.1, 192.168.1.*, 10.0.0.*, localmachine, *.okay.com +# Or, to prevent un/mounting of any network shares, set: +# allowed_networks = +# allowed_networks_FSTYPE, if present, is used to override allowed_networks +# when mounting or unmounting a specific network fstype (eg nfs, cifs, sshfs, +# curlftpfs). For example, to limit nfs and samba shares to only local +# networks, use these two lines: +# allowed_networks_nfs = 192.168.1.*, 10.0.0.* +# allowed_networks_cifs = 192.168.1.*, 10.0.0.* +allowed_networks = * + + +# forbidden_networks and forbidden_networks_FSTYPE are used to specify networks +# that are never allowed, even if other settings allow them (except fstab). +# NO REVERSE LOOKUP IS PERFORMED, so including bad.com will only have an effect +# if the user uses that hostname. IP lookup is always performed, so forbidding +# an IP address will also forbid all corresponding hostnames. +forbidden_networks = + + +# allowed_files is used to determine what files in what directories may be +# un/mounted. A user must also have read permission on a file to mount it. +# Note: Wildcards may be used, but a wildcard will never match a /, except +# for "allowed_files=*" which allows any file. For example, to allow only +# files in the /share directory to be mounted, use: +# allowed_files = /share/* +# NOTE: Specifying allowed_files_FSTYPE will NOT work because the fstype of +# files is always 'file'. +allowed_files = * + + +# forbidden_files is used to specify files that are never allowed, even if +# other settings allow them (except fstab). Specify a full path. +# Note: Wildcards may be used, but a wildcard will never match a /, except +# for "forbidden_files = *". +# NOTE: file paths are canonicalized before being tested, so forbidding +# a link to a file will have no effect. +forbidden_files = + + +# default_options specifies what options are always included when performing +# a mount, in addition to any options the user may specify. +# Note: When a device is present in /etc/fstab, and the user does not specify +# a mount point, the device is mounted with normal user permissions using +# the fstab entry, without these options. +# default_options_FSTYPE, if present, is used to override default_options +# when mounting a specific fstype (eg ext2, nfs). +# The variables $USER, $UID, and $GID are changed to the user's username, UID, +# and GID. +# FOR GOOD SECURITY, default_options SHOULD ALWAYS INCLUDE: nosuid,noexec,nodev +# WARNING: OPTIONS PRESENT OR MISSING CAN CAUSE SERIOUS SECURITY PROBLEMS. +default_options = nosuid, noexec, nodev, noatime +default_options_file = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro +# mount iso9660 with 'ro' to prevent mount read-only warning +default_options_iso9660 = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro, utf8 +default_options_udf = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID +default_options_vfat = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID, utf8 +default_options_msdos = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID +default_options_umsdos = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID +default_options_ntfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, utf8 +default_options_cifs = nosuid, noexec, nodev, uid=$UID, gid=$GID +default_options_smbfs = nosuid, noexec, nodev, uid=$UID, gid=$GID +default_options_sshfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other +default_options_curlftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other +default_options_ftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID +default_options_davfs = nosuid, noexec, nodev, uid=$UID, gid=$GID +default_options_tmpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID +default_options_ramfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID + + +# allowed_options determines all options that a user may specify when mounting. +# All the options used in default_options above must be included here too, or +# they will be rejected. If the user attempts to use an option not included +# here, an error will result. Wildcards may be used. +# allowed_options_FSTYPE, if present, is used to override allowed_options +# when mounting a specific fstype (eg ext2, nfs). +# The variables $USER, $UID, and $GID are changed to the user's username, UID, +# and GID. +# If you want to forbid remounts, remove 'remount' from here. +# WARNING: OPTIONS HERE CAN CAUSE SERIOUS SECURITY PROBLEMS - CHOOSE CAREFULLY +allowed_options = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID, ro, rw, sync, flush, iocharset=*, utf8, remount +allowed_options_nfs = nosuid, noexec, nodev, noatime, ro, rw, sync, remount, port=*, rsize=*, wsize=*, hard, proto=*, timeo=*, retrans=* +allowed_options_cifs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=* +allowed_options_smbfs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=* +allowed_options_sshfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, idmap=user, BatchMode=yes, port=* +allowed_options_curlftpfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, user=* +allowed_options_ftpfs = nosuid, noexec, nodev, noatime, ro, rw, port=*, user=*, pass=*, ip=*, root=*, uid=$UID, gid=$GID + + +# mount_point_mode, if present and set to a non-empty value, will cause udevil +# to set the mode (permissions) on the moint point after mounting If not +# specified or if left empty, the mode is not changed. Mode must be octal +# starting with a zero (0755). +# mount_point_mode_FSTYPE, if present, is used to override mount_point_mode +# when mounting a specific fstype (eg ext2, nfs). +# NOT SETTING A MODE CAN HAVE SECURITY IMPLICATIONS FOR SOME FSTYPES +mount_point_mode = 0755 +# don't set a mode for some types: +mount_point_mode_sshfs = +mount_point_mode_curlftpfs = +mount_point_mode_ftpfs = + + +# Use the settings below to change the default locations of programs used by +# udevil, or (advanced topic) to redirect commands to your scripts. +# When substituting scripts, make sure they are root-owned and accept the +# options used by udevil (for example, the mount_program must accept --fake, +# -o, -v, and other options valid to mount.) +# Be sure to specify the full path and include NO OPTIONS or other arguments. +# These programs may also be specified as configure options when building +# udevil. +# THESE PROGRAMS ARE RUN AS ROOT +# mount_program = /bin/mount +# umount_program = /bin/umount +# losetup_program = /sbin/losetup +# setfacl_program = /usr/bin/setfacl + + +# validate_exec specifies a program or script which provides additional +# validation of a mount or unmount command, beyond the checks performed by +# udevil. The program is run as a normal user (if root runs udevil, +# validate_exec will NOT be run). The program is NOT run if the user is +# mounting a device without root priviledges (a device in fstab). +# The program is passed the username, a printable description of what is +# happening, and the entire udevil command line as the first three arguments. +# The program must return an exit status of 0 to allow the mount or unmount +# to proceed. If it returns non-zero, the user will be denied permission. +# For example, validate_exec might specify a script which notifies you +# of the command being run, or performs additional steps to authenticate the +# user. +# Specify a full path to the program, with NO options or arguments. +# validate_exec = + + +# validate_rootexec works similarly to validate_exec, except that the program +# is run as root. validate_rootexec will also be run if the root user runs +# udevil. If both validate_exec and validate_rootexec are specified, +# validate_rootexec will run first, followed by validate_exec. +# The program must return an exit status of 0 to allow the mount or unmount +# to proceed. If it returns non-zero, the user will be denied permission. +# Unless you are familiar with writing root scripts, it is recommended that +# rootexec settings NOT be used, as it is easy to inadvertently open exploits. +# THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not. +# validate_rootexec = + + +# success_exec is run after a successful mount, remount, or unmount. The +# program is run as a normal user (if root runs udevil, success_exec +# will NOT be run). +# The program is passed the username, a printable description of what action +# was taken, and the entire udevil command line as the first three arguments. +# The program's exit status is ignored. +# For example, success_exec might run a script which informs you of what action +# was taken, and might perform further actions. +# Specify a full path to the program, with NO options or arguments. +# success_exec = + + +# success_rootexec works similarly to success_exec, except that the program is +# run as root. success_rootexec will also be run if the root user runs udevil. +# If both success_exec and success_rootexec are specified, success_rootexec +# will run first, followed by success_exec. +# Unless you are familiar with writing root scripts, it is recommended that +# rootexec settings NOT be used, as it is easy to inadvertently open exploits. +# THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not. +# success_rootexec = + diff --git a/packages/sysutils/udevil/package.mk b/packages/sysutils/udevil/package.mk new file mode 100644 index 0000000000..d8f6cf7b1f --- /dev/null +++ b/packages/sysutils/udevil/package.mk @@ -0,0 +1,54 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +PKG_NAME="udevil" +PKG_VERSION="77e0ba0" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="https://github.com/IgnorantGuru/udevil" +PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_DEPENDS="systemd glib" +PKG_BUILD_DEPENDS_TARGET="toolchain systemd glib" +PKG_PRIORITY="optional" +PKG_SECTION="system" +PKG_SHORTDESC="udevil: Mounts and unmounts removable devices and networks without a password." +PKG_LONGDESC="udevil Mounts and unmounts removable devices and networks without a password (set suid), shows device info, monitors device changes. Emulates mount's and udisks's command line usage and udisks v1's output. Includes the devmon automounting daemon." + +PKG_IS_ADDON="no" +PKG_AUTORECONF="yes" + +PKG_CONFIGURE_OPTS_TARGET="--disable-systemd \ + --with-mount-prog=/bin/mount \ + --with-umount-prog=/bin/umount \ + --with-losetup-prog=/sbin/losetup \ + --with-setfacl-prog=/usr/bin/setfacl" + +makeinstall_target() { + : # nothing to install +} + +post_makeinstall_target() { + mkdir -p $INSTALL/etc/udevil + cp $PKG_DIR/config/udevil.conf $INSTALL/etc/udevil + + mkdir -p $INSTALL/usr/bin + cp -PR src/udevil $INSTALL/usr/bin +} diff --git a/packages/sysutils/udevil/udev.d/95-udevil-mount.rules b/packages/sysutils/udevil/udev.d/95-udevil-mount.rules new file mode 100644 index 0000000000..0ade5e5b70 --- /dev/null +++ b/packages/sysutils/udevil/udev.d/95-udevil-mount.rules @@ -0,0 +1,12 @@ +# Mount blockdevices, /dev/sd* and partitions only +SUBSYSTEM!="block", KERNEL!="sd*", ENV{DEVTYPE}!="partition", GOTO="exit" + +# Mount the device +ACTION=="add", RUN+="/usr/bin/udevil --mount /dev/%k" + +# Clean up after removal +ACTION=="remove", RUN+="/usr/bin/udevil --umount /dev/%k" + +# Exit +LABEL="exit" + diff --git a/projects/ARCTIC_MC/options b/projects/ARCTIC_MC/options index 6919db3ef3..571555d51c 100755 --- a/projects/ARCTIC_MC/options +++ b/projects/ARCTIC_MC/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/projects/ATV/options b/projects/ATV/options index 84321ef1cc..45842b8e62 100755 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="no" diff --git a/projects/Fusion/options b/projects/Fusion/options index 1ac6cda8d9..304ae9d3ef 100755 --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/projects/Generic/options b/projects/Generic/options index 25d81ab1b8..6d574df096 100755 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/projects/Generic_OSS/options b/projects/Generic_OSS/options index 2ca1154c98..e9bf268f7f 100755 --- a/projects/Generic_OSS/options +++ b/projects/Generic_OSS/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/projects/ION/options b/projects/ION/options index 49fc3dcd1c..87ae494780 100755 --- a/projects/ION/options +++ b/projects/ION/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/projects/Intel/options b/projects/Intel/options index 71abe5abe3..ff3f443e88 100755 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/projects/RPi/options b/projects/RPi/options index 2bb8d71a13..77c7d43fc4 100755 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -222,6 +222,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="no" diff --git a/projects/Virtual/options b/projects/Virtual/options index 1693b87397..af2a4ff924 100755 --- a/projects/Virtual/options +++ b/projects/Virtual/options @@ -217,6 +217,11 @@ # in the mediacenter also automount internally drives at boottime (yes / no) UDISKS="yes" +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="no" + # build and install powermanagement support (upower) (yes / no) UPOWER="yes" diff --git a/scripts/image b/scripts/image index 787b02a141..5e1e7a29cd 100755 --- a/scripts/image +++ b/scripts/image @@ -121,6 +121,7 @@ IMAGE_NAME="$DISTRONAME-$TARGET_VERSION" # Automounter support [ "$UDISKS" = "yes" ] && $SCRIPTS/install udisks + [ "$UDEVIL" = "yes" ] && $SCRIPTS/install udevil # Powermanagement support [ "$UPOWER" = "yes" ] && $SCRIPTS/install upower diff --git a/tools/mkpkg/mkpkg_udevil b/tools/mkpkg/mkpkg_udevil new file mode 100755 index 0000000000..b35e413e9c --- /dev/null +++ b/tools/mkpkg/mkpkg_udevil @@ -0,0 +1,44 @@ +#!/bin/sh +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +echo "getting sources..." + if [ ! -d udevil.git ]; then + git clone git@github.com:IgnorantGuru/udevil.git -b master udevil.git + fi + + cd udevil.git + git pull + GIT_REV=`git log -n1 --format=%h` + cd .. + +echo "copying sources..." + rm -rf udevil-$GIT_REV + cp -R udevil.git udevil-$GIT_REV + +echo "cleaning sources..." + rm -rf udevil-$GIT_REV/.git + rm -rf udevil-$GIT_REV/packages + +echo "packing sources..." + tar cvJf udevil-$GIT_REV.tar.xz udevil-$GIT_REV + +echo "remove temporary sourcedir..." + rm -rf udevil-$GIT_REV From ea88d59d268766be5f19c927a7b26029c987ed52 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 14:29:07 +0200 Subject: [PATCH 13/23] xbmc: add patch to support udev mounts Signed-off-by: Stephan Raue --- .../xbmc-AML-XB9295c3f-udev-mount.patch | 367 ++++++++++++++++++ 1 file changed, 367 insertions(+) create mode 100644 packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-udev-mount.patch diff --git a/packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-udev-mount.patch b/packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-udev-mount.patch new file mode 100644 index 0000000000..dbdcec8273 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-udev-mount.patch @@ -0,0 +1,367 @@ +From 9295c3ffac97c64cebee88229ee6ac8376f150ae Mon Sep 17 00:00:00 2001 +From: davilla +Date: Fri, 20 Apr 2012 13:23:19 -0400 +Subject: [PATCH] [aml] fixed, add UDevProvider to handle usb disk add/remove + storage handling + +--- + xbmc/storage/linux/LinuxStorageProvider.h | 5 + + xbmc/storage/linux/Makefile | 9 +- + xbmc/storage/linux/UDevProvider.cpp | 241 ++++++++++++++++++++++++++++++ + xbmc/storage/linux/UDevProvider.h | 55 +++++++ + 4 files changed, 306 insertions(+), 4 deletions(-) + create mode 100644 xbmc/storage/linux/UDevProvider.cpp + create mode 100644 xbmc/storage/linux/UDevProvider.h + +diff --git a/xbmc/storage/linux/LinuxStorageProvider.h b/xbmc/storage/linux/LinuxStorageProvider.h +index 1f14548..740b282 100644 +--- a/xbmc/storage/linux/LinuxStorageProvider.h ++++ b/xbmc/storage/linux/LinuxStorageProvider.h +@@ -21,6 +21,7 @@ + #include "storage/IStorageProvider.h" + #include "HALProvider.h" + #include "DeviceKitDisksProvider.h" ++#include "UDevProvider.h" + #include "UDisksProvider.h" + #include "PosixMountProvider.h" + +@@ -41,6 +42,10 @@ class CLinuxStorageProvider : public IStorageProvider + if (m_instance == NULL) + m_instance = new CHALProvider(); + #endif ++#ifdef HAVE_LIBUDEV ++ if (m_instance == NULL) ++ m_instance = new CUDevProvider(); ++#endif + + if (m_instance == NULL) + m_instance = new CPosixMountProvider(); +diff --git a/xbmc/storage/linux/Makefile b/xbmc/storage/linux/Makefile +index 9be601d..325f84d 100644 +--- a/xbmc/storage/linux/Makefile ++++ b/xbmc/storage/linux/Makefile +@@ -1,8 +1,9 @@ +-SRCS=DeviceKitDisksProvider.cpp \ +- HALProvider.cpp \ +- UDisksProvider.cpp \ ++SRCS = DeviceKitDisksProvider.cpp ++SRCS += UDisksProvider.cpp ++SRCS += HALProvider.cpp ++SRCS += UDevProvider.cpp + +-LIB=storage_linux.a ++LIB = storage_linux.a + + include ../../../Makefile.include + -include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) +diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp +new file mode 100644 +index 0000000..21b6b50 +--- /dev/null ++++ b/xbmc/storage/linux/UDevProvider.cpp +@@ -0,0 +1,241 @@ ++/* ++ * Copyright (C) 2005-2012 Team XBMC ++ * http://www.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 "UDevProvider.h" ++ ++#ifdef HAVE_LIBUDEV ++ ++#include "linux/PosixMountProvider.h" ++#include "utils/log.h" ++#include "utils/URIUtils.h" ++ ++extern "C" { ++#include ++#include ++} ++ ++static const char *get_mountpoint(const char *devnode) ++{ ++ static char buf[4096]; ++ const char *delim = " "; ++ const char *mountpoint = NULL; ++ FILE *fp = fopen("/proc/mounts", "r"); ++ ++ while (fgets(buf, sizeof (buf), fp)) ++ { ++ const char *node = strtok(buf, delim); ++ if (strcmp(node, devnode) == 0) ++ { ++ mountpoint = strtok(NULL, delim); ++ break; ++ } ++ } ++ ++ if (mountpoint != NULL) ++ { ++ // If mount point contain characters like space, it is converted to ++ // "\040". This situation should be handled. ++ char *c1, *c2; ++ for (c1 = c2 = (char*)mountpoint; *c2; ++c1) ++ { ++ if (*c2 == '\\') ++ { ++ *c1 = (((c2[1] - '0') << 6) | ((c2[2] - '0') << 3) | (c2[3] - '0')); ++ c2 += 4; ++ continue; ++ } ++ if (c1 != c2) ++ *c1 = *c2; ++ ++c2; ++ } ++ *c1 = *c2; ++ } ++ ++ fclose(fp); ++ return mountpoint; ++} ++ ++CUDevProvider::CUDevProvider() ++{ ++ m_udev = NULL; ++ m_udevMon = NULL; ++} ++ ++void CUDevProvider::Initialize() ++{ ++ CLog::Log(LOGDEBUG, "Selected UDev as storage provider"); ++ ++ m_udev = udev_new(); ++ if (!m_udev) ++ { ++ CLog::Log(LOGERROR, "%s - failed to allocate udev context", __FUNCTION__); ++ return; ++ } ++ /* set up a devices monitor that listen for any device change */ ++ m_udevMon = udev_monitor_new_from_netlink(m_udev, "udev"); ++ udev_monitor_filter_add_match_subsystem_devtype(m_udevMon, "block", "disk"); ++ udev_monitor_filter_add_match_subsystem_devtype(m_udevMon, "block", "partition"); ++ udev_monitor_enable_receiving(m_udevMon); ++ ++ PumpDriveChangeEvents(NULL); ++} ++ ++void CUDevProvider::Stop() ++{ ++ udev_monitor_unref(m_udevMon); ++ udev_unref(m_udev); ++} ++ ++void CUDevProvider::GetDisks(VECSOURCES& disks, bool removable) ++{ ++ // enumerate existing block devices ++ struct udev_enumerate *u_enum = udev_enumerate_new(m_udev); ++ if (u_enum == NULL) ++ { ++ fprintf(stderr, "Error: udev_enumerate_new(udev)\n"); ++ return; ++ } ++ ++ udev_enumerate_add_match_subsystem(u_enum, "block"); ++ udev_enumerate_add_match_property(u_enum, "DEVTYPE", "disk"); ++ udev_enumerate_add_match_property(u_enum, "DEVTYPE", "partition"); ++ udev_enumerate_scan_devices(u_enum); ++ ++ struct udev_list_entry *u_list_ent; ++ struct udev_list_entry *u_first_list_ent; ++ u_first_list_ent = udev_enumerate_get_list_entry(u_enum); ++ udev_list_entry_foreach(u_list_ent, u_first_list_ent) ++ { ++ const char *name = udev_list_entry_get_name(u_list_ent); ++ struct udev *context = udev_enumerate_get_udev(u_enum); ++ struct udev_device *device = udev_device_new_from_syspath(context, name); ++ if (device == NULL) ++ continue; ++ ++ // filter out devices that are not mounted ++ const char *mountpoint = get_mountpoint(udev_device_get_devnode(device)); ++ if (!mountpoint) ++ { ++ udev_device_unref(device); ++ continue; ++ } ++ ++ // filter out things mounted on /tmp ++ if (strstr(mountpoint, "/tmp")) ++ { ++ udev_device_unref(device); ++ continue; ++ } ++ ++ // look for usb devices on the usb bus or mounted on /media/usbX (sdcards) ++ const char *bus = udev_device_get_property_value(device, "ID_BUS"); ++ if (removable && ++ ((bus && strstr(bus, "usb")) || ++ (mountpoint && strstr(mountpoint, "usb")))) ++ { ++ const char *label = udev_device_get_property_value(device, "ID_FS_LABEL"); ++ if (!label) ++ label = URIUtils::GetFileName(mountpoint); ++ ++ CMediaSource share; ++ share.strName = label; ++ share.strPath = mountpoint; ++ share.m_ignore = true; ++ share.m_iDriveType = CMediaSource::SOURCE_TYPE_REMOVABLE; ++ AddOrReplace(disks, share); ++ } ++ udev_device_unref(device); ++ } ++ udev_enumerate_unref(u_enum); ++} ++ ++void CUDevProvider::GetLocalDrives(VECSOURCES &localDrives) ++{ ++ GetDisks(localDrives, false); ++} ++ ++void CUDevProvider::GetRemovableDrives(VECSOURCES &removableDrives) ++{ ++ GetDisks(removableDrives, true); ++} ++ ++bool CUDevProvider::Eject(CStdString mountpath) ++{ ++ return false; ++} ++ ++std::vector CUDevProvider::GetDiskUsage() ++{ ++ CPosixMountProvider legacy; ++ return legacy.GetDiskUsage(); ++} ++ ++bool CUDevProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback) ++{ ++ bool changed = false; ++ ++ fd_set readfds; ++ FD_ZERO(&readfds); ++ FD_SET(udev_monitor_get_fd(m_udevMon), &readfds); ++ ++ // non-blocking, check the file descriptor for received data ++ struct timeval tv = {0}; ++ int count = select(udev_monitor_get_fd(m_udevMon) + 1, &readfds, NULL, NULL, &tv); ++ if (count < 0) ++ return false; ++ ++ if (FD_ISSET(udev_monitor_get_fd(m_udevMon), &readfds)) ++ { ++ struct udev_device *dev = udev_monitor_receive_device(m_udevMon); ++ if (!dev) ++ return false; ++ ++ const char *action = udev_device_get_action(dev); ++ const char *devtype = udev_device_get_devtype(dev); ++ if (action) ++ { ++ const char *label = udev_device_get_property_value(dev, "ID_FS_LABEL"); ++ const char *mountpoint = get_mountpoint(udev_device_get_devnode(dev)); ++ if (!label) ++ label = URIUtils::GetFileName(mountpoint); ++ ++ if (!strcmp(action, "add") && !strcmp(devtype, "partition")) ++ { ++ CLog::Log(LOGNOTICE, "UDev: Added %s", mountpoint); ++ if (callback) ++ callback->OnStorageAdded(label, mountpoint); ++ changed = true; ++ } ++ if (!strcmp(action, "remove") && !strcmp(devtype, "partition")) ++ { ++ CLog::Log(LOGNOTICE, "UDev: Removed %s", mountpoint); ++ if (callback) ++ callback->OnStorageSafelyRemoved(label); ++ changed = true; ++ } ++ } ++ udev_device_unref(dev); ++ } ++ ++ return changed; ++} ++ ++#endif +diff --git a/xbmc/storage/linux/UDevProvider.h b/xbmc/storage/linux/UDevProvider.h +new file mode 100644 +index 0000000..6b51e2a +--- /dev/null ++++ b/xbmc/storage/linux/UDevProvider.h +@@ -0,0 +1,55 @@ ++#pragma once ++/* ++ * Copyright (C) 2005-2012 Team XBMC ++ * http://www.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 "storage/IStorageProvider.h" ++ ++#ifdef HAVE_LIBUDEV ++ ++struct udev; ++struct udev_monitor; ++ ++class CUDevProvider : public IStorageProvider ++{ ++public: ++ CUDevProvider(); ++ virtual ~CUDevProvider() { } ++ ++ virtual void Initialize(); ++ virtual void Stop(); ++ ++ virtual void GetLocalDrives(VECSOURCES &localDrives); ++ virtual void GetRemovableDrives(VECSOURCES &removableDrives); ++ ++ virtual bool Eject(CStdString mountpath); ++ ++ virtual std::vector GetDiskUsage(); ++ ++ virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback); ++ ++private: ++ void GetDisks(VECSOURCES& devices, bool removable); ++ ++ struct udev *m_udev; ++ struct udev_monitor *m_udevMon; ++}; ++ ++#endif +-- +1.8.1.6 + From a4e1da6d54b8dc615076d9b3c851cef6b18691b4 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 14:55:24 +0200 Subject: [PATCH 14/23] gettext: convert to new package format Signed-off-by: Stephan Raue --- .../toolchain/devel/autotools/gettext/build | 39 ------------------- .../autotools/gettext/{meta => package.mk} | 8 +++- 2 files changed, 6 insertions(+), 41 deletions(-) delete mode 100755 packages/toolchain/devel/autotools/gettext/build rename packages/toolchain/devel/autotools/gettext/{meta => package.mk} (91%) diff --git a/packages/toolchain/devel/autotools/gettext/build b/packages/toolchain/devel/autotools/gettext/build deleted file mode 100755 index 03d8937950..0000000000 --- a/packages/toolchain/devel/autotools/gettext/build +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -setup_toolchain host - -cd $PKG_BUILD -./configure --host=$HOST_NAME \ - --build=$HOST_NAME \ - --target=$TARGET_NAME \ - --prefix=$ROOT/$TOOLCHAIN \ - --enable-shared \ - --disable-static \ - --disable-rpath \ - --with-gnu-ld \ - --without-emacs - -make -make install diff --git a/packages/toolchain/devel/autotools/gettext/meta b/packages/toolchain/devel/autotools/gettext/package.mk similarity index 91% rename from packages/toolchain/devel/autotools/gettext/meta rename to packages/toolchain/devel/autotools/gettext/package.mk index 637d22f1bf..4d359633fc 100644 --- a/packages/toolchain/devel/autotools/gettext/meta +++ b/packages/toolchain/devel/autotools/gettext/package.mk @@ -26,11 +26,15 @@ PKG_LICENSE="GPL" PKG_SITE="http://www.gnu.org/s/gettext/" PKG_URL="http://ftp.gnu.org/pub/gnu/gettext/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS="" -PKG_BUILD_DEPENDS="ccache" +PKG_BUILD_DEPENDS_HOST="ccache" PKG_PRIORITY="optional" PKG_SECTION="toolchain/devel" PKG_SHORTDESC="gettext: A program internationalization library and tools" PKG_LONGDESC="This is the GNU gettext package. It is interesting for authors or maintainers of other packages or programs which they want to see internationalized. As one step the handling of messages in different languages should be implemented. For this task GNU gettext provides the needed tools and library functions." -PKG_IS_ADDON="no" +PKG_IS_ADDON="no" PKG_AUTORECONF="no" + +PKG_CONFIGURE_OPTS_HOST="--disable-rpath \ + --with-gnu-ld \ + --without-emacs" From 095df924a465910c38e4b12d6c0db7909deb9a7c Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 14:55:52 +0200 Subject: [PATCH 15/23] gettext: update to gettext-0.18.3.1 Signed-off-by: Stephan Raue --- packages/toolchain/devel/autotools/gettext/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/toolchain/devel/autotools/gettext/package.mk b/packages/toolchain/devel/autotools/gettext/package.mk index 4d359633fc..e4d111a5cb 100644 --- a/packages/toolchain/devel/autotools/gettext/package.mk +++ b/packages/toolchain/devel/autotools/gettext/package.mk @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="gettext" -PKG_VERSION="0.18.3" +PKG_VERSION="0.18.3.1" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 188cfb99365c70ee0927d624279a6ea0b0975f91 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:02:04 +0200 Subject: [PATCH 16/23] autoconf: depends on gettext:host Signed-off-by: Stephan Raue --- packages/toolchain/devel/autotools/autoconf/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/toolchain/devel/autotools/autoconf/meta b/packages/toolchain/devel/autotools/autoconf/meta index d94be5de0b..f5562ee6b8 100644 --- a/packages/toolchain/devel/autotools/autoconf/meta +++ b/packages/toolchain/devel/autotools/autoconf/meta @@ -26,7 +26,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://sources.redhat.com/autoconf/" PKG_URL="http://ftp.gnu.org/gnu/autoconf/$PKG_NAME-$PKG_VERSION.tar.xz" PKG_DEPENDS="" -PKG_BUILD_DEPENDS="ccache m4 gettext" +PKG_BUILD_DEPENDS="ccache m4 gettext:host" PKG_PRIORITY="optional" PKG_SECTION="toolchain/devel" PKG_SHORTDESC="autoconf: A GNU tool for automatically configuring source code" From 275328959c76b43a59ac16d7b2c1578b20c76fb1 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:02:20 +0200 Subject: [PATCH 17/23] pkg-config: depends on gettext:host Signed-off-by: Stephan Raue --- packages/toolchain/devel/pkg-config/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/toolchain/devel/pkg-config/meta b/packages/toolchain/devel/pkg-config/meta index 7cff973a3a..8b4957d3b1 100644 --- a/packages/toolchain/devel/pkg-config/meta +++ b/packages/toolchain/devel/pkg-config/meta @@ -26,7 +26,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://www.freedesktop.org/software/pkgconfig/" PKG_URL="http://pkgconfig.freedesktop.org/releases/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS="" -PKG_BUILD_DEPENDS="ccache gettext" +PKG_BUILD_DEPENDS="ccache gettext:host" PKG_PRIORITY="optional" PKG_SECTION="toolchain/devel" PKG_SHORTDESC="pkg-config: A library configuration management system" From ac42de2a3c117a9a417f0183a851b8f3d0c0b0f1 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:12:46 +0200 Subject: [PATCH 18/23] service.openelec.settings: update to service.openelec.settings-0.2.10 Signed-off-by: Stephan Raue --- packages/mediacenter/service.openelec.settings/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mediacenter/service.openelec.settings/meta b/packages/mediacenter/service.openelec.settings/meta index 21311cd3cf..1a3f62d8b8 100644 --- a/packages/mediacenter/service.openelec.settings/meta +++ b/packages/mediacenter/service.openelec.settings/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="service.openelec.settings" -PKG_VERSION="0.2.8" +PKG_VERSION="0.2.10" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="prop." From 1fe0933a198202a1cdeadd51324f87b954b7ecd6 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:44:54 +0200 Subject: [PATCH 19/23] libgcrypt: convert to new package format Signed-off-by: Stephan Raue --- packages/security/libgcrypt/build | 41 ------------------- packages/security/libgcrypt/install | 26 ------------ .../security/libgcrypt/{meta => package.mk} | 11 ++++- 3 files changed, 10 insertions(+), 68 deletions(-) delete mode 100755 packages/security/libgcrypt/build delete mode 100755 packages/security/libgcrypt/install rename packages/security/libgcrypt/{meta => package.mk} (88%) diff --git a/packages/security/libgcrypt/build b/packages/security/libgcrypt/build deleted file mode 100755 index 83c25a709b..0000000000 --- a/packages/security/libgcrypt/build +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -cd $PKG_BUILD -./configure --host=$TARGET_NAME \ - --build=$HOST_NAME \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-static \ - --enable-shared \ - --disable-asm \ - --with-gnu-ld - -make -$MAKEINSTALL - -sed -e "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" -i src/libgcrypt-config - -cp src/libgcrypt-config $ROOT/$TOOLCHAIN/bin diff --git a/packages/security/libgcrypt/install b/packages/security/libgcrypt/install deleted file mode 100755 index 9a1692eb11..0000000000 --- a/packages/security/libgcrypt/install +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -mkdir -p $INSTALL/usr/lib - cp -P $PKG_BUILD/src/.libs/*.so* $INSTALL/usr/lib diff --git a/packages/security/libgcrypt/meta b/packages/security/libgcrypt/package.mk similarity index 88% rename from packages/security/libgcrypt/meta rename to packages/security/libgcrypt/package.mk index 8fcecb7133..ae2a3d0419 100644 --- a/packages/security/libgcrypt/meta +++ b/packages/security/libgcrypt/package.mk @@ -31,6 +31,15 @@ PKG_PRIORITY="optional" PKG_SECTION="security" PKG_SHORTDESC="libgcrypt: General purpose cryptographic library" PKG_LONGDESC="Libgcrypt is a general purpose cryptographic library based on the code from GnuPG. It provides functions for all cryptographic building blocks: symmetric ciphers, hash algorithms, MACs, public key algorithms, large integer functions, random numbers and a lot of supporting functions." -PKG_IS_ADDON="no" +PKG_IS_ADDON="no" PKG_AUTORECONF="yes" + +PKG_CONFIGURE_OPTS_TARGET="--disable-asm --with-gnu-ld" + +post_makeinstall_target() { + sed -e "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" -i src/libgcrypt-config + cp src/libgcrypt-config $ROOT/$TOOLCHAIN/bin + + rm -rf $INSTALL/usr/bin +} From 531b5216d895af518cca16725a033aa0f1205c8b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:46:37 +0200 Subject: [PATCH 20/23] libgcrypt: update to libgcrypt-1.5.3 Signed-off-by: Stephan Raue --- packages/security/libgcrypt/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/security/libgcrypt/package.mk b/packages/security/libgcrypt/package.mk index ae2a3d0419..c2ea5cb41a 100644 --- a/packages/security/libgcrypt/package.mk +++ b/packages/security/libgcrypt/package.mk @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="libgcrypt" -PKG_VERSION="1.5.2" +PKG_VERSION="1.5.3" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 86fcf0dcfe01e341eecdab33d07d2240bd35f131 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:53:56 +0200 Subject: [PATCH 21/23] libssh: convert to new package format Signed-off-by: Stephan Raue --- packages/network/libssh/build | 50 -------------------- packages/network/libssh/{meta => package.mk} | 30 +++++++++++- 2 files changed, 28 insertions(+), 52 deletions(-) delete mode 100755 packages/network/libssh/build rename packages/network/libssh/{meta => package.mk} (64%) diff --git a/packages/network/libssh/build b/packages/network/libssh/build deleted file mode 100755 index f910dca69b..0000000000 --- a/packages/network/libssh/build +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) -# -# 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 OpenELEC.tv; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. -# http://www.gnu.org/copyleft/gpl.html -################################################################################ - -. config/options $1 - -cd $PKG_BUILD -mkdir -p build && cd build - -cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DWITH_STATIC_LIB=1 -DWITH_GCRYPT="ON" \ - .. - -make - -# install static library only - mkdir -p $SYSROOT_PREFIX/usr/lib - cp src/libssh.a $SYSROOT_PREFIX/usr/lib - cp src/threads/libssh_threads.a $SYSROOT_PREFIX/usr/lib - - mkdir -p $SYSROOT_PREFIX/usr/lib/pkgconfig - cp libssh.pc $SYSROOT_PREFIX/usr/lib/pkgconfig - cp libssh_threads.pc $SYSROOT_PREFIX/usr/lib/pkgconfig - - mkdir -p $SYSROOT_PREFIX/usr/include/libssh - cp ../include/libssh/callbacks.h $SYSROOT_PREFIX/usr/include/libssh - cp ../include/libssh/legacy.h $SYSROOT_PREFIX/usr/include/libssh - cp ../include/libssh/libssh.h $SYSROOT_PREFIX/usr/include/libssh - cp ../include/libssh/server.h $SYSROOT_PREFIX/usr/include/libssh - cp ../include/libssh/sftp.h $SYSROOT_PREFIX/usr/include/libssh - cp ../include/libssh/ssh2.h $SYSROOT_PREFIX/usr/include/libssh diff --git a/packages/network/libssh/meta b/packages/network/libssh/package.mk similarity index 64% rename from packages/network/libssh/meta rename to packages/network/libssh/package.mk index ece585c79f..facf139123 100644 --- a/packages/network/libssh/meta +++ b/packages/network/libssh/package.mk @@ -26,11 +26,37 @@ PKG_LICENSE="OpenSource" PKG_SITE="http://www.libssh.org/" PKG_URL="http://www.libssh.org/files/0.5/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS="zlib libgcrypt" -PKG_BUILD_DEPENDS="toolchain zlib libgcrypt" +PKG_BUILD_DEPENDS_TARGET="toolchain zlib libgcrypt" PKG_PRIORITY="optional" PKG_SECTION="network" PKG_SHORTDESC="libssh: A working SSH implementation by means of a library" PKG_LONGDESC="The ssh library was designed to be used by programmers needing a working SSH implementation by the mean of a library. The complete control of the client is made by the programmer. With libssh, you can remotely execute programs, transfer files, use a secure and transparent tunnel for your remote programs. With its Secure FTP implementation, you can play with remote files easily, without third-party programs others than libcrypto (from openssl)." -PKG_IS_ADDON="no" +PKG_IS_ADDON="no" PKG_AUTORECONF="no" + +configure_target() { + cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_STATIC_LIB=1 -DWITH_GCRYPT="ON" \ + .. +} + +makeinstall_target() { +# install static library only + mkdir -p $SYSROOT_PREFIX/usr/lib + cp src/libssh.a $SYSROOT_PREFIX/usr/lib + cp src/threads/libssh_threads.a $SYSROOT_PREFIX/usr/lib + + mkdir -p $SYSROOT_PREFIX/usr/lib/pkgconfig + cp libssh.pc $SYSROOT_PREFIX/usr/lib/pkgconfig + cp libssh_threads.pc $SYSROOT_PREFIX/usr/lib/pkgconfig + + mkdir -p $SYSROOT_PREFIX/usr/include/libssh + cp ../include/libssh/callbacks.h $SYSROOT_PREFIX/usr/include/libssh + cp ../include/libssh/legacy.h $SYSROOT_PREFIX/usr/include/libssh + cp ../include/libssh/libssh.h $SYSROOT_PREFIX/usr/include/libssh + cp ../include/libssh/server.h $SYSROOT_PREFIX/usr/include/libssh + cp ../include/libssh/sftp.h $SYSROOT_PREFIX/usr/include/libssh + cp ../include/libssh/ssh2.h $SYSROOT_PREFIX/usr/include/libssh +} From ced2a7f06ee5c0e837506b0fdccbaac737f08094 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:54:45 +0200 Subject: [PATCH 22/23] libssh: update to libssh-0.5.5 Signed-off-by: Stephan Raue --- packages/network/libssh/package.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/network/libssh/package.mk b/packages/network/libssh/package.mk index facf139123..191b46a80b 100644 --- a/packages/network/libssh/package.mk +++ b/packages/network/libssh/package.mk @@ -19,12 +19,13 @@ ################################################################################ PKG_NAME="libssh" -PKG_VERSION="0.5.2" +PKG_VERSION="0.5.5" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="OpenSource" PKG_SITE="http://www.libssh.org/" -PKG_URL="http://www.libssh.org/files/0.5/$PKG_NAME-$PKG_VERSION.tar.gz" +# PKG_URL="http://www.libssh.org/files/0.5/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_URL="https://red.libssh.org/attachments/download/51/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS="zlib libgcrypt" PKG_BUILD_DEPENDS_TARGET="toolchain zlib libgcrypt" PKG_PRIORITY="optional" From 7767678fac00feec059d57b5ea3e3d9ad7e2be68 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 Aug 2013 15:55:26 +0200 Subject: [PATCH 23/23] libgcrypt: fix package script Signed-off-by: Stephan Raue --- packages/security/libgcrypt/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/security/libgcrypt/package.mk b/packages/security/libgcrypt/package.mk index c2ea5cb41a..b3da84471a 100644 --- a/packages/security/libgcrypt/package.mk +++ b/packages/security/libgcrypt/package.mk @@ -26,7 +26,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://www.gnupg.org/" PKG_URL="ftp://ftp.gnupg.org/gcrypt/libgcrypt/$PKG_NAME-$PKG_VERSION.tar.bz2" PKG_DEPENDS="libgpg-error" -PKG_BUILD_DEPENDS="toolchain libgpg-error" +PKG_BUILD_DEPENDS_TARGET="toolchain libgpg-error" PKG_PRIORITY="optional" PKG_SECTION="security" PKG_SHORTDESC="libgcrypt: General purpose cryptographic library"