diff options
75 files changed, 238 insertions, 1913 deletions
diff --git a/.travis.yml b/.travis.yml index cdc092f6f1..a6074f9788 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ install: gettext git-core gperf libasound2-dev libass-dev libbluray-dev libbz2-dev libcap-dev libcdio-dev libcec4-dev libcrossguid-dev libcurl3 libcurl4-openssl-dev libdbus-1-dev libfmt3-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev libgl1-mesa-dev libglu1-mesa-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev - libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev libsqlite3-dev libssh-dev + libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libyajl-dev mesa-utils nasm pmount python-dev python-imaging python-sqlite rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev; diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aff11fb97..4350a82bd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,6 @@ set(optional_deps Alsa Python SmbClient Sndio - SSH UDEV XSLT ${PLATFORM_OPTIONAL_DEPS}) diff --git a/cmake/cpack/deb/copyright b/cmake/cpack/deb/copyright index ba82f18883..3033afd865 100644 --- a/cmake/cpack/deb/copyright +++ b/cmake/cpack/deb/copyright @@ -1920,14 +1920,6 @@ Crystal HD You should have received a copy of the GNU General Public License along with this driver. If not, see <http://www.gnu.org/licenses/>. -OpenSSH -<http://www.openssh.org/> - - Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland - All rights reserved. - - See the section 'License: OpenSSH' for full license terms. - Enca - Extremely Naive Charset Analyser <http://freshmeat.net/projects/enca/> @@ -2916,211 +2908,3 @@ We are required to state that CompuServe Incorporated." -- End of IJG License -- - -License: OpenSSH - -This file is part of the OpenSSH software. - -The licences which components of this software fall under are as -follows. First, we will summarize and say that all components -are under a BSD licence, or a licence more free than that. - -OpenSSH contains no GPL code. - -1) - * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland - * All rights reserved - * - * As far as I am concerned, the code I have written for this software - * can be used freely for any purpose. Any derived versions of this - * software must be clearly marked as such, and if the derived work is - * incompatible with the protocol description in the RFC file, it must be - * called by a name other than "ssh" or "Secure Shell". - - [Tatu continues] - * However, I am not implying to give any licenses to any patents or - * copyrights held by third parties, and the software includes parts that - * are not under my direct control. As far as I know, all included - * source code is used in accordance with the relevant license agreements - * and can be used freely for any purpose (the GNU license being the most - * restrictive); see below for details. - - [However, none of that term is relevant at this point in time. All of - these restrictively licenced software components which he talks about - have been removed from OpenSSH, i.e., - - - RSA is no longer included, found in the OpenSSL library - - IDEA is no longer included, its use is deprecated - - DES is now external, in the OpenSSL library - - GMP is no longer used, and instead we call BN code from OpenSSL - - Zlib is now external, in a library - - The make-ssh-known-hosts script is no longer included - - TSS has been removed - - MD5 is now external, in the OpenSSL library - - RC4 support has been replaced with ARC4 support from OpenSSL - - Blowfish is now external, in the OpenSSL library - - [The licence continues] - - Note that any information and cryptographic algorithms used in this - software are publicly available on the Internet and at any major - bookstore, scientific library, and patent office worldwide. More - information can be found e.g. at "http://www.cs.hut.fi/crypto". - - The legal status of this program is some combination of all these - permissions and restrictions. Use only at your own responsibility. - You will be responsible for any legal consequences yourself; I am not - making any claims whether possessing or using this is legal or not in - your country, and I am not taking any responsibility on your behalf. - - - NO WARRANTY - - BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY - FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN - OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES - PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED - OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS - TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, - REPAIR OR CORRECTION. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING - WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, - INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING - OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED - TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY - YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGES. - -2) - The 32-bit CRC compensation attack detector in deattack.c was - contributed by CORE SDI S.A. under a BSD-style license. - - * Cryptographic attack detector for ssh - source code - * - * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina. - * - * All rights reserved. Redistribution and use in source and binary - * forms, with or without modification, are permitted provided that - * this copyright notice is retained. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL CORE SDI S.A. BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR - * CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS - * SOFTWARE. - * - * Ariel Futoransky <futo@core-sdi.com> - * <http://www.core-sdi.com> - -3) - ssh-keyscan was contributed by David Mazieres under a BSD-style - license. - - * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. - * - * Modification and redistribution in source and binary forms is - * permitted provided that due credit is given to the author and the - * OpenBSD project by leaving this copyright notice intact. - -4) - The Rijndael implementation by Vincent Rijmen, Antoon Bosselaers - and Paulo Barreto is in the public domain and distributed - with the following license: - - * @version 3.0 (December 2000) - * - * Optimised ANSI C code for the Rijndael cipher (now AES) - * - * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be> - * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be> - * @author Paulo Barreto <paulo.barreto@terra.com.br> - * - * This code is hereby placed in the public domain. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -5) - One component of the ssh source code is under a 3-clause BSD license, - held by the University of California, since we pulled these parts from - original Berkeley code. - - * Copyright (c) 1983, 1990, 1992, 1993, 1995 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - -6) - Remaining components of the software are provided under a standard - 2-term BSD licence with the following names as copyright holders: - - Markus Friedl - Theo de Raadt - Niels Provos - Dug Song - Aaron Campbell - Damien Miller - Kevin Steves - Daniel Kouril - Wesley Griffin - Per Allansson - Nils Nordman - Simon Wilkinson - - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --- End of OpenSSH License -- diff --git a/cmake/cpack/deb/packages/kodi.txt.in b/cmake/cpack/deb/packages/kodi.txt.in index 90ae9ea298..5ab89054cd 100644 --- a/cmake/cpack/deb/packages/kodi.txt.in +++ b/cmake/cpack/deb/packages/kodi.txt.in @@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all PACKAGE_SECTION video PACKAGE_PRIORITY optional PACKAGE_SHLIBDEPS -PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2 +PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2 PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake deleted file mode 100644 index b88e769fe5..0000000000 --- a/cmake/modules/FindSSH.cmake +++ /dev/null @@ -1,47 +0,0 @@ -#.rst: -# FindSSH -# ------- -# Finds the SSH library -# -# This will define the following variables:: -# -# SSH_FOUND - system has SSH -# SSH_INCLUDE_DIRS - the SSH include directory -# SSH_LIBRARIES - the SSH libraries -# SSH_DEFINITIONS - the SSH definitions -# -# and the following imported targets:: -# -# SSH::SSH - The SSH library - -if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_SSH libssh>=0.6 QUIET) -endif() - -find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h - PATHS ${PC_SSH_INCLUDEDIR}) -find_library(SSH_LIBRARY NAMES ssh - PATHS ${PC_SSH_LIBDIR}) - -set(SSH_VERSION ${PC_SSH_VERSION}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SSH - REQUIRED_VARS SSH_LIBRARY SSH_INCLUDE_DIR - VERSION_VAR SSH_VERSION) - -if(SSH_FOUND) - set(SSH_LIBRARIES ${SSH_LIBRARY}) - set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR}) - set(SSH_DEFINITIONS -DHAS_FILESYSTEM_SFTP=1) - - if(NOT TARGET SSH::SSH) - add_library(SSH::SSH UNKNOWN IMPORTED) - set_target_properties(SSH::SSH PROPERTIES - IMPORTED_LOCATION "${SSH_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}" - INTERFACE_COMPILE_DEFINITIONS HAS_FILESYSTEM_SFTP=1) - endif() -endif() - -mark_as_advanced(SSH_INCLUDE_DIR SSH_LIBRARY) diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index 48d4a4738e..b94842f75f 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake @@ -87,7 +87,7 @@ foreach(_lib ${_nodefaultlibs_DEBUG}) endforeach() # DELAYLOAD option -set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll ssh.dll sqlite3.dll +set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll avcodec-58.dll avfilter-7.dll avformat-58.dll avutil-56.dll postproc-55.dll swresample-3.dll swscale-5.dll d3dcompiler_47.dll) foreach(_lib ${_delayloadlibs}) diff --git a/docs/README.FreeBSD b/docs/README.FreeBSD index 1314730a55..4d752c670a 100644 --- a/docs/README.FreeBSD +++ b/docs/README.FreeBSD @@ -47,7 +47,7 @@ that are used to build Kodi packages on Debian/Ubuntu (with all supported external libraries enabled). $ pkg install taglib gstreamer1-vaapi hal libcapn \ -enca gawk gperf cmake zip nasm swig30 libssh openjdk8 libtool gettext-tools \ +enca gawk gperf cmake zip nasm swig30 openjdk8 libtool gettext-tools \ gmake pkgconf rapidjson mesa-libs doxygen glproto dri2proto dri3proto libass \ flac libcdio curl dbus fontconfig freetype2 fribidi \ libgcrypt gmp libgpg-error gnutls libidn libinotify lzo2 \ diff --git a/docs/README.fedora b/docs/README.fedora index 69e05bd0c3..b9240ecd53 100755 --- a/docs/README.fedora +++ b/docs/README.fedora @@ -50,7 +50,7 @@ fribidi-devel giflib-devel \ libjpeg-turbo-devel libtool-ltdl-devel lzo-devel libmicrohttpd-devel \ libmpc-devel mariadb-devel libnfs-devel \ pcre-devel libplist-devel libpng12-devel \ -shairplay-devel libsmbclient-devel sqlite-devel libssh-devel openssl-devel ffmpeg-devel \ +shairplay-devel libsmbclient-devel sqlite-devel openssl-devel ffmpeg-devel \ taglib-devel tinyxml-devel libtool-ltdl-devel libudev-devel \ libusb-devel libva-devel libvdpau-devel libxml2-devel \ libXmu-devel libXrandr-devel libxslt-devel libXt-devel rapidjson-devel \ diff --git a/docs/README.linux b/docs/README.linux index ee1c5b4cf4..e7e722010c 100644 --- a/docs/README.linux +++ b/docs/README.linux @@ -53,7 +53,7 @@ Build-Depends: autoconf, automake, autopoint, autotools-dev, cmake, curl, libiso9660-dev, libjpeg-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmpcdec-dev, libmysqlclient-dev, libnfs-dev, libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev, - libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssh-dev, libssl-dev, libswscale-dev, + libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssl-dev, libswscale-dev, libtag1-dev (>= 1.8), libtinyxml-dev (>= 2.6.2), libtool, libudev-dev, libusb-dev, libva-dev, libvdpau-dev, libxml2-dev, libxmu-dev, libxrandr-dev, libxslt1-dev, libxt-dev, lsb-release, rapidjson-dev, diff --git a/docs/README.opensuse b/docs/README.opensuse index ba69543943..125db44f35 100644 --- a/docs/README.opensuse +++ b/docs/README.opensuse @@ -54,7 +54,7 @@ libvorbis-devel libmodplug-devel libcurl-devel flac-devel libbz2-devel libtiff-d fribidi-devel sqlite3-devel libpng12-devel pcre-devel libcdio-devel libjasper-devel libmicrohttpd-devel libsmbclient-devel python-devel gperf nasm tinyxml-devel libtag-devel libbluray-devel libnfs-devel shairplay-devel swig libvdpau-devel libavahi-devel libcec-devel libdvdread-devel libva-devel libplist-devel -libxst-devel alsa-devel libpulse-devel libXrandr-devel libXrender-devel randrproto-devel renderproto-devel libssh-devel +libxst-devel alsa-devel libpulse-devel libXrandr-devel libXrender-devel randrproto-devel renderproto-devel libudev-devel libpcap-devel libgudev-1_0-devel libcap-ng-devel libcap-devel ccache doxygen capi4linux-devel liblcms2-devel libunistring-devel @@ -69,7 +69,7 @@ Build-Depends: autoconf, automake, autopoint, autotools-dev, cmake, curl, libiso9660-dev, libjpeg-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmpcdec-dev, libmysqlclient-dev, libnfs-dev, libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev, - libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssh-dev, libssl-dev, libswscale-dev, + libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssl-dev, libswscale-dev, libtag1-dev (>= 1.8), libtinyxml-dev (>= 2.6.2), libtool, libudev-dev, libusb-dev, libva-dev, libvdpau-dev, libxml2-dev, libxmu-dev, libxrandr-dev, libxslt1-dev, libxt-dev, libyajl-dev (>=2.0), lsb-release, diff --git a/docs/README.ubuntu b/docs/README.ubuntu index fba3d86cf9..313d9053d1 100644 --- a/docs/README.ubuntu +++ b/docs/README.ubuntu @@ -88,7 +88,7 @@ For Ubuntu (all versions >= 7.04): libfribidi-dev libgif-dev libiso9660-dev libjpeg-dev liblzo2-dev \ libmicrohttpd-dev libmysqlclient-dev libnfs-dev \ libpcre3-dev libplist-dev libpng-dev libpulse-dev libsmbclient-dev \ - libsqlite3-dev libssh-dev libssl-dev libtinyxml-dev libtool libudev-dev libusb-dev \ + libsqlite3-dev libssl-dev libtinyxml-dev libtool libudev-dev libusb-dev \ libva-dev libvdpau-dev libxml2-dev libxmu-dev libxrandr-dev \ libxrender-dev libxslt1-dev libxt-dev mesa-utils nasm pmount python-dev python-imaging \ python-sqlite rapidjson-dev swig uuid-dev yasm zlib1g-dev liblirc-dev diff --git a/project/BuildDependencies/scripts/0_package.target-win10-arm.list b/project/BuildDependencies/scripts/0_package.target-win10-arm.list index a7874357c7..8ac20dd94a 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-arm.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-arm.list @@ -22,7 +22,6 @@ libiconv-1.15-win10-ARM-v141.7z libmicrohttpd-0.9.55-win10-ARM-v140.7z libnfs-1.11.0-win10-ARM-v140.7z libplist-1.12-win10-ARM-v140.7z -libssh-0.7.0-v1-win10-ARM-v140.7z libxml2-2.9.4-win10-ARM-v141.7z libxslt-1.1.29-win10-ARM-v140.7z lzo2-2.09-win10-ARM-v140.7z @@ -38,4 +37,4 @@ shairplay-ce80e00-win10-ARM-v140.7z sqlite-3170000-win10-ARM-v140.7z taglib-1.11.1-win10-ARM-v140.7z tinyxml-2.6.2-win10-ARM-v140.7z -zlib-1.2.11-win10-ARM-v140.7z
\ No newline at end of file +zlib-1.2.11-win10-ARM-v140.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win10-win32.list b/project/BuildDependencies/scripts/0_package.target-win10-win32.list index 67ba2bf86a..73ec8a18f9 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-win32.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-win32.list @@ -22,7 +22,6 @@ libiconv-1.15-win10-Win32-v141.7z libmicrohttpd-0.9.55-win10-Win32-v140.7z libnfs-1.11.0-win10-Win32-v140.7z libplist-1.12-win10-Win32-v140.7z -libssh-0.7.0-v1-win10-Win32-v140.7z libxml2-2.9.4-win10-Win32-v141.7z libxslt-1.1.29-win10-Win32-v140.7z lzo2-2.09-win10-Win32-v140.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win10-x64.list b/project/BuildDependencies/scripts/0_package.target-win10-x64.list index b32aca19b4..77bd661027 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-x64.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-x64.list @@ -22,7 +22,6 @@ libiconv-1.15-win10-x64-v141.7z libmicrohttpd-0.9.55-win10-x64-v140.7z libnfs-1.11.0-win10-x64-v140.7z libplist-1.12-win10-x64-v140.7z -libssh-0.7.0-v1-win10-x64-v140.7z libxml2-2.9.4-win10-x64-v141.7z libxslt-1.1.29-win10-x64-v140.7z lzo2-2.09-win10-x64-v140.7z @@ -38,4 +37,4 @@ shairplay-ce80e00-win10-x64-v140.7z sqlite-3170000-win10-x64-v140.7z taglib-1.11.1-win10-x64-v140.7z tinyxml-2.6.2-win10-x64-v140.7z -zlib-1.2.11-win10-x64-v140.7z
\ No newline at end of file +zlib-1.2.11-win10-x64-v140.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win32.list b/project/BuildDependencies/scripts/0_package.target-win32.list index 5f1bd083b5..8eeee86e45 100644 --- a/project/BuildDependencies/scripts/0_package.target-win32.list +++ b/project/BuildDependencies/scripts/0_package.target-win32.list @@ -27,7 +27,6 @@ libmicrohttpd-0.9.55-win32-vc140.7z libnfs-1.10.0-win32.7z libplist-1.13.0-win32-vc140.7z libpng-1.6.21-win32-vc140.7z -libssh-0.7.0-win32-vc140.7z libxml2-2.9.4-win32-vc140-v2.7z libxslt-1.1.29-win32-vc140.7z lzo-2.09-win32-vc140-v3.7z diff --git a/project/BuildDependencies/scripts/0_package.target-x64.list b/project/BuildDependencies/scripts/0_package.target-x64.list index a4a27add7b..a3151a7109 100644 --- a/project/BuildDependencies/scripts/0_package.target-x64.list +++ b/project/BuildDependencies/scripts/0_package.target-x64.list @@ -24,7 +24,6 @@ libiconv-1.15-x64-vc140.7z libmicrohttpd-0.9.55-x64-vc140.7z libnfs-1.11.0-x64-vc140-v2.7z libplist-1.12-x64-vc140.7z -libssh-0.7.4-x64-vc140.7z libxml2-2.9.4-x64-vc140.7z libxslt-1.1.29-x64-vc140.7z lzo-2.09-x64-vc140.7z diff --git a/system/settings/settings.xml b/system/settings/settings.xml index a6b9080cf5..dea94ec2ae 100755 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2008,6 +2008,7 @@ <condition>HAVE_WAYLAND</condition> <condition>HAVE_OSX</condition> <condition>HAS_DX</condition> + <condition>HAVE_IOS</condition> </or> </requirement> <level>0</level> diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 4cd6060c60..f2028b235b 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -12,7 +12,7 @@ DEPENDS = \ libxml2 rapidjson libmicrohttpd mariadb libffi \ python27 libshairplay libfmt \ libplist libcec libbluray tinyxml \ - libssh taglib libusb libnfs \ + taglib libusb libnfs \ pythonmodule-pil pythonmodule-pycryptodome pythonmodule-setuptools \ libxslt ffmpeg platform crossguid \ libdvdread libdvdnav libdvdcss p8-platform @@ -99,7 +99,6 @@ libcdio: $(ICONV) libcdio-gplv3: $(ICONV) libplist: $(ZLIB) libbluray: $(ICONV) libxml2 -libssh: libgcrypt openssl $(ZLIB) mariadb: openssl $(ICONV) $(ZLIB) libzip: $(ZLIB) libpng: $(ZLIB) diff --git a/tools/depends/target/libssh/Makefile b/tools/depends/target/libssh/Makefile deleted file mode 100644 index 819f208e0e..0000000000 --- a/tools/depends/target/libssh/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -include ../../Makefile.include -DEPS= ../../Makefile.include Makefile removelegacy.patch android.patch darwin.patch darwin-no-fork.patch fix-gcc-5-compile.patch ntohl.patch md5.patch pkg-config.patch - -# lib name, version -LIBNAME=libssh -VERSION=0.7.0a -SOURCE=$(LIBNAME)-$(VERSION) -ARCHIVE=$(SOURCE).tar.gz - -LIBDYLIB=$(PLATFORM)/build/src/$(LIBNAME).a - -ifeq ($(OS),ios) -#_tlv_bootstrap aka __thread is private under ios/tvos. That is thread local storage, so disable it -CMAKE_EXTRAFLAGS=-DHAVE_GCC_THREAD_LOCAL_STORAGE=0 -endif - -all: .installed-$(PLATFORM) - -$(TARBALLS_LOCATION)/$(ARCHIVE): - cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) - -$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); rm -rf build; mkdir -p build - cd $(PLATFORM); patch -p0 < ../removelegacy.patch - cd $(PLATFORM); patch -p0 < ../android.patch - cd $(PLATFORM); patch -p0 < ../ntohl.patch - cd $(PLATFORM); patch -p0 < ../md5.patch - cd $(PLATFORM); patch -p1 < ../darwin.patch - cd $(PLATFORM); patch -p0 < ../fix-gcc-5-compile.patch - cd $(PLATFORM); patch -p0 < ../pkg-config.patch -ifeq ($(OS),ios) - cd $(PLATFORM); patch -p1 < ../darwin-no-fork.patch -endif - sed -ie "s|-fstack-protector|-fno-stack-protector|" "$(PLATFORM)/cmake/Modules/DefineCompilerFlags.cmake" - sed -ie "s|add_subdirectory(examples)||" "$(PLATFORM)/CMakeLists.txt" - cd $(PLATFORM)/build; $(CMAKE) -DWITH_STATIC_LIB=1 -DWITH_EXAMPLES=0 -DTHREADS_PTHREAD_ARG=0 $(CMAKE_EXTRAFLAGS) -DWITH_GSSAPI=0 VERBOSE=1 .. - -$(LIBDYLIB): $(PLATFORM) - make -j 1 -C $(PLATFORM)/build - -.installed-$(PLATFORM): $(LIBDYLIB) - make -C $(PLATFORM)/build install - rm -f $(PREFIX)/lib/libssh.so $(PREFIX)/lib/libssh.so.4.3.0 $(PREFIX)/lib/libssh.so.4 - rm -f $(PREFIX)/lib/libssh.*dylib* - rm -f $(PREFIX)/lib/libssh_threads.*dylib* - touch $@ - -clean: - rm -rf $(PLATFORM) .installed-$(PLATFORM) - -distclean:: - rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/tools/depends/target/libssh/android.patch b/tools/depends/target/libssh/android.patch deleted file mode 100644 index 8df5945608..0000000000 --- a/tools/depends/target/libssh/android.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- src/misc.c 2011-05-31 10:29:52.000000000 -0400 -+++ src/misc.c 2013-01-03 00:37:37.652737345 -0500 -@@ -207,6 +208,9 @@ - - char *ssh_get_user_home_dir(void) { - char *szPath = NULL; -+#ifdef ANDROID -+ return strdup(getenv("HOME")); -+#else - struct passwd pwd; - struct passwd *pwdbuf; - char buf[NSS_BUFLEN_PASSWD]; -@@ -225,7 +222,7 @@ - } - - szPath = strdup(pwd.pw_dir); -- -+#endif - return szPath; - } - -@@ -239,6 +236,17 @@ - } - - char *ssh_get_local_username(void) { -+#ifdef ANDROID -+ char *name = NULL; -+ struct passwd *pwd = NULL; -+ pwd = getpwuid(getuid()); -+ if ( pwd == NULL) { -+ return NULL; -+ } -+ -+ name = strdup(pwd->pw_name); -+ -+#else - struct passwd pwd; - struct passwd *pwdbuf; - char buf[NSS_BUFLEN_PASSWD]; -@@ -252,6 +264,7 @@ - - name = strdup(pwd.pw_name); - -+#endif - if (name == NULL) { - return NULL; diff --git a/tools/depends/target/libssh/darwin-no-fork.patch b/tools/depends/target/libssh/darwin-no-fork.patch deleted file mode 100644 index f3bdf8844a..0000000000 --- a/tools/depends/target/libssh/darwin-no-fork.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/src/socket.c-org 2015-09-20 17:19:13.000000000 -0400 -+++ b/src/socket.c 2015-09-20 17:19:56.000000000 -0400 -@@ -797,7 +797,7 @@ int ssh_socket_connect(ssh_socket s, con - return SSH_OK; - } - --#ifndef _WIN32 -+#if 0 - /** - * @internal - * @brief executes a command and redirect input and outputs ---- a/include/libssh/socket.h-org 2015-09-20 17:19:28.000000000 -0400 -+++ b/include/libssh/socket.h 2015-09-20 17:20:49.000000000 -0400 -@@ -37,9 +37,11 @@ void ssh_socket_set_fd(ssh_socket s, soc - socket_t ssh_socket_get_fd_in(ssh_socket s); - #ifndef _WIN32 - int ssh_socket_unix(ssh_socket s, const char *path); -+#if 0 - void ssh_execute_command(const char *command, socket_t in, socket_t out); - int ssh_socket_connect_proxycommand(ssh_socket s, const char *command); - #endif -+#endif - void ssh_socket_close(ssh_socket s); - int ssh_socket_write(ssh_socket s,const void *buffer, int len); - int ssh_socket_is_open(ssh_socket s); ---- a/src/client.c-org 2015-09-20 17:19:37.000000000 -0400 -+++ b/src/client.c 2015-09-20 17:20:04.000000000 -0400 -@@ -518,7 +518,7 @@ int ssh_connect(ssh_session session) { - session->session_state=SSH_SESSION_STATE_SOCKET_CONNECTED; - ssh_socket_set_fd(session->socket, session->opts.fd); - ret=SSH_OK; --#ifndef _WIN32 -+#if 0 - } else if (session->opts.ProxyCommand != NULL){ - ret = ssh_socket_connect_proxycommand(session->socket, - session->opts.ProxyCommand); diff --git a/tools/depends/target/libssh/darwin.patch b/tools/depends/target/libssh/darwin.patch deleted file mode 100644 index 2f37854a10..0000000000 --- a/tools/depends/target/libssh/darwin.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/ConfigureChecks.cmake 2014-12-27 04:30:13.000000000 -0600 -+++ b/ConfigureChecks.cmake 2015-01-07 12:20:43.000000000 -0600 -@@ -104,8 +104,14 @@ - check_function_exists(poll HAVE_POLL) - check_function_exists(select HAVE_SELECT) - check_function_exists(getaddrinfo HAVE_GETADDRINFO) -+ -+if (APPLE) -+check_symbol_exists(ntohll sys/_endian.h HAVE_NTOHLL) -+check_symbol_exists(htonll sys/_endian.h HAVE_HTONLL) -+else (APPLE) - check_function_exists(ntohll HAVE_NTOHLL) - check_function_exists(htonll HAVE_HTONLL) -+endif(APPLE) - - if (WIN32) - check_function_exists(_strtoui64 HAVE__STRTOUI64) diff --git a/tools/depends/target/libssh/fix-gcc-5-compile.patch b/tools/depends/target/libssh/fix-gcc-5-compile.patch deleted file mode 100644 index d015a9be6c..0000000000 --- a/tools/depends/target/libssh/fix-gcc-5-compile.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- include/libssh/pki_priv.h 2015-11-05 09:39:40.011875890 +0100 -+++ include/libssh/pki_priv.h 2015-11-05 09:39:34.151849945 +0100 -@@ -29,7 +29,7 @@ - #define ECDSA_HEADER_END "-----END EC PRIVATE KEY-----" - - #define ssh_pki_log(...) \ -- _ssh_pki_log(__FUNCTION__, __VA_ARGS__) -+ _ssh_pki_log(__extension__ __FUNCTION__, __VA_ARGS__) - void _ssh_pki_log(const char *function, - const char *format, ...) PRINTF_ATTRIBUTE(2, 3); - ---- include/libssh/priv.h 2015-11-05 09:39:40.011875890 +0100 -+++ include/libssh/priv.h 2015-11-05 09:41:01.272239916 +0100 -@@ -179,7 +179,7 @@ - const char *function, - const char *buffer); - #define SSH_LOG(priority, ...) \ -- _ssh_log(priority, __FUNCTION__, __VA_ARGS__) -+ _ssh_log(priority, __extension__ __FUNCTION__, __VA_ARGS__) - - /* LEGACY */ - void ssh_log_common(struct ssh_common_struct *common, -@@ -197,18 +197,18 @@ - }; - - #define ssh_set_error(error, code, ...) \ -- _ssh_set_error(error, code, __FUNCTION__, __VA_ARGS__) -+ _ssh_set_error(error, code, __extension__ __FUNCTION__, __VA_ARGS__) - void _ssh_set_error(void *error, - int code, - const char *function, - const char *descr, ...) PRINTF_ATTRIBUTE(4, 5); - - #define ssh_set_error_oom(error) \ -- _ssh_set_error_oom(error, __FUNCTION__) -+ _ssh_set_error_oom(error, __extension__ __FUNCTION__) - void _ssh_set_error_oom(void *error, const char *function); - - #define ssh_set_error_invalid(error) \ -- _ssh_set_error_invalid(error, __FUNCTION__) -+ _ssh_set_error_invalid(error, __extension__ __FUNCTION__) - void _ssh_set_error_invalid(void *error, const char *function); - - ---- src/auth.c 2014-12-27 11:30:13.000000000 +0100 -+++ src/auth.c 2015-11-05 09:42:41.732698584 +0100 -@@ -1548,7 +1548,7 @@ - * This should not happen - */ - rc = SSH_AUTH_ERROR; -- ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __FUNCTION__); -+ ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __extension__ __FUNCTION__); - } - return rc; - } diff --git a/tools/depends/target/libssh/md5.patch b/tools/depends/target/libssh/md5.patch deleted file mode 100644 index 84f4bec0ef..0000000000 --- a/tools/depends/target/libssh/md5.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- include/libssh/wrapper.h.orig 2014-12-27 12:03:55.521114159 +0100 -+++ include/libssh/wrapper.h 2014-12-27 12:06:35.072310640 +0100 -@@ -52,7 +52,7 @@ - }; - - typedef struct ssh_mac_ctx_struct *ssh_mac_ctx; --MD5CTX md5_init(void); -+MD5CTX ssh_md5_init(void); - void md5_update(MD5CTX c, const void *data, unsigned long len); - void md5_final(unsigned char *md,MD5CTX c); - ---- src/dh.c.orig 2014-12-27 12:08:07.441537435 +0100 -+++ src/dh.c 2014-12-27 12:09:25.539205892 +0100 -@@ -906,7 +906,7 @@ - return SSH_ERROR; - } - -- ctx = md5_init(); -+ ctx = ssh_md5_init(); - if (ctx == NULL) { - SAFE_FREE(h); - return SSH_ERROR; -@@ -1037,7 +1037,7 @@ - goto out; - } - -- ctx = md5_init(); -+ ctx = ssh_md5_init(); - if (ctx == NULL) { - free(h); - rc = -1; ---- src/kex1.c.orig 2014-12-27 12:11:18.307842585 +0100 -+++ src/kex1.c 2014-12-27 12:11:38.999225682 +0100 -@@ -78,7 +78,7 @@ - ssh_string hostn) { - MD5CTX md5 = NULL; - -- md5 = md5_init(); -+ md5 = ssh_md5_init(); - if (md5 == NULL) { - return -1; - } ---- src/libcrypto.c.orig 2014-12-27 12:12:40.977378184 +0100 -+++ src/libcrypto.c 2014-12-27 12:13:14.716372667 +0100 -@@ -234,7 +234,7 @@ - SHA512(digest, len, hash); - } - --MD5CTX md5_init(void) { -+MD5CTX ssh_md5_init(void) { - MD5CTX c = malloc(sizeof(*c)); - if (c == NULL) { - return NULL; ---- src/libgcrypt.c.orig 2014-12-27 12:13:46.319430927 +0100 -+++ src/libgcrypt.c 2014-12-27 12:13:59.611034883 +0100 -@@ -132,7 +132,7 @@ - gcry_md_hash_buffer(GCRY_MD_SHA512, hash, digest, len); - } - --MD5CTX md5_init(void) { -+MD5CTX ssh_md5_init(void) { - MD5CTX c = NULL; - gcry_md_open(&c, GCRY_MD_MD5, 0); - diff --git a/tools/depends/target/libssh/ntohl.patch b/tools/depends/target/libssh/ntohl.patch deleted file mode 100644 index 2c0c0272a2..0000000000 --- a/tools/depends/target/libssh/ntohl.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- src/packet_cb.c.orig 2014-12-26 09:41:09.220220531 +0100 -+++ src/packet_cb.c 2014-12-26 09:39:49.850555189 +0100 -@@ -36,6 +36,9 @@ - #include "libssh/socket.h" - #include "libssh/ssh2.h" - #include "libssh/curve25519.h" -+#ifdef ANDROID -+#include <sys/endian.h> -+#endif - - - /** diff --git a/tools/depends/target/libssh/pkg-config.patch b/tools/depends/target/libssh/pkg-config.patch deleted file mode 100644 index b87e8a866b..0000000000 --- a/tools/depends/target/libssh/pkg-config.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- libssh.pc.cmake.orig 2014-12-27 11:30:13.000000000 +0100 -+++ libssh.pc.cmake 2016-01-11 15:12:20.556549666 +0100 -@@ -1,6 +1,6 @@ - Name: ${APPLICATION_NAME} - Description: The SSH Library - Version: ${APPLICATION_VERSION} --Libs: -L${LIB_INSTALL_DIR} -lssh -+Libs: -L${LIB_INSTALL_DIR} -lssh -lcrypto - Cflags: -I${INCLUDE_INSTALL_DIR} - diff --git a/tools/depends/target/libssh/removelegacy.patch b/tools/depends/target/libssh/removelegacy.patch deleted file mode 100644 index 69683cb869..0000000000 --- a/tools/depends/target/libssh/removelegacy.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/CMakeLists.txt 2011-06-16 19:04:44.000000000 +0200 -+++ src/CMakeLists.txt 2011-06-16 19:03:40.000000000 +0200 -@@ -94,7 +94,6 @@ - keyfiles.c - keys.c - known_hosts.c -- legacy.c - libcrypto.c - libgcrypt.c - log.c diff --git a/tools/depends/target/rapidjson/Makefile b/tools/depends/target/rapidjson/Makefile index 1ce1f77b88..b54af9190c 100644 --- a/tools/depends/target/rapidjson/Makefile +++ b/tools/depends/target/rapidjson/Makefile @@ -36,7 +36,7 @@ $(TARBALLS_LOCATION)/$(ARCHIVE): $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) ifeq ($(PREFIX),) @echo - @echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local" + @echo "ERROR: please set PREFIX to the kodi install path e.g. $(MAKE) PREFIX=/usr/local" @exit 1 endif rm -rf $(PLATFORM); mkdir -p $(PLATFORM) @@ -46,8 +46,8 @@ endif cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. .installed-$(PLATFORM): $(PLATFORM) - make -C $(PLATFORM)/build - make -C $(PLATFORM)/build install + $(MAKE) -C $(PLATFORM)/build + $(MAKE) -C $(PLATFORM)/build install rm -rf $(PREFIX)/share/doc/RapidJSON touch $@ diff --git a/tools/depends/xbmc-addons.include b/tools/depends/xbmc-addons.include index e07da9b8f9..63046be4f3 100644 --- a/tools/depends/xbmc-addons.include +++ b/tools/depends/xbmc-addons.include @@ -55,7 +55,7 @@ distclean: mkdir -p $(PLATFORM) ifeq ($(PREFIX),) @echo - @echo "ERROR: please set PREFIX to the xbmc install path e.g. make PREFIX=/usr/local" + @echo "ERROR: please set PREFIX to the xbmc install path e.g. $(MAKE) PREFIX=/usr/local" @exit 1 endif ifeq ($(CROSS_COMPILING),yes) @@ -66,7 +66,7 @@ endif $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) $(CMAKE_EXTRA) \ $(TOOLCHAIN) $(SRC_OVERRIDE) \ -DADDONS_TO_BUILD="$(ADDONS)" $(ADDON_PROJECT_DIR) -DBUILD_DIR=$(BUILDDIR)/$(PLATFORM)/build ;\ - for addon in $$(make supported_addons | awk '/^ALL_ADDONS_BUILDING: .*$$/ { first = $$1; $$1 = ""; print $$0 }'); do \ + for addon in $$($(MAKE) supported_addons | awk '/^ALL_ADDONS_BUILDING: .*$$/ { first = $$1; $$1 = ""; print $$0 }'); do \ $(MAKE) $$addon && echo $$addon >> $(ADDON_PROJECT_DIR)/.success || echo $$addon >> $(ADDON_PROJECT_DIR)/.failure ;\ done ifneq ($(CROSS_COMPILING),yes) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index c33a3c1760..0f281bdf24 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -112,9 +112,6 @@ #ifdef HAS_FILESYSTEM_NFS #include "filesystem/NFSFile.h" #endif -#ifdef HAS_FILESYSTEM_SFTP -#include "filesystem/SFTPFile.h" -#endif #include "PartyModeManager.h" #include "network/ZeroconfBrowser.h" #ifndef TARGET_POSIX @@ -2879,10 +2876,6 @@ void CApplication::Stop(int exitCode) } #endif -#ifdef HAS_FILESYSTEM_SFTP - CSFTPSessionManager::DisconnectAllSessions(); -#endif - for (const auto& vfsAddon : CServiceBroker::GetVFSAddonCache().GetAddonInstances()) vfsAddon->DisconnectAll(); @@ -4390,10 +4383,6 @@ void CApplication::ProcessSlow() gNfsConnection.CheckIfIdle(); #endif -#ifdef HAS_FILESYSTEM_SFTP - CSFTPSessionManager::ClearOutIdleSessions(); -#endif - for (const auto& vfsAddon : CServiceBroker::GetVFSAddonCache().GetAddonInstances()) vfsAddon->ClearOutIdle(); @@ -5055,10 +5044,6 @@ void CApplication::CloseNetworkShares() gNfsConnection.Deinit(); #endif -#ifdef HAS_FILESYSTEM_SFTP - CSFTPSessionManager::DisconnectAllSessions(); -#endif - for (const auto& vfsAddon : CServiceBroker::GetVFSAddonCache().GetAddonInstances()) vfsAddon->DisconnectAll(); } diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp index 1d6915c1e3..11951a8b13 100644 --- a/xbmc/Util.cpp +++ b/xbmc/Util.cpp @@ -1223,6 +1223,7 @@ int CUtil::GetMatchingSource(const std::string& strPath1, VECSOURCES& VECSOURCES // and ends with a trailing slash so as not to match a substring CURL urlDest(strPath); urlDest.SetOptions(""); + urlDest.SetProtocolOptions(""); std::string strDest = urlDest.GetWithoutUserDetails(); ForceForwardSlashes(strDest); if (!URIUtils::HasSlashAtEnd(strDest)) @@ -1259,6 +1260,7 @@ int CUtil::GetMatchingSource(const std::string& strPath1, VECSOURCES& VECSOURCES // and ends with a trailing slash so as not to match a substring CURL urlShare(path); urlShare.SetOptions(""); + urlShare.SetProtocolOptions(""); std::string strShare = urlShare.GetWithoutUserDetails(); ForceForwardSlashes(strShare); if (!URIUtils::HasSlashAtEnd(strShare)) diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h index edf16d27c4..f0379d59dd 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h @@ -110,7 +110,7 @@ #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ "addon-instance/PeripheralUtils.h" -#define ADDON_INSTANCE_VERSION_PVR "5.10.0" +#define ADDON_INSTANCE_VERSION_PVR "5.10.1" #define ADDON_INSTANCE_VERSION_PVR_MIN "5.10.0" #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h index 8185c84fc4..6cc3e987cd 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h @@ -79,7 +79,8 @@ struct DemuxPacket; #define PVR_STREAM_MAX_PROPERTIES 20 #define PVR_STREAM_PROPERTY_STREAMURL "streamurl" /*!< @brief the URL of the stream that should be played. */ #define PVR_STREAM_PROPERTY_INPUTSTREAMADDON "inputstreamaddon" /*!< @brief the name of the inputstream add-on that should be used by Kodi to play the stream denoted by PVR_STREAM_PROPERTY_STREAMURL. Leave blank to use Kodi's built-in playing capabilities. */ -#define PVR_STREAM_PROPERTY_MIMETYPE "mimetype" /*!< @brief the Mime-Type of the stream that should be played. */ +#define PVR_STREAM_PROPERTY_MIMETYPE "mimetype" /*!< @brief the MIME type of the stream that should be played. */ +#define PVR_STREAM_PROPERTY_ISREALTIMESTREAM "isrealtimestream" /*!< @brief "true" to denote that the stream that should be played is a realtime stream. Any other value indicates that this is no realtime stream.*/ /* using the default avformat's MAX_STREAMS value to be safe */ #define PVR_STREAM_MAX_STREAMS 20 diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp index 227ce06398..e980dbc573 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -394,9 +394,9 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) } return; case CActiveAEDataProtocol::FREESTREAM: - CActiveAEStream *stream; - stream = *(CActiveAEStream**)msg->data; - DiscardStream(stream); + MsgStreamFree *msgStreamFree; + msgStreamFree = *(MsgStreamFree**)msg->data; + DiscardStream(msgStreamFree->stream); msg->Reply(CActiveAEDataProtocol::ACC); return; case CActiveAEDataProtocol::FREESOUND: @@ -404,6 +404,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) DiscardSound(sound); return; case CActiveAEDataProtocol::DRAINSTREAM: + CActiveAEStream *stream; stream = *(CActiveAEStream**)msg->data; stream->m_drain = true; stream->m_processingBuffers->SetDrain(true); @@ -775,8 +776,9 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) m_state = AE_TOP_CONFIGURED_PLAY; return; case CActiveAEDataProtocol::FREESTREAM: - stream = *(CActiveAEStream**)msg->data; - DiscardStream(stream); + MsgStreamFree *msgStreamFree; + msgStreamFree = reinterpret_cast<MsgStreamFree*>(msg->data); + DiscardStream(msgStreamFree->stream); msg->Reply(CActiveAEDataProtocol::ACC); if (m_streams.empty()) { @@ -786,7 +788,10 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) { AEDelayStatus status; m_stats.GetDelay(status); - m_extDrainTimer.Set(status.GetDelay() * 1000); + if (msgStreamFree->finish) + m_extDrainTimer.Set(status.GetDelay() * 1000); + else + m_extDrainTimer.Set(status.GetDelay() * 1000 + 1000); } m_extDrain = true; } @@ -3241,12 +3246,16 @@ IAEStream *CActiveAE::MakeStream(AEAudioFormat &audioFormat, unsigned int option return NULL; } -bool CActiveAE::FreeStream(IAEStream *stream) +bool CActiveAE::FreeStream(IAEStream *stream, bool finish) { + MsgStreamFree msg; + msg.stream = static_cast<CActiveAEStream*>(stream); + msg.finish = finish; + Message *reply; if (m_dataPort.SendOutMessageSync(CActiveAEDataProtocol::FREESTREAM, &reply,1000, - &stream, sizeof(IAEStream*))) + &msg, sizeof(MsgStreamFree))) { bool success = reply->signal == CActiveAEControlProtocol::ACC; reply->Release(); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h index cc2576e1b7..468cfacc63 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h @@ -143,6 +143,12 @@ struct MsgStreamNew IAEClockCallback *clock; }; +struct MsgStreamFree +{ + CActiveAEStream *stream; + bool finish; // if true switch back to gui sound mode +}; + struct MsgStreamSample { CSampleBuffer *buffer; @@ -245,7 +251,7 @@ public: /* returns a new stream for data in the specified format */ IAEStream *MakeStream(AEAudioFormat &audioFormat, unsigned int options = 0, IAEClockCallback *clock = NULL) override; - bool FreeStream(IAEStream *stream) override; + bool FreeStream(IAEStream *stream, bool finish) override; /* returns a new sound object */ IAESound *MakeSound(const std::string& file) override; diff --git a/xbmc/cores/AudioEngine/Interfaces/AE.h b/xbmc/cores/AudioEngine/Interfaces/AE.h index e9118e8199..4e0b1d56b4 100644 --- a/xbmc/cores/AudioEngine/Interfaces/AE.h +++ b/xbmc/cores/AudioEngine/Interfaces/AE.h @@ -143,9 +143,10 @@ public: * This method will remove the specifyed stream from the engine. * For OSX/IOS this is essential to reconfigure the audio output. * @param stream The stream to be altered + * @param finish if true AE will switch back to gui sound mode (if this is last stream) * @return NULL */ - virtual bool FreeStream(IAEStream *stream) = 0; + virtual bool FreeStream(IAEStream *stream, bool finish) = 0; /** * Creates a new IAESound that is ready to play the specified file diff --git a/xbmc/cores/RetroPlayer/streams/RetroPlayerAudio.cpp b/xbmc/cores/RetroPlayer/streams/RetroPlayerAudio.cpp index 5e98f63dbf..1875bef3ca 100644 --- a/xbmc/cores/RetroPlayer/streams/RetroPlayerAudio.cpp +++ b/xbmc/cores/RetroPlayer/streams/RetroPlayerAudio.cpp @@ -147,7 +147,7 @@ void CRetroPlayerAudio::CloseStream() { CLog::Log(LOGDEBUG, "RetroPlayer[AUDIO]: Closing audio stream"); - CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream); + CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream, true); m_pAudioStream = nullptr; } } diff --git a/xbmc/cores/VideoPlayer/AudioSinkAE.cpp b/xbmc/cores/VideoPlayer/AudioSinkAE.cpp index 41f6390435..dbb99a6b59 100644 --- a/xbmc/cores/VideoPlayer/AudioSinkAE.cpp +++ b/xbmc/cores/VideoPlayer/AudioSinkAE.cpp @@ -48,7 +48,7 @@ CAudioSinkAE::~CAudioSinkAE() { CSingleLock lock (m_critSection); if (m_pAudioStream) - CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream); + CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream, true); } bool CAudioSinkAE::Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool needresampler) @@ -84,12 +84,12 @@ bool CAudioSinkAE::Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool return true; } -void CAudioSinkAE::Destroy() +void CAudioSinkAE::Destroy(bool finish) { CSingleLock lock (m_critSection); if (m_pAudioStream) - CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream); + CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream, finish); m_pAudioStream = NULL; m_sampleRate = 0; diff --git a/xbmc/cores/VideoPlayer/AudioSinkAE.h b/xbmc/cores/VideoPlayer/AudioSinkAE.h index 233772b919..0e3f379505 100644 --- a/xbmc/cores/VideoPlayer/AudioSinkAE.h +++ b/xbmc/cores/VideoPlayer/AudioSinkAE.h @@ -48,7 +48,7 @@ public: void Resume(); bool Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool needresampler); bool IsValidFormat(const DVDAudioFrame &audioframe); - void Destroy(); + void Destroy(bool finish); unsigned int AddPackets(const DVDAudioFrame &audioframe); double GetPlayingPts(); double GetCacheTime(); diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index 3422c841da..9c850d3709 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -459,8 +459,8 @@ void CDVDVideoCodecFFmpeg::Dispose() av_frame_free(&m_pFrame); av_frame_free(&m_pDecodedFrame); av_frame_free(&m_pFilterFrame); - SAFE_RELEASE(m_pHardware); avcodec_free_context(&m_pCodecContext); + SAFE_RELEASE(m_pHardware); FilterClose(); } diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp index 23f7d42f26..698ec3b080 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp @@ -167,11 +167,7 @@ CDecoder::~CDecoder() void CDecoder::Close() { - if (m_avctx) - { - av_videotoolbox_default_free(m_avctx); - m_avctx = nullptr; - } + } bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixelFormat fmt) @@ -179,14 +175,14 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel if (!CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB)) return false; - if (av_videotoolbox_default_init(avctx) < 0) - return false; - + AVBufferRef *deviceRef = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VIDEOTOOLBOX); + AVBufferRef *framesRef = av_hwframe_ctx_alloc(deviceRef); + AVHWFramesContext *framesCtx = (AVHWFramesContext*)framesRef->data; + framesCtx->format = AV_PIX_FMT_VIDEOTOOLBOX; + framesCtx->sw_format = AV_PIX_FMT_NV12; + avctx->hw_frames_ctx = framesRef; m_avctx = avctx; - mainctx->pix_fmt = fmt; - mainctx->hwaccel_context = avctx->hwaccel_context; - m_processInfo.SetVideoDeintMethod("none"); std::list<EINTERLACEMETHOD> deintMethods; diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.cpp index 04f915d517..c74700fbaa 100644 --- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.cpp +++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.cpp @@ -26,7 +26,7 @@ CDVDInputStream::CDVDInputStream(DVDStreamType streamType, const CFileItem& file { m_streamType = streamType; m_contentLookup = true; - m_realtime = false; + m_realtime = fileitem.GetProperty("isrealtimestream").asBoolean(false); m_item = fileitem; } diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp index b8e3f3e9bf..b4c90fc6ac 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp @@ -188,7 +188,7 @@ void CVideoPlayerAudio::CloseStream(bool bWaitForBuffers) m_audioSink.Flush(); } - m_audioSink.Destroy(); + m_audioSink.Destroy(true); // uninit queue m_messageQueue.End(); @@ -474,7 +474,7 @@ bool CVideoPlayerAudio::ProcessDecoderOutput(DVDAudioFrame &audioframe) if(m_speed) m_audioSink.Drain(); - m_audioSink.Destroy(); + m_audioSink.Destroy(false); if (!m_audioSink.Create(audioframe, m_streaminfo.codec, m_setsynctype == SYNC_RESAMPLE)) CLog::Log(LOGERROR, "%s - failed to create audio renderer", __FUNCTION__); diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp index eb8e86999b..2106522e72 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp @@ -29,8 +29,6 @@ const std::string SETTING_VIDEOPLAYER_USEPRIMERENDERER = "videoplayer.useprimerenderer"; -static CWinSystemGbmGLESContext *m_pWinSystem; - CRendererDRMPRIME::CRendererDRMPRIME(std::shared_ptr<CDRMUtils> drm) : m_DRM(drm) { @@ -43,19 +41,20 @@ CRendererDRMPRIME::~CRendererDRMPRIME() CBaseRenderer* CRendererDRMPRIME::Create(CVideoBuffer* buffer) { - if (buffer && dynamic_cast<CVideoBufferDRMPRIME*>(buffer)) + if (buffer && dynamic_cast<CVideoBufferDRMPRIME*>(buffer) && + CServiceBroker::GetSettings().GetInt(SETTING_VIDEOPLAYER_USEPRIMERENDERER) == 0) { - if (CServiceBroker::GetSettings().GetInt(SETTING_VIDEOPLAYER_USEPRIMERENDERER) == 0) - return new CRendererDRMPRIME(m_pWinSystem->m_DRM); + CWinSystemGbmGLESContext* winSystem = dynamic_cast<CWinSystemGbmGLESContext*>(CServiceBroker::GetWinSystem()); + if (winSystem) + return new CRendererDRMPRIME(winSystem->m_DRM); } return nullptr; } -bool CRendererDRMPRIME::Register(CWinSystemGbmGLESContext *winSystem) +bool CRendererDRMPRIME::Register() { VIDEOPLAYER::CRendererFactory::RegisterRenderer("drm_prime", CRendererDRMPRIME::Create); - m_pWinSystem = winSystem; return true; } @@ -97,7 +96,7 @@ void CRendererDRMPRIME::AddVideoPicture(const VideoPicture& picture, int index, void CRendererDRMPRIME::Reset() { - for (int i = 0; i < m_numRenderBuffers; i++) + for (int i = 0; i < NUM_BUFFERS; i++) ReleaseBuffer(i); m_iLastRenderBuffer = -1; @@ -126,9 +125,7 @@ bool CRendererDRMPRIME::NeedBuffer(int index) CRenderInfo CRendererDRMPRIME::GetRenderInfo() { CRenderInfo info; - info.max_buffer_size = m_numRenderBuffers; - info.optimal_buffer_size = m_numRenderBuffers; - info.opaque_pointer = (void*)this; + info.max_buffer_size = NUM_BUFFERS; return info; } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.h index a8ef0d3d95..6bf58e76b3 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.h @@ -33,7 +33,7 @@ public: // Registration static CBaseRenderer* Create(CVideoBuffer* buffer); - static bool Register(CWinSystemGbmGLESContext *winSystem); + static bool Register(); // Player functions bool Configure(const VideoPicture& picture, float fps, unsigned int orientation) override; @@ -61,13 +61,11 @@ private: bool m_bConfigured = false; int m_iLastRenderBuffer = -1; - static const int m_numRenderBuffers = 4; std::shared_ptr<CDRMUtils> m_DRM; struct BUFFER { - BUFFER() : videoBuffer(nullptr) {}; - CVideoBuffer* videoBuffer; - } m_buffers[m_numRenderBuffers]; + CVideoBuffer* videoBuffer = nullptr; + } m_buffers[NUM_BUFFERS]; }; diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp index 9499f53d12..0c79af089f 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -108,7 +108,7 @@ COMXAudio::~COMXAudio() Deinitialize(); if (m_pAudioStream) - CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream); + CServiceBroker::GetActiveAE()->FreeStream(m_pAudioStream, true); } bool COMXAudio::PortSettingsChanged() diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp index 527147b395..31127bdda1 100644 --- a/xbmc/cores/paplayer/PAPlayer.cpp +++ b/xbmc/cores/paplayer/PAPlayer.cpp @@ -192,7 +192,7 @@ void PAPlayer::CloseAllStreams(bool fade/* = true */) if (si->m_stream) { CloseFileCB(*si); - CServiceBroker::GetActiveAE()->FreeStream(si->m_stream); + CServiceBroker::GetActiveAE()->FreeStream(si->m_stream, true); si->m_stream = NULL; } @@ -208,7 +208,7 @@ void PAPlayer::CloseAllStreams(bool fade/* = true */) if (si->m_stream) { CloseFileCB(*si); - CServiceBroker::GetActiveAE()->FreeStream(si->m_stream); + CServiceBroker::GetActiveAE()->FreeStream(si->m_stream, true); si->m_stream = nullptr; } @@ -605,7 +605,7 @@ inline void PAPlayer::ProcessStreams(double &freeBufferTime) { itt = m_finishing.erase(itt); CloseFileCB(*si); - CServiceBroker::GetActiveAE()->FreeStream(si->m_stream); + CServiceBroker::GetActiveAE()->FreeStream(si->m_stream, true); delete si; CLog::Log(LOGDEBUG, "PAPlayer::ProcessStreams - Stream Freed"); } diff --git a/xbmc/filesystem/CMakeLists.txt b/xbmc/filesystem/CMakeLists.txt index e07e0c6bb1..0575103166 100644 --- a/xbmc/filesystem/CMakeLists.txt +++ b/xbmc/filesystem/CMakeLists.txt @@ -155,13 +155,6 @@ if(NFS_FOUND) NFSFile.h) endif() -if(SSH_FOUND) - list(APPEND SOURCES SFTPDirectory.cpp - SFTPFile.cpp) - list(APPEND SOURCES SFTPDirectory.h - SFTPFile.h) -endif() - if(ENABLE_UPNP) list(APPEND SOURCES NptXbmcFile.cpp UPnPDirectory.cpp diff --git a/xbmc/filesystem/DirectoryFactory.cpp b/xbmc/filesystem/DirectoryFactory.cpp index fd432433da..a2a3b2bcd0 100644 --- a/xbmc/filesystem/DirectoryFactory.cpp +++ b/xbmc/filesystem/DirectoryFactory.cpp @@ -74,9 +74,6 @@ #ifdef HAS_ZEROCONF #include "ZeroconfDirectory.h" #endif -#ifdef HAS_FILESYSTEM_SFTP -#include "SFTPDirectory.h" -#endif #ifdef HAS_FILESYSTEM_NFS #include "NFSDirectory.h" #endif @@ -158,9 +155,6 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) if (url.IsProtocol("ftp") || url.IsProtocol("ftps")) return new CFTPDirectory(); if (url.IsProtocol("http") || url.IsProtocol("https")) return new CHTTPDirectory(); if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVDirectory(); -#ifdef HAS_FILESYSTEM_SFTP - if (url.IsProtocol("sftp") || url.IsProtocol("ssh")) return new CSFTPDirectory(); -#endif #ifdef HAS_FILESYSTEM_SMB #ifdef TARGET_WINDOWS if (url.IsProtocol("smb")) return new CWin32SMBDirectory(); diff --git a/xbmc/filesystem/FileFactory.cpp b/xbmc/filesystem/FileFactory.cpp index b76c41baea..7242f11c05 100644 --- a/xbmc/filesystem/FileFactory.cpp +++ b/xbmc/filesystem/FileFactory.cpp @@ -45,9 +45,6 @@ #endif #include "XbtFile.h" #include "ZipFile.h" -#ifdef HAS_FILESYSTEM_SFTP -#include "SFTPFile.h" -#endif #ifdef HAS_FILESYSTEM_NFS #include "NFSFile.h" #endif @@ -154,9 +151,6 @@ IFile* CFileFactory::CreateLoader(const CURL& url) || url.IsProtocol("http") || url.IsProtocol("https")) return new CCurlFile(); else if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVFile(); -#ifdef HAS_FILESYSTEM_SFTP - else if (url.IsProtocol("sftp") || url.IsProtocol("ssh")) return new CSFTPFile(); -#endif else if (url.IsProtocol("shout")) return new CShoutcastFile(); #ifdef HAS_FILESYSTEM_SMB #ifdef TARGET_WINDOWS diff --git a/xbmc/filesystem/SFTPDirectory.cpp b/xbmc/filesystem/SFTPDirectory.cpp deleted file mode 100644 index f987fd1f9d..0000000000 --- a/xbmc/filesystem/SFTPDirectory.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://kodi.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 XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "SFTPDirectory.h" - -#include "SFTPFile.h" -#include "utils/log.h" -#include "URL.h" - -using namespace XFILE; - -CSFTPDirectory::CSFTPDirectory(void) = default; - -CSFTPDirectory::~CSFTPDirectory(void) = default; - -bool CSFTPDirectory::GetDirectory(const CURL& url, CFileItemList &items) -{ - CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url); - return session->GetDirectory(url.GetWithoutFilename().c_str(), url.GetFileName().c_str(), items); -} - -bool CSFTPDirectory::Exists(const CURL& url) -{ - CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url); - if (session) - return session->DirectoryExists(url.GetFileName().c_str()); - else - { - CLog::Log(LOGERROR, "SFTPDirectory: Failed to create session to check exists"); - return false; - } -} diff --git a/xbmc/filesystem/SFTPDirectory.h b/xbmc/filesystem/SFTPDirectory.h deleted file mode 100644 index 24122dadb5..0000000000 --- a/xbmc/filesystem/SFTPDirectory.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://kodi.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 XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include "IDirectory.h" - -class CURL; -class TiXmlElement; - -namespace XFILE -{ - class CSFTPDirectory : public IDirectory - { - public: - CSFTPDirectory(void); - ~CSFTPDirectory(void) override; - bool GetDirectory(const CURL& url, CFileItemList &items) override; - bool Exists(const CURL& url) override; - }; -} diff --git a/xbmc/filesystem/SFTPFile.cpp b/xbmc/filesystem/SFTPFile.cpp deleted file mode 100644 index fb1e017630..0000000000 --- a/xbmc/filesystem/SFTPFile.cpp +++ /dev/null @@ -1,694 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://kodi.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 XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "threads/SystemClock.h" -#include "SFTPFile.h" -#include "threads/SingleLock.h" -#include "utils/log.h" -#include "URL.h" -#include <fcntl.h> -#include <sstream> - -#if defined(TARGET_DARWIN_IOS) -#include "utils/StringUtils.h" -#include "platform/darwin/DarwinUtils.h" -#endif - -#ifndef S_ISDIR -#define S_ISDIR(m) ((m & _S_IFDIR) != 0) -#endif -#ifndef S_ISREG -#define S_ISREG(m) ((m & _S_IFREG) != 0) -#endif -#ifndef O_RDONLY -#define O_RDONLY _O_RDONLY -#endif - -using namespace XFILE; - - -static std::string CorrectPath(const std::string& path) -{ - if (path == "~") - return "./"; - else if (path.substr(0, 2) == "~/") - return "./" + path.substr(2); - else - return "/" + path; -} - -static const char * SFTPErrorText(int sftp_error) -{ - switch(sftp_error) - { - case SSH_FX_OK: - return "No error"; - case SSH_FX_EOF: - return "End-of-file encountered"; - case SSH_FX_NO_SUCH_FILE: - return "File doesn't exist"; - case SSH_FX_PERMISSION_DENIED: - return "Permission denied"; - case SSH_FX_BAD_MESSAGE: - return "Garbage received from server"; - case SSH_FX_NO_CONNECTION: - return "No connection has been set up"; - case SSH_FX_CONNECTION_LOST: - return "There was a connection, but we lost it"; - case SSH_FX_OP_UNSUPPORTED: - return "Operation not supported by the server"; - case SSH_FX_INVALID_HANDLE: - return "Invalid file handle"; - case SSH_FX_NO_SUCH_PATH: - return "No such file or directory path exists"; - case SSH_FX_FILE_ALREADY_EXISTS: - return "An attempt to create an already existing file or directory has been made"; - case SSH_FX_WRITE_PROTECT: - return "We are trying to write on a write-protected filesystem"; - case SSH_FX_NO_MEDIA: - return "No media in remote drive"; - case -1: - return "Not a valid error code, probably called on an invalid session"; - default: - CLog::Log(LOGERROR, "SFTPErrorText: Unknown error code: %d", sftp_error); - } - return "Unknown error code"; -} - - - -CSFTPSession::CSFTPSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password) -{ - CLog::Log(LOGINFO, "SFTPSession: Creating new session on host '%s:%d'", host.c_str(), port); - CSingleLock lock(m_critSect); - if (!Connect(host, port, username, password)) - Disconnect(); - - m_LastActive = XbmcThreads::SystemClockMillis(); -} - -CSFTPSession::~CSFTPSession() -{ - CSingleLock lock(m_critSect); - Disconnect(); -} - -sftp_file CSFTPSession::CreateFileHandle(const std::string &file) -{ - if (m_connected) - { - CSingleLock lock(m_critSect); - m_LastActive = XbmcThreads::SystemClockMillis(); - sftp_file handle = sftp_open(m_sftp_session, CorrectPath(file).c_str(), O_RDONLY, 0); - if (handle) - { - sftp_file_set_blocking(handle); - return handle; - } - else - CLog::Log(LOGERROR, "SFTPSession: Was connected but couldn't create filehandle for '%s'", file.c_str()); - } - else - CLog::Log(LOGERROR, "SFTPSession: Not connected and can't create file handle for '%s'", file.c_str()); - - return NULL; -} - -void CSFTPSession::CloseFileHandle(sftp_file handle) -{ - CSingleLock lock(m_critSect); - sftp_close(handle); -} - -bool CSFTPSession::GetDirectory(const std::string &base, const std::string &folder, CFileItemList &items) -{ - int sftp_error = SSH_FX_OK; - if (m_connected) - { - sftp_dir dir = NULL; - - { - CSingleLock lock(m_critSect); - m_LastActive = XbmcThreads::SystemClockMillis(); - dir = sftp_opendir(m_sftp_session, CorrectPath(folder).c_str()); - - //Doing as little work as possible within the critical section - if (!dir) - sftp_error = sftp_get_error(m_sftp_session); - } - - if (!dir) - { - CLog::Log(LOGERROR, "%s: %s for '%s'", __FUNCTION__, SFTPErrorText(sftp_error), folder.c_str()); - } - else - { - bool read = true; - while (read) - { - sftp_attributes attributes = NULL; - - { - CSingleLock lock(m_critSect); - read = sftp_dir_eof(dir) == 0; - attributes = sftp_readdir(m_sftp_session, dir); - } - - if (attributes && (attributes->name == NULL || strcmp(attributes->name, "..") == 0 || strcmp(attributes->name, ".") == 0)) - { - CSingleLock lock(m_critSect); - sftp_attributes_free(attributes); - continue; - } - - if (attributes) - { - std::string itemName = attributes->name; - std::string localPath = folder; - localPath.append(itemName); - - if (attributes->type == SSH_FILEXFER_TYPE_SYMLINK) - { - CSingleLock lock(m_critSect); - sftp_attributes_free(attributes); - attributes = sftp_stat(m_sftp_session, CorrectPath(localPath).c_str()); - if (attributes == NULL) - continue; - } - - CFileItemPtr pItem(new CFileItem); - pItem->SetLabel(itemName); - - if (itemName[0] == '.') - pItem->SetProperty("file:hidden", true); - - if (attributes->flags & SSH_FILEXFER_ATTR_ACMODTIME) - pItem->m_dateTime = attributes->mtime; - - if (attributes->type & SSH_FILEXFER_TYPE_DIRECTORY) - { - localPath.append("/"); - pItem->m_bIsFolder = true; - pItem->m_dwSize = 0; - } - else - { - pItem->m_dwSize = attributes->size; - } - - pItem->SetPath(base + localPath); - items.Add(pItem); - - { - CSingleLock lock(m_critSect); - sftp_attributes_free(attributes); - } - } - else - read = false; - } - - { - CSingleLock lock(m_critSect); - sftp_closedir(dir); - } - - return true; - } - } - else - CLog::Log(LOGERROR, "SFTPSession: Not connected, can't list directory '%s'", folder.c_str()); - - return false; -} - -bool CSFTPSession::DirectoryExists(const char *path) -{ - uint32_t permissions = 0; - bool exists = GetItemPermissions(path, permissions); - return exists && S_ISDIR(permissions); -} - -bool CSFTPSession::FileExists(const char *path) -{ - uint32_t permissions = 0; - bool exists = GetItemPermissions(path, permissions); - return exists && S_ISREG(permissions); -} - -int CSFTPSession::Stat(const char *path, struct __stat64* buffer) -{ - CSingleLock lock(m_critSect); - if(m_connected) - { - m_LastActive = XbmcThreads::SystemClockMillis(); - sftp_attributes attributes = sftp_stat(m_sftp_session, CorrectPath(path).c_str()); - - if (attributes) - { - memset(buffer, 0, sizeof(struct __stat64)); - buffer->st_size = attributes->size; - buffer->st_mtime = attributes->mtime; - buffer->st_atime = attributes->atime; - - if S_ISDIR(attributes->permissions) - buffer->st_mode = _S_IFDIR; - else if S_ISREG(attributes->permissions) - buffer->st_mode = _S_IFREG; - - sftp_attributes_free(attributes); - return 0; - } - else - { - CLog::Log(LOGERROR, "SFTPSession::Stat - Failed to get attributes for '%s'", path); - return -1; - } - } - else - { - CLog::Log(LOGERROR, "SFTPSession::Stat - Failed because not connected for '%s'", path); - return -1; - } -} - -int CSFTPSession::Seek(sftp_file handle, uint64_t position) -{ - CSingleLock lock(m_critSect); - m_LastActive = XbmcThreads::SystemClockMillis(); - return sftp_seek64(handle, position); -} - -int CSFTPSession::Read(sftp_file handle, void *buffer, size_t length) -{ - CSingleLock lock(m_critSect); - m_LastActive = XbmcThreads::SystemClockMillis(); - return sftp_read(handle, buffer, length); -} - -int64_t CSFTPSession::GetPosition(sftp_file handle) -{ - CSingleLock lock(m_critSect); - m_LastActive = XbmcThreads::SystemClockMillis(); - return sftp_tell64(handle); -} - -bool CSFTPSession::IsIdle() -{ - return (XbmcThreads::SystemClockMillis() - m_LastActive) > 90000; -} - -bool CSFTPSession::VerifyKnownHost(ssh_session session) -{ - switch (ssh_is_server_known(session)) - { - case SSH_SERVER_KNOWN_OK: - return true; - case SSH_SERVER_KNOWN_CHANGED: - CLog::Log(LOGERROR, "SFTPSession: Server that was known has changed"); - return false; - case SSH_SERVER_FOUND_OTHER: - CLog::Log(LOGERROR, "SFTPSession: The host key for this server was not found but an other type of key exists. An attacker might change the default server key to confuse your client into thinking the key does not exist"); - return false; - case SSH_SERVER_FILE_NOT_FOUND: - CLog::Log(LOGINFO, "SFTPSession: Server file was not found, creating a new one"); - case SSH_SERVER_NOT_KNOWN: - CLog::Log(LOGINFO, "SFTPSession: Server unknown, we trust it for now"); - if (ssh_write_knownhost(session) < 0) - { - CLog::Log(LOGERROR, "CSFTPSession: Failed to save host '%s'", strerror(errno)); - return false; - } - - return true; - case SSH_SERVER_ERROR: - CLog::Log(LOGERROR, "SFTPSession: Failed to verify host '%s'", ssh_get_error(session)); - return false; - } - - return false; -} - -bool CSFTPSession::Connect(const std::string &host, unsigned int port, const std::string &username, const std::string &password) -{ - int timeout = SFTP_TIMEOUT; - m_connected = false; - m_session = NULL; - m_sftp_session = NULL; - - m_session=ssh_new(); - if (m_session == NULL) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to initialize session for host '%s'", host.c_str()); - return false; - } - - if (ssh_options_set(m_session, SSH_OPTIONS_USER, username.c_str()) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set username '%s' for session", username.c_str()); - return false; - } - - if (ssh_options_set(m_session, SSH_OPTIONS_HOST, host.c_str()) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set host '%s' for session", host.c_str()); - return false; - } - - if (ssh_options_set(m_session, SSH_OPTIONS_PORT, &port) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set port '%d' for session", port); - return false; - } -#if defined(TARGET_DARWIN_IOS) - std::string home = CDarwinUtils::GetUserHomeDirectory(); - std::string sshFolder = StringUtils::Format("%s/.ssh", home.c_str()); - if (ssh_options_set(m_session, SSH_OPTIONS_SSH_DIR, sshFolder.c_str()) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set .ssh folder to '%s' for session", sshFolder.c_str()); - return false; - } -#endif - ssh_options_set(m_session, SSH_OPTIONS_LOG_VERBOSITY, 0); - ssh_options_set(m_session, SSH_OPTIONS_TIMEOUT, &timeout); - - if(ssh_connect(m_session)) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to connect '%s'", ssh_get_error(m_session)); - return false; - } - - if (!VerifyKnownHost(m_session)) - { - CLog::Log(LOGERROR, "SFTPSession: Host is not known '%s'", ssh_get_error(m_session)); - return false; - } - - - int noAuth = SSH_AUTH_DENIED; - if ((noAuth = ssh_userauth_none(m_session, NULL)) == SSH_AUTH_ERROR) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via guest '%s'", ssh_get_error(m_session)); - return false; - } - - int method = ssh_userauth_list(m_session, NULL); - - // Try to authenticate with public key first - int publicKeyAuth = SSH_AUTH_DENIED; - if (method & SSH_AUTH_METHOD_PUBLICKEY && (publicKeyAuth = ssh_userauth_publickey_auto(m_session, NULL, NULL)) == SSH_AUTH_ERROR) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via publickey '%s'", ssh_get_error(m_session)); - return false; - } - - // Try to authenticate with password - int passwordAuth = SSH_AUTH_DENIED; - if (method & SSH_AUTH_METHOD_PASSWORD) - { - if (publicKeyAuth != SSH_AUTH_SUCCESS && - (passwordAuth = ssh_userauth_password(m_session, username.c_str(), password.c_str())) == SSH_AUTH_ERROR) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via password '%s'", ssh_get_error(m_session)); - return false; - } - } - else if (!password.empty()) - { - CLog::Log(LOGERROR, "SFTPSession: Password present, but server does not support password authentication"); - } - - if (noAuth == SSH_AUTH_SUCCESS || publicKeyAuth == SSH_AUTH_SUCCESS || passwordAuth == SSH_AUTH_SUCCESS) - { - m_sftp_session = sftp_new(m_session); - - if (m_sftp_session == NULL) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to initialize channel '%s'", ssh_get_error(m_session)); - return false; - } - - if (sftp_init(m_sftp_session)) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to initialize sftp '%s'", ssh_get_error(m_session)); - return false; - } - - m_connected = true; - } - else - { - CLog::Log(LOGERROR, "SFTPSession: No authentication method successful"); - } - - return m_connected; -} - -void CSFTPSession::Disconnect() -{ - if (m_sftp_session) - sftp_free(m_sftp_session); - - if (m_session) - ssh_disconnect(m_session); - - m_sftp_session = NULL; - m_session = NULL; -} - -/*! - \brief Gets POSIX compatible permissions information about the specified file or directory. - \param path Remote SSH path to the file or directory. - \param permissions POSIX compatible permissions information for the file or directory (if it exists). i.e. can use macros S_ISDIR() etc. - \return Returns \e true, if it was possible to get permissions for the file or directory, \e false otherwise. - */ -bool CSFTPSession::GetItemPermissions(const char *path, uint32_t &permissions) -{ - bool gotPermissions = false; - CSingleLock lock(m_critSect); - if(m_connected) - { - sftp_attributes attributes = sftp_stat(m_sftp_session, CorrectPath(path).c_str()); - if (attributes) - { - if (attributes->flags & SSH_FILEXFER_ATTR_PERMISSIONS) - { - permissions = attributes->permissions; - gotPermissions = true; - } - - sftp_attributes_free(attributes); - } - } - return gotPermissions; -} - -CCriticalSection CSFTPSessionManager::m_critSect; -std::map<std::string, CSFTPSessionPtr> CSFTPSessionManager::sessions; - -CSFTPSessionPtr CSFTPSessionManager::CreateSession(const CURL &url) -{ - std::string username = url.GetUserName().c_str(); - std::string password = url.GetPassWord().c_str(); - std::string hostname = url.GetHostName().c_str(); - unsigned int port = url.HasPort() ? url.GetPort() : 22; - - return CSFTPSessionManager::CreateSession(hostname, port, username, password); -} - -CSFTPSessionPtr CSFTPSessionManager::CreateSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password) -{ - // Convert port number to string - std::stringstream itoa; - itoa << port; - std::string portstr = itoa.str(); - - CSingleLock lock(m_critSect); - std::string key = username + ':' + password + '@' + host + ':' + portstr; - CSFTPSessionPtr ptr = sessions[key]; - if (ptr == NULL) - { - ptr = CSFTPSessionPtr(new CSFTPSession(host, port, username, password)); - sessions[key] = ptr; - } - - return ptr; -} - -void CSFTPSessionManager::ClearOutIdleSessions() -{ - CSingleLock lock(m_critSect); - for(std::map<std::string, CSFTPSessionPtr>::iterator iter = sessions.begin(); iter != sessions.end();) - { - if (iter->second->IsIdle()) - sessions.erase(iter++); - else - ++iter; - } -} - -void CSFTPSessionManager::DisconnectAllSessions() -{ - CSingleLock lock(m_critSect); - sessions.clear(); -} - -CSFTPFile::CSFTPFile() -{ - m_sftp_handle = NULL; -} - -CSFTPFile::~CSFTPFile() -{ - Close(); -} - -bool CSFTPFile::Open(const CURL& url) -{ - m_session = CSFTPSessionManager::CreateSession(url); - if (m_session) - { - m_file = url.GetFileName().c_str(); - m_sftp_handle = m_session->CreateFileHandle(m_file); - - return (m_sftp_handle != NULL); - } - else - { - CLog::Log(LOGERROR, "SFTPFile: Failed to allocate session"); - return false; - } -} - -void CSFTPFile::Close() -{ - if (m_session && m_sftp_handle) - { - m_session->CloseFileHandle(m_sftp_handle); - m_sftp_handle = NULL; - m_session = CSFTPSessionPtr(); - } -} - -int64_t CSFTPFile::Seek(int64_t iFilePosition, int iWhence) -{ - if (m_session && m_sftp_handle) - { - uint64_t position = 0; - if (iWhence == SEEK_SET) - position = iFilePosition; - else if (iWhence == SEEK_CUR) - position = GetPosition() + iFilePosition; - else if (iWhence == SEEK_END) - position = GetLength() + iFilePosition; - - if (m_session->Seek(m_sftp_handle, position) == 0) - return GetPosition(); - else - return -1; - } - else - { - CLog::Log(LOGERROR, "SFTPFile: Can't seek without a filehandle"); - return -1; - } -} - -ssize_t CSFTPFile::Read(void* lpBuf, size_t uiBufSize) -{ - if (m_session && m_sftp_handle) - { - if (uiBufSize > SSIZE_MAX) - uiBufSize = SSIZE_MAX; - - int rc = m_session->Read(m_sftp_handle, lpBuf, (size_t)uiBufSize); - - if (rc >= 0) - return rc; - else - CLog::Log(LOGERROR, "SFTPFile: Failed to read %i", rc); - } - else - CLog::Log(LOGERROR, "SFTPFile: Can't read without a filehandle"); - - return 0; -} - -bool CSFTPFile::Exists(const CURL& url) -{ - CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url); - if (session) - return session->FileExists(url.GetFileName().c_str()); - else - { - CLog::Log(LOGERROR, "SFTPFile: Failed to create session to check exists for '%s'", url.GetFileName().c_str()); - return false; - } -} - -int CSFTPFile::Stat(const CURL& url, struct __stat64* buffer) -{ - CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url); - if (session) - return session->Stat(url.GetFileName().c_str(), buffer); - else - { - CLog::Log(LOGERROR, "SFTPFile: Failed to create session to stat for '%s'", url.GetFileName().c_str()); - return -1; - } -} - -int CSFTPFile::Stat(struct __stat64* buffer) -{ - if (m_session) - return m_session->Stat(m_file.c_str(), buffer); - - CLog::Log(LOGERROR, "SFTPFile: Can't stat without a session for '%s'", m_file.c_str()); - return -1; -} - -int64_t CSFTPFile::GetLength() -{ - struct __stat64 buffer; - if (Stat(&buffer) != 0) - return 0; - else - { - int64_t length = buffer.st_size; - return length; - } -} - -int64_t CSFTPFile::GetPosition() -{ - if (m_session && m_sftp_handle) - return m_session->GetPosition(m_sftp_handle); - - CLog::Log(LOGERROR, "SFTPFile: Can't get position without a filehandle for '%s'", m_file.c_str()); - return 0; -} - -int CSFTPFile::IoControl(EIoControl request, void* param) -{ - if(request == IOCTRL_SEEK_POSSIBLE) - return 1; - - return -1; -} diff --git a/xbmc/filesystem/SFTPFile.h b/xbmc/filesystem/SFTPFile.h deleted file mode 100644 index 4ec5da6760..0000000000 --- a/xbmc/filesystem/SFTPFile.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://kodi.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 XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include "IFile.h" -#include "FileItem.h" -#include "threads/CriticalSection.h" - -#include <libssh/libssh.h> -#ifdef TARGET_WINDOWS -#define ssize_t SSIZE_T -#include <libssh/sftp.h> -#undef ssize_t -#else // !TARGET_WINDOWS -#include <libssh/sftp.h> -#endif // !TARGET_WINDOWS -#include <string> -#include <map> -#include <memory> - -class CURL; - -//five secs timeout for SFTP -#define SFTP_TIMEOUT 5 - -class CSFTPSession -{ -public: - CSFTPSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password); - virtual ~CSFTPSession(); - - sftp_file CreateFileHandle(const std::string &file); - void CloseFileHandle(sftp_file handle); - bool GetDirectory(const std::string &base, const std::string &folder, CFileItemList &items); - bool DirectoryExists(const char *path); - bool FileExists(const char *path); - int Stat(const char *path, struct __stat64* buffer); - int Seek(sftp_file handle, uint64_t position); - int Read(sftp_file handle, void *buffer, size_t length); - int64_t GetPosition(sftp_file handle); - bool IsIdle(); -private: - bool VerifyKnownHost(ssh_session session); - bool Connect(const std::string &host, unsigned int port, const std::string &username, const std::string &password); - void Disconnect(); - bool GetItemPermissions(const char *path, uint32_t &permissions); - CCriticalSection m_critSect; - - bool m_connected; - ssh_session m_session; - sftp_session m_sftp_session; - int m_LastActive; -}; - -typedef std::shared_ptr<CSFTPSession> CSFTPSessionPtr; - -class CSFTPSessionManager -{ -public: - static CSFTPSessionPtr CreateSession(const CURL &url); - static CSFTPSessionPtr CreateSession(const std::string &host, unsigned int port, const std::string &username, const std::string &password); - static void ClearOutIdleSessions(); - static void DisconnectAllSessions(); -private: - static CCriticalSection m_critSect; - static std::map<std::string, CSFTPSessionPtr> sessions; -}; - -namespace XFILE -{ - class CSFTPFile : public IFile - { - public: - CSFTPFile(); - ~CSFTPFile() override; - void Close() override; - int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET) override; - ssize_t Read(void* lpBuf, size_t uiBufSize) override; - bool Open(const CURL& url) override; - bool Exists(const CURL& url) override; - int Stat(const CURL& url, struct __stat64* buffer) override; - int Stat(struct __stat64* buffer) override; - int64_t GetLength() override; - int64_t GetPosition() override; - int GetChunkSize() override {return 1;}; - int IoControl(EIoControl request, void* param) override; - private: - std::string m_file; - CSFTPSessionPtr m_session; - sftp_file m_sftp_handle; - }; -} diff --git a/xbmc/input/InputManager.cpp b/xbmc/input/InputManager.cpp index 163a0d0adf..9da90728fc 100644 --- a/xbmc/input/InputManager.cpp +++ b/xbmc/input/InputManager.cpp @@ -244,7 +244,7 @@ bool CInputManager::ProcessEventServer(int windowId, float frameTime) CKey key; if (wKeyID & ES_FLAG_UNICODE) { - key = CKey((uint8_t)0, wKeyID & ~ES_FLAG_UNICODE, 0, 0, 0); + key = CKey(0u, 0u, static_cast<wchar_t>(wKeyID & ~ES_FLAG_UNICODE), 0, 0, 0, 0); return OnKey(key); } diff --git a/xbmc/interfaces/generic/ScriptInvocationManager.cpp b/xbmc/interfaces/generic/ScriptInvocationManager.cpp index 6a5fbeddcf..24fe1c68aa 100644 --- a/xbmc/interfaces/generic/ScriptInvocationManager.cpp +++ b/xbmc/interfaces/generic/ScriptInvocationManager.cpp @@ -276,10 +276,12 @@ int CScriptInvocationManager::ExecuteAsync(const std::string &script, if (addon != NULL) m_lastInvokerThread->SetAddon(addon); + // After we leave the lock, m_lastInvokerThread can be released -> copy! + CLanguageInvokerThreadPtr invokerThread = m_lastInvokerThread; lock.Leave(); - m_lastInvokerThread->Execute(script, arguments); + invokerThread->Execute(script, arguments); - return m_lastInvokerThread->GetId(); + return invokerThread->GetId(); } m_lastInvokerThread = CLanguageInvokerThreadPtr(new CLanguageInvokerThread(languageInvoker, this, reuseable)); @@ -295,10 +297,12 @@ int CScriptInvocationManager::ExecuteAsync(const std::string &script, LanguageInvokerThread thread = { m_lastInvokerThread, script, false }; m_scripts.insert(std::make_pair(m_lastInvokerThread->GetId(), thread)); m_scriptPaths.insert(std::make_pair(script, m_lastInvokerThread->GetId())); + // After we leave the lock, m_lastInvokerThread can be released -> copy! + CLanguageInvokerThreadPtr invokerThread = m_lastInvokerThread; lock.Leave(); - m_lastInvokerThread->Execute(script, arguments); + invokerThread->Execute(script, arguments); - return m_lastInvokerThread->GetId(); + return invokerThread->GetId(); } int CScriptInvocationManager::ExecuteSync(const std::string &script, diff --git a/xbmc/network/GUIDialogNetworkSetup.cpp b/xbmc/network/GUIDialogNetworkSetup.cpp index 44d60f8b6a..d7a9ba5ba6 100644 --- a/xbmc/network/GUIDialogNetworkSetup.cpp +++ b/xbmc/network/GUIDialogNetworkSetup.cpp @@ -480,7 +480,4 @@ void CGUIDialogNetworkSetup::UpdateAvailableProtocols() #ifdef HAS_FILESYSTEM_NFS m_protocols.emplace_back(Protocol{true, false, false, false, true, 0, "nfs", 20259}); #endif -#ifdef HAS_FILESYSTEM_SFTP - m_protocols.emplace_back(Protocol{true, true, true, true, false, 22, "sftp", 20260}); -#endif } diff --git a/xbmc/network/ZeroconfBrowser.cpp b/xbmc/network/ZeroconfBrowser.cpp index 196ed01e5e..cee2a4d61c 100644 --- a/xbmc/network/ZeroconfBrowser.cpp +++ b/xbmc/network/ZeroconfBrowser.cpp @@ -62,7 +62,6 @@ CZeroconfBrowser::CZeroconfBrowser():mp_crit_sec(new CCriticalSection),m_started #ifdef HAS_FILESYSTEM_NFS AddServiceType("_nfs._tcp."); #endif// HAS_FILESYSTEM_NFS - AddServiceType("_sftp-ssh._tcp."); } CZeroconfBrowser::~CZeroconfBrowser() diff --git a/xbmc/platform/darwin/DarwinUtils.h b/xbmc/platform/darwin/DarwinUtils.h index caf1e5b229..29a300396a 100644 --- a/xbmc/platform/darwin/DarwinUtils.h +++ b/xbmc/platform/darwin/DarwinUtils.h @@ -39,7 +39,6 @@ public: static const char *GetOSXVersionString(void); static int GetFrameworkPath(bool forPython, char* path, size_t *pathsize); static int GetExecutablePath(char* path, size_t *pathsize); - static const char *GetUserHomeDirectory(void); static const char *GetAppRootFolder(void); static bool IsIosSandboxed(void); static bool HasVideoToolboxDecoder(void); diff --git a/xbmc/platform/darwin/DarwinUtils.mm b/xbmc/platform/darwin/DarwinUtils.mm index e7008156c4..66351c270f 100644 --- a/xbmc/platform/darwin/DarwinUtils.mm +++ b/xbmc/platform/darwin/DarwinUtils.mm @@ -395,22 +395,6 @@ int CDarwinUtils::GetExecutablePath(char* path, size_t *pathsize) return 0; } -const char* CDarwinUtils::GetUserHomeDirectory(void) -{ - static std::string appHomeFolder; - if (appHomeFolder.empty()) - { -#if defined(TARGET_DARWIN_IOS) - appHomeFolder = URIUtils::AddFileToFolder(CDarwinUtils::GetAppRootFolder(), CCompileInfo::GetAppName()); -#else - appHomeFolder = URIUtils::AddFileToFolder(getenv("HOME"), "Library/Application Support"); - appHomeFolder = URIUtils::AddFileToFolder(appHomeFolder, CCompileInfo::GetAppName()); -#endif - } - - return appHomeFolder.c_str(); -} - const char* CDarwinUtils::GetAppRootFolder(void) { static std::string rootFolder = ""; diff --git a/xbmc/platform/darwin/ios/IOSEAGLView.mm b/xbmc/platform/darwin/ios/IOSEAGLView.mm index 1c7413d67f..e6c16a9b88 100644 --- a/xbmc/platform/darwin/ios/IOSEAGLView.mm +++ b/xbmc/platform/darwin/ios/IOSEAGLView.mm @@ -71,7 +71,7 @@ using namespace KODI::MESSAGING; //-------------------------------------------------------------- - (void) resizeFrameBuffer { - CGRect frame = [IOSScreenManager getLandscapeResolution: currentScreen]; + CGRect frame = [currentScreen bounds]; CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[self layer]; //allow a maximum framebuffer size of 1080p //needed for tvout on iPad3/4 and iphone4/5 and maybe AppleTV3 diff --git a/xbmc/platform/darwin/ios/IOSExternalTouchController.h b/xbmc/platform/darwin/ios/IOSExternalTouchController.h index c9e37f2d81..08a9642c9b 100644 --- a/xbmc/platform/darwin/ios/IOSExternalTouchController.h +++ b/xbmc/platform/darwin/ios/IOSExternalTouchController.h @@ -26,7 +26,6 @@ UIWindow *_internalWindow; UIView *_touchView; NSTimer *_sleepTimer; - bool _startup; } - (id)init; - (void)createGestureRecognizers; diff --git a/xbmc/platform/darwin/ios/IOSExternalTouchController.mm b/xbmc/platform/darwin/ios/IOSExternalTouchController.mm index 85f2330b28..712ef6b003 100644 --- a/xbmc/platform/darwin/ios/IOSExternalTouchController.mm +++ b/xbmc/platform/darwin/ios/IOSExternalTouchController.mm @@ -52,6 +52,22 @@ const CGFloat timeFadeSecs = 2.0; [_touchView setMultipleTouchEnabled:YES]; [_touchView setContentMode:UIViewContentModeCenter]; + //load the splash image + std::string strUserSplash = CUtil::GetSplashPath(); + xbmcLogo = [UIImage imageWithContentsOfFile:[NSString stringWithUTF8String:strUserSplash.c_str()]]; + + //make a view with the image + xbmcLogoView = [[UIImageView alloc] initWithImage:xbmcLogo]; + //center the image and add it to the view + [xbmcLogoView setFrame:frame]; + [xbmcLogoView setContentMode:UIViewContentModeScaleAspectFill]; + //autoresize the image frame + [xbmcLogoView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; + [xbmcLogoView setAutoresizesSubviews:YES]; + [_touchView addSubview:xbmcLogoView]; + //send the image to the background + [_touchView sendSubviewToBack:xbmcLogoView]; + [xbmcLogoView release]; CGRect labelRect = frame; labelRect.size.height/=2; @@ -84,23 +100,6 @@ const CGFloat timeFadeSecs = 2.0; [_touchView addSubview:descriptionLabel]; [descriptionLabel release]; - //load the splash image - std::string strUserSplash = CUtil::GetSplashPath(); - xbmcLogo = [UIImage imageWithContentsOfFile:[NSString stringWithUTF8String:strUserSplash.c_str()]]; - - //make a view with the image - xbmcLogoView = [[UIImageView alloc] initWithImage:xbmcLogo]; - //center the image and add it to the view - [xbmcLogoView setFrame:frame]; - [xbmcLogoView setContentMode:UIViewContentModeCenter]; - //autoresize the image frame - [xbmcLogoView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; - [xbmcLogoView setAutoresizesSubviews:YES]; - [_touchView addSubview:xbmcLogoView]; - //send the image to the background - [_touchView sendSubviewToBack:xbmcLogoView]; - [xbmcLogoView release]; - [[self view] addSubview: _touchView]; [self createGestureRecognizers]; @@ -111,8 +110,6 @@ const CGFloat timeFadeSecs = 2.0; [_internalWindow makeKeyAndVisible]; [_internalWindow setRootViewController:self]; - [self setWantsFullScreenLayout:YES]; - [self startSleepTimer];//will fade from black too } return self; @@ -321,7 +318,6 @@ const CGFloat timeFadeSecs = 2.0; //-------------------------------------------------------------- - (void)viewWillAppear:(BOOL)animated { - _startup = true; [super viewWillAppear:animated]; } //-------------------------------------------------------------- @@ -333,54 +329,4 @@ const CGFloat timeFadeSecs = 2.0; [super dealloc]; } //-------------------------------------------------------------- -// - iOS6 rotation API - will be called on iOS7 runtime!-------- -- (NSUInteger)supportedInterfaceOrientations -{ - // mask defines available as of ios6 sdk - //return UIInterfaceOrientationMaskAll; - return (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | - (1 << UIInterfaceOrientationPortraitUpsideDown) | (1 << UIInterfaceOrientationPortrait); -} -- (BOOL)shouldAutorotate -{ - _startup = false; - return [self shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)[[UIDevice currentDevice] orientation]]; -} -// - old rotation API will be called on iOS6 and lower - removed in iOS7 --(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - if(_startup) - { - //start with landscape - switch(interfaceOrientation) - { - case UIInterfaceOrientationLandscapeLeft: - case UIInterfaceOrientationLandscapeRight: - return YES; - default: - return FALSE; - } - } - else - { - return YES;//we allow all rotations after startup... - } -} -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - if(_startup) - { - //start with landscape - switch(toInterfaceOrientation) - { - case UIInterfaceOrientationLandscapeLeft: - case UIInterfaceOrientationLandscapeRight: - _startup = false;//allow all orientations after initial landscape rotation - break; - default: - break; - } - } -} -//-------------------------------------------------------------- @end diff --git a/xbmc/platform/darwin/ios/IOSKeyboard.mm b/xbmc/platform/darwin/ios/IOSKeyboard.mm index 14f136e276..5ad53decd1 100644 --- a/xbmc/platform/darwin/ios/IOSKeyboard.mm +++ b/xbmc/platform/darwin/ios/IOSKeyboard.mm @@ -42,11 +42,7 @@ bool CIOSKeyboard::ShowAndGetInput(char_callback_t pCallback, const std::string // assume we are only drawn on the mainscreen ever! UIScreen *pCurrentScreen = [UIScreen mainScreen]; - CGRect keyboardFrame = CGRectMake(0, 0, pCurrentScreen.bounds.size.height, pCurrentScreen.bounds.size.width); -#if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() >= 8.0) - keyboardFrame = CGRectMake(0, 0, pCurrentScreen.bounds.size.width, pCurrentScreen.bounds.size.height); -#endif + CGRect keyboardFrame = CGRectMake(0, 0, pCurrentScreen.bounds.size.width, pCurrentScreen.bounds.size.height); // LOG(@"kb: kb frame: %@", NSStringFromCGRect(keyboardFrame)); //create the keyboardview diff --git a/xbmc/platform/darwin/ios/IOSKeyboardView.mm b/xbmc/platform/darwin/ios/IOSKeyboardView.mm index bc805d4aaf..f514063a25 100644 --- a/xbmc/platform/darwin/ios/IOSKeyboardView.mm +++ b/xbmc/platform/darwin/ios/IOSKeyboardView.mm @@ -127,14 +127,10 @@ static CEvent keyboardFinishedEvent; CGFloat headingW = 0; if (_heading.text and _heading.text.length > 0) { - CGSize headingSize = [_heading.text sizeWithFont:[UIFont systemFontOfSize:[UIFont systemFontSize]]]; + CGSize headingSize = [_heading.text sizeWithAttributes: @{NSFontAttributeName: [UIFont systemFontOfSize:[UIFont systemFontSize]]}]; headingW = MIN(self.bounds.size.width/2, headingSize.width+30); } - CGFloat kbHeight = _kbRect.size.width; -#if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() >= 8.0) - kbHeight =_kbRect.size.height; -#endif + CGFloat kbHeight = _kbRect.size.height; CGFloat y = kbHeight <= 0 ? _textField.frame.origin.y : @@ -150,10 +146,6 @@ static CEvent keyboardFinishedEvent; -(void)keyboardWillShow:(NSNotification *) notification{ NSDictionary* info = [notification userInfo]; CGRect kbRect = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; -#if !__IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() >= 8.0) - kbRect = [self convertRect:kbRect fromView:nil]; -#endif LOG(@"keyboardWillShow: keyboard frame: %@", NSStringFromCGRect(kbRect)); _kbRect = kbRect; [self setNeedsLayout]; @@ -196,30 +188,6 @@ static CEvent keyboardFinishedEvent; - (void)keyboardDidChangeFrame:(id)sender { -#if __IPHONE_8_0 - // when compiled against ios 8.x sdk and runtime is ios - // 5.1.1 (f.e. ipad1 which has 5.1.1 as latest available ios version) - // there is an incompatibility which somehow prevents us from getting - // notified about "keyboardDidHide". This makes the keyboard - // useless on those ios platforms. - // Instead we are called here with "DidChangeFrame" and - // and an invalid frame set (height, width == 0 and pos is inf). - // Lets detect this situation and treat this as "keyboard was hidden" - // message - if (CDarwinUtils::GetIOSVersion() < 6.0) - { - PRINT_SIGNATURE(); - - NSDictionary* info = [sender userInfo]; - CGRect kbRect = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; -// LOG(@"keyboardWillShow: keyboard frame: %f %f %f %f", kbRect.origin.x, kbRect.origin.y, kbRect.size.width, kbRect.size.height); - if (kbRect.size.height == 0) - { - LOG(@"keyboardDidChangeFrame: working around missing keyboardDidHide Message on iOS 5.x"); - [self keyboardDidHide:sender]; - } - } -#endif } - (void)keyboardDidHide:(id)sender diff --git a/xbmc/platform/darwin/ios/IOSScreenManager.h b/xbmc/platform/darwin/ios/IOSScreenManager.h index 6f47f508f7..022b5633b5 100644 --- a/xbmc/platform/darwin/ios/IOSScreenManager.h +++ b/xbmc/platform/darwin/ios/IOSScreenManager.h @@ -47,8 +47,6 @@ - (void) screenDisconnect; // wrapper for g_Windowing.UpdateResolutions(); + (void) updateResolutions; -// returns the landscape resolution for the given screen -+ (CGRect) getLandscapeResolution:(UIScreen *)screen; // fades the screen from black back to full alpha after delaySecs seconds - (void) fadeFromBlack:(CGFloat) delaySecs; // returns true if switching to screenIdx will change from internal to external screen diff --git a/xbmc/platform/darwin/ios/IOSScreenManager.mm b/xbmc/platform/darwin/ios/IOSScreenManager.mm index 0a0a21c294..094eee0247 100644 --- a/xbmc/platform/darwin/ios/IOSScreenManager.mm +++ b/xbmc/platform/darwin/ios/IOSScreenManager.mm @@ -26,6 +26,7 @@ #include "threads/Event.h" #include "Application.h" #include "windowing/WinSystem.h" +#include "windowing/osx/WinSystemIOS.h" #include "settings/DisplaySettings.h" #include "ServiceBroker.h" #include "cores/AudioEngine/Interfaces/AE.h" @@ -100,26 +101,7 @@ static CEvent screenChangeEvent; [_glView setScreen:newScreen withFrameBufferResize:TRUE];//will also resize the framebuffer - if (toExternal) - { - // portrait on external screen means its landscape for xbmc -#if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() >= 8.0 && CDarwinUtils::GetIOSVersion() < 9.0) - [g_xbmcController activateScreen:newScreen withOrientation:UIInterfaceOrientationLandscapeLeft];// will attach the screen to xbmc mainwindow - else -#endif - [g_xbmcController activateScreen:newScreen withOrientation:UIInterfaceOrientationPortrait];// will attach the screen to xbmc mainwindow - } - else - { -#if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() >= 8.0) - [g_xbmcController activateScreen:newScreen withOrientation:UIInterfaceOrientationPortrait];// will attach the screen to xbmc mainwindow - else -#endif - // switching back to internal - use same orientation as we used for the touch controller - [g_xbmcController activateScreen:newScreen withOrientation:_lastTouchControllerOrientation];// will attach the screen to xbmc mainwindow - } + [g_xbmcController activateScreen:newScreen withOrientation:UIInterfaceOrientationPortrait];// will attach the screen to xbmc mainwindow if(toExternal)//changing the external screen might need some time ... { @@ -134,11 +116,7 @@ static CEvent screenChangeEvent; //the parameter enum is lacking the UIScreenOverscanCompensationNone value. //Someone on stackoverflow figured out that value 3 is for turning it off //(though there is no enum value for it). -#ifdef __IPHONE_5_0 [newScreen setOverscanCompensation:(UIScreenOverscanCompensation)3]; -#else - [newScreen setOverscanCompensation:3]; -#endif CLog::Log(LOGDEBUG, "[IOSScreenManager] Disabling overscancompensation."); } else @@ -171,7 +149,7 @@ static CEvent screenChangeEvent; if([self willSwitchToInternal:screenIdx] && _externalTouchController != nil) { - _lastTouchControllerOrientation = [_externalTouchController interfaceOrientation]; + _lastTouchControllerOrientation = [[UIApplication sharedApplication] statusBarOrientation]; [_externalTouchController release]; _externalTouchController = nil; } @@ -249,38 +227,27 @@ static CEvent screenChangeEvent; return false; } //-------------------------------------------------------------- -+ (CGRect) getLandscapeResolution:(UIScreen *)screen -{ - CGRect res = [screen bounds]; - #if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() < 8.0) - #endif - { - //main screen is in portrait mode (physically) so exchange height and width - //at least when compiled with ios sdk < 8.0 (seems to be fixed in later sdks) - if(screen == [UIScreen mainScreen]) - { - CGRect frame = res; - res.size = CGSizeMake(frame.size.height, frame.size.width); - } - } - return res; -} -//-------------------------------------------------------------- - (void) screenDisconnect { //if we are on external screen and he was disconnected //change back to internal screen - if([[UIScreen screens] count] == 1 && _screenIdx != 0) + if (_screenIdx != 0) { - RESOLUTION_INFO res = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP);//internal screen default res - CServiceBroker::GetWinSystem()->SetFullScreen(true, res, false); + CWinSystemIOS *winSystem = (CWinSystemIOS *)CServiceBroker::GetWinSystem(); + if (winSystem != nullptr) + { + winSystem->MoveToTouchscreen(); + } } } //-------------------------------------------------------------- + (void) updateResolutions { - CServiceBroker::GetWinSystem()->UpdateResolutions(); + CWinSystemBase *winSystem = CServiceBroker::GetWinSystem(); + if (winSystem != nullptr) + { + winSystem->UpdateResolutions(); + } } //-------------------------------------------------------------- - (void) dealloc diff --git a/xbmc/platform/darwin/ios/XBMCApplication.mm b/xbmc/platform/darwin/ios/XBMCApplication.mm index 91950abd32..7cad416b6c 100644 --- a/xbmc/platform/darwin/ios/XBMCApplication.mm +++ b/xbmc/platform/darwin/ios/XBMCApplication.mm @@ -88,7 +88,7 @@ XBMCController *m_xbmcController; - (void)screenDidDisconnect:(NSNotification *)aNotification { - [IOSScreenManager updateResolutions]; + [[IOSScreenManager sharedInstance] screenDisconnect]; } - (void)registerScreenNotifications:(BOOL)bRegister @@ -117,7 +117,6 @@ XBMCController *m_xbmcController; UIScreen *currentScreen = [UIScreen mainScreen]; m_xbmcController = [[XBMCController alloc] initWithFrame: [currentScreen bounds] withScreen:currentScreen]; - m_xbmcController.wantsFullScreenLayout = YES; [m_xbmcController startAnimation]; [self registerScreenNotifications:YES]; diff --git a/xbmc/platform/darwin/ios/XBMCController.mm b/xbmc/platform/darwin/ios/XBMCController.mm index f2265796f0..0809c3aa91 100644 --- a/xbmc/platform/darwin/ios/XBMCController.mm +++ b/xbmc/platform/darwin/ios/XBMCController.mm @@ -55,14 +55,7 @@ using namespace KODI::MESSAGING; #import <AVFoundation/AVAudioSession.h> #import <MediaPlayer/MPMediaItem.h> -#ifdef __IPHONE_5_0 #import <MediaPlayer/MPNowPlayingInfoCenter.h> -#else -const NSString *MPNowPlayingInfoPropertyElapsedPlaybackTime = @"MPNowPlayingInfoPropertyElapsedPlaybackTime"; -const NSString *MPNowPlayingInfoPropertyPlaybackRate = @"MPNowPlayingInfoPropertyPlaybackRate"; -const NSString *MPNowPlayingInfoPropertyPlaybackQueueIndex = @"MPNowPlayingInfoPropertyPlaybackQueueIndex"; -const NSString *MPNowPlayingInfoPropertyPlaybackQueueCount = @"MPNowPlayingInfoPropertyPlaybackQueueCount"; -#endif #import "IOSEAGLView.h" #import "XBMCController.h" @@ -186,34 +179,6 @@ XBMCController *g_xbmcController; return NO; } //-------------------------------------------------------------- -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ -#if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() < 8.0) -#endif - { - orientation = toInterfaceOrientation; - CGRect srect = [IOSScreenManager getLandscapeResolution: [m_glView getCurrentScreen]]; - CGRect rect = srect;; - - switch(toInterfaceOrientation) - { - case UIInterfaceOrientationPortrait: - case UIInterfaceOrientationPortraitUpsideDown: - if(![[IOSScreenManager sharedInstance] isExternalScreen]) - { - rect.size = CGSizeMake( srect.size.height, srect.size.width ); - } - break; - case UIInterfaceOrientationLandscapeLeft: - case UIInterfaceOrientationLandscapeRight: - case UIInterfaceOrientationUnknown: - break;//just leave the rect as is - } - m_glView.frame = rect; - } -} - - (UIInterfaceOrientation) getOrientation { return orientation; @@ -605,36 +570,12 @@ XBMCController *g_xbmcController; orientation = UIInterfaceOrientationLandscapeLeft; -#if __IPHONE_8_0 - if (CDarwinUtils::GetIOSVersion() < 8.0) -#endif - { - /* We start in landscape mode */ - CGRect srect = frame; - // in ios sdks older then 8.0 the landscape mode is 90 degrees - // rotated - srect.size = CGSizeMake( frame.size.height, frame.size.width ); - - m_glView = [[IOSEAGLView alloc] initWithFrame: srect withScreen:screen]; - [[IOSScreenManager sharedInstance] setView:m_glView]; - [m_glView setMultipleTouchEnabled:YES]; - - /* Check if screen is Retina */ - screenScale = [m_glView getScreenScale:screen]; - - [self.view addSubview: m_glView]; - - [self createGestureRecognizers]; - [m_window addSubview: self.view]; - } - [m_window makeKeyAndVisible]; g_xbmcController = self; return self; } //-------------------------------------------------------------- -#if __IPHONE_8_0 - (void)loadView { [super loadView]; @@ -655,7 +596,6 @@ XBMCController *g_xbmcController; [self createGestureRecognizers]; } } -#endif //-------------------------------------------------------------- -(void)viewDidLoad { @@ -760,8 +700,20 @@ XBMCController *g_xbmcController; //-------------------------------------------------------------- - (CGSize) getScreenSize { - screensize.width = m_glView.bounds.size.width * screenScale; - screensize.height = m_glView.bounds.size.height * screenScale; + __block CGSize tmp; + if ([NSThread isMainThread]) + { + tmp.width = m_glView.bounds.size.width * screenScale; + tmp.height = m_glView.bounds.size.height * screenScale; + } + else + { + dispatch_sync(dispatch_get_main_queue(), ^{ + tmp.width = m_glView.bounds.size.width * screenScale; + tmp.height = m_glView.bounds.size.height * screenScale; + }); + } + screensize = tmp; return screensize; } //-------------------------------------------------------------- @@ -863,15 +815,9 @@ XBMCController *g_xbmcController; } // reset the rotation of the view view.layer.transform = CATransform3DMakeRotation(angle, 0, 0.0, 1.0); -#if __IPHONE_8_0 view.layer.bounds = view.bounds; -#else - [view setFrame:m_window.frame]; -#endif m_window.screen = screen; -#if __IPHONE_8_0 [view setFrame:m_window.frame]; -#endif } //-------------------------------------------------------------- - (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent { diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp index 5ddb06eb90..3602bbea93 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp @@ -52,6 +52,8 @@ #include "windowing/X11/WinSystemX11.h" #elif defined(TARGET_DARWIN_OSX) #include "windowing/osx/WinSystemOSX.h" +#elif defined(TARGET_DARWIN_IOS) +#include "windowing/osx/WinSystemIOS.h" #elif defined(HAVE_WAYLAND) #include "windowing/wayland/WinSystemWayland.h" #elif defined(TARGET_WINDOWS_DESKTOP) @@ -778,7 +780,7 @@ void CDisplaySettings::SettingOptionsScreensFiller(SettingConstPtr setting, std: if (g_advancedSettings.m_canWindowed && CServiceBroker::GetWinSystem()->CanDoWindowed()) list.push_back(std::make_pair(g_localizeStrings.Get(242), DM_WINDOWED)); -#if defined(HAVE_X11) || defined(HAVE_WAYLAND) || defined(TARGET_DARWIN_OSX) || defined(TARGET_WINDOWS) +#if defined(HAVE_X11) || defined(HAVE_WAYLAND) || defined(TARGET_DARWIN_OSX) || defined(TARGET_WINDOWS) || defined(TARGET_DARWIN_IOS) list.push_back(std::make_pair(g_localizeStrings.Get(244), 0)); #else @@ -832,13 +834,15 @@ void CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller(Settin void CDisplaySettings::SettingOptionsMonitorsFiller(SettingConstPtr setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, void *data) { -#if defined(HAVE_X11) || defined(TARGET_DARWIN_OSX) +#if defined(HAVE_X11) || defined(TARGET_DARWIN_OSX) || defined(TARGET_DARWIN_IOS) std::vector<std::string> monitors; #if defined(HAVE_X11) CWinSystemX11 *winSystem = dynamic_cast<CWinSystemX11*>(CServiceBroker::GetWinSystem()); #elif defined(TARGET_DARWIN_OSX) CWinSystemOSX *winSystem = dynamic_cast<CWinSystemOSX*>(CServiceBroker::GetWinSystem()); +#elif defined(TARGET_DARWIN_IOS) + CWinSystemIOS *winSystem = dynamic_cast<CWinSystemIOS*>(CServiceBroker::GetWinSystem()); #endif winSystem->GetConnectedOutputs(&monitors); std::string currentMonitor = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR); diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp index 4a26a449bc..9ff24373a5 100644 --- a/xbmc/settings/SettingConditions.cpp +++ b/xbmc/settings/SettingConditions.cpp @@ -333,6 +333,9 @@ void CSettingConditions::Initialize(const CProfilesManager &profileManager) #ifdef TARGET_DARWIN_OSX m_simpleConditions.insert("have_osx"); #endif +#ifdef TARGET_DARWIN_IOS + m_simpleConditions.insert("have_ios"); +#endif #ifdef HAS_LIBAMCODEC if (aml_present()) m_simpleConditions.insert("have_amcodec"); diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index e26c8e736c..8036f343f3 100644 --- a/xbmc/utils/URIUtils.cpp +++ b/xbmc/utils/URIUtils.cpp @@ -982,6 +982,7 @@ bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */ return IsInternetStream(CStackDirectory::GetFirstStackedFile(url.Get())); // Special case these + //! @todo sftp special case has to be handled by vfs addon if (url.IsProtocol("ftp") || url.IsProtocol("ftps") || url.IsProtocol("dav") || url.IsProtocol("davs") || url.IsProtocol("sftp")) diff --git a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp index 4f4e2239f6..9c876a53ce 100644 --- a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp +++ b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp @@ -69,7 +69,7 @@ bool CWinSystemGbmGLESContext::InitWindowSystem() } CRendererDRMPRIMEGLES::Register(); - CRendererDRMPRIME::Register(this); + CRendererDRMPRIME::Register(); CDVDVideoCodecDRMPRIME::Register(); return true; diff --git a/xbmc/windowing/osx/WinSystemIOS.h b/xbmc/windowing/osx/WinSystemIOS.h index 345dbb012a..965a420cca 100644 --- a/xbmc/windowing/osx/WinSystemIOS.h +++ b/xbmc/windowing/osx/WinSystemIOS.h @@ -37,6 +37,7 @@ public: CWinSystemIOS(); virtual ~CWinSystemIOS(); + int GetDisplayIndexFromSettings(); // Implementation of CWinSystemBase CRenderSystemBase *GetRenderSystem() override { return this; } bool InitWindowSystem() override; @@ -66,9 +67,6 @@ public: void Register(IDispResource *resource) override; void Unregister(IDispResource *resource) override; - int GetNumScreens() override; - int GetCurrentScreen() override; - virtual std::unique_ptr<CVideoSync> GetVideoSync(void *clock) override; bool InitDisplayLink(CVideoSyncIos *syncImpl); @@ -76,6 +74,8 @@ public: void OnAppFocusChange(bool focus); bool IsBackgrounded() const { return m_bIsBackgrounded; } void* GetEAGLContextObj(); + void GetConnectedOutputs(std::vector<std::string> *outputs); + void MoveToTouchscreen(); // winevents override bool MessagePump() override; @@ -95,8 +95,8 @@ protected: private: bool GetScreenResolution(int* w, int* h, double* fps, int screenIdx); - void FillInVideoModes(); - bool SwitchToVideoMode(int width, int height, double refreshrate, int screenIdx); + void FillInVideoModes(int screenIdx); + bool SwitchToVideoMode(int width, int height, double refreshrate); CADisplayLinkWrapper *m_pDisplayLink; }; diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm index 0e24625c9e..fe09419d61 100644 --- a/xbmc/windowing/osx/WinSystemIOS.mm +++ b/xbmc/windowing/osx/WinSystemIOS.mm @@ -50,8 +50,12 @@ #import "platform/darwin/ios/XBMCController.h" #import "platform/darwin/ios/IOSScreenManager.h" #include "platform/darwin/DarwinUtils.h" +#include "settings/Settings.h" #import <dlfcn.h> +#define CONST_TOUCHSCREEN "Touchscreen" +#define CONST_EXTERNAL "External" + // IOSDisplayLinkCallback is declared in the lower part of the file @interface IOSDisplayLinkCallback : NSObject { @@ -76,6 +80,27 @@ std::unique_ptr<CWinSystemBase> CWinSystemBase::CreateWinSystem() return winSystem; } +int CWinSystemIOS::GetDisplayIndexFromSettings() +{ + std::string currentScreen = CServiceBroker::GetSettings().GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR); + + int screenIdx = 0; + if (currentScreen == CONST_EXTERNAL) + { + if ([[UIScreen screens] count] > 1) + { + screenIdx = 1; + } + else// screen 1 is setup but not connected + { + // force internal screen + MoveToTouchscreen(); + } + } + + return screenIdx; +} + CWinSystemIOS::CWinSystemIOS() : CWinSystemBase() { m_iVSyncErrors = 0; @@ -168,7 +193,7 @@ bool CWinSystemIOS::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl m_bFullScreen = fullScreen; CLog::Log(LOGDEBUG, "About to switch to %i x %i on screen %i",m_nWidth, m_nHeight, res.iScreen); - SwitchToVideoMode(res.iWidth, res.iHeight, res.fRefreshRate, res.iScreen); + SwitchToVideoMode(res.iWidth, res.iHeight, res.fRefreshRate); CRenderSystemGLES::ResetRenderSystem(res.iWidth, res.iHeight); return true; @@ -176,16 +201,14 @@ bool CWinSystemIOS::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl UIScreenMode *getModeForResolution(int width, int height, unsigned int screenIdx) { - if( screenIdx >= [[UIScreen screens] count]) - return NULL; - UIScreen *aScreen = [[UIScreen screens]objectAtIndex:screenIdx]; for ( UIScreenMode *mode in [aScreen availableModes] ) { //for main screen also find modes where width and height are //exchanged (because of the 90°degree rotated buildinscreens) if((mode.size.width == width && mode.size.height == height) || - (screenIdx == 0 && mode.size.width == height && mode.size.height == width)) + (screenIdx == 0 && mode.size.width == height && mode.size.height == width) + || screenIdx == 0) // for screenIdx == 0 - which is the mainscreen - we only have one resolution - match it every time { CLog::Log(LOGDEBUG,"Found matching mode"); return mode; @@ -195,13 +218,10 @@ UIScreenMode *getModeForResolution(int width, int height, unsigned int screenIdx return NULL; } -bool CWinSystemIOS::SwitchToVideoMode(int width, int height, double refreshrate, int screenIdx) +bool CWinSystemIOS::SwitchToVideoMode(int width, int height, double refreshrate) { bool ret = false; - // SwitchToVideoMode will not return until the display has actually switched over. - // This can take several seconds. - if( screenIdx >= GetNumScreens()) - return false; + int screenIdx = GetDisplayIndexFromSettings(); //get the mode to pass to the controller UIScreenMode *newMode = getModeForResolution(width, height, screenIdx); @@ -213,26 +233,8 @@ bool CWinSystemIOS::SwitchToVideoMode(int width, int height, double refreshrate, return ret; } -int CWinSystemIOS::GetNumScreens() -{ - return [[UIScreen screens] count]; -} - -int CWinSystemIOS::GetCurrentScreen() -{ - int idx = 0; - if ([[IOSScreenManager sharedInstance] isExternalScreen]) - { - idx = 1; - } - return idx; -} - bool CWinSystemIOS::GetScreenResolution(int* w, int* h, double* fps, int screenIdx) { - // Figure out the screen size. (default to main screen) - if(screenIdx >= GetNumScreens()) - return false; UIScreen *screen = [[UIScreen screens] objectAtIndex:screenIdx]; CGSize screenSize = [screen currentMode].size; *w = screenSize.width; @@ -247,13 +249,14 @@ bool CWinSystemIOS::GetScreenResolution(int* w, int* h, double* fps, int screenI *h = firstMode.size.height; } - //for mainscreen use the eagl bounds + //for mainscreen exchange w and h //because mainscreen is build in //in 90° rotated if(screenIdx == 0) { - *w = [g_xbmcController getScreenSize].width; - *h = [g_xbmcController getScreenSize].height; + int tmp = *w; + *w = *h; + *h = tmp; } CLog::Log(LOGDEBUG,"Current resolution Screen: %i with %i x %i",screenIdx, *w, *h); return true; @@ -266,69 +269,54 @@ void CWinSystemIOS::UpdateResolutions() double fps; CWinSystemBase::UpdateResolutions(); + int screenIdx = GetDisplayIndexFromSettings(); + //first screen goes into the current desktop mode - if(GetScreenResolution(&w, &h, &fps, 0)) + if(GetScreenResolution(&w, &h, &fps, screenIdx)) { UpdateDesktopResolution(CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP), 0, w, h, fps); + CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).strOutput = screenIdx == 0 ? CONST_TOUCHSCREEN : CONST_EXTERNAL; } - - //see resolution.h enum RESOLUTION for how the resolutions - //have to appear in the resolution info vector in CDisplaySettings - //add the desktop resolutions of the other screens - for(int i = 1; i < GetNumScreens(); i++) - { - RESOLUTION_INFO res; - //get current resolution of screen i - if(GetScreenResolution(&w, &h, &fps, i)) - { - UpdateDesktopResolution(res, i, w, h, fps); - CDisplaySettings::GetInstance().AddResolutionInfo(res); - } - } - + + CDisplaySettings::GetInstance().ClearCustomResolutions(); + //now just fill in the possible resolutions for the attached screens //and push to the resolution info vector - FillInVideoModes(); + FillInVideoModes(screenIdx); } -void CWinSystemIOS::FillInVideoModes() +void CWinSystemIOS::FillInVideoModes(int screenIdx) { // Add full screen settings for additional monitors - int numDisplays = GetNumScreens(); - - for (int disp = 0; disp < numDisplays; disp++) + RESOLUTION_INFO res; + int w, h; + // atm we don't get refreshrate info from iOS + // but this may change in the future. In that case + // we will adapt this code for filling some + // useful info into this local var :) + double refreshrate = 0.0; + //screen 0 is mainscreen - 1 has to be the external one... + UIScreen *aScreen = [[UIScreen screens]objectAtIndex:screenIdx]; + //found external screen + for ( UIScreenMode *mode in [aScreen availableModes] ) { - RESOLUTION_INFO res; - int w, h; - // atm we don't get refreshrate info from iOS - // but this may change in the future. In that case - // we will adapt this code for filling some - // useful info into this local var :) - double refreshrate = 0.0; - //screen 0 is mainscreen - 1 has to be the external one... - UIScreen *aScreen = [[UIScreen screens]objectAtIndex:disp]; - //found external screen - for ( UIScreenMode *mode in [aScreen availableModes] ) + w = mode.size.width; + h = mode.size.height; + + if (screenIdx == 0) { - w = mode.size.width; - h = mode.size.height; - UpdateDesktopResolution(res, disp, w, h, refreshrate); - CLog::Log(LOGNOTICE, "Found possible resolution for display %d with %d x %d\n", disp, w, h); - - //overwrite the mode str because UpdateDesktopResolution adds a - //"Full Screen". Since the current resolution is there twice - //this would lead to 2 identical resolution entrys in the guisettings.xml. - //That would cause problems with saving screen overscan calibration - //because the wrong entry is picked on load. - //So we just use UpdateDesktopResolutions for the current DESKTOP_RESOLUTIONS - //in UpdateResolutions. And on all other resolutions make a unique - //mode str by doing it without appending "Full Screen". - //this is what linux does - though it feels that there shouldn't be - //the same resolution twice... - thats why i add a FIXME here. - res.strMode = StringUtils::Format("%dx%d @ %.2f", w, h, refreshrate); - CServiceBroker::GetWinSystem()->GetGfxContext().ResetOverscan(res); - CDisplaySettings::GetInstance().AddResolutionInfo(res); + res.strOutput = CONST_TOUCHSCREEN; } + else + { + res.strOutput = CONST_EXTERNAL; + } + + UpdateDesktopResolution(res, 0, w, h, refreshrate); + CLog::Log(LOGNOTICE, "Found possible resolution for display %d with %d x %d\n", screenIdx, w, h); + + CServiceBroker::GetWinSystem()->GetGfxContext().ResetOverscan(res); + CDisplaySettings::GetInstance().AddResolutionInfo(res); } } @@ -504,6 +492,21 @@ void* CWinSystemIOS::GetEAGLContextObj() return [g_xbmcController getEAGLContextObj]; } +void CWinSystemIOS::GetConnectedOutputs(std::vector<std::string> *outputs) +{ + outputs->push_back("Default"); + outputs->push_back(CONST_TOUCHSCREEN); + if ([[UIScreen screens] count] > 1) + { + outputs->push_back(CONST_EXTERNAL); + } +} + +void CWinSystemIOS::MoveToTouchscreen() +{ + CDisplaySettings::GetInstance().SetMonitor(CONST_TOUCHSCREEN); +} + std::unique_ptr<CVideoSync> CWinSystemIOS::GetVideoSync(void *clock) { std::unique_ptr<CVideoSync> pVSync(new CVideoSyncIos(clock, *this)); |