summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project/cmake/CMakeLists.txt33
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt33
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in3
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in17
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/mingw.txt1
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in6
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt0
-rw-r--r--project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt5
-rw-r--r--project/cmake/addons/depends/windows/cmake/msys/msys.txt1
-rw-r--r--project/cmake/addons/depends/windows/cmake/msys/noinstall.txt0
-rw-r--r--project/cmake/cpack/deb/copyright118
-rw-r--r--project/cmake/cpack/deb/packages/kodi.txt.in2
-rw-r--r--project/cmake/installdata/common/addons.txt3
-rw-r--r--project/cmake/modules/FindBluetooth.cmake6
-rw-r--r--project/cmake/modules/FindCAP.cmake44
-rw-r--r--project/cmake/modules/FindCpluff.cmake8
-rw-r--r--project/cmake/modules/FindCrossGUID.cmake5
-rw-r--r--project/cmake/modules/FindFFMPEG.cmake258
-rw-r--r--project/cmake/modules/FindFribidi.cmake6
-rw-r--r--project/cmake/modules/FindMir.cmake33
-rw-r--r--project/cmake/modules/FindTexturePacker.cmake22
-rw-r--r--project/cmake/modules/FindVAAPI.cmake15
-rw-r--r--project/cmake/modules/FindXSLT.cmake2
-rw-r--r--project/cmake/scripts/android/Install.cmake1
-rw-r--r--project/cmake/scripts/common/ArchSetup.cmake5
-rw-r--r--project/cmake/scripts/common/CheckTargetPlatform.cmake6
-rw-r--r--project/cmake/scripts/common/HandleDepends.cmake43
-rw-r--r--project/cmake/scripts/common/Macros.cmake9
-rw-r--r--project/cmake/scripts/common/PrepareEnv.cmake47
-rw-r--r--project/cmake/scripts/ios/ArchSetup.cmake21
-rw-r--r--project/cmake/scripts/ios/Install.cmake93
-rw-r--r--project/cmake/scripts/linux/ArchSetup.cmake4
-rw-r--r--project/cmake/scripts/linux/Install.cmake18
-rw-r--r--project/cmake/scripts/osx/Macros.cmake9
-rw-r--r--project/cmake/scripts/windows/tools/patch.cmake37
-rw-r--r--project/cmake/treedata/common/addons.txt3
-rw-r--r--project/cmake/treedata/common/cores.txt1
-rw-r--r--project/cmake/treedata/common/games.txt8
-rw-r--r--project/cmake/treedata/common/network.txt2
-rw-r--r--project/cmake/treedata/common/subdirs.txt5
-rw-r--r--project/cmake/treedata/optional/common/mir.txt1
-rw-r--r--project/cmake/treedata/optional/common/webserver.txt2
-rw-r--r--version.txt8
-rw-r--r--xbmc/addons/addon-bindings.mk5
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h161
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h287
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h487
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h2
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h11
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h3
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h238
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h6
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h96
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h43
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h211
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h2
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h6
-rw-r--r--xbmc/input/XBMC_vkeys.h286
58 files changed, 2277 insertions, 511 deletions
diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt
index fa1156d..c70b18d 100644
--- a/project/cmake/CMakeLists.txt
+++ b/project/cmake/CMakeLists.txt
@@ -45,14 +45,14 @@ option(ENABLE_NONFREE "Enable non-free components?" ON)
45option(ENABLE_AIRTUNES "Enable AirTunes support?" ON) 45option(ENABLE_AIRTUNES "Enable AirTunes support?" ON)
46option(ENABLE_CEC "Enable CEC support?" ON) 46option(ENABLE_CEC "Enable CEC support?" ON)
47option(ENABLE_OPTICAL "Enable optical support?" ON) 47option(ENABLE_OPTICAL "Enable optical support?" ON)
48# use ffmpeg from depends or system
49option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" OFF)
48if(UNIX) 50if(UNIX)
49 if(NOT APPLE)
50 option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" ON)
51 endif()
52 option(FFMPEG_PATH "Path to external ffmpeg?" "") 51 option(FFMPEG_PATH "Path to external ffmpeg?" "")
53 option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON) 52 option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON)
54 option(ENABLE_OPENSSL "Enable OpenSSL?" ON) 53 option(ENABLE_OPENSSL "Enable OpenSSL?" ON)
55 option(ENABLE_SDL "Enable SDL?" OFF) 54 option(ENABLE_SDL "Enable SDL?" OFF)
55 option(ENABLE_MIR "Enable MIR?" OFF)
56 if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) 56 if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
57 option(ENABLE_X11 "Enable X11 support?" ON) 57 option(ENABLE_X11 "Enable X11 support?" ON)
58 option(ENABLE_AML "Enable AML?" OFF) 58 option(ENABLE_AML "Enable AML?" OFF)
@@ -119,7 +119,7 @@ endif()
119# Optional dependencies 119# Optional dependencies
120set(optional_deps MicroHttpd MySqlClient SSH XSLT 120set(optional_deps MicroHttpd MySqlClient SSH XSLT
121 Alsa UDEV DBus Avahi SmbClient 121 Alsa UDEV DBus Avahi SmbClient
122 PulseAudio VDPAU VAAPI) 122 PulseAudio VDPAU VAAPI Bluetooth CAP)
123 123
124# Required, dyloaded deps 124# Required, dyloaded deps
125set(required_dyload Curl ASS) 125set(required_dyload Curl ASS)
@@ -197,14 +197,24 @@ endif()
197if(NOT WIN32) 197if(NOT WIN32)
198 core_optional_dep(OpenGl) 198 core_optional_dep(OpenGl)
199 if(OPENGL_FOUND) 199 if(OPENGL_FOUND)
200 core_optional_dep(X ENABLE_X11) 200 if(ENABLE_MIR)
201 core_optional_dep(LibDRM ENABLE_X11) 201 core_require_dep(Mir ENABLE_MIR)
202 core_optional_dep(XRandR ENABLE_X11) 202 core_optional_dep(LibDRM ENABLE_MIR)
203 else()
204 core_optional_dep(X ENABLE_X11)
205 core_optional_dep(XRandR ENABLE_X11)
206 core_optional_dep(LibDRM ENABLE_X11)
207 endif()
203 else() 208 else()
204 core_optional_dep(OpenGLES) 209 core_optional_dep(OpenGLES)
205 if(OPENGLES_FOUND) 210 if(OPENGLES_FOUND)
206 core_optional_dep(X ENABLE_X11) 211 if(ENABLE_MIR)
207 core_optional_dep(LibDRM ENABLE_X11) 212 core_require_dep(Mir ENABLE_MIR)
213 core_optional_dep(LibDRM ENABLE_MIR)
214 else()
215 core_optional_dep(X ENABLE_X11)
216 core_optional_dep(LibDRM ENABLE_X11)
217 endif()
208 endif() 218 endif()
209 endif() 219 endif()
210 if(NOT APPLE) 220 if(NOT APPLE)
@@ -337,9 +347,12 @@ unset(_MAIN_LIBRARIES)
337if(WIN32) 347if(WIN32)
338 set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) 348 set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON)
339 set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC}) 349 set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC})
340 target_sources(kodi PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest) 350 target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest)
341elseif(CORE_SYSTEM_NAME STREQUAL android) 351elseif(CORE_SYSTEM_NAME STREQUAL android)
342 # Nothing 352 # Nothing
353elseif(CORE_SYSTEM_NAME STREQUAL ios)
354 set_target_properties(${APP_NAME_LC} PROPERTIES OUTPUT_NAME ${APP_NAME}
355 MACOSX_BUNDLE_INFO_PLIST ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in)
343else() 356else()
344 set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") 357 set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin")
345endif() 358endif()
diff --git a/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt
new file mode 100644
index 0000000..2c2c4b8
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt
@@ -0,0 +1,33 @@
1cmake_minimum_required(VERSION 3.1)
2project(mingw)
3
4function(generate_mingw32_wrapper cmd)
5 set(CMD ${cmd})
6 configure_file(${PROJECT_SOURCE_DIR}/mingw32-cmd.bat.in ${MINGW_PATH}/bin/${CMD}.bat @ONLY)
7endfunction()
8
9get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../../.. REALPATH)
10
11set(MSYS_PATH "${CORE_SOURCE_DIR}/project/BuildDependencies/msys64")
12set(MINGW_PATH "${MSYS_PATH}/mingw32")
13
14# configure the MinGW toolchain file
15configure_file(${PROJECT_SOURCE_DIR}/Toolchain_mingw32.cmake.in ${CMAKE_INSTALL_PREFIX}/Toolchain_mingw32.cmake @ONLY)
16
17# configure MinGWConfig.cmake
18configure_file(${PROJECT_SOURCE_DIR}/MinGWConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/MinGWConfig.cmake)
19
20# TODO: MinGW GCC 5.3.0-1 comes without cc.exe, Remove this once package is bumped to 5.3.0-p2
21# See https://github.com/Alexpux/MINGW-packages/pull/1034
22if(NOT EXISTS ${MINGW_PATH}/bin/cc.exe)
23 execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_PATH}/bin/gcc.exe ${MINGW_PATH}/bin/cc.exe)
24endif()
25
26# configure the MinGW wrapper batch scripts
27generate_mingw32_wrapper("make")
28generate_mingw32_wrapper("gcc")
29generate_mingw32_wrapper("cc")
30generate_mingw32_wrapper("g++")
31generate_mingw32_wrapper("ar")
32generate_mingw32_wrapper("ld")
33generate_mingw32_wrapper("windres")
diff --git a/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in b/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in
new file mode 100644
index 0000000..2d6baa7
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in
@@ -0,0 +1,3 @@
1set(MINGW_INCLUDE_DIRS @MINGW_PATH@/include)
2set(MINGW_MAKE @MINGW_PATH@/bin/make.bat -j$ENV{NUMBER_OF_PROCESSORS})
3set(MINGW_FOUND 1)
diff --git a/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in b/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in
new file mode 100644
index 0000000..01d281d
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in
@@ -0,0 +1,17 @@
1set(CMAKE_SYSTEM_VERSION 1)
2set(CMAKE_SYSTEM_NAME Windows)
3
4set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@ @CMAKE_INSTALL_PREFIX@ @MSYS_PATH@ @MINGW_PATH@)
5
6# specify the cross compiler
7set(CMAKE_C_COMPILER @MINGW_PATH@/bin/gcc.bat)
8set(CMAKE_CXX_COMPILER @MINGW_PATH@/bin/g++.bat)
9set(CMAKE_AR @MINGW_PATH@/bin/ar.bat CACHE FILEPATH "Archiver")
10set(CMAKE_LINKER @MINGW_PATH@/bin/ld.bat CACHE FILEPATH "Linker")
11SET(CMAKE_RC_COMPILER @MINGW_PATH@/bin/windres.bat)
12
13# search for programs in the build host directories
14set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
15# for libraries and headers in the target directories
16set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
17set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt b/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt
new file mode 100644
index 0000000..90aa6ae
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt
@@ -0,0 +1 @@
mingw
diff --git a/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in b/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in
new file mode 100644
index 0000000..44a0ea2
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in
@@ -0,0 +1,6 @@
1@ECHO OFF
2SETLOCAL
3
4SET PATH=@MINGW_PATH@/bin;@MSYS_PATH@/usr/bin;%PATH%
5@CMD@.exe %*
6
diff --git a/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt b/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt
diff --git a/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt
new file mode 100644
index 0000000..1c0536e
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt
@@ -0,0 +1,5 @@
1cmake_minimum_required(VERSION 3.1)
2project(msys LANGUAGES NONE)
3
4# This is an empty dummy dependency because a lot of game addons depend on it.
5# After they got fixed, this can be removed.
diff --git a/project/cmake/addons/depends/windows/cmake/msys/msys.txt b/project/cmake/addons/depends/windows/cmake/msys/msys.txt
new file mode 100644
index 0000000..00de9c2
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/msys/msys.txt
@@ -0,0 +1 @@
msys
diff --git a/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt b/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt
diff --git a/project/cmake/cpack/deb/copyright b/project/cmake/cpack/deb/copyright
index 5616264..a79cf54 100644
--- a/project/cmake/cpack/deb/copyright
+++ b/project/cmake/cpack/deb/copyright
@@ -529,84 +529,6 @@ projectM - OpenGL based advanced music visualization program
529 You should have received a copy of the GNU Lesser General Public License 529 You should have received a copy of the GNU Lesser General Public License
530 along with this program. If not, see <http://www.gnu.org/licenses/>. 530 along with this program. If not, see <http://www.gnu.org/licenses/>.
531 531
532GLEW - The OpenGL Extension Wrangler Library
533<http://glew.sourceforge.net/>
534
535 Copyright © 2002-2008, Milan Ikits <milan ikits[]ieee org>
536 Copyright © 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
537 Copyright © 2002, Lev Povalahev
538 Copyright © 1999-2007 Brian Paul
539 Copyright © 2007 The Khronos Group Inc.
540 All Rights Reserved.
541
542 Falls under three licenses, which are the Modified BSD License, the Mesa 3-D
543 License (MIT License), and the Khronos License (MIT License).
544
545 Modified BSD License
546
547 Redistribution and use in source and binary forms, with or without
548 modification, are permitted provided that the following conditions are met:
549
550 * Redistributions of source code must retain the above copyright notice,
551 this list of conditions and the following disclaimer.
552 * Redistributions in binary form must reproduce the above copyright notice,
553 this list of conditions and the following disclaimer in the documentation
554 and/or other materials provided with the distribution.
555 * The name of the author may be used to endorse or promote products
556 derived from this software without specific prior written permission.
557
558 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
559 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
560 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
561 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
562 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
563 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
564 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
565 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
566 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
567 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
568 THE POSSIBILITY OF SUCH DAMAGE.
569
570 Mesa 3-D License (MIT License)
571
572 Permission is hereby granted, free of charge, to any person obtaining a
573 copy of this software and associated documentation files (the "Software"),
574 to deal in the Software without restriction, including without limitation
575 the rights to use, copy, modify, merge, publish, distribute, sublicense,
576 and/or sell copies of the Software, and to permit persons to whom the
577 Software is furnished to do so, subject to the following conditions:
578
579 The above copyright notice and this permission notice shall be included
580 in all copies or substantial portions of the Software.
581
582 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
583 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
584 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
585 BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
586 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
587 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
588
589 Khronos License (MIT License)
590
591 Permission is hereby granted, free of charge, to any person obtaining a
592 copy of this software and/or associated documentation files (the
593 "Materials"), to deal in the Materials without restriction, including
594 without limitation the rights to use, copy, modify, merge, publish,
595 distribute, sublicense, and/or sell copies of the Materials, and to
596 permit persons to whom the Materials are furnished to do so, subject to
597 the following conditions:
598
599 The above copyright notice and this permission notice shall be included
600 in all copies or substantial portions of the Materials.
601
602 THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
603 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
604 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
605 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
606 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
607 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
608 MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
609
610OpenDAAP 532OpenDAAP
611<http://www.opendaap.org/> 533<http://www.opendaap.org/>
612 534
@@ -809,28 +731,6 @@ GNU libmicrohttpd
809 You should have received a copy of the GNU Lesser General Public License 731 You should have received a copy of the GNU Lesser General Public License
810 along with this program. If not, see <http://www.gnu.org/licenses/>. 732 along with this program. If not, see <http://www.gnu.org/licenses/>.
811 733
812libmodplug
813<http://modplug-xmms.sourceforge.net>
814
815 Copyright 2002-2003 Kenton Varda <temporal@gauge3d.org>,
816 Olivier Lapicque <olivierl@jps.net>,
817 Colin DeVilbiss <crdevilb@mtu.edu>,
818 Markus Fick <marf@gmx.net>,
819 Adam Goode <adam@evdebs.org>
820
821 This library is free software; you can redistribute it and/or
822 modify it under the terms of the GNU Lesser General Public
823 License as published by the Free Software Foundation; either
824 version 2.1 of the License, or (at your option) any later version.
825
826 This library is distributed in the hope that it will be useful,
827 but WITHOUT ANY WARRANTY; without even the implied warranty of
828 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
829 Lesser General Public License for more details.
830
831 You should have received a copy of the GNU Lesser General Public License
832 along with this program. If not, see <http://www.gnu.org/licenses/>.
833
834Python Programming Language 734Python Programming Language
835<http://www.python.org/> 735<http://www.python.org/>
836 736
@@ -2430,24 +2330,6 @@ libnfs - NFS client library
2430 You should have received a copy of the GNU Lesser General Public License 2330 You should have received a copy of the GNU Lesser General Public License
2431 along with this library. If not, see <http://www.gnu.org/licenses/>. 2331 along with this library. If not, see <http://www.gnu.org/licenses/>.
2432 2332
2433librtmp - toolkit for RTMP streams
2434
2435 Copyright (C) 2009 Andrej Stepanchuk
2436 Copyright (C) 2009-2010 Howard Chu
2437
2438 This program is free software; you can redistribute it and/or modify
2439 it under the terms of the GNU General Public License as published by
2440 the Free Software Foundation; either version 2 of the License, or
2441 (at your option) any later version.
2442
2443 This program is distributed in the hope that it will be useful,
2444 but WITHOUT ANY WARRANTY; without even the implied warranty of
2445 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2446 GNU General Public License for more details.
2447
2448 You should have received a copy of the GNU General Public License
2449 along with this program. If not, see <http://www.gnu.org/licenses/>.
2450
2451libsquish - Open source DXT compression library 2333libsquish - Open source DXT compression library
2452 2334
2453 Copyright (C) 2006 Simon Brown <si@sjbrown.co.uk> 2335 Copyright (C) 2006 Simon Brown <si@sjbrown.co.uk>
diff --git a/project/cmake/cpack/deb/packages/kodi.txt.in b/project/cmake/cpack/deb/packages/kodi.txt.in
index 3a5cde1..4ca417b 100644
--- a/project/cmake/cpack/deb/packages/kodi.txt.in
+++ b/project/cmake/cpack/deb/packages/kodi.txt.in
@@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION video 15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional 16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS 17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging, python-simplejson, libmad0, libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1, libshairplay0, libvorbisfile3, libaacs0, libcec3, librtmp1 | librtmp0, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2 18PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging, python-simplejson, libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2
19PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 19PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1
20PACKAGE_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 20PACKAGE_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
21PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone 21PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone
diff --git a/project/cmake/installdata/common/addons.txt b/project/cmake/installdata/common/addons.txt
index 1cbe4d6..5613ba7 100644
--- a/project/cmake/installdata/common/addons.txt
+++ b/project/cmake/installdata/common/addons.txt
@@ -20,12 +20,11 @@ addons/xbmc.python/*
20addons/xbmc.webinterface/* 20addons/xbmc.webinterface/*
21addons/library.kodi.adsp/* 21addons/library.kodi.adsp/*
22addons/library.kodi.audioengine/* 22addons/library.kodi.audioengine/*
23addons/library.kodi.game/*
23addons/library.kodi.guilib/* 24addons/library.kodi.guilib/*
24addons/library.kodi.inputstream/*
25addons/library.kodi.peripheral/* 25addons/library.kodi.peripheral/*
26addons/library.xbmc.addon/* 26addons/library.xbmc.addon/*
27addons/library.xbmc.codec/* 27addons/library.xbmc.codec/*
28addons/library.xbmc.pvr/*
29addons/repository.xbmc.org/* 28addons/repository.xbmc.org/*
30addons/webinterface.default/* 29addons/webinterface.default/*
31addons/screensaver.xbmc.builtin.dim/* 30addons/screensaver.xbmc.builtin.dim/*
diff --git a/project/cmake/modules/FindBluetooth.cmake b/project/cmake/modules/FindBluetooth.cmake
index 538e89c..a69980d 100644
--- a/project/cmake/modules/FindBluetooth.cmake
+++ b/project/cmake/modules/FindBluetooth.cmake
@@ -14,12 +14,12 @@
14# Bluetooth::Bluetooth - The Bluetooth library 14# Bluetooth::Bluetooth - The Bluetooth library
15 15
16if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_BLUETOOTH bluetooth QUIET) 17 pkg_check_modules(PC_BLUETOOTH bluez bluetooth QUIET)
18endif() 18endif()
19 19
20find_path(BLUETOOTH_INCLUDE_DIR NAMES bluetooth/bluetooth.h 20find_path(BLUETOOTH_INCLUDE_DIR NAMES bluetooth/bluetooth.h
21 PATHS ${PC_BLUETOOTH_INCLUDEDIR}) 21 PATHS ${PC_BLUETOOTH_INCLUDEDIR})
22find_library(BLUETOOTH_LIBRARY NAMES bluetooth 22find_library(BLUETOOTH_LIBRARY NAMES bluetooth libbluetooth
23 PATHS ${PC_BLUETOOTH_LIBDIR}) 23 PATHS ${PC_BLUETOOTH_LIBDIR})
24 24
25set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION}) 25set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION})
@@ -27,7 +27,7 @@ set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION})
27include(FindPackageHandleStandardArgs) 27include(FindPackageHandleStandardArgs)
28find_package_handle_standard_args(Bluetooth 28find_package_handle_standard_args(Bluetooth
29 REQUIRED_VARS BLUETOOTH_LIBRARY BLUETOOTH_INCLUDE_DIR 29 REQUIRED_VARS BLUETOOTH_LIBRARY BLUETOOTH_INCLUDE_DIR
30 VERSION_VAR ${BLUETOOTH_VERSION}) 30 VERSION_VAR BLUETOOTH_VERSION)
31 31
32if(BLUETOOTH_FOUND) 32if(BLUETOOTH_FOUND)
33 set(BLUETOOTH_INCLUDE_DIRS ${BLUETOOTH_INCLUDE_DIR}) 33 set(BLUETOOTH_INCLUDE_DIRS ${BLUETOOTH_INCLUDE_DIR})
diff --git a/project/cmake/modules/FindCAP.cmake b/project/cmake/modules/FindCAP.cmake
new file mode 100644
index 0000000..04e8378
--- /dev/null
+++ b/project/cmake/modules/FindCAP.cmake
@@ -0,0 +1,44 @@
1#.rst:
2# FindCAP
3# -----------
4# Finds the POSIX 1003.1e capabilities library
5#
6# This will define the following variables::
7#
8# CAP_FOUND - system has LibCap
9# CAP_INCLUDE_DIRS - the LibCap include directory
10# CAP_LIBRARIES - the LibCap libraries
11#
12# and the following imported targets::
13#
14# CAP::CAP - The LibCap library
15
16if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_CAP libcap QUIET)
18endif()
19
20find_path(CAP_INCLUDE_DIR NAMES sys/capability.h
21 PATHS ${PC_CAP_INCLUDEDIR})
22find_library(CAP_LIBRARY NAMES cap libcap
23 PATHS ${PC_CAP_LIBDIR})
24
25set(CAP_VERSION ${PC_CAP_VERSION})
26
27include(FindPackageHandleStandardArgs)
28find_package_handle_standard_args(CAP
29 REQUIRED_VARS CAP_LIBRARY CAP_INCLUDE_DIR
30 VERSION_VAR CAP_VERSION)
31
32if(CAP_FOUND)
33 set(CAP_LIBRARIES ${CAP_LIBRARY})
34 set(CAP_INCLUDE_DIRS ${CAP_INCLUDE_DIR})
35
36 if(NOT TARGET CAP::CAP)
37 add_library(CAP::CAP UNKNOWN IMPORTED)
38 set_target_properties(CAP::CAP PROPERTIES
39 IMPORTED_LOCATION "${CAP_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${CAP_INCLUDE_DIR}")
41 endif()
42endif()
43
44mark_as_advanced(CAP_INCLUDE_DIR CAP_LIBRARY)
diff --git a/project/cmake/modules/FindCpluff.cmake b/project/cmake/modules/FindCpluff.cmake
index fb2bb25..ce6c127 100644
--- a/project/cmake/modules/FindCpluff.cmake
+++ b/project/cmake/modules/FindCpluff.cmake
@@ -10,6 +10,13 @@ if(NOT WIN32)
10 string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") 10 string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}")
11 get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) 11 get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY)
12 set(ldflags "-L${expat_dir}") 12 set(ldflags "-L${expat_dir}")
13
14 # iOS: Without specifying -arch, configure tries to use /bin/cpp as C-preprocessor
15 # http://stackoverflow.com/questions/38836754/cant-cross-compile-c-library-for-arm-ios
16 if(CORE_SYSTEM_NAME STREQUAL ios)
17 set(cppflags "-arch ${CPU}")
18 endif()
19
13 ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff 20 ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff
14 BUILD_IN_SOURCE 1 21 BUILD_IN_SOURCE 1
15 PREFIX ${CORE_BUILD_DIR}/cpluff 22 PREFIX ${CORE_BUILD_DIR}/cpluff
@@ -22,6 +29,7 @@ if(NOT WIN32)
22 --libdir=<INSTALL_DIR>/lib 29 --libdir=<INSTALL_DIR>/lib
23 --host=${ARCH} 30 --host=${ARCH}
24 CFLAGS=${defines} 31 CFLAGS=${defines}
32 CPPFLAGS=${cppflags}
25 LDFLAGS=${ldflags}) 33 LDFLAGS=${ldflags})
26 ExternalProject_Add_Step(libcpluff autoreconf 34 ExternalProject_Add_Step(libcpluff autoreconf
27 DEPENDEES download update patch 35 DEPENDEES download update patch
diff --git a/project/cmake/modules/FindCrossGUID.cmake b/project/cmake/modules/FindCrossGUID.cmake
index bcae3d3..ba2823a 100644
--- a/project/cmake/modules/FindCrossGUID.cmake
+++ b/project/cmake/modules/FindCrossGUID.cmake
@@ -16,6 +16,10 @@ if(ENABLE_INTERNAL_CROSSGUID)
16 message(STATUS "CROSSGUID_URL: ${CROSSGUID_URL}") 16 message(STATUS "CROSSGUID_URL: ${CROSSGUID_URL}")
17 endif() 17 endif()
18 18
19 if(APPLE)
20 set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}")
21 endif()
22
19 set(CROSSGUID_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a) 23 set(CROSSGUID_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a)
20 set(CROSSGUID_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) 24 set(CROSSGUID_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
21 externalproject_add(crossguid 25 externalproject_add(crossguid
@@ -24,6 +28,7 @@ if(ENABLE_INTERNAL_CROSSGUID)
24 PREFIX ${CORE_BUILD_DIR}/crossguid 28 PREFIX ${CORE_BUILD_DIR}/crossguid
25 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 29 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
26 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 30 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
31 "${EXTRA_ARGS}"
27 PATCH_COMMAND ${CMAKE_COMMAND} -E copy 32 PATCH_COMMAND ${CMAKE_COMMAND} -E copy
28 ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/CMakeLists.txt 33 ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/CMakeLists.txt
29 <SOURCE_DIR> && 34 <SOURCE_DIR> &&
diff --git a/project/cmake/modules/FindFFMPEG.cmake b/project/cmake/modules/FindFFMPEG.cmake
index a9f88fb..2b3f47b 100644
--- a/project/cmake/modules/FindFFMPEG.cmake
+++ b/project/cmake/modules/FindFFMPEG.cmake
@@ -1,18 +1,224 @@
1include(ExternalProject) 1# FindFFMPEG
2file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER) 2# --------
3string(REGEX MATCH "VERSION=[^ ]*$.*" FFMPEG_VER "${VER}") 3# Finds FFmpeg libraries
4list(GET FFMPEG_VER 0 FFMPEG_VER) 4#
5string(SUBSTRING "${FFMPEG_VER}" 8 -1 FFMPEG_VER) 5# This module will first look for the required library versions on the system.
6string(REGEX MATCH "BASE_URL=([^ ]*)" FFMPEG_BASE_URL "${VER}") 6# If they are not found, it will fall back to downloading and building kodi's own version
7list(GET FFMPEG_BASE_URL 0 FFMPEG_BASE_URL) 7#
8string(SUBSTRING "${FFMPEG_BASE_URL}" 9 -1 FFMPEG_BASE_URL) 8# --------
9# the following variables influence behaviour:
10# ENABLE_INTERNAL_FFMPEG - if enabled, kodi's own version will always be built
11#
12# FFMPEG_PATH - use external ffmpeg not found in system paths
13# usage: -DFFMPEG_PATH=/path/to/ffmpeg_install_prefix
14#
15# WITH_FFMPEG - use external ffmpeg not found in system paths
16# WARNING: this option is for developers as it will _disable ffmpeg version checks_!
17# Consider using FFMPEG_PATH instead, which _does_ check library versions
18# usage: -DWITH_FFMPEG=/path/to/ffmpeg_install_prefix
19#
20# --------
21# This module will will define the following variables:
22#
23# FFMPEG_FOUND - system has FFmpeg
24# FFMPEG_INCLUDE_DIRS - FFmpeg include directory
25# FFMPEG_LIBRARIES - FFmpeg libraries
26# FFMPEG_DEFINITIONS - pre-processor definitions
27# FFMPEG_LDFLAGS - linker flags
28#
29# and the following imported targets::
30#
31# ffmpeg - The FFmpeg libraries
32# --------
33#
9 34
35# required ffmpeg library versions
36set(REQUIRED_FFMPEG_VERSION 3.1)
37set(_avcodec_ver ">=57.48.101")
38set(_avfilter_ver ">=6.47.100")
39set(_avformat_ver ">=57.41.100")
40set(_avutil_ver ">=55.28.100")
41set(_swscale_ver ">=4.1.100")
42set(_swresample_ver ">=2.1.100")
43set(_postproc_ver ">=54.0.100")
10 44
11if(ENABLE_INTERNAL_FFMPEG) 45
46# Allows building with external ffmpeg not found in system paths,
47# without library version checks
48if(WITH_FFMPEG)
49 set(FFMPEG_PATH ${WITH_FFMPEG})
50 message(STATUS "Warning: FFmpeg version checking disabled")
51 set(REQUIRED_FFMPEG_VERSION undef)
52 unset(_avcodec_ver)
53 unset(_avfilter_ver)
54 unset(_avformat_ver)
55 unset(_avutil_ver)
56 unset(_swscale_ver)
57 unset(_swresample_ver)
58 unset(_postproc_ver)
59endif()
60
61# Allows building with external ffmpeg not found in system paths,
62# with library version checks
63if(FFMPEG_PATH)
64 set(ENABLE_INTERNAL_FFMPEG OFF)
65endif()
66
67# external FFMPEG
68if(NOT ENABLE_INTERNAL_FFMPEG OR CMAKE_CROSSCOMPILING)
12 if(FFMPEG_PATH) 69 if(FFMPEG_PATH)
13 message(WARNING "Internal FFmpeg enabled, but FFMPEG_PATH given, ignoring") 70 set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig")
71 list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH})
14 endif() 72 endif()
15 73
74 set(FFMPEG_PKGS libavcodec${_avcodec_ver}
75 libavfilter${_avfilter_ver}
76 libavformat${_avformat_ver}
77 libavutil${_avutil_ver}
78 libswscale${_swscale_ver}
79 libswresample${_swresample_ver}
80 libpostproc${_postproc_ver})
81
82 if(PKG_CONFIG_FOUND)
83 pkg_check_modules(PC_FFMPEG ${FFMPEG_PKGS} QUIET)
84 string(REGEX REPLACE "framework;" "framework " PC_FFMPEG_LDFLAGS "${PC_FFMPEG_LDFLAGS}")
85 endif()
86
87 find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h
88 libavutil/avutil.h libswscale/swscale.h libpostproc/postprocess.h
89 PATH_SUFFIXES ffmpeg
90 PATHS ${PC_FFMPEG_INCLUDE_DIRS}
91 NO_DEFAULT_PATH)
92 find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h
93 libavutil/avutil.h libswscale/swscale.h libpostproc/postprocess.h)
94
95 find_library(FFMPEG_LIBAVCODEC
96 NAMES avcodec libavcodec
97 PATH_SUFFIXES ffmpeg/libavcodec
98 PATHS ${PC_FFMPEG_libavcodec_LIBDIR}
99 NO_DEFAULT_PATH)
100 find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec)
101
102 find_library(FFMPEG_LIBAVFILTER
103 NAMES avfilter libavfilter
104 PATH_SUFFIXES ffmpeg/libavfilter
105 PATHS ${PC_FFMPEG_libavfilter_LIBDIR}
106 NO_DEFAULT_PATH)
107 find_library(FFMPEG_LIBAVFILTER NAMES avfilter libavfilter PATH_SUFFIXES ffmpeg/libavfilter)
108
109 find_library(FFMPEG_LIBAVFORMAT
110 NAMES avformat libavformat
111 PATH_SUFFIXES ffmpeg/libavformat
112 PATHS ${PC_FFMPEG_libavformat_LIBDIR}
113 NO_DEFAULT_PATH)
114 find_library(FFMPEG_LIBAVFORMAT NAMES avformat libavformat PATH_SUFFIXES ffmpeg/libavformat)
115
116 find_library(FFMPEG_LIBAVUTIL
117 NAMES avutil libavutil
118 PATH_SUFFIXES ffmpeg/libavutil
119 PATHS ${PC_FFMPEG_libavutil_LIBDIR}
120 NO_DEFAULT_PATH)
121 find_library(FFMPEG_LIBAVUTIL NAMES avutil libavutil PATH_SUFFIXES ffmpeg/libavutil)
122
123 find_library(FFMPEG_LIBSWSCALE
124 NAMES swscale libswscale
125 PATH_SUFFIXES ffmpeg/libswscale
126 PATHS ${PC_FFMPEG_libswscale_LIBDIR}
127 NO_DEFAULT_PATH)
128 find_library(FFMPEG_LIBSWSCALE NAMES swscale libswscale PATH_SUFFIXES ffmpeg/libswscale)
129
130 find_library(FFMPEG_LIBSWRESAMPLE
131 NAMES swresample libswresample
132 PATH_SUFFIXES ffmpeg/libswresample
133 PATHS ${PC_FFMPEG_libswresample_LIBDIR}
134 NO_DEFAULT_PATH)
135 find_library(FFMPEG_LIBSWRESAMPLE NAMES NAMES swresample libswresample PATH_SUFFIXES ffmpeg/libswresample)
136
137 find_library(FFMPEG_LIBPOSTPROC
138 NAMES postproc libpostproc
139 PATH_SUFFIXES ffmpeg/libpostproc
140 PATHS ${PC_FFMPEG_libpostproc_LIBDIR}
141 NO_DEFAULT_PATH)
142 find_library(FFMPEG_LIBPOSTPROC NAMES postproc libpostproc PATH_SUFFIXES ffmpeg/libpostproc)
143
144 if((PC_FFMPEG_FOUND
145 AND PC_FFMPEG_libavcodec_VERSION
146 AND PC_FFMPEG_libavfilter_VERSION
147 AND PC_FFMPEG_libavformat_VERSION
148 AND PC_FFMPEG_libavutil_VERSION
149 AND PC_FFMPEG_libswscale_VERSION
150 AND PC_FFMPEG_libswresample_VERSION
151 AND PC_FFMPEG_libpostproc_VERSION)
152 OR WIN32)
153 set(FFMPEG_VERSION ${REQUIRED_FFMPEG_VERSION})
154
155
156 include(FindPackageHandleStandardArgs)
157 find_package_handle_standard_args(FFMPEG
158 VERSION_VAR FFMPEG_VERSION
159 REQUIRED_VARS FFMPEG_INCLUDE_DIRS
160 FFMPEG_LIBAVCODEC
161 FFMPEG_LIBAVFILTER
162 FFMPEG_LIBAVFORMAT
163 FFMPEG_LIBAVUTIL
164 FFMPEG_LIBSWSCALE
165 FFMPEG_LIBSWRESAMPLE
166 FFMPEG_LIBPOSTPROC
167 FFMPEG_VERSION
168 FAIL_MESSAGE "FFmpeg ${REQUIRED_FFMPEG_VERSION} not found, please consider using -DENABLE_INTERNAL_FFMPEG=ON")
169
170 else()
171 message(STATUS "FFmpeg ${REQUIRED_FFMPEG_VERSION} not found, falling back to internal build")
172 unset(FFMPEG_INCLUDE_DIRS)
173 unset(FFMPEG_INCLUDE_DIRS CACHE)
174 unset(FFMPEG_LIBRARIES)
175 unset(FFMPEG_LIBRARIES CACHE)
176 unset(FFMPEG_DEFINITIONS)
177 unset(FFMPEG_DEFINITIONS CACHE)
178 endif()
179
180 if(FFMPEG_FOUND)
181 set(FFMPEG_LDFLAGS ${PC_FFMPEG_LDFLAGS} CACHE STRING "ffmpeg linker flags")
182
183 # check if ffmpeg libs are statically linked
184 set(FFMPEG_LIB_TYPE SHARED)
185 foreach(_fflib IN LISTS FFMPEG_LIBRARIES)
186 if(${_fflib} MATCHES ".+\.a$" AND PC_FFMPEG_STATIC_LDFLAGS)
187 set(FFMPEG_LDFLAGS ${PC_FFMPEG_STATIC_LDFLAGS} CACHE STRING "ffmpeg linker flags" FORCE)
188 set(FFMPEG_LIB_TYPE STATIC)
189 break()
190 endif()
191 endforeach()
192
193 set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER}
194 ${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL}
195 ${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBSWRESAMPLE}
196 ${FFMPEG_LIBPOSTPROC} ${FFMPEG_LDFLAGS})
197 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VERSION}\")
198
199 if(NOT TARGET ffmpeg)
200 add_library(ffmpeg ${FFMPEG_LIB_TYPE} IMPORTED)
201 set_target_properties(ffmpeg PROPERTIES
202 FOLDER "External Projects"
203 IMPORTED_LOCATION "${FFMPEG_LIBRARIES}"
204 INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_INCLUDE_DIRS}"
205 INTERFACE_LINK_LIBRARIES "${FFMPEG_LDFLAGS}"
206 INTERFACE_COMPILE_DEFINITIONS "${FFMPEG_DEFINITIONS}")
207 endif()
208 endif()
209endif()
210
211# Internal FFMPEG
212if(NOT FFMPEG_FOUND)
213 include(ExternalProject)
214 file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER)
215 string(REGEX MATCH "VERSION=[^ ]*$.*" FFMPEG_VER "${VER}")
216 list(GET FFMPEG_VER 0 FFMPEG_VER)
217 string(SUBSTRING "${FFMPEG_VER}" 8 -1 FFMPEG_VER)
218 string(REGEX MATCH "BASE_URL=([^ ]*)" FFMPEG_BASE_URL "${VER}")
219 list(GET FFMPEG_BASE_URL 0 FFMPEG_BASE_URL)
220 string(SUBSTRING "${FFMPEG_BASE_URL}" 9 -1 FFMPEG_BASE_URL)
221
16 # allow user to override the download URL with a local tarball 222 # allow user to override the download URL with a local tarball
17 # needed for offline build envs 223 # needed for offline build envs
18 if(FFMPEG_URL) 224 if(FFMPEG_URL)
@@ -80,35 +286,7 @@ fi")
80 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\" 286 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\"
81 -DUSE_STATIC_FFMPEG=1) 287 -DUSE_STATIC_FFMPEG=1)
82 set(FFMPEG_FOUND 1) 288 set(FFMPEG_FOUND 1)
83else() 289 set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects")
84 if(FFMPEG_PATH)
85 set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig")
86 endif()
87 set(FFMPEG_PKGS libavcodec>=56.26.100 libavfilter>=5.11.100 libavformat>=56.25.101
88 libavutil>=54.20.100 libswscale>=3.1.101 libswresample>=1.1.100 libpostproc>=53.3.100)
89 if(PKG_CONFIG_FOUND AND NOT WIN32)
90 pkg_check_modules (FFMPEG ${FFMPEG_PKGS})
91 string(REGEX REPLACE "framework;" "framework " FFMPEG_LDFLAGS "${FFMPEG_LDFLAGS}")
92 set(FFMPEG_LIBRARIES ${FFMPEG_LDFLAGS})
93 add_custom_target(ffmpeg)
94 else()
95 find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h PATH_SUFFIXES ffmpeg)
96 find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec)
97 find_library(FFMPEG_LIBAVFILTER NAMES avfilter libavfilter PATH_SUFFIXES ffmpeg/libavfilter)
98 find_library(FFMPEG_LIBAVFORMAT NAMES avformat libavformat PATH_SUFFIXES ffmpeg/libavformat)
99 find_library(FFMPEG_LIBAVUTIL NAMES avutil libavutil PATH_SUFFIXES ffmpeg/libavutil)
100 find_library(FFMPEG_LIBSWSCALE NAMES swscale libswscale PATH_SUFFIXES ffmpeg/libswscale)
101 find_library(FFMPEG_LIBPOSTPROC NAMES postproc libpostproc PATH_SUFFIXES ffmpeg/libpostproc)
102 set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER} ${FFMPEG_LIBAVFORMAT}
103 ${FFMPEG_LIBAVUTIL} ${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBPOSTPROC})
104 add_custom_target(ffmpeg DEPENDS ${FFMPEG_LIBRARIES})
105 endif()
106
107 include(FindPackageHandleStandardArgs)
108 find_package_handle_standard_args(FFMPEG DEFAULT_MSG FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES)
109 set(FFMPEG_FOUND 1)
110 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\")
111endif() 290endif()
112set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects")
113 291
114mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS FFMPEG_FOUND) 292mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_LDFLAGS FFMPEG_DEFINITIONS FFMPEG_FOUND)
diff --git a/project/cmake/modules/FindFribidi.cmake b/project/cmake/modules/FindFribidi.cmake
index 03c2f53..dcaeb48 100644
--- a/project/cmake/modules/FindFribidi.cmake
+++ b/project/cmake/modules/FindFribidi.cmake
@@ -32,12 +32,16 @@ find_package_handle_standard_args(FriBidi
32if(FRIBIDI_FOUND) 32if(FRIBIDI_FOUND)
33 set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY}) 33 set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
34 set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR}) 34 set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR})
35 if(PC_FRIBIDI_CFLAGS)
36 set(FRIBIDI_DEFINITIONS ${PC_FRIBIDI_CFLAGS})
37 endif()
35 38
36 if(NOT TARGET FriBidi::FriBidi) 39 if(NOT TARGET FriBidi::FriBidi)
37 add_library(FriBidi::FriBidi UNKNOWN IMPORTED) 40 add_library(FriBidi::FriBidi UNKNOWN IMPORTED)
38 set_target_properties(FriBidi::FriBidi PROPERTIES 41 set_target_properties(FriBidi::FriBidi PROPERTIES
39 IMPORTED_LOCATION "${FRIBIDI_LIBRARY}" 42 IMPORTED_LOCATION "${FRIBIDI_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIR}") 43 INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIR}"
44 INTERFACE_COMPILE_OPTIONS "${FRIBIDI_DEFINITIONS}")
41 endif() 45 endif()
42endif() 46endif()
43 47
diff --git a/project/cmake/modules/FindMir.cmake b/project/cmake/modules/FindMir.cmake
new file mode 100644
index 0000000..8847a61
--- /dev/null
+++ b/project/cmake/modules/FindMir.cmake
@@ -0,0 +1,33 @@
1# FindMir
2# -------
3# Finds the Mir library
4#
5# This will will define the following variables::
6#
7# MIR_FOUND - the system has Mir
8# MIR_INCLUDE_DIRS - the Mir include directory
9# MIR_LIBRARIES - the Mir libraries
10# MIR_DEFINITIONS - the Mir definitions
11
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules (PC_MIR mirclient QUIET)
15endif()
16
17find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h
18 PATHS ${PC_MIR_INCLUDE_DIRS})
19
20find_library(MIR_LIBRARY NAMES mirclient
21 PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS})
22
23include (FindPackageHandleStandardArgs)
24find_package_handle_standard_args (MIR
25 REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR)
26
27if (MIR_FOUND)
28 set(MIR_LIBRARIES ${MIR_LIBRARY})
29 set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS})
30 set(MIR_DEFINITIONS -DHAVE_MIR=1)
31endif()
32
33mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR)
diff --git a/project/cmake/modules/FindTexturePacker.cmake b/project/cmake/modules/FindTexturePacker.cmake
index 2229ff7..f9e4c75 100644
--- a/project/cmake/modules/FindTexturePacker.cmake
+++ b/project/cmake/modules/FindTexturePacker.cmake
@@ -3,6 +3,10 @@
3# ----------------- 3# -----------------
4# Finds the TexturePacker 4# Finds the TexturePacker
5# 5#
6# If WITH_TEXTUREPACKER is defined and points to a directory,
7# this path will be used to search for the Texturepacker binary
8#
9#
6# This will define the following (imported) targets:: 10# This will define the following (imported) targets::
7# 11#
8# TexturePacker::TexturePacker - The TexturePacker executable 12# TexturePacker::TexturePacker - The TexturePacker executable
@@ -17,7 +21,21 @@ if(NOT TARGET TexturePacker::TexturePacker)
17 set_target_properties(TexturePacker::TexturePacker PROPERTIES 21 set_target_properties(TexturePacker::TexturePacker PROPERTIES
18 IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") 22 IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe")
19 else() 23 else()
20 add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) 24 if(WITH_TEXTUREPACKER)
21 add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) 25 get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE)
26 find_program(TEXTUREPACKER_EXECUTABLE TexturePacker PATHS ${_tppath})
27
28 include(FindPackageHandleStandardArgs)
29 find_package_handle_standard_args(TexturePacker DEFAULT_MSG TEXTUREPACKER_EXECUTABLE)
30 if(TEXTUREPACKER_FOUND)
31 add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL)
32 set_target_properties(TexturePacker::TexturePacker PROPERTIES
33 IMPORTED_LOCATION "${TEXTUREPACKER_EXECUTABLE}")
34 endif()
35 mark_as_advanced(TEXTUREPACKER)
36 else()
37 add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker)
38 add_executable(TexturePacker::TexturePacker ALIAS TexturePacker)
39 endif()
22 endif() 40 endif()
23endif() 41endif()
diff --git a/project/cmake/modules/FindVAAPI.cmake b/project/cmake/modules/FindVAAPI.cmake
index ce3fe1a..ea9a3c9 100644
--- a/project/cmake/modules/FindVAAPI.cmake
+++ b/project/cmake/modules/FindVAAPI.cmake
@@ -24,6 +24,8 @@ find_library(VAAPI_libva_LIBRARY NAMES va
24 PATHS ${PC_VAAPI_libva_LIBDIR}) 24 PATHS ${PC_VAAPI_libva_LIBDIR})
25find_library(VAAPI_libva-x11_LIBRARY NAMES va-x11 25find_library(VAAPI_libva-x11_LIBRARY NAMES va-x11
26 PATHS ${PC_VAAPI_libva_LIBDIR}) 26 PATHS ${PC_VAAPI_libva_LIBDIR})
27find_library(VAAPI_libva-drm_LIBRARY NAMES va-drm
28 PATHS ${PC_VAAPI_libva_LIBDIR})
27 29
28if(PC_VAAPI_libva_VERSION) 30if(PC_VAAPI_libva_VERSION)
29 set(VAAPI_VERSION_STRING ${PC_VAAPI_libva_VERSION}) 31 set(VAAPI_VERSION_STRING ${PC_VAAPI_libva_VERSION})
@@ -39,12 +41,12 @@ endif()
39 41
40include(FindPackageHandleStandardArgs) 42include(FindPackageHandleStandardArgs)
41find_package_handle_standard_args(VAAPI 43find_package_handle_standard_args(VAAPI
42 REQUIRED_VARS VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_INCLUDE_DIR 44 REQUIRED_VARS VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_libva-drm_LIBRARY VAAPI_INCLUDE_DIR
43 VERSION_VAR VAAPI_VERSION_STRING) 45 VERSION_VAR VAAPI_VERSION_STRING)
44 46
45if(VAAPI_FOUND) 47if(VAAPI_FOUND)
46 set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR}) 48 set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR})
47 set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY}) 49 set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY} ${VAAPI_libva-drm_LIBRARY})
48 set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1) 50 set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1)
49 51
50 if(NOT TARGET VAAPI::VAAPI_X11) 52 if(NOT TARGET VAAPI::VAAPI_X11)
@@ -52,14 +54,19 @@ if(VAAPI_FOUND)
52 set_target_properties(VAAPI::VAAPI_X11 PROPERTIES 54 set_target_properties(VAAPI::VAAPI_X11 PROPERTIES
53 IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}") 55 IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}")
54 endif() 56 endif()
57 if (NOT TARGET VAAPI::VAAPI_DRM)
58 add_library(VAAPI::VAAPI_DRM UNKNOWN IMPORTED)
59 set_target_properties(VAAPI::VAAPI_DRM PROPERTIES
60 IMPORTED_LOCATION "${VAAPI_libva-drm_LIBRARY}")
61 endif()
55 if(NOT TARGET VAAPI::VAAPI) 62 if(NOT TARGET VAAPI::VAAPI)
56 add_library(VAAPI::VAAPI UNKNOWN IMPORTED) 63 add_library(VAAPI::VAAPI UNKNOWN IMPORTED)
57 set_target_properties(VAAPI::VAAPI PROPERTIES 64 set_target_properties(VAAPI::VAAPI PROPERTIES
58 IMPORTED_LOCATION "${VAAPI_libva_LIBRARY}" 65 IMPORTED_LOCATION "${VAAPI_libva_LIBRARY}"
59 INTERFACE_INCLUDE_DIRECTORIES "${VAAPI_INCLUDE_DIR}" 66 INTERFACE_INCLUDE_DIRECTORIES "${VAAPI_INCLUDE_DIR}"
60 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVA=1 67 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVA=1
61 INTERFACE_LINK_LIBRARIES VAAPI::VAAPI_X11) 68 INTERFACE_LINK_LIBRARIES "VAAPI::VAAPI_X11 VAAPI::VAAPI_DRM")
62 endif() 69 endif()
63endif() 70endif()
64 71
65mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY) 72mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_libva-drm_LIBRARY)
diff --git a/project/cmake/modules/FindXSLT.cmake b/project/cmake/modules/FindXSLT.cmake
index 9be51d3..f7fea9e 100644
--- a/project/cmake/modules/FindXSLT.cmake
+++ b/project/cmake/modules/FindXSLT.cmake
@@ -43,7 +43,7 @@ if(XSLT_FOUND)
43 IMPORTED_LOCATION "${XSLT_LIBRARY}" 43 IMPORTED_LOCATION "${XSLT_LIBRARY}"
44 INTERFACE_INCLUDE_DIRECTORIES "${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}" 44 INTERFACE_INCLUDE_DIRECTORIES "${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}"
45 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXSLT=1 45 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXSLT=1
46 ITERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}") 46 INTERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}")
47 endif() 47 endif()
48endif() 48endif()
49 49
diff --git a/project/cmake/scripts/android/Install.cmake b/project/cmake/scripts/android/Install.cmake
index 5c66f41..025f194 100644
--- a/project/cmake/scripts/android/Install.cmake
+++ b/project/cmake/scripts/android/Install.cmake
@@ -91,7 +91,6 @@ foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay)
91 endif() 91 endif()
92endforeach() 92endforeach()
93add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "") 93add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "")
94add_bundle_file(${DEPENDS_PATH}/lib/librtmp.so ${libdir} "")
95 94
96# Main targets from Makefile.in 95# Main targets from Makefile.in
97if(CPU MATCHES i686) 96if(CPU MATCHES i686)
diff --git a/project/cmake/scripts/common/ArchSetup.cmake b/project/cmake/scripts/common/ArchSetup.cmake
index 438e3bd..538fcaf 100644
--- a/project/cmake/scripts/common/ArchSetup.cmake
+++ b/project/cmake/scripts/common/ArchSetup.cmake
@@ -14,6 +14,7 @@
14include(CheckCXXSourceCompiles) 14include(CheckCXXSourceCompiles)
15include(CheckSymbolExists) 15include(CheckSymbolExists)
16include(CheckFunctionExists) 16include(CheckFunctionExists)
17include(CheckIncludeFile)
17 18
18# Macro to check if a given type exists in a given header 19# Macro to check if a given type exists in a given header
19# Arguments: 20# Arguments:
@@ -109,6 +110,10 @@ check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H)
109check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) 110check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH)
110check_builtin("long* temp=0; long ret=__sync_sub_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_SUB_AND_FETCH) 111check_builtin("long* temp=0; long ret=__sync_sub_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_SUB_AND_FETCH)
111check_builtin("long* temp=0; long ret=__sync_val_compare_and_swap(temp, 1, 1)" HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP) 112check_builtin("long* temp=0; long ret=__sync_val_compare_and_swap(temp, 1, 1)" HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP)
113check_include_file(sys/inotify.h HAVE_INOTIFY)
114if(HAVE_INOTIFY)
115 list(APPEND SYSTEM_DEFINES -DHAVE_INOTIFY=1)
116endif()
112if(HAVE_POSIX_FADVISE) 117if(HAVE_POSIX_FADVISE)
113 list(APPEND SYSTEM_DEFINES -DHAVE_POSIX_FADVISE=1) 118 list(APPEND SYSTEM_DEFINES -DHAVE_POSIX_FADVISE=1)
114endif() 119endif()
diff --git a/project/cmake/scripts/common/CheckTargetPlatform.cmake b/project/cmake/scripts/common/CheckTargetPlatform.cmake
index 5b5d9a1..82ee668 100644
--- a/project/cmake/scripts/common/CheckTargetPlatform.cmake
+++ b/project/cmake/scripts/common/CheckTargetPlatform.cmake
@@ -9,7 +9,11 @@ function(check_target_platform dir target_platform build)
9 if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt) 9 if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt)
10 # get all the specified platforms 10 # get all the specified platforms
11 file(STRINGS ${dir}/platforms.txt platforms) 11 file(STRINGS ${dir}/platforms.txt platforms)
12 string(REPLACE " " ";" platforms ${platforms}) 12
13 list( LENGTH platforms listlen )
14 if(${listlen} EQUAL 1)
15 string(REPLACE " " ";" platforms ${platforms})
16 endif()
13 17
14 # check if the addon/dependency should be built for the current platform 18 # check if the addon/dependency should be built for the current platform
15 foreach(platform ${platforms}) 19 foreach(platform ${platforms})
diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake
index 880ccdf..adc105b 100644
--- a/project/cmake/scripts/common/HandleDepends.cmake
+++ b/project/cmake/scripts/common/HandleDepends.cmake
@@ -17,6 +17,7 @@ function(add_addon_depends addon searchpath)
17 file MATCHES noinstall.txt OR 17 file MATCHES noinstall.txt OR
18 file MATCHES flags.txt OR 18 file MATCHES flags.txt OR
19 file MATCHES deps.txt OR 19 file MATCHES deps.txt OR
20 file MATCHES "[a-z]+-deps[.]txt" OR
20 file MATCHES platforms.txt)) 21 file MATCHES platforms.txt))
21 message(STATUS "Processing ${file}") 22 message(STATUS "Processing ${file}")
22 file(STRINGS ${file} def) 23 file(STRINGS ${file} def)
@@ -49,7 +50,11 @@ function(add_addon_depends addon searchpath)
49 if(EXISTS ${dir}/flags.txt) 50 if(EXISTS ${dir}/flags.txt)
50 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) 51 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt)
51 file(STRINGS ${dir}/flags.txt extraflags) 52 file(STRINGS ${dir}/flags.txt extraflags)
53
54 # replace some custom placeholders
55 string(REPLACE "@MINGW_TOOLCHAIN_FILE@" "${OUTPUT_DIR}/Toolchain_mingw32.cmake" extraflags "${extraflags}")
52 string(REPLACE " " ";" extraflags ${extraflags}) 56 string(REPLACE " " ";" extraflags ${extraflags})
57
53 message(STATUS "${id} extraflags: ${extraflags}") 58 message(STATUS "${id} extraflags: ${extraflags}")
54 endif() 59 endif()
55 60
@@ -103,11 +108,18 @@ function(add_addon_depends addon searchpath)
103 endif() 108 endif()
104 endif() 109 endif()
105 110
106 # on windows "patch.exe" can only handle CR-LF line-endings so we
107 # need to force it to also handle LF-only line endings
108 set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) 111 set(PATCH_PROGRAM ${PATCH_EXECUTABLE})
112
113 # On Windows "patch.exe" can only handle CR-LF line-endings.
114 # Our patches have LF-only line endings - except when they
115 # have been checked out as part of a dependency hosted on Git
116 # and core.autocrlf=true.
109 if(WIN32) 117 if(WIN32)
110 set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") 118 file(READ ${patch} patch_content_hex HEX)
119 # Force handle LF-only line endings
120 if(NOT patch_content_hex MATCHES "0d0a")
121 set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary")
122 endif()
111 endif() 123 endif()
112 endif() 124 endif()
113 125
@@ -131,8 +143,11 @@ function(add_addon_depends addon searchpath)
131 set(INSTALL_COMMAND INSTALL_COMMAND "") 143 set(INSTALL_COMMAND INSTALL_COMMAND "")
132 endif() 144 endif()
133 145
134 # check if there's a deps.txt containing dependencies on other libraries 146 # check if there's a platform-specific or generic deps.txt containing dependencies on other libraries
135 if(EXISTS ${dir}/deps.txt) 147 if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt)
148 file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps)
149 message(STATUS "${id} depends: ${deps}")
150 elseif(EXISTS ${dir}/deps.txt)
136 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) 151 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt)
137 file(STRINGS ${dir}/deps.txt deps) 152 file(STRINGS ${dir}/deps.txt deps)
138 message(STATUS "${id} depends: ${deps}") 153 message(STATUS "${id} depends: ${deps}")
@@ -161,6 +176,10 @@ function(add_addon_depends addon searchpath)
161 PATCH_COMMAND ${PATCH_COMMAND} 176 PATCH_COMMAND ${PATCH_COMMAND}
162 "${INSTALL_COMMAND}") 177 "${INSTALL_COMMAND}")
163 178
179 if(CMAKE_VERSION VERSION_GREATER 3.5.9)
180 list(APPEND EXTERNALPROJECT_SETUP GIT_SHALLOW 1)
181 endif()
182
164 # if there's an url defined we need to pass that to externalproject_add() 183 # if there's an url defined we need to pass that to externalproject_add()
165 if(DEFINED url AND NOT "${url}" STREQUAL "") 184 if(DEFINED url AND NOT "${url}" STREQUAL "")
166 # check if there's a third parameter in the file 185 # check if there's a third parameter in the file
@@ -172,6 +191,20 @@ function(add_addon_depends addon searchpath)
172 GIT_REPOSITORY ${url} 191 GIT_REPOSITORY ${url}
173 GIT_TAG ${revision} 192 GIT_TAG ${revision}
174 "${EXTERNALPROJECT_SETUP}") 193 "${EXTERNALPROJECT_SETUP}")
194
195 # For patchfiles to work, disable (users globally set) autocrlf=true
196 if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER 3.7)
197 message(AUTHOR_WARNING "Make use of GIT_CONFIG")
198 endif()
199 if(WIN32 AND patches)
200 externalproject_add_step(${id} gitconfig
201 COMMAND git config core.autocrlf false
202 COMMAND git rm -rf --cached .
203 COMMAND git reset --hard HEAD
204 COMMENT "Performing gitconfig step: Disabling autocrlf to enable patching for '${id}'"
205 DEPENDERS patch
206 WORKING_DIRECTORY <SOURCE_DIR>)
207 endif()
175 else() 208 else()
176 set(CONFIGURE_COMMAND "") 209 set(CONFIGURE_COMMAND "")
177 if(NOT WIN32) 210 if(NOT WIN32)
diff --git a/project/cmake/scripts/common/Macros.cmake b/project/cmake/scripts/common/Macros.cmake
index 71c39ef..cce3245 100644
--- a/project/cmake/scripts/common/Macros.cmake
+++ b/project/cmake/scripts/common/Macros.cmake
@@ -155,9 +155,12 @@ function(core_add_shared_library name)
155 add_library(${name} SHARED ${SOURCES} ${HEADERS} ${OTHERS}) 155 add_library(${name} SHARED ${SOURCES} ${HEADERS} ${OTHERS})
156 set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} 156 set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
157 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} 157 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
158 RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
159 RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
160 OUTPUT_NAME ${OUTPUT_NAME} PREFIX "") 158 OUTPUT_NAME ${OUTPUT_NAME} PREFIX "")
159 foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
160 string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
161 set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
162 RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY})
163 endforeach()
161 164
162 set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}/${OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE STRING "" FORCE) 165 set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}/${OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE STRING "" FORCE)
163 add_dependencies(${APP_NAME_LC}-libraries ${name}) 166 add_dependencies(${APP_NAME_LC}-libraries ${name})
@@ -595,9 +598,9 @@ macro(core_find_versions)
595 set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) 598 set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR})
596 if(APP_VERSION_TAG) 599 if(APP_VERSION_TAG)
597 set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) 600 set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG})
601 string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC)
598 endif() 602 endif()
599 string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) 603 string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0)
600 string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC)
601 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$") 604 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$")
602 string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) 605 string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version})
603 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") 606 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$")
diff --git a/project/cmake/scripts/common/PrepareEnv.cmake b/project/cmake/scripts/common/PrepareEnv.cmake
index 8e02382..51be739 100644
--- a/project/cmake/scripts/common/PrepareEnv.cmake
+++ b/project/cmake/scripts/common/PrepareEnv.cmake
@@ -51,43 +51,14 @@ foreach(binding ${bindings})
51 configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY) 51 configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY)
52endforeach() 52endforeach()
53 53
54### on windows we need a "patch" binary to be able to patch 3rd party sources 54### processing additional tools required by the platform
55if(WIN32) 55if(EXISTS ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/)
56 find_program(PATCH_FOUND NAMES patch patch.exe) 56 file(GLOB platform_tools ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/*.cmake)
57 if(PATCH_FOUND) 57 foreach(platform_tool ${platform_tools})
58 message(STATUS "patch utility found at ${PATCH_FOUND}") 58 get_filename_component(platform_tool_name ${platform_tool} NAME_WE)
59 else() 59 message(STATUS "Processing ${CORE_SYSTEM_NAME} specific tool: ${platform_tool_name}")
60 set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3")
61 set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip")
62 set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}")
63 set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE})
64 60
65 # download the archive containing patch.exe 61 # include the file
66 message(STATUS "Downloading patch utility from ${PATCH_URL}...") 62 include(${platform_tool})
67 file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS) 63 endforeach()
68 list(GET PATCH_DL_STATUS 0 PATCH_RETCODE)
69 if(NOT ${PATCH_RETCODE} EQUAL 0)
70 message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}")
71 endif()
72
73 # extract the archive containing patch.exe
74 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD}
75 WORKING_DIRECTORY ${BUILD_DIR})
76
77 # make sure the extraction worked and that patch.exe is there
78 set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME})
79 set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe)
80 if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH})
81 message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_DOWNLOAD_DIR}")
82 endif()
83
84 # copy patch.exe into the output directory
85 file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin)
86
87 # make sure that cmake can find the copied patch.exe
88 find_program(PATCH_FOUND NAMES patch patch.exe)
89 if(NOT PATCH_FOUND)
90 message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin")
91 endif()
92 endif()
93endif() 64endif()
diff --git a/project/cmake/scripts/ios/ArchSetup.cmake b/project/cmake/scripts/ios/ArchSetup.cmake
index 56661e2..f3e8590 100644
--- a/project/cmake/scripts/ios/ArchSetup.cmake
+++ b/project/cmake/scripts/ios/ArchSetup.cmake
@@ -13,6 +13,7 @@ if(WITH_ARCH)
13 set(ARCH ${WITH_ARCH}) 13 set(ARCH ${WITH_ARCH})
14else() 14else()
15 if(CPU STREQUAL armv7 OR CPU STREQUAL arm64) 15 if(CPU STREQUAL armv7 OR CPU STREQUAL arm64)
16 set(CMAKE_OSX_ARCHITECTURES ${CPU})
16 set(ARCH arm-osx) 17 set(ARCH arm-osx)
17 set(NEON False) 18 set(NEON False)
18 else() 19 else()
@@ -34,3 +35,23 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo"
34 35
35set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) 36set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE)
36set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) 37set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
38
39set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "5.1")
40set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
41
42set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF)
43set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF)
44set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF)
45
46# Xcode strips dead code by default which breaks wrapping
47set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF)
48
49# Unify output directories for iOS packaging scripts
50if(NOT CMAKE_GENERATOR MATCHES Xcode)
51 set(CORE_BUILD_CONFIG "${CORE_BUILD_CONFIG}-iphoneos")
52endif()
53set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG})
54foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
55 string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
56 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG})
57endforeach()
diff --git a/project/cmake/scripts/ios/Install.cmake b/project/cmake/scripts/ios/Install.cmake
index 052565f..c49fcd5 100644
--- a/project/cmake/scripts/ios/Install.cmake
+++ b/project/cmake/scripts/ios/Install.cmake
@@ -1,42 +1,54 @@
1# IOS packaging 1# IOS packaging
2 2
3set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}-iphoneos) 3set(BUNDLE_RESOURCES ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png
4 ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png
5 ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png
6 ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png
7 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
8 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
9 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
10 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png
11 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png
12 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png
13 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png
14 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png
15 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png
16 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png
17 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png
18 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png
19 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png
20 ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png)
4 21
5file(MAKE_DIRECTORY ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app) 22if(CMAKE_GENERATOR STREQUAL Xcode)
6set(BUNDLE_RESOURCES xbmc/platform/darwin/ios/Default-568h@2x.png 23 set(RESOURCE_LOCATION ${APP_NAME}.app)
7 xbmc/platform/darwin/ios/Default-667h@2x.png 24else()
8 xbmc/platform/darwin/ios/Default-736h@3x.png 25 set(RESOURCE_LOCATION ".")
9 xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png 26endif()
10 tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
11 tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
12 tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
13 tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png
14 tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png
15 tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png
16 tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png
17 tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png
18 tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png
19 tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png
20 tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png
21 tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png
22 tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png
23 tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png)
24 27
25foreach(resource IN LISTS BUNDLE_RESOURCES) 28target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES})
26 configure_file(${CORE_SOURCE_DIR}/${resource} ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app COPYONLY) 29foreach(file IN LISTS BUNDLE_RESOURCES)
30 set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION ${RESOURCE_LOCATION})
27endforeach() 31endforeach()
28configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings
29 ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/English.lproj/InfoPlist.strings COPYONLY)
30 32
31configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in 33target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings)
32 ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/Info.plist @ONLY) 34set_source_files_properties(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "${RESOURCE_LOCATION}/English.lproj")
35
36# Options for code signing propagated as env vars to Codesign.command via Xcode
37set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity")
38if(IOS_CODE_SIGN_IDENTITY)
39 set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED TRUE
40 XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${IOS_CODE_SIGN_IDENTITY})
41endif()
42
43add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
44 # TODO: Remove in sync with CopyRootFiles-ios expecting the ".bin" file
45 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
46 $<TARGET_FILE_DIR:${APP_NAME_LC}>/${APP_NAME}.bin
33 47
34add_custom_target(bundle
35 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}> ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/${APP_NAME}.bin
36 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h 48 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h
37 ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h 49 ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h
38 COMMAND "ACTION=build" 50 COMMAND "ACTION=build"
39 "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" 51 "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
40 "TARGET_NAME=${APP_NAME}.app" 52 "TARGET_NAME=${APP_NAME}.app"
41 "APP_NAME=${APP_NAME}" 53 "APP_NAME=${APP_NAME}"
42 "PRODUCT_NAME=${APP_NAME}" 54 "PRODUCT_NAME=${APP_NAME}"
@@ -44,15 +56,22 @@ add_custom_target(bundle
44 "SRCROOT=${CMAKE_BINARY_DIR}" 56 "SRCROOT=${CMAKE_BINARY_DIR}"
45 ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command 57 ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command
46 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" 58 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
47 "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" 59 "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
48 "TARGET_NAME=${APP_NAME}.app" 60 "TARGET_NAME=${APP_NAME}.app"
49 "APP_NAME=${APP_NAME}" 61 "APP_NAME=${APP_NAME}"
50 "PRODUCT_NAME=${APP_NAME}" 62 "PRODUCT_NAME=${APP_NAME}"
51 "FULL_PRODUCT_NAME=${APP_NAME}.app" 63 "FULL_PRODUCT_NAME=${APP_NAME}.app"
52 "WRAPPER_EXTENSION=app" 64 "WRAPPER_EXTENSION=app"
53 "SRCROOT=${CMAKE_BINARY_DIR}" 65 "SRCROOT=${CMAKE_BINARY_DIR}"
54 ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command) 66 ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command
55add_dependencies(bundle ${APP_NAME_LC}) 67 COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.."
68 "PLATFORM_NAME=${PLATFORM}"
69 "CODESIGNING_FOLDER_PATH=$<TARGET_FILE_DIR:${APP_NAME_LC}>"
70 "BUILT_PRODUCTS_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
71 "WRAPPER_NAME=${APP_NAME}.app"
72 "APP_NAME=${APP_NAME}"
73 ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
74)
56 75
57set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) 76set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..)
58configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in 77configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in
@@ -61,14 +80,6 @@ configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.
61 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY) 80 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY)
62 81
63add_custom_target(deb 82add_custom_target(deb
64 COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.."
65 "PLATFORM_NAME=${PLATFORM}"
66 "CODESIGNING_FOLDER_PATH=${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app"
67 "BUILT_PRODUCTS_DIR=${PACKAGE_OUTPUT_DIR}"
68 "WRAPPER_NAME=${APP_NAME}.app"
69 "APP_NAME=${APP_NAME}"
70 "CODE_SIGN_IDENTITY=\"\""
71 ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
72 COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG} 83 COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG}
73 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios) 84 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios)
74add_dependencies(deb bundle) 85add_dependencies(deb ${APP_NAME_LC})
diff --git a/project/cmake/scripts/linux/ArchSetup.cmake b/project/cmake/scripts/linux/ArchSetup.cmake
index cae0bb8..bcd70df 100644
--- a/project/cmake/scripts/linux/ArchSetup.cmake
+++ b/project/cmake/scripts/linux/ArchSetup.cmake
@@ -39,3 +39,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Coverage)
39 set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") 39 set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test")
40 set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) 40 set(COVERAGE_EXCLUDES */test/* lib/* */lib/*)
41endif() 41endif()
42
43if(ENABLE_MIR)
44 set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU since no Mir support" FORCE)
45endif()
diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake
index 5458707..43e2e5e 100644
--- a/project/cmake/scripts/linux/Install.cmake
+++ b/project/cmake/scripts/linux/Install.cmake
@@ -137,9 +137,11 @@ install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt
137 COMPONENT kodi) 137 COMPONENT kodi)
138 138
139# Install kodi-tools-texturepacker 139# Install kodi-tools-texturepacker
140install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker 140if(NOT WITH_TEXTUREPACKER)
141 DESTINATION ${bindir} 141 install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker
142 COMPONENT kodi-tools-texturepacker) 142 DESTINATION ${bindir}
143 COMPONENT kodi-tools-texturepacker)
144endif()
143 145
144# Install kodi-addon-dev headers 146# Install kodi-addon-dev headers
145install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h 147install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h
@@ -152,12 +154,14 @@ install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kod
152 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h 154 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
153 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h 155 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h
154 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h 156 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
157 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h
155 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h 158 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h
156 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h 159 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h
157 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h 160 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h
158 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h 161 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h
159 ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h 162 ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
160 ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h 163 ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
164 ${CORE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h
161 DESTINATION ${includedir}/${APP_NAME_LC} 165 DESTINATION ${includedir}/${APP_NAME_LC}
162 COMPONENT kodi-addon-dev) 166 COMPONENT kodi-addon-dev)
163 167
@@ -310,6 +314,14 @@ install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kod
310 DESTINATION ${includedir}/${APP_NAME_LC} 314 DESTINATION ${includedir}/${APP_NAME_LC}
311 COMPONENT kodi-peripheral-dev) 315 COMPONENT kodi-peripheral-dev)
312 316
317# Install kodi-game-dev
318install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h
319 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
320 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
321 DESTINATION ${includedir}/${APP_NAME_LC}
322 COMPONENT kodi-game-dev)
323
324
313# Install XBT skin files 325# Install XBT skin files
314foreach(texture ${XBT_FILES}) 326foreach(texture ${XBT_FILES})
315 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) 327 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
diff --git a/project/cmake/scripts/osx/Macros.cmake b/project/cmake/scripts/osx/Macros.cmake
index 0d04439..52f87d1 100644
--- a/project/cmake/scripts/osx/Macros.cmake
+++ b/project/cmake/scripts/osx/Macros.cmake
@@ -2,7 +2,7 @@ function(core_link_library lib wraplib)
2 if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja) 2 if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja)
3 set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) 3 set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o)
4 elseif(CMAKE_GENERATOR MATCHES "Xcode") 4 elseif(CMAKE_GENERATOR MATCHES "Xcode")
5 set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) 5 set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o)
6 else() 6 else()
7 message(FATAL_ERROR "Unsupported generator in core_link_library") 7 message(FATAL_ERROR "Unsupported generator in core_link_library")
8 endif() 8 endif()
@@ -17,6 +17,13 @@ function(core_link_library lib wraplib)
17 set(link_lib $<TARGET_FILE:${lib}>) 17 set(link_lib $<TARGET_FILE:${lib}>)
18 set(check_arg ${ARGV2}) 18 set(check_arg ${ARGV2})
19 set(data_arg ${ARGV3}) 19 set(data_arg ${ARGV3})
20
21 # iOS: EFFECTIVE_PLATFORM_NAME is not resolved
22 # http://public.kitware.com/pipermail/cmake/2016-March/063049.html
23 if(CORE_SYSTEM_NAME STREQUAL ios AND CMAKE_GENERATOR STREQUAL Xcode)
24 get_target_property(dir ${lib} BINARY_DIR)
25 set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
26 endif()
20 else() 27 else()
21 set(target ${ARGV2}) 28 set(target ${ARGV2})
22 set(link_lib ${lib}) 29 set(link_lib ${lib})
diff --git a/project/cmake/scripts/windows/tools/patch.cmake b/project/cmake/scripts/windows/tools/patch.cmake
new file mode 100644
index 0000000..0ef2952
--- /dev/null
+++ b/project/cmake/scripts/windows/tools/patch.cmake
@@ -0,0 +1,37 @@
1find_program(PATCH_FOUND NAMES patch patch.exe)
2if(PATCH_FOUND)
3 message(STATUS "patch utility found at ${PATCH_FOUND}")
4else()
5 set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-1")
6 set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip")
7 set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}")
8 set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE})
9
10 # download the archive containing patch.exe
11 message(STATUS "Downloading patch utility from ${PATCH_URL}...")
12 file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS)
13 list(GET PATCH_DL_STATUS 0 PATCH_RETCODE)
14 if(NOT PATCH_RETCODE EQUAL 0)
15 message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}")
16 endif()
17
18 # extract the archive containing patch.exe
19 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD}
20 WORKING_DIRECTORY ${BUILD_DIR})
21
22 # make sure the extraction worked and that patch.exe is there
23 set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME})
24 set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe)
25 if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH})
26 message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_PATH}")
27 endif()
28
29 # copy patch.exe into the output directory
30 file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin)
31
32 # make sure that cmake can find the copied patch.exe
33 find_program(PATCH_FOUND NAMES patch patch.exe)
34 if(NOT PATCH_FOUND)
35 message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin")
36 endif()
37endif()
diff --git a/project/cmake/treedata/common/addons.txt b/project/cmake/treedata/common/addons.txt
index 76410b7..f29e086 100644
--- a/project/cmake/treedata/common/addons.txt
+++ b/project/cmake/treedata/common/addons.txt
@@ -1,8 +1,7 @@
1lib/addons/library.kodi.adsp KODI_adsp 1lib/addons/library.kodi.adsp KODI_adsp
2lib/addons/library.kodi.audioengine KODI_audioengine 2lib/addons/library.kodi.audioengine KODI_audioengine
3lib/addons/library.kodi.game KODI_game
3lib/addons/library.kodi.guilib KODI_guilib 4lib/addons/library.kodi.guilib KODI_guilib
4lib/addons/library.kodi.inputstream KODI_inputstream
5lib/addons/library.kodi.peripheral KODI_peripheral 5lib/addons/library.kodi.peripheral KODI_peripheral
6lib/addons/library.xbmc.addon XBMC_addon 6lib/addons/library.xbmc.addon XBMC_addon
7lib/addons/library.xbmc.codec XBMC_codec 7lib/addons/library.xbmc.codec XBMC_codec
8lib/addons/library.xbmc.pvr XBMC_pvr
diff --git a/project/cmake/treedata/common/cores.txt b/project/cmake/treedata/common/cores.txt
index d23939d..8d79dd1 100644
--- a/project/cmake/treedata/common/cores.txt
+++ b/project/cmake/treedata/common/cores.txt
@@ -6,3 +6,4 @@ xbmc/cores/DllLoader/exports/util cores/dll-loader/exports/util
6xbmc/cores/ExternalPlayer cores/externalplayer 6xbmc/cores/ExternalPlayer cores/externalplayer
7xbmc/cores/paplayer cores/paplayer 7xbmc/cores/paplayer cores/paplayer
8xbmc/cores/playercorefactory cores/playercorefactory 8xbmc/cores/playercorefactory cores/playercorefactory
9xbmc/cores/RetroPlayer cores/RetroPlayer
diff --git a/project/cmake/treedata/common/games.txt b/project/cmake/treedata/common/games.txt
index b622f5a..03d42bc 100644
--- a/project/cmake/treedata/common/games.txt
+++ b/project/cmake/treedata/common/games.txt
@@ -1,4 +1,12 @@
1xbmc/games games
2xbmc/games/addons games/addons
3xbmc/games/addons/playback games/addons/playback
4xbmc/games/addons/savestates games/addons/savestates
1xbmc/games/controllers games/controllers 5xbmc/games/controllers games/controllers
2xbmc/games/controllers/dialogs games/controllers/dialogs 6xbmc/games/controllers/dialogs games/controllers/dialogs
3xbmc/games/controllers/guicontrols games/controllers/guicontrols 7xbmc/games/controllers/guicontrols games/controllers/guicontrols
4xbmc/games/controllers/windows games/controllers/windows 8xbmc/games/controllers/windows games/controllers/windows
9xbmc/games/dialogs games/dialogs
10xbmc/games/ports games/ports
11xbmc/games/tags games/tags
12xbmc/games/windows games/windows
diff --git a/project/cmake/treedata/common/network.txt b/project/cmake/treedata/common/network.txt
index 6331b2d..46da314 100644
--- a/project/cmake/treedata/common/network.txt
+++ b/project/cmake/treedata/common/network.txt
@@ -1,4 +1,2 @@
1xbmc/network network 1xbmc/network network
2xbmc/network/httprequesthandler network/httprequesthandler
3xbmc/network/httprequesthandler/python network/httprequesthandler/python
4xbmc/network/websocket network/websocket 2xbmc/network/websocket network/websocket
diff --git a/project/cmake/treedata/common/subdirs.txt b/project/cmake/treedata/common/subdirs.txt
index e2bca7e..af91611 100644
--- a/project/cmake/treedata/common/subdirs.txt
+++ b/project/cmake/treedata/common/subdirs.txt
@@ -5,6 +5,7 @@ xbmc/addons/binary/interfaces/api1/Addon api1AddonCallbacks_Addon
5xbmc/addons/binary/interfaces/api1/AudioDSP api1AddonCallbacks_AudioDSP 5xbmc/addons/binary/interfaces/api1/AudioDSP api1AddonCallbacks_AudioDSP
6xbmc/addons/binary/interfaces/api1/AudioEngine api1AddonCallbacks_AudioEngine 6xbmc/addons/binary/interfaces/api1/AudioEngine api1AddonCallbacks_AudioEngine
7xbmc/addons/binary/interfaces/api1/Codec api1AddonCallbacks_Codec 7xbmc/addons/binary/interfaces/api1/Codec api1AddonCallbacks_Codec
8xbmc/addons/binary/interfaces/api1/Game api1AddonCallbacks_Game
8xbmc/addons/binary/interfaces/api1/GUI api1AddonCallbacks_GUI 9xbmc/addons/binary/interfaces/api1/GUI api1AddonCallbacks_GUI
9xbmc/addons/binary/interfaces/api1/InputStream api1AddonCallbacks_InputStream 10xbmc/addons/binary/interfaces/api1/InputStream api1AddonCallbacks_InputStream
10xbmc/addons/binary/interfaces/api1/Peripheral api1AddonCallbacks_Peripheral 11xbmc/addons/binary/interfaces/api1/Peripheral api1AddonCallbacks_Peripheral
@@ -18,6 +19,10 @@ xbmc/input input
18xbmc/input/joysticks input/joysticks 19xbmc/input/joysticks input/joysticks
19xbmc/input/joysticks/dialogs input/joysticks/dialogs 20xbmc/input/joysticks/dialogs input/joysticks/dialogs
20xbmc/input/joysticks/generic input/joysticks/generic 21xbmc/input/joysticks/generic input/joysticks/generic
22xbmc/input/keyboard input/keyboard
23xbmc/input/keyboard/generic input/keyboard/generic
24xbmc/input/mouse input/mouse
25xbmc/input/mouse/generic input/mouse/generic
21xbmc/listproviders listproviders 26xbmc/listproviders listproviders
22xbmc/media media 27xbmc/media media
23xbmc/messaging messaging 28xbmc/messaging messaging
diff --git a/project/cmake/treedata/optional/common/mir.txt b/project/cmake/treedata/optional/common/mir.txt
new file mode 100644
index 0000000..d681e8b
--- /dev/null
+++ b/project/cmake/treedata/optional/common/mir.txt
@@ -0,0 +1 @@
xbmc/windowing/mir windowing/mir # MIR
diff --git a/project/cmake/treedata/optional/common/webserver.txt b/project/cmake/treedata/optional/common/webserver.txt
new file mode 100644
index 0000000..b492006
--- /dev/null
+++ b/project/cmake/treedata/optional/common/webserver.txt
@@ -0,0 +1,2 @@
1xbmc/network/httprequesthandler network/httprequesthandler # MICROHTTPD
2xbmc/network/httprequesthandler/python network/httprequesthandler/python # MICROHTTPD
diff --git a/version.txt b/version.txt
index c1b802c..a27c1bd 100644
--- a/version.txt
+++ b/version.txt
@@ -1,11 +1,11 @@
1APP_NAME Kodi 1APP_NAME Kodi
2COMPANY_NAME XBMC-Foundation 2COMPANY_NAME XBMC-Foundation
3WEBSITE http://kodi.tv 3WEBSITE http://kodi.tv
4VERSION_MAJOR 17 4VERSION_MAJOR 18
5VERSION_MINOR 0 5VERSION_MINOR 0
6VERSION_TAG BETA6 6VERSION_TAG ALPHA1
7VERSION_CODE 169806 7VERSION_CODE 179701
8ADDON_API 16.9.806 8ADDON_API 17.9.701
9 9
10# Notes: 10# Notes:
11# Change AC_INIT in configure.ac 11# Change AC_INIT in configure.ac
diff --git a/xbmc/addons/addon-bindings.mk b/xbmc/addons/addon-bindings.mk
index 6bfed36..788b50e 100644
--- a/xbmc/addons/addon-bindings.mk
+++ b/xbmc/addons/addon-bindings.mk
@@ -13,6 +13,9 @@ BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h
13BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h 13BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h
14BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h 14BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h
15BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h 15BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
16BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h
17BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
18BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
16BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h 19BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
17BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h 20BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
18BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h 21BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h
@@ -30,6 +33,7 @@ BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h
30BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h 33BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
31BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h 34BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h
32BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h 35BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h
36BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h
33BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h 37BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
34BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h 38BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
35BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h 39BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
@@ -38,3 +42,4 @@ BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h
38BINDINGS+=xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h 42BINDINGS+=xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
39BINDINGS+=xbmc/cores/AudioEngine/Utils/AEChannelData.h 43BINDINGS+=xbmc/cores/AudioEngine/Utils/AEChannelData.h
40BINDINGS+=xbmc/filesystem/IFileTypes.h 44BINDINGS+=xbmc/filesystem/IFileTypes.h
45BINDINGS+=xbmc/input/XBMC_vkeys.h
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h
new file mode 100644
index 0000000..6057f46
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h
@@ -0,0 +1,161 @@
1/*
2 * Copyright (C) 2014-2016 Team Kodi
3 * http://kodi.tv
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this Program; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20#ifndef KODI_GAME_CALLBACKS_H_
21#define KODI_GAME_CALLBACKS_H_
22
23#include "kodi_game_types.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29typedef struct CB_GameLib
30{
31 // --- Game callbacks --------------------------------------------------------
32
33 /*!
34 * \brief Requests the frontend to stop the current game
35 */
36 void (*CloseGame)(void* addonData);
37
38 /*!
39 * \brief Create a video stream for pixel data
40 *
41 * \param format The type of pixel data accepted by this stream
42 * \param width The frame width
43 * \param height The frame height
44 * \param rotation The rotation (counter-clockwise) of the video frames
45 *
46 * \return 0 on success or -1 if a video stream is already created
47 */
48 int (*OpenPixelStream)(void* addonData, GAME_PIXEL_FORMAT format, unsigned int width, unsigned int height, GAME_VIDEO_ROTATION rotation);
49
50 /*!
51 * \brief Create a video stream for encoded video data
52 *
53 * \param codec The video format accepted by this stream
54 *
55 * \return 0 on success or -1 if a video stream is already created
56 */
57 int (*OpenVideoStream)(void* addonData, GAME_VIDEO_CODEC codec);
58
59 /*!
60 * \brief Create an audio stream for PCM audio data
61 *
62 * \param format The type of audio data accepted by this stream
63 * \param channel_map The channel layout terminated by GAME_CH_NULL
64 *
65 * \return 0 on success or -1 if an audio stream is already created
66 */
67 int (*OpenPCMStream)(void* addonData, GAME_PCM_FORMAT format, const GAME_AUDIO_CHANNEL* channel_map);
68
69 /*!
70 * \brief Create an audio stream for encoded audio data
71 *
72 * \param codec The audio format accepted by this stream
73 * \param channel_map The channel layout terminated by GAME_CH_NULL
74 *
75 * \return 0 on success or -1 if an audio stream is already created
76 */
77 int(*OpenAudioStream)(void* addonData, GAME_AUDIO_CODEC codec, const GAME_AUDIO_CHANNEL* channel_map);
78
79 /*!
80 * \brief Add a data packet to an audio or video stream
81 *
82 * \param stream The target stream
83 * \param data The data packet
84 * \param size The size of the data
85 */
86 void (*AddStreamData)(void* addonData, GAME_STREAM_TYPE stream, const uint8_t* data, unsigned int size);
87
88 /*!
89 * \brief Free the specified stream
90 *
91 * \param stream The stream to close
92 */
93 void (*CloseStream)(void* addonData, GAME_STREAM_TYPE stream);
94
95 // -- Hardware rendering callbacks -------------------------------------------
96
97 /*!
98 * \brief Enable hardware rendering
99 *
100 * \param hw_info A struct of properties for the hardware rendering system
101 */
102 void (*EnableHardwareRendering)(void* addonData, const game_hw_info* hw_info);
103
104 /*!
105 * \brief Get the framebuffer for rendering
106 *
107 * \return The framebuffer
108 */
109 uintptr_t (*HwGetCurrentFramebuffer)(void* addonData);
110
111 /*!
112 * \brief Get a symbol from the hardware context
113 *
114 * \param symbol The symbol's name
115 *
116 * \return A function pointer for the specified symbol
117 */
118 game_proc_address_t (*HwGetProcAddress)(void* addonData, const char* symbol);
119
120 /*!
121 * \brief Called when a frame is being rendered
122 */
123 void (*RenderFrame)(void* addonData);
124
125 // --- Input callbacks -------------------------------------------------------
126
127 /*!
128 * \brief Begin reporting events for the specified joystick port
129 *
130 * \param port The zero-indexed port number
131 *
132 * \return true if the port was opened, false otherwise
133 */
134 bool (*OpenPort)(void* addonData, unsigned int port);
135
136 /*!
137 * \brief End reporting events for the specified port
138 *
139 * \param port The port number passed to OpenPort()
140 */
141 void (*ClosePort)(void* addonData, unsigned int port);
142
143 /*!
144 * \brief Notify the port of an input event
145 *
146 * \param event The input event
147 *
148 * Input events can arrive for the following sources:
149 * - GAME_INPUT_EVENT_MOTOR
150 *
151 * \return true if the event was handled, false otherwise
152 */
153 bool (*InputEvent)(void* addonData, const game_input_event* event);
154
155} CB_GameLib;
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif // KODI_GAME_CALLBACKS_H_
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
new file mode 100644
index 0000000..247f24b
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
@@ -0,0 +1,287 @@
1/*
2 * Copyright (C) 2014-2016 Team Kodi
3 * http://kodi.tv
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this Program; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20#ifndef KODI_GAME_DLL_H_
21#define KODI_GAME_DLL_H_
22
23#include "kodi_game_types.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29// --- Game API operations -----------------------------------------------------
30
31/*!
32 * \brief Return GAME_API_VERSION_STRING
33 *
34 * The add-on is backwards compatible with the frontend if this API version is
35 * is at least the frontend's minimum API version.
36 *
37 * \return Must be GAME_API_VERSION_STRING
38 */
39const char* GetGameAPIVersion(void);
40
41/*!
42 * \brief Return GAME_MIN_API_VERSION_STRING
43 *
44 * The add-on is forwards compatible with the frontend if this minimum version
45 * is no more than the frontend's API version.
46 *
47 * \return Must be GAME_MIN_API_VERSION_STRING
48 */
49const char* GetMininumGameAPIVersion(void);
50
51// --- Game operations ---------------------------------------------------------
52
53/*!
54 * \brief Load a game
55 *
56 * \param url The URL to load
57 *
58 * return the error, or GAME_ERROR_NO_ERROR if the game was loaded
59 */
60GAME_ERROR LoadGame(const char* url);
61
62/*!
63 * \brief Load a game that requires multiple files
64 *
65 * \param type The game stype
66 * \param urls An array of urls
67 * \param urlCount The number of urls in the array
68 *
69 * \return the error, or GAME_ERROR_NO_ERROR if the game was loaded
70 */
71GAME_ERROR LoadGameSpecial(SPECIAL_GAME_TYPE type, const char** urls, size_t urlCount);
72
73/*!
74 * \brief Begin playing without a game file
75 *
76 * If the add-on supports standalone mode, it must add the <supports_standalone>
77 * tag to the extension point in addon.xml:
78 *
79 * <supports_no_game>false</supports_no_game>
80 *
81 * \return the error, or GAME_ERROR_NO_ERROR if the game add-on was loaded
82 */
83GAME_ERROR LoadStandalone(void);
84
85/*!
86 * \brief Unload the current game
87 *
88 * \return the error, or GAME_ERROR_NO_ERROR if the game was unloaded
89 */
90/*! Unloads a currently loaded game */
91GAME_ERROR UnloadGame(void);
92
93/*!
94 * \brief Get information about the loaded game
95 *
96 * \param info The info structure to fill
97 *
98 * \return the error, or GAME_ERROR_NO_ERROR if info was filled
99 */
100GAME_ERROR GetGameInfo(game_system_av_info* info);
101
102/*!
103 * \brief Get region of the loaded game
104 *
105 * \return the region, or GAME_REGION_UNKNOWN if unknown or no game is loaded
106 */
107GAME_REGION GetRegion(void);
108
109/*!
110 * \brief Return true if the client requires the frontend to provide a game loop
111 *
112 * The game loop is a thread that calls RunFrame() in a loop at a rate
113 * determined by the playback speed and the client's FPS.
114 *
115 * \return true if the frontend should provide a game loop, false otherwise
116 */
117bool RequiresGameLoop(void);
118
119/*!
120 * \brief Run a single frame for add-ons that use a game loop
121 *
122 * \return the error, or GAME_ERROR_NO_ERROR if there was no error
123 */
124GAME_ERROR RunFrame(void);
125
126/*!
127 * \brief Reset the current game
128 *
129 * \return the error, or GAME_ERROR_NO_ERROR if the game was reset
130 */
131GAME_ERROR Reset(void);
132
133// --- Hardware rendering operations -------------------------------------------
134
135/*!
136 * \brief Invalidates the current HW context and reinitializes GPU resources
137 *
138 * Any GL state is lost, and must not be deinitialized explicitly.
139 *
140 * \return the error, or GAME_ERROR_NO_ERROR if the HW context was reset
141 */
142GAME_ERROR HwContextReset(void);
143
144/*!
145 * \brief Called before the context is destroyed
146 *
147 * Resources can be deinitialized at this step.
148 *
149 * \return the error, or GAME_ERROR_NO_ERROR if the HW context was destroyed
150 */
151GAME_ERROR HwContextDestroy(void);
152
153// --- Input operations --------------------------------------------------------
154
155/*!
156 * \brief Notify the add-on of a status change on an open port
157 *
158 * Ports can be opened using the OpenPort() callback
159 *
160 * \param port Non-negative for a joystick port, or GAME_INPUT_PORT value otherwise
161 * \param collected True if a controller was connected, false if disconnected
162 * \param controller The connected controller
163 */
164void UpdatePort(int port, bool connected, const game_controller* controller);
165
166/*!
167 * \brief Check if input is accepted for a feature on the controller
168 *
169 * If only a subset of the controller profile is used, this can return false
170 * for unsupported features to not absorb their input.
171 *
172 * If the entire controller profile is used, this should always return true.
173 *
174 * \param controller_id The ID of the controller profile
175 * \param feature_name The name of a feature in that profile
176 * \return true if input is accepted for the feature, false otherwise
177 */
178bool HasFeature(const char* controller_id, const char* feature_name);
179
180/*!
181 * \brief Notify the add-on of an input event
182 *
183 * \param event The input event
184 *
185 * \return true if the event was handled, false otherwise
186 */
187bool InputEvent(const game_input_event* event);
188
189// --- Serialization operations ------------------------------------------------
190
191/*!
192 * \brief Get the number of bytes required to serialize the game
193 *
194 * \return the number of bytes, or 0 if serialization is not supported
195 */
196size_t SerializeSize(void);
197
198/*!
199 * \brief Serialize the state of the game
200 *
201 * \param data The buffer receiving the serialized game data
202 * \param size The size of the buffer
203 *
204 * \return the error, or GAME_ERROR_NO_ERROR if the game was serialized into the buffer
205 */
206GAME_ERROR Serialize(uint8_t* data, size_t size);
207
208/*!
209 * \brief Deserialize the game from the given state
210 *
211 * \param data A buffer containing the game's new state
212 * \param size The size of the buffer
213 *
214 * \return the error, or GAME_ERROR_NO_ERROR if the game deserialized
215 */
216GAME_ERROR Deserialize(const uint8_t* data, size_t size);
217
218// --- Cheat operations --------------------------------------------------------
219
220/*!
221 * \brief Reset the cheat system
222 *
223 * \return the error, or GAME_ERROR_NO_ERROR if the cheat system was reset
224 */
225GAME_ERROR CheatReset(void);
226
227/*!
228 * \brief Get a region of memory
229 *
230 * \param type The type of memory to retrieve
231 * \param data Set to the region of memory; must remain valid until UnloadGame() is called
232 * \param size Set to the size of the region of memory
233 *
234 * \return the error, or GAME_ERROR_NO_ERROR if data was set to a valid buffer
235 */
236GAME_ERROR GetMemory(GAME_MEMORY type, const uint8_t** data, size_t* size);
237
238/*!
239 * \brief Set a cheat code
240 *
241 * \param index
242 * \param enabled
243 * \param code
244 *
245 * \return the error, or GAME_ERROR_NO_ERROR if the cheat was set
246 */
247GAME_ERROR SetCheat(unsigned int index, bool enabled, const char* code);
248
249// --- Add-on helper implementation --------------------------------------------
250
251/*!
252 * \brief Called by Kodi to assign the function pointers of this add-on to pClient
253 *
254 * Note that get_addon() is defined here, so it will be available in all
255 * compiled game clients.
256 */
257void __declspec(dllexport) get_addon(GameClient* pClient)
258{
259 pClient->GetGameAPIVersion = GetGameAPIVersion;
260 pClient->GetMininumGameAPIVersion = GetMininumGameAPIVersion;
261 pClient->LoadGame = LoadGame;
262 pClient->LoadGameSpecial = LoadGameSpecial;
263 pClient->LoadStandalone = LoadStandalone;
264 pClient->UnloadGame = UnloadGame;
265 pClient->GetGameInfo = GetGameInfo;
266 pClient->GetRegion = GetRegion;
267 pClient->RequiresGameLoop = RequiresGameLoop;
268 pClient->RunFrame = RunFrame;
269 pClient->Reset = Reset;
270 pClient->HwContextReset = HwContextReset;
271 pClient->HwContextDestroy = HwContextDestroy;
272 pClient->UpdatePort = UpdatePort;
273 pClient->HasFeature = HasFeature;
274 pClient->InputEvent = InputEvent;
275 pClient->SerializeSize = SerializeSize;
276 pClient->Serialize = Serialize;
277 pClient->Deserialize = Deserialize;
278 pClient->CheatReset = CheatReset;
279 pClient->GetMemory = GetMemory;
280 pClient->SetCheat = SetCheat;
281}
282
283#ifdef __cplusplus
284}
285#endif
286
287#endif // KODI_GAME_DLL_H_
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
new file mode 100644
index 0000000..fa2762d
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
@@ -0,0 +1,487 @@
1/*
2 * Copyright (C) 2014-2016 Team Kodi
3 * http://kodi.tv
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this Program; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20#ifndef KODI_GAME_TYPES_H_
21#define KODI_GAME_TYPES_H_
22
23/* current game API version */
24#define GAME_API_VERSION "1.0.28"
25
26/* min. game API version */
27#define GAME_MIN_API_VERSION "1.0.28"
28
29#include <stddef.h>
30#include <stdint.h>
31
32#ifdef TARGET_WINDOWS
33 #include <windows.h>
34#else
35 #ifndef __cdecl
36 #define __cdecl
37 #endif
38 #ifndef __declspec
39 #define __declspec(X)
40 #endif
41#endif
42
43#undef ATTRIBUTE_PACKED
44#undef PRAGMA_PACK_BEGIN
45#undef PRAGMA_PACK_END
46
47#if defined(__GNUC__)
48 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
49 #define ATTRIBUTE_PACKED __attribute__ ((packed))
50 #define PRAGMA_PACK 0
51 #endif
52#endif
53
54#if !defined(ATTRIBUTE_PACKED)
55 #define ATTRIBUTE_PACKED
56 #define PRAGMA_PACK 1
57#endif
58
59#ifdef BUILD_KODI_ADDON
60#include "XBMC_vkeys.h"
61#else
62#include "input/XBMC_vkeys.h"
63#endif
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69/*! Game add-on error codes */
70typedef enum GAME_ERROR
71{
72 GAME_ERROR_NO_ERROR, // no error occurred
73 GAME_ERROR_UNKNOWN, // an unknown error occurred
74 GAME_ERROR_NOT_IMPLEMENTED, // the method that the frontend called is not implemented
75 GAME_ERROR_REJECTED, // the command was rejected by the game client
76 GAME_ERROR_INVALID_PARAMETERS, // the parameters of the method that was called are invalid for this operation
77 GAME_ERROR_FAILED, // the command failed
78 GAME_ERROR_NOT_LOADED, // no game is loaded
79 GAME_ERROR_RESTRICTED, // game requires restricted resources
80} GAME_ERROR;
81
82typedef enum GAME_STREAM_TYPE
83{
84 GAME_STREAM_UNKNOWN,
85 GAME_STREAM_AUDIO,
86 GAME_STREAM_VIDEO,
87} GAME_STREAM_TYPE;
88
89typedef enum GAME_PIXEL_FORMAT
90{
91 GAME_PIXEL_FORMAT_UNKNOWN,
92 GAME_PIXEL_FORMAT_YUV420P,
93 GAME_PIXEL_FORMAT_0RGB8888,
94 GAME_PIXEL_FORMAT_RGB565,
95 GAME_PIXEL_FORMAT_0RGB1555,
96} GAME_PIXEL_FORMAT;
97
98typedef enum GAME_VIDEO_CODEC
99{
100 GAME_VIDEO_CODEC_UNKNOWN,
101 GAME_VIDEO_CODEC_H264,
102 GAME_VIDEO_CODEC_THEORA,
103} GAME_VIDEO_CODEC;
104
105typedef enum GAME_VIDEO_ROTATION // Counter-clockwise
106{
107 GAME_VIDEO_ROTATION_0,
108 GAME_VIDEO_ROTATION_90,
109 GAME_VIDEO_ROTATION_180,
110 GAME_VIDEO_ROTATION_270,
111} GAME_VIDEO_ROTATION;
112
113typedef enum GAME_PCM_FORMAT
114{
115 GAME_PCM_FORMAT_UNKNOWN,
116 GAME_PCM_FORMAT_S16NE,
117} GAME_PCM_FORMAT;
118
119typedef enum GAME_AUDIO_CODEC
120{
121 GAME_AUDIO_CODEC_UNKNOWN,
122 GAME_AUDIO_CODEC_OPUS,
123} GAME_AUDIO_CODEC;
124
125typedef enum GAME_AUDIO_CHANNEL
126{
127 GAME_CH_NULL, // Channel list terminator
128 GAME_CH_FL,
129 GAME_CH_FR,
130 GAME_CH_FC,
131 GAME_CH_LFE,
132 GAME_CH_BL,
133 GAME_CH_BR,
134 GAME_CH_FLOC,
135 GAME_CH_FROC,
136 GAME_CH_BC,
137 GAME_CH_SL,
138 GAME_CH_SR,
139 GAME_CH_TFL,
140 GAME_CH_TFR,
141 GAME_CH_TFC,
142 GAME_CH_TC,
143 GAME_CH_TBL,
144 GAME_CH_TBR,
145 GAME_CH_TBC,
146 GAME_CH_BLOC,
147 GAME_CH_BROC,
148} GAME_AUDIO_CHANNEL;
149
150// TODO
151typedef enum GAME_HW_FRAME_BUFFER
152{
153 GAME_HW_FRAME_BUFFER_VALID, // Pass this to game_video_refresh if rendering to hardware
154 GAME_HW_FRAME_BUFFER_DUPLICATE, // Passing NULL to game_video_refresh is still a frame dupe as normal
155 GAME_HW_FRAME_BUFFER_RENDER,
156} GAME_HW_FRAME_BUFFER;
157
158typedef enum GAME_HW_CONTEXT_TYPE
159{
160 GAME_HW_CONTEXT_NONE,
161 GAME_HW_CONTEXT_OPENGL, // OpenGL 2.x. Latest version available before 3.x+. Driver can choose to use latest compatibility context
162 GAME_HW_CONTEXT_OPENGLES2, // GLES 2.0
163 GAME_HW_CONTEXT_OPENGL_CORE, // Modern desktop core GL context. Use major/minor fields to set GL version
164 GAME_HW_CONTEXT_OPENGLES3, // GLES 3.0
165} GAME_HW_CONTEXT_TYPE;
166
167typedef enum GAME_INPUT_PORT
168{
169 GAME_INPUT_PORT_JOYSTICK_START = 0, // Non-negative values are for joystick ports
170 GAME_INPUT_PORT_KEYBOARD = -1,
171 GAME_INPUT_PORT_MOUSE = -2,
172} GAME_INPUT_PORT;
173
174typedef enum GAME_INPUT_EVENT_SOURCE
175{
176 GAME_INPUT_EVENT_DIGITAL_BUTTON,
177 GAME_INPUT_EVENT_ANALOG_BUTTON,
178 GAME_INPUT_EVENT_ANALOG_STICK,
179 GAME_INPUT_EVENT_ACCELEROMETER,
180 GAME_INPUT_EVENT_KEY,
181 GAME_INPUT_EVENT_RELATIVE_POINTER,
182 GAME_INPUT_EVENT_ABSOLUTE_POINTER,
183 GAME_INPUT_EVENT_MOTOR,
184} GAME_INPUT_EVENT_SOURCE;
185
186typedef enum GAME_KEY_MOD
187{
188 GAME_KEY_MOD_NONE = 0x00,
189
190 GAME_KEY_MOD_SHIFT = 0x01,
191 GAME_KEY_MOD_CTRL = 0x02,
192 GAME_KEY_MOD_ALT = 0x04,
193 GAME_KEY_MOD_RALT = 0x08,
194 GAME_KEY_MOD_META = 0x10,
195
196 GAME_KEY_MOD_NUMLOCK = 0x20,
197 GAME_KEY_MOD_CAPSLOCK = 0x40,
198 GAME_KEY_MOD_SCROLLOCK = 0x80,
199} GAME_KEY_MOD;
200
201/*! Returned from game_get_region() */
202typedef enum GAME_REGION
203{
204 GAME_REGION_UNKNOWN,
205 GAME_REGION_NTSC,
206 GAME_REGION_PAL,
207} GAME_REGION;
208
209/*!
210* Special game types passed into game_load_game_special(). Only used when
211* multiple ROMs are required.
212*/
213typedef enum SPECIAL_GAME_TYPE
214{
215 SPECIAL_GAME_TYPE_BSX,
216 SPECIAL_GAME_TYPE_BSX_SLOTTED,
217 SPECIAL_GAME_TYPE_SUFAMI_TURBO,
218 SPECIAL_GAME_TYPE_SUPER_GAME_BOY,
219} SPECIAL_GAME_TYPE;
220
221typedef enum GAME_MEMORY
222{
223 /*!
224 * Passed to game_get_memory_data/size(). If the memory type doesn't apply
225 * to the implementation NULL/0 can be returned.
226 */
227 GAME_MEMORY_MASK = 0xff,
228
229 /*!
230 * Regular save ram. This ram is usually found on a game cartridge, backed
231 * up by a battery. If save game data is too complex for a single memory
232 * buffer, the SYSTEM_DIRECTORY environment callback can be used.
233 */
234 GAME_MEMORY_SAVE_RAM = 0,
235
236 /*!
237 * Some games have a built-in clock to keep track of time. This memory is
238 * usually just a couple of bytes to keep track of time.
239 */
240 GAME_MEMORY_RTC = 1,
241
242 /*! System ram lets a frontend peek into a game systems main RAM */
243 GAME_MEMORY_SYSTEM_RAM = 2,
244
245 /*! Video ram lets a frontend peek into a game systems video RAM (VRAM) */
246 GAME_MEMORY_VIDEO_RAM = 3,
247
248 /*! Special memory types */
249 GAME_MEMORY_SNES_BSX_RAM = ((1 << 8) | GAME_MEMORY_SAVE_RAM),
250 GAME_MEMORY_SNES_BSX_PRAM = ((2 << 8) | GAME_MEMORY_SAVE_RAM),
251 GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM= ((3 << 8) | GAME_MEMORY_SAVE_RAM),
252 GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM= ((4 << 8) | GAME_MEMORY_SAVE_RAM),
253 GAME_MEMORY_SNES_GAME_BOY_RAM = ((5 << 8) | GAME_MEMORY_SAVE_RAM),
254 GAME_MEMORY_SNES_GAME_BOY_RTC = ((6 << 8) | GAME_MEMORY_RTC),
255} GAME_MEMORY;
256
257/*! ID values for SIMD CPU features */
258typedef enum GAME_SIMD
259{
260 GAME_SIMD_SSE = (1 << 0),
261 GAME_SIMD_SSE2 = (1 << 1),
262 GAME_SIMD_VMX = (1 << 2),
263 GAME_SIMD_VMX128 = (1 << 3),
264 GAME_SIMD_AVX = (1 << 4),
265 GAME_SIMD_NEON = (1 << 5),
266 GAME_SIMD_SSE3 = (1 << 6),
267 GAME_SIMD_SSSE3 = (1 << 7),
268 GAME_SIMD_MMX = (1 << 8),
269 GAME_SIMD_MMXEXT = (1 << 9),
270 GAME_SIMD_SSE4 = (1 << 10),
271 GAME_SIMD_SSE42 = (1 << 11),
272 GAME_SIMD_AVX2 = (1 << 12),
273 GAME_SIMD_VFPU = (1 << 13),
274} GAME_SIMD;
275
276typedef enum GAME_ROTATION
277{
278 GAME_ROTATION_0_CW,
279 GAME_ROTATION_90_CW,
280 GAME_ROTATION_180_CW,
281 GAME_ROTATION_270_CW,
282} GAME_ROTATION;
283
284typedef struct game_controller
285{
286 const char* controller_id;
287 unsigned int digital_button_count;
288 unsigned int analog_button_count;
289 unsigned int analog_stick_count;
290 unsigned int accelerometer_count;
291 unsigned int key_count;
292 unsigned int rel_pointer_count;
293 unsigned int abs_pointer_count;
294 unsigned int motor_count;
295} ATTRIBUTE_PACKED game_controller;
296
297typedef struct game_digital_button_event
298{
299 bool pressed;
300} ATTRIBUTE_PACKED game_digital_button_event;
301
302typedef struct game_analog_button_event
303{
304 float magnitude;
305} ATTRIBUTE_PACKED game_analog_button_event;
306
307typedef struct game_analog_stick_event
308{
309 float x;
310 float y;
311} ATTRIBUTE_PACKED game_analog_stick_event;
312
313typedef struct game_accelerometer_event
314{
315 float x;
316 float y;
317 float z;
318} ATTRIBUTE_PACKED game_accelerometer_event;
319
320typedef struct game_key_event
321{
322 bool pressed;
323 XBMCVKey character;
324 GAME_KEY_MOD modifiers;
325} ATTRIBUTE_PACKED game_key_event;
326
327typedef struct game_rel_pointer_event
328{
329 int x;
330 int y;
331} ATTRIBUTE_PACKED game_rel_pointer_event;
332
333typedef struct game_abs_pointer_event
334{
335 bool pressed;
336 float x;
337 float y;
338} ATTRIBUTE_PACKED game_abs_pointer_event;
339
340typedef struct game_motor_event
341{
342 float magnitude;
343} ATTRIBUTE_PACKED game_motor_event;
344
345typedef struct game_input_event
346{
347 GAME_INPUT_EVENT_SOURCE type;
348 int port;
349 const char* controller_id;
350 const char* feature_name;
351 union
352 {
353 struct game_digital_button_event digital_button;
354 struct game_analog_button_event analog_button;
355 struct game_analog_stick_event analog_stick;
356 struct game_accelerometer_event accelerometer;
357 struct game_key_event key;
358 struct game_rel_pointer_event rel_pointer;
359 struct game_abs_pointer_event abs_pointer;
360 struct game_motor_event motor;
361 };
362} ATTRIBUTE_PACKED game_input_event;
363
364struct game_geometry
365{
366 unsigned base_width; // Nominal video width of game
367 unsigned base_height; // Nominal video height of game
368 unsigned max_width; // Maximum possible width of game
369 unsigned max_height; // Maximum possible height of game
370 float aspect_ratio; // Nominal aspect ratio of game. If aspect_ratio is <= 0.0,
371 // an aspect ratio of base_width / base_height is assumed.
372 // A frontend could override this setting if desired.
373};
374
375struct game_system_timing
376{
377 double fps; // FPS of video content.
378 double sample_rate; // Sampling rate of audio.
379};
380
381struct game_system_av_info
382{
383 struct game_geometry geometry;
384 struct game_system_timing timing;
385};
386
387typedef void (*game_proc_address_t)(void);
388
389struct game_hw_info
390{
391 GAME_HW_CONTEXT_TYPE context_type; // Which API to use. Set by game client
392 bool depth; // Set if render buffers should have depth component attached
393 bool stencil; // Set if stencil buffers should be attached
394 // If depth and stencil are true, a packed 24/8 buffer will be added. Only attaching stencil is invalid and will be ignored
395 bool bottom_left_origin; // Use conventional bottom-left origin convention. Is false, standard top-left origin semantics are used
396 unsigned version_major; // Major version number for core GL context
397 unsigned version_minor; // Minor version number for core GL context
398 bool cache_context; // If this is true, the frontend will go very far to avoid resetting context in scenarios like toggling fullscreen, etc.
399 // The reset callback might still be called in extreme situations such as if the context is lost beyond recovery
400 // For optimal stability, set this to false, and allow context to be reset at any time
401 bool debug_context; // Creates a debug context
402};
403
404/*! Properties passed to the ADDON_Create() method of a game client */
405typedef struct game_client_properties
406{
407 /*!
408 * The path of the game client being loaded.
409 */
410 const char* game_client_dll_path;
411
412 /*!
413 * Paths to proxy DLLs used to load the game client.
414 */
415 const char** proxy_dll_paths;
416
417 /*!
418 * Number of proxy DLL paths provided.
419 */
420 unsigned int proxy_dll_count;
421
422 /*!
423 * The "system" directories of the frontend. These directories can be used to
424 * store system-specific ROMs such as BIOSes, configuration data, etc.
425 */
426 const char** resource_directories;
427
428 /*!
429 * Number of resource directories provided
430 */
431 unsigned int resource_directory_count;
432
433 /*!
434 * The writable directory of the frontend. This directory can be used to store
435 * SRAM, memory cards, high scores, etc, if the game client cannot use the
436 * regular memory interface, GetMemoryData().
437 */
438 const char* profile_directory;
439
440 /*!
441 * The value of the <supports_vfs> property from addon.xml
442 */
443 bool supports_vfs;
444
445 /*!
446 * The extensions in the <extensions> property from addon.xml
447 */
448 const char** extensions;
449
450 /*!
451 * Number of extensions provided
452 */
453 unsigned int extension_count;
454} game_client_properties;
455
456/*! Structure to transfer the methods from kodi_game_dll.h to Kodi */
457typedef struct GameClient
458{
459 const char* (__cdecl* GetGameAPIVersion)(void);
460 const char* (__cdecl* GetMininumGameAPIVersion)(void);
461 GAME_ERROR (__cdecl* LoadGame)(const char*);
462 GAME_ERROR (__cdecl* LoadGameSpecial)(SPECIAL_GAME_TYPE, const char**, size_t);
463 GAME_ERROR (__cdecl* LoadStandalone)(void);
464 GAME_ERROR (__cdecl* UnloadGame)(void);
465 GAME_ERROR (__cdecl* GetGameInfo)(game_system_av_info*);
466 GAME_REGION (__cdecl* GetRegion)(void);
467 bool (__cdecl* RequiresGameLoop)(void);
468 GAME_ERROR (__cdecl* RunFrame)(void);
469 GAME_ERROR (__cdecl* Reset)(void);
470 GAME_ERROR (__cdecl* HwContextReset)(void);
471 GAME_ERROR (__cdecl* HwContextDestroy)(void);
472 void (__cdecl* UpdatePort)(int, bool, const game_controller*);
473 bool (__cdecl* HasFeature)(const char* controller_id, const char* feature_name);
474 bool (__cdecl* InputEvent)(const game_input_event*);
475 size_t (__cdecl* SerializeSize)(void);
476 GAME_ERROR (__cdecl* Serialize)(uint8_t*, size_t);
477 GAME_ERROR (__cdecl* Deserialize)(const uint8_t*, size_t);
478 GAME_ERROR (__cdecl* CheatReset)(void);
479 GAME_ERROR (__cdecl* GetMemory)(GAME_MEMORY, const uint8_t**, size_t*);
480 GAME_ERROR (__cdecl* SetCheat)(unsigned int, bool, const char*);
481} GameClient;
482
483#ifdef __cplusplus
484}
485#endif
486
487#endif // KODI_GAME_TYPES_H_
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
index 3721971..8dc49c0 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
@@ -122,7 +122,7 @@ extern "C"
122 * @return True if the seek operation was possible 122 * @return True if the seek operation was possible
123 * @remarks Optional, and only used if addon has its own demuxer. 123 * @remarks Optional, and only used if addon has its own demuxer.
124 */ 124 */
125 bool DemuxSeekTime(int time, bool backwards, double *startpts); 125 bool DemuxSeekTime(double time, bool backwards, double *startpts);
126 126
127 /*! 127 /*!
128 * Notify the InputStream addon/demuxer that XBMC wishes to change playback speed 128 * Notify the InputStream addon/demuxer that XBMC wishes to change playback speed
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
index ad47bb5..46e9d03 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
@@ -20,9 +20,16 @@
20 * 20 *
21 */ 21 */
22 22
23#ifdef TARGET_WINDOWS
24#include <windows.h>
25#else
23#ifndef __cdecl 26#ifndef __cdecl
24#define __cdecl 27#define __cdecl
25#endif 28#endif
29#ifndef __declspec
30#define __declspec(X)
31#endif
32#endif
26 33
27#ifdef BUILD_KODI_ADDON 34#ifdef BUILD_KODI_ADDON
28#include "DVDDemuxPacket.h" 35#include "DVDDemuxPacket.h"
@@ -31,7 +38,7 @@
31#endif 38#endif
32 39
33/* current API version */ 40/* current API version */
34#define INPUTSTREAM_API_VERSION "1.0.5" 41#define INPUTSTREAM_API_VERSION "1.0.6"
35 42
36extern "C" { 43extern "C" {
37 44
@@ -140,7 +147,7 @@ extern "C" {
140 void (__cdecl* DemuxAbort)(void); 147 void (__cdecl* DemuxAbort)(void);
141 void (__cdecl* DemuxFlush)(void); 148 void (__cdecl* DemuxFlush)(void);
142 DemuxPacket* (__cdecl* DemuxRead)(void); 149 DemuxPacket* (__cdecl* DemuxRead)(void);
143 bool (__cdecl* DemuxSeekTime)(int, bool, double*); 150 bool (__cdecl* DemuxSeekTime)(double, bool, double*);
144 void (__cdecl* DemuxSetSpeed)(int); 151 void (__cdecl* DemuxSetSpeed)(int);
145 void (__cdecl* SetVideoResolution)(int, int); 152 void (__cdecl* SetVideoResolution)(int, int);
146 153
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h
index 2df5622..d7c4282 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h
@@ -51,7 +51,7 @@
51#endif 51#endif
52 52
53/* current Peripheral API version */ 53/* current Peripheral API version */
54#define PERIPHERAL_API_VERSION "1.2.0" 54#define PERIPHERAL_API_VERSION "1.2.1"
55 55
56/* min. Peripheral API version */ 56/* min. Peripheral API version */
57#define PERIPHERAL_MIN_API_VERSION "1.2.0" 57#define PERIPHERAL_MIN_API_VERSION "1.2.0"
@@ -84,6 +84,7 @@ extern "C"
84 { 84 {
85 PERIPHERAL_TYPE_UNKNOWN, 85 PERIPHERAL_TYPE_UNKNOWN,
86 PERIPHERAL_TYPE_JOYSTICK, 86 PERIPHERAL_TYPE_JOYSTICK,
87 PERIPHERAL_TYPE_KEYBOARD,
87 } PERIPHERAL_TYPE; 88 } PERIPHERAL_TYPE;
88 89
89 typedef struct PERIPHERAL_INFO 90 typedef struct PERIPHERAL_INFO
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h
new file mode 100644
index 0000000..b5a46dd
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h
@@ -0,0 +1,238 @@
1/*
2 * Copyright (C) 2014-2016 Team Kodi
3 * http://kodi.tv
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this Program; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20#pragma once
21
22#include "libXBMC_addon.h"
23#include "kodi_game_callbacks.h"
24
25#include <string>
26#include <stdio.h>
27
28#if defined(ANDROID)
29 #include <sys/stat.h>
30#endif
31
32#ifdef _WIN32
33 #define GAME_HELPER_DLL "\\library.kodi.game\\libKODI_game" ADDON_HELPER_EXT
34#else
35 #define GAME_HELPER_DLL_NAME "libKODI_game-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
36 #define GAME_HELPER_DLL "/library.kodi.game/" GAME_HELPER_DLL_NAME
37#endif
38
39#define GAME_REGISTER_SYMBOL(dll, functionPtr) \
40 CHelper_libKODI_game::RegisterSymbol(dll, functionPtr, #functionPtr)
41
42class CHelper_libKODI_game
43{
44public:
45 CHelper_libKODI_game(void) :
46 GAME_register_me(nullptr),
47 GAME_unregister_me(nullptr),
48 GAME_close_game(nullptr),
49 GAME_open_pixel_stream(nullptr),
50 GAME_open_video_stream(nullptr),
51 GAME_open_pcm_stream(nullptr),
52 GAME_open_audio_stream(nullptr),
53 GAME_add_stream_data(nullptr),
54 GAME_close_stream(nullptr),
55 GAME_enable_hardware_rendering(nullptr),
56 GAME_hw_get_current_framebuffer(nullptr),
57 GAME_hw_get_proc_address(nullptr),
58 GAME_render_frame(nullptr),
59 GAME_open_port(nullptr),
60 GAME_close_port(nullptr),
61 GAME_input_event(nullptr),
62 m_handle(nullptr),
63 m_callbacks(nullptr),
64 m_libKODI_game(nullptr)
65 {
66 }
67
68 ~CHelper_libKODI_game(void)
69 {
70 if (m_libKODI_game)
71 {
72 GAME_unregister_me(m_handle, m_callbacks);
73 dlclose(m_libKODI_game);
74 }
75 }
76
77 template <typename T>
78 static bool RegisterSymbol(void* dll, T& functionPtr, const char* strFunctionPtr)
79 {
80 return (functionPtr = (T)dlsym(dll, strFunctionPtr)) != NULL;
81 }
82
83 /*!
84 * @brief Resolve all callback methods
85 * @param handle Pointer to the add-on
86 * @return True when all methods were resolved, false otherwise.
87 */
88 bool RegisterMe(void* handle)
89 {
90 m_handle = handle;
91
92 std::string libBasePath;
93 libBasePath = ((cb_array*)m_handle)->libBasePath;
94 libBasePath += GAME_HELPER_DLL;
95
96#if defined(ANDROID)
97 struct stat st;
98 if (stat(libBasePath.c_str(),&st) != 0)
99 {
100 std::string tempbin = getenv("XBMC_ANDROID_LIBS");
101 libBasePath = tempbin + "/" + GAME_HELPER_DLL_NAME;
102 }
103#endif
104
105 m_libKODI_game = dlopen(libBasePath.c_str(), RTLD_LAZY);
106 if (m_libKODI_game == NULL)
107 {
108 fprintf(stderr, "Unable to load %s\n", dlerror());
109 return false;
110 }
111
112 try
113 {
114 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_register_me)) throw false;
115 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_unregister_me)) throw false;
116 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_close_game)) throw false;
117 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_open_pixel_stream)) throw false;
118 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_open_video_stream)) throw false;
119 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_open_pcm_stream)) throw false;
120 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_open_audio_stream)) throw false;
121 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_add_stream_data)) throw false;
122 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_close_stream)) throw false;
123 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_enable_hardware_rendering)) throw false;
124 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_hw_get_current_framebuffer)) throw false;
125 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_hw_get_proc_address)) throw false;
126 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_render_frame)) throw false;
127 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_open_port)) throw false;
128 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_close_port)) throw false;
129 if (!GAME_REGISTER_SYMBOL(m_libKODI_game, GAME_input_event)) throw false;
130 }
131 catch (const bool& bSuccess)
132 {
133 fprintf(stderr, "ERROR: Unable to assign function %s\n", dlerror());
134 return bSuccess;
135 }
136
137 m_callbacks = GAME_register_me(m_handle);
138 return m_callbacks != NULL;
139 }
140
141 void CloseGame(void)
142 {
143 return GAME_close_game(m_handle, m_callbacks);
144 }
145
146 bool OpenPixelStream(GAME_PIXEL_FORMAT format, unsigned int width, unsigned int height, GAME_VIDEO_ROTATION rotation)
147 {
148 return GAME_open_pixel_stream(m_handle, m_callbacks, format, width, height, rotation) == 0;
149 }
150
151 bool OpenVideoStream(GAME_VIDEO_CODEC codec)
152 {
153 return GAME_open_video_stream(m_handle, m_callbacks, codec) == 0;
154 }
155
156 bool OpenPCMStream(GAME_PCM_FORMAT format, const GAME_AUDIO_CHANNEL* channel_map)
157 {
158 return GAME_open_pcm_stream(m_handle, m_callbacks, format, channel_map) == 0;
159 }
160
161 bool OpenAudioStream(GAME_AUDIO_CODEC codec, const GAME_AUDIO_CHANNEL* channel_map)
162 {
163 return GAME_open_audio_stream(m_handle, m_callbacks, codec, channel_map) == 0;
164 }
165
166 void AddStreamData(GAME_STREAM_TYPE stream, const uint8_t* data, unsigned int size)
167 {
168 GAME_add_stream_data(m_handle, m_callbacks, stream, data, size);
169 }
170
171 void CloseStream(GAME_STREAM_TYPE stream)
172 {
173 GAME_close_stream(m_handle, m_callbacks, stream);
174 }
175
176 void EnableHardwareRendering(const struct game_hw_info* hw_info)
177 {
178 return GAME_enable_hardware_rendering(m_handle, m_callbacks, hw_info);
179 }
180
181 uintptr_t HwGetCurrentFramebuffer(void)
182 {
183 return GAME_hw_get_current_framebuffer(m_handle, m_callbacks);
184 }
185
186 game_proc_address_t HwGetProcAddress(const char* sym)
187 {
188 return GAME_hw_get_proc_address(m_handle, m_callbacks, sym);
189 }
190
191 void RenderFrame()
192 {
193 return GAME_render_frame(m_handle, m_callbacks);
194 }
195
196 bool OpenPort(unsigned int port)
197 {
198 return GAME_open_port(m_handle, m_callbacks, port);
199 }
200
201 void ClosePort(unsigned int port)
202 {
203 return GAME_close_port(m_handle, m_callbacks, port);
204 }
205
206 bool InputEvent(const game_input_event& event)
207 {
208 return GAME_input_event(m_handle, m_callbacks, &event);
209 }
210
211protected:
212 CB_GameLib* (*GAME_register_me)(void* handle);
213 void (*GAME_unregister_me)(void* handle, CB_GameLib* cb);
214 void (*GAME_close_game)(void* handle, CB_GameLib* cb);
215 int (*GAME_open_pixel_stream)(void* handle, CB_GameLib* cb, GAME_PIXEL_FORMAT, unsigned int, unsigned int, GAME_VIDEO_ROTATION);
216 int (*GAME_open_video_stream)(void* handle, CB_GameLib* cb, GAME_VIDEO_CODEC);
217 int (*GAME_open_pcm_stream)(void* handle, CB_GameLib* cb, GAME_PCM_FORMAT, const GAME_AUDIO_CHANNEL*);
218 int (*GAME_open_audio_stream)(void* handle, CB_GameLib* cb, GAME_AUDIO_CODEC, const GAME_AUDIO_CHANNEL*);
219 int (*GAME_add_stream_data)(void* handle, CB_GameLib* cb, GAME_STREAM_TYPE, const uint8_t*, unsigned int);
220 int (*GAME_close_stream)(void* handle, CB_GameLib* cb, GAME_STREAM_TYPE);
221 void (*GAME_enable_hardware_rendering)(void* handle, CB_GameLib* cb, const struct game_hw_info*);
222 uintptr_t (*GAME_hw_get_current_framebuffer)(void* handle, CB_GameLib* cb);
223 game_proc_address_t (*GAME_hw_get_proc_address)(void* handle, CB_GameLib* cb, const char*);
224 void (*GAME_render_frame)(void* handle, CB_GameLib* cb);
225 bool (*GAME_open_port)(void* handle, CB_GameLib* cb, unsigned int);
226 void (*GAME_close_port)(void* handle, CB_GameLib* cb, unsigned int);
227 bool (*GAME_input_event)(void* handle, CB_GameLib* cb, const game_input_event* event);
228
229private:
230 void* m_handle;
231 CB_GameLib* m_callbacks;
232 void* m_libKODI_game;
233
234 struct cb_array
235 {
236 const char* libBasePath;
237 };
238};
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
index 3fe12c9..b699fa0 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
@@ -615,7 +615,6 @@ public:
615 615
616private: 616private:
617 CAddonGUIWindow *m_Window; 617 CAddonGUIWindow *m_Window;
618 int m_ControlId;
619 GUIHANDLE m_SpinHandle; 618 GUIHANDLE m_SpinHandle;
620 void *m_Handle; 619 void *m_Handle;
621 void *m_cb; 620 void *m_cb;
@@ -634,7 +633,6 @@ public:
634 633
635private: 634private:
636 CAddonGUIWindow *m_Window; 635 CAddonGUIWindow *m_Window;
637 int m_ControlId;
638 GUIHANDLE m_ButtonHandle; 636 GUIHANDLE m_ButtonHandle;
639 void *m_Handle; 637 void *m_Handle;
640 void *m_cb; 638 void *m_cb;
@@ -654,7 +652,6 @@ public:
654 652
655private: 653private:
656 CAddonGUIWindow *m_Window; 654 CAddonGUIWindow *m_Window;
657 int m_ControlId;
658 GUIHANDLE m_ProgressHandle; 655 GUIHANDLE m_ProgressHandle;
659 void *m_Handle; 656 void *m_Handle;
660 void *m_cb; 657 void *m_cb;
@@ -684,7 +681,6 @@ public:
684 681
685private: 682private:
686 CAddonGUIWindow *m_Window; 683 CAddonGUIWindow *m_Window;
687 int m_ControlId;
688 GUIHANDLE m_SliderHandle; 684 GUIHANDLE m_SliderHandle;
689 void *m_Handle; 685 void *m_Handle;
690 void *m_cb; 686 void *m_cb;
@@ -715,7 +711,6 @@ public:
715 711
716private: 712private:
717 CAddonGUIWindow *m_Window; 713 CAddonGUIWindow *m_Window;
718 int m_ControlId;
719 GUIHANDLE m_SettingsSliderHandle; 714 GUIHANDLE m_SettingsSliderHandle;
720 void *m_Handle; 715 void *m_Handle;
721 void *m_cb; 716 void *m_cb;
@@ -825,7 +820,6 @@ public:
825 820
826private: 821private:
827 CAddonGUIWindow *m_Window; 822 CAddonGUIWindow *m_Window;
828 int m_ControlId;
829 GUIHANDLE m_RenderingHandle; 823 GUIHANDLE m_RenderingHandle;
830 void *m_Handle; 824 void *m_Handle;
831 void *m_cb; 825 void *m_cb;
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
index a6e83cb..c55a42b 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
@@ -33,27 +33,40 @@
33#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" 33#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h"
34#endif 34#endif
35 35
36#define INPUTSTREAM_HELPER_DLL KODI_DLL("inputstream")
37#define INPUTSTREAM_HELPER_DLL_NAME KODI_DLL_NAME("inputstream")
38
39/* current input stream API version */ 36/* current input stream API version */
40#define KODI_INPUTSTREAM_API_VERSION "1.0.0" 37#define KODI_INPUTSTREAM_API_VERSION "1.0.0"
41 38
39namespace KodiAPI
40{
41namespace V1
42{
43namespace InputStream
44{
45
46typedef struct CB_INPUTSTREAMLib
47{
48 void (*FreeDemuxPacket)(void *addonData, DemuxPacket* pPacket);
49 DemuxPacket* (*AllocateDemuxPacket)(void *addonData, int iDataSize);
50} CB_INPUTSTREAMLib;
51
52} /* namespace InputStream */
53} /* namespace V1 */
54} /* namespace KodiAPI */
55
42class CHelper_libKODI_inputstream 56class CHelper_libKODI_inputstream
43{ 57{
44public: 58public:
45 CHelper_libKODI_inputstream(void) 59 CHelper_libKODI_inputstream(void)
46 { 60 {
47 m_libKODI_inputstream = nullptr;
48 m_Handle = nullptr; 61 m_Handle = nullptr;
62 m_Callbacks = nullptr;
49 } 63 }
50 64
51 ~CHelper_libKODI_inputstream(void) 65 ~CHelper_libKODI_inputstream(void)
52 { 66 {
53 if (m_libKODI_inputstream) 67 if (m_Handle && m_Callbacks)
54 { 68 {
55 INPUTSTREAM_unregister_me(m_Handle, m_Callbacks); 69 m_Handle->INPUTSTREAMLib_UnRegisterMe(m_Handle->addonData, m_Callbacks);
56 dlclose(m_libKODI_inputstream);
57 } 70 }
58 } 71 }
59 72
@@ -64,52 +77,12 @@ public:
64 */ 77 */
65 bool RegisterMe(void* handle) 78 bool RegisterMe(void* handle)
66 { 79 {
67 m_Handle = handle; 80 m_Handle = static_cast<AddonCB*>(handle);
68 81 if (m_Handle)
69 std::string libBasePath; 82 m_Callbacks = (KodiAPI::V1::InputStream::CB_INPUTSTREAMLib*)m_Handle->INPUTSTREAMLib_RegisterMe(m_Handle->addonData);
70 libBasePath = ((cb_array*)m_Handle)->libPath; 83 if (!m_Callbacks)
71 libBasePath += INPUTSTREAM_HELPER_DLL; 84 fprintf(stderr, "libKODI_inputstream-ERROR: InputStream_RegisterMe can't get callback table from Kodi !!!\n");
72
73 m_libKODI_inputstream = dlopen(libBasePath.c_str(), RTLD_LAZY);
74 if (m_libKODI_inputstream == nullptr)
75 {
76 fprintf(stderr, "Unable to load %s\n", dlerror());
77 return false;
78 }
79
80 INPUTSTREAM_register_me = (void* (*)(void *HANDLE))
81 dlsym(m_libKODI_inputstream, "INPUTSTREAM_register_me");
82 if (INPUTSTREAM_register_me == nullptr)
83 {
84 fprintf(stderr, "Unable to assign function %s\n", dlerror());
85 return false;
86 }
87 85
88 INPUTSTREAM_unregister_me = (void (*)(void* HANDLE, void* CB))
89 dlsym(m_libKODI_inputstream, "INPUTSTREAM_unregister_me");
90 if (INPUTSTREAM_unregister_me == nullptr)
91 {
92 fprintf(stderr, "Unable to assign function %s\n", dlerror());
93 return false;
94 }
95
96 INPUTSTREAM_free_demux_packet = (void (*)(void* HANDLE, void* CB, DemuxPacket* pPacket))
97 dlsym(m_libKODI_inputstream, "INPUTSTREAM_free_demux_packet");
98 if (INPUTSTREAM_free_demux_packet == NULL)
99 {
100 fprintf(stderr, "Unable to assign function %s\n", dlerror());
101 return false;
102 }
103
104 INPUTSTREAM_allocate_demux_packet = (DemuxPacket* (*)(void* HANDLE, void* CB, int iDataSize))
105 dlsym(m_libKODI_inputstream, "INPUTSTREAM_allocate_demux_packet");
106 if (INPUTSTREAM_allocate_demux_packet == NULL)
107 {
108 fprintf(stderr, "Unable to assign function %s\n", dlerror());
109 return false;
110 }
111
112 m_Callbacks = INPUTSTREAM_register_me(m_Handle);
113 return m_Callbacks != nullptr; 86 return m_Callbacks != nullptr;
114 } 87 }
115 88
@@ -120,7 +93,7 @@ public:
120 */ 93 */
121 DemuxPacket* AllocateDemuxPacket(int iDataSize) 94 DemuxPacket* AllocateDemuxPacket(int iDataSize)
122 { 95 {
123 return INPUTSTREAM_allocate_demux_packet(m_Handle, m_Callbacks, iDataSize); 96 return m_Callbacks->AllocateDemuxPacket(m_Handle->addonData, iDataSize);
124 } 97 }
125 98
126 /*! 99 /*!
@@ -129,21 +102,10 @@ public:
129 */ 102 */
130 void FreeDemuxPacket(DemuxPacket* pPacket) 103 void FreeDemuxPacket(DemuxPacket* pPacket)
131 { 104 {
132 return INPUTSTREAM_free_demux_packet(m_Handle, m_Callbacks, pPacket); 105 return m_Callbacks->FreeDemuxPacket(m_Handle->addonData, pPacket);
133 } 106 }
134 107
135protected:
136 void* (*INPUTSTREAM_register_me)(void*);
137 void (*INPUTSTREAM_unregister_me)(void*, void*);
138 void (*INPUTSTREAM_free_demux_packet)(void*, void*, DemuxPacket*);
139 DemuxPacket* (*INPUTSTREAM_allocate_demux_packet)(void*, void*, int);
140
141private: 108private:
142 void* m_libKODI_inputstream; 109 AddonCB* m_Handle;
143 void* m_Handle; 110 KodiAPI::V1::InputStream::CB_INPUTSTREAMLib* m_Callbacks;
144 void* m_Callbacks;
145 struct cb_array
146 {
147 const char* libPath;
148 };
149}; 111};
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
index 70bd19b..d9f72c1 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
@@ -116,6 +116,49 @@ typedef intptr_t ssize_t;
116/* current addon API version */ 116/* current addon API version */
117#define KODI_ADDON_API_VERSION "1.0.0" 117#define KODI_ADDON_API_VERSION "1.0.0"
118 118
119typedef void* (*KODIAddOnLib_RegisterMe)(void *addonData);
120typedef void (*KODIAddOnLib_UnRegisterMe)(void *addonData, void *cbTable);
121typedef void* (*KODIAudioEngineLib_RegisterMe)(void *addonData);
122typedef void (*KODIAudioEngineLib_UnRegisterMe)(void *addonData, void *cbTable);
123typedef void* (*KODIGUILib_RegisterMe)(void *addonData);
124typedef void (*KODIGUILib_UnRegisterMe)(void *addonData, void *cbTable);
125typedef void* (*KODIPVRLib_RegisterMe)(void *addonData);
126typedef void (*KODIPVRLib_UnRegisterMe)(void *addonData, void *cbTable);
127typedef void* (*KODIADSPLib_RegisterMe)(void *addonData);
128typedef void (*KODIADSPLib_UnRegisterMe)(void *addonData, void *cbTable);
129typedef void* (*KODICodecLib_RegisterMe)(void *addonData);
130typedef void (*KODICodecLib_UnRegisterMe)(void *addonData, void *cbTable);
131typedef void* (*KODIINPUTSTREAMLib_RegisterMe)(void *addonData);
132typedef void (*KODIINPUTSTREAMLib_UnRegisterMe)(void *addonData, void *cbTable);
133typedef void* (*KODIPeripheralLib_RegisterMe)(void *addonData);
134typedef void (*KODIPeripheralLib_UnRegisterMe)(void *addonData, void *cbTable);
135typedef void* (*KODIGameLib_RegisterMe)(void *addonData);
136typedef void (*KODIGameLib_UnRegisterMe)(void *addonData, void *cbTable);
137
138typedef struct AddonCB
139{
140 const char* libBasePath; ///< Never, never change this!!!
141 void* addonData;
142 KODIAddOnLib_RegisterMe AddOnLib_RegisterMe;
143 KODIAddOnLib_UnRegisterMe AddOnLib_UnRegisterMe;
144 KODIAudioEngineLib_RegisterMe AudioEngineLib_RegisterMe;
145 KODIAudioEngineLib_UnRegisterMe AudioEngineLib_UnRegisterMe;
146 KODICodecLib_RegisterMe CodecLib_RegisterMe;
147 KODICodecLib_UnRegisterMe CodecLib_UnRegisterMe;
148 KODIGUILib_RegisterMe GUILib_RegisterMe;
149 KODIGUILib_UnRegisterMe GUILib_UnRegisterMe;
150 KODIPVRLib_RegisterMe PVRLib_RegisterMe;
151 KODIPVRLib_UnRegisterMe PVRLib_UnRegisterMe;
152 KODIADSPLib_RegisterMe ADSPLib_RegisterMe;
153 KODIADSPLib_UnRegisterMe ADSPLib_UnRegisterMe;
154 KODIINPUTSTREAMLib_RegisterMe INPUTSTREAMLib_RegisterMe;
155 KODIINPUTSTREAMLib_UnRegisterMe INPUTSTREAMLib_UnRegisterMe;
156 KODIPeripheralLib_RegisterMe PeripheralLib_RegisterMe;
157 KODIPeripheralLib_UnRegisterMe PeripheralLib_UnRegisterMe;
158 KODIGameLib_RegisterMe GameLib_RegisterMe;
159 KODIGameLib_UnRegisterMe GameLib_UnRegisterMe;
160} AddonCB;
161
119namespace ADDON 162namespace ADDON
120{ 163{
121 typedef enum addon_log 164 typedef enum addon_log
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
index a769328..3ae30a7 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
@@ -27,29 +27,60 @@
27#include "xbmc_pvr_types.h" 27#include "xbmc_pvr_types.h"
28#include "libXBMC_addon.h" 28#include "libXBMC_addon.h"
29 29
30#define PVR_HELPER_DLL_NAME XBMC_DLL_NAME("pvr")
31#define PVR_HELPER_DLL XBMC_DLL("pvr")
32
33#define DVD_TIME_BASE 1000000 30#define DVD_TIME_BASE 1000000
34 31
35//! @todo original definition is in DVDClock.h 32//! @todo original definition is in DVDClock.h
36#define DVD_NOPTS_VALUE 0xFFF0000000000000 33#define DVD_NOPTS_VALUE 0xFFF0000000000000
37 34
35namespace KodiAPI
36{
37namespace V1
38{
39namespace PVR
40{
41
42typedef struct CB_PVRLib
43{
44 void (*TransferEpgEntry)(void *userData, const ADDON_HANDLE handle, const EPG_TAG *epgentry);
45 void (*TransferChannelEntry)(void *userData, const ADDON_HANDLE handle, const PVR_CHANNEL *chan);
46 void (*TransferTimerEntry)(void *userData, const ADDON_HANDLE handle, const PVR_TIMER *timer);
47 void (*TransferRecordingEntry)(void *userData, const ADDON_HANDLE handle, const PVR_RECORDING *recording);
48 void (*AddMenuHook)(void *addonData, PVR_MENUHOOK *hook);
49 void (*Recording)(void *addonData, const char *Name, const char *FileName, bool On);
50 void (*TriggerChannelUpdate)(void *addonData);
51 void (*TriggerTimerUpdate)(void *addonData);
52 void (*TriggerRecordingUpdate)(void *addonData);
53 void (*TriggerChannelGroupsUpdate)(void *addonData);
54 void (*TriggerEpgUpdate)(void *addonData, unsigned int iChannelUid);
55
56 void (*TransferChannelGroup)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group);
57 void (*TransferChannelGroupMember)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
58
59 void (*FreeDemuxPacket)(void *addonData, DemuxPacket* pPacket);
60 DemuxPacket* (*AllocateDemuxPacket)(void *addonData, int iDataSize);
61
62 void (*ConnectionStateChange)(void* addonData, const char* strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage);
63 void (*EpgEventStateChange)(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState);
64} CB_PVRLib;
65
66} /* namespace PVR */
67} /* namespace V1 */
68} /* namespace KodiAPI */
69
38class CHelper_libXBMC_pvr 70class CHelper_libXBMC_pvr
39{ 71{
40public: 72public:
41 CHelper_libXBMC_pvr(void) 73 CHelper_libXBMC_pvr(void)
42 { 74 {
43 m_libXBMC_pvr = NULL; 75 m_Handle = nullptr;
44 m_Handle = NULL; 76 m_Callbacks = nullptr;
45 } 77 }
46 78
47 ~CHelper_libXBMC_pvr(void) 79 ~CHelper_libXBMC_pvr(void)
48 { 80 {
49 if (m_libXBMC_pvr) 81 if (m_Handle && m_Callbacks)
50 { 82 {
51 PVR_unregister_me(m_Handle, m_Callbacks); 83 m_Handle->PVRLib_UnRegisterMe(m_Handle->addonData, m_Callbacks);
52 dlclose(m_libXBMC_pvr);
53 } 84 }
54 } 85 }
55 86
@@ -60,98 +91,12 @@ public:
60 */ 91 */
61 bool RegisterMe(void* handle) 92 bool RegisterMe(void* handle)
62 { 93 {
63 m_Handle = handle; 94 m_Handle = static_cast<AddonCB*>(handle);
64 95 if (m_Handle)
65 std::string libBasePath; 96 m_Callbacks = (KodiAPI::V1::PVR::CB_PVRLib*)m_Handle->PVRLib_RegisterMe(m_Handle->addonData);
66 libBasePath = ((cb_array*)m_Handle)->libPath; 97 if (!m_Callbacks)
67 libBasePath += PVR_HELPER_DLL; 98 fprintf(stderr, "libXBMC_pvr-ERROR: PVRLib_register_me can't get callback table from Kodi !!!\n");
68 99
69 m_libXBMC_pvr = dlopen(libBasePath.c_str(), RTLD_LAZY);
70 if (m_libXBMC_pvr == NULL)
71 {
72 fprintf(stderr, "Unable to load %s\n", dlerror());
73 return false;
74 }
75
76 PVR_register_me = (void* (*)(void *HANDLE))
77 dlsym(m_libXBMC_pvr, "PVR_register_me");
78 if (PVR_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
79
80 PVR_unregister_me = (void (*)(void* HANDLE, void* CB))
81 dlsym(m_libXBMC_pvr, "PVR_unregister_me");
82 if (PVR_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
83
84 PVR_transfer_epg_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const EPG_TAG *epgentry))
85 dlsym(m_libXBMC_pvr, "PVR_transfer_epg_entry");
86 if (PVR_transfer_epg_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
87
88 PVR_transfer_channel_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_CHANNEL *chan))
89 dlsym(m_libXBMC_pvr, "PVR_transfer_channel_entry");
90 if (PVR_transfer_channel_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
91
92 PVR_transfer_timer_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_TIMER *timer))
93 dlsym(m_libXBMC_pvr, "PVR_transfer_timer_entry");
94 if (PVR_transfer_timer_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
95
96 PVR_transfer_recording_entry = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_RECORDING *recording))
97 dlsym(m_libXBMC_pvr, "PVR_transfer_recording_entry");
98 if (PVR_transfer_recording_entry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
99
100 PVR_add_menu_hook = (void (*)(void* HANDLE, void* CB, PVR_MENUHOOK *hook))
101 dlsym(m_libXBMC_pvr, "PVR_add_menu_hook");
102 if (PVR_add_menu_hook == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
103
104 PVR_recording = (void (*)(void* HANDLE, void* CB, const char *Name, const char *FileName, bool On))
105 dlsym(m_libXBMC_pvr, "PVR_recording");
106 if (PVR_recording == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
107
108 PVR_trigger_timer_update = (void (*)(void* HANDLE, void* CB))
109 dlsym(m_libXBMC_pvr, "PVR_trigger_timer_update");
110 if (PVR_trigger_timer_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
111
112 PVR_trigger_recording_update = (void (*)(void* HANDLE, void* CB))
113 dlsym(m_libXBMC_pvr, "PVR_trigger_recording_update");
114 if (PVR_trigger_recording_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
115
116 PVR_trigger_channel_update = (void (*)(void* HANDLE, void* CB))
117 dlsym(m_libXBMC_pvr, "PVR_trigger_channel_update");
118 if (PVR_trigger_channel_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
119
120 PVR_trigger_channel_groups_update = (void (*)(void* HANDLE, void* CB))
121 dlsym(m_libXBMC_pvr, "PVR_trigger_channel_groups_update");
122 if (PVR_trigger_channel_groups_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
123
124 PVR_trigger_epg_update = (void (*)(void* HANDLE, void* CB, unsigned int iChannelUid))
125 dlsym(m_libXBMC_pvr, "PVR_trigger_epg_update");
126 if (PVR_trigger_epg_update == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
127
128 PVR_transfer_channel_group = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group))
129 dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group");
130 if (PVR_transfer_channel_group == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
131
132 PVR_transfer_channel_group_member = (void (*)(void* HANDLE, void* CB, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member))
133 dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group_member");
134 if (PVR_transfer_channel_group_member == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
135
136#ifdef USE_DEMUX
137 PVR_free_demux_packet = (void (*)(void* HANDLE, void* CB, DemuxPacket* pPacket))
138 dlsym(m_libXBMC_pvr, "PVR_free_demux_packet");
139 if (PVR_free_demux_packet == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
140
141 PVR_allocate_demux_packet = (DemuxPacket* (*)(void* HANDLE, void* CB, int iDataSize))
142 dlsym(m_libXBMC_pvr, "PVR_allocate_demux_packet");
143 if (PVR_allocate_demux_packet == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
144#endif
145
146 PVR_connection_state_change = (void (*)(void* HANDLE, void* CB, const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage))
147 dlsym(m_libXBMC_pvr, "PVR_connection_state_change");
148 if (PVR_connection_state_change == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
149
150 PVR_epg_event_state_change = (void (*)(void* HANDLE, void* CB, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState))
151 dlsym(m_libXBMC_pvr, "PVR_epg_event_state_change");
152 if (PVR_epg_event_state_change == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
153
154 m_Callbacks = PVR_register_me(m_Handle);
155 return m_Callbacks != NULL; 100 return m_Callbacks != NULL;
156 } 101 }
157 102
@@ -162,7 +107,7 @@ public:
162 */ 107 */
163 void TransferEpgEntry(const ADDON_HANDLE handle, const EPG_TAG* entry) 108 void TransferEpgEntry(const ADDON_HANDLE handle, const EPG_TAG* entry)
164 { 109 {
165 return PVR_transfer_epg_entry(m_Handle, m_Callbacks, handle, entry); 110 return m_Callbacks->TransferEpgEntry(m_Handle->addonData, handle, entry);
166 } 111 }
167 112
168 /*! 113 /*!
@@ -172,7 +117,7 @@ public:
172 */ 117 */
173 void TransferChannelEntry(const ADDON_HANDLE handle, const PVR_CHANNEL* entry) 118 void TransferChannelEntry(const ADDON_HANDLE handle, const PVR_CHANNEL* entry)
174 { 119 {
175 return PVR_transfer_channel_entry(m_Handle, m_Callbacks, handle, entry); 120 return m_Callbacks->TransferChannelEntry(m_Handle->addonData, handle, entry);
176 } 121 }
177 122
178 /*! 123 /*!
@@ -182,7 +127,7 @@ public:
182 */ 127 */
183 void TransferTimerEntry(const ADDON_HANDLE handle, const PVR_TIMER* entry) 128 void TransferTimerEntry(const ADDON_HANDLE handle, const PVR_TIMER* entry)
184 { 129 {
185 return PVR_transfer_timer_entry(m_Handle, m_Callbacks, handle, entry); 130 return m_Callbacks->TransferTimerEntry(m_Handle->addonData, handle, entry);
186 } 131 }
187 132
188 /*! 133 /*!
@@ -192,7 +137,7 @@ public:
192 */ 137 */
193 void TransferRecordingEntry(const ADDON_HANDLE handle, const PVR_RECORDING* entry) 138 void TransferRecordingEntry(const ADDON_HANDLE handle, const PVR_RECORDING* entry)
194 { 139 {
195 return PVR_transfer_recording_entry(m_Handle, m_Callbacks, handle, entry); 140 return m_Callbacks->TransferRecordingEntry(m_Handle->addonData, handle, entry);
196 } 141 }
197 142
198 /*! 143 /*!
@@ -202,7 +147,7 @@ public:
202 */ 147 */
203 void TransferChannelGroup(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP* entry) 148 void TransferChannelGroup(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP* entry)
204 { 149 {
205 return PVR_transfer_channel_group(m_Handle, m_Callbacks, handle, entry); 150 return m_Callbacks->TransferChannelGroup(m_Handle->addonData, handle, entry);
206 } 151 }
207 152
208 /*! 153 /*!
@@ -212,7 +157,7 @@ public:
212 */ 157 */
213 void TransferChannelGroupMember(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER* entry) 158 void TransferChannelGroupMember(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER* entry)
214 { 159 {
215 return PVR_transfer_channel_group_member(m_Handle, m_Callbacks, handle, entry); 160 return m_Callbacks->TransferChannelGroupMember(m_Handle->addonData, handle, entry);
216 } 161 }
217 162
218 /*! 163 /*!
@@ -221,7 +166,7 @@ public:
221 */ 166 */
222 void AddMenuHook(PVR_MENUHOOK* hook) 167 void AddMenuHook(PVR_MENUHOOK* hook)
223 { 168 {
224 return PVR_add_menu_hook(m_Handle, m_Callbacks, hook); 169 return m_Callbacks->AddMenuHook(m_Handle->addonData, hook);
225 } 170 }
226 171
227 /*! 172 /*!
@@ -232,7 +177,7 @@ public:
232 */ 177 */
233 void Recording(const char* strRecordingName, const char* strFileName, bool bOn) 178 void Recording(const char* strRecordingName, const char* strFileName, bool bOn)
234 { 179 {
235 return PVR_recording(m_Handle, m_Callbacks, strRecordingName, strFileName, bOn); 180 return m_Callbacks->Recording(m_Handle->addonData, strRecordingName, strFileName, bOn);
236 } 181 }
237 182
238 /*! 183 /*!
@@ -240,7 +185,7 @@ public:
240 */ 185 */
241 void TriggerTimerUpdate(void) 186 void TriggerTimerUpdate(void)
242 { 187 {
243 return PVR_trigger_timer_update(m_Handle, m_Callbacks); 188 return m_Callbacks->TriggerTimerUpdate(m_Handle->addonData);
244 } 189 }
245 190
246 /*! 191 /*!
@@ -248,7 +193,7 @@ public:
248 */ 193 */
249 void TriggerRecordingUpdate(void) 194 void TriggerRecordingUpdate(void)
250 { 195 {
251 return PVR_trigger_recording_update(m_Handle, m_Callbacks); 196 return m_Callbacks->TriggerRecordingUpdate(m_Handle->addonData);
252 } 197 }
253 198
254 /*! 199 /*!
@@ -256,7 +201,7 @@ public:
256 */ 201 */
257 void TriggerChannelUpdate(void) 202 void TriggerChannelUpdate(void)
258 { 203 {
259 return PVR_trigger_channel_update(m_Handle, m_Callbacks); 204 return m_Callbacks->TriggerChannelUpdate(m_Handle->addonData);
260 } 205 }
261 206
262 /*! 207 /*!
@@ -265,7 +210,7 @@ public:
265 */ 210 */
266 void TriggerEpgUpdate(unsigned int iChannelUid) 211 void TriggerEpgUpdate(unsigned int iChannelUid)
267 { 212 {
268 return PVR_trigger_epg_update(m_Handle, m_Callbacks, iChannelUid); 213 return m_Callbacks->TriggerEpgUpdate(m_Handle->addonData, iChannelUid);
269 } 214 }
270 215
271 /*! 216 /*!
@@ -273,7 +218,7 @@ public:
273 */ 218 */
274 void TriggerChannelGroupsUpdate(void) 219 void TriggerChannelGroupsUpdate(void)
275 { 220 {
276 return PVR_trigger_channel_groups_update(m_Handle, m_Callbacks); 221 return m_Callbacks->TriggerChannelGroupsUpdate(m_Handle->addonData);
277 } 222 }
278 223
279#ifdef USE_DEMUX 224#ifdef USE_DEMUX
@@ -283,7 +228,7 @@ public:
283 */ 228 */
284 void FreeDemuxPacket(DemuxPacket* pPacket) 229 void FreeDemuxPacket(DemuxPacket* pPacket)
285 { 230 {
286 return PVR_free_demux_packet(m_Handle, m_Callbacks, pPacket); 231 return m_Callbacks->FreeDemuxPacket(m_Handle->addonData, pPacket);
287 } 232 }
288 233
289 /*! 234 /*!
@@ -293,7 +238,7 @@ public:
293 */ 238 */
294 DemuxPacket* AllocateDemuxPacket(int iDataSize) 239 DemuxPacket* AllocateDemuxPacket(int iDataSize)
295 { 240 {
296 return PVR_allocate_demux_packet(m_Handle, m_Callbacks, iDataSize); 241 return m_Callbacks->AllocateDemuxPacket(m_Handle->addonData, iDataSize);
297 } 242 }
298#endif 243#endif
299 244
@@ -306,7 +251,7 @@ public:
306 */ 251 */
307 void ConnectionStateChange(const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage) 252 void ConnectionStateChange(const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage)
308 { 253 {
309 return PVR_connection_state_change(m_Handle, m_Callbacks, strConnectionString, newState, strMessage); 254 return m_Callbacks->ConnectionStateChange(m_Handle->addonData, strConnectionString, newState, strMessage);
310 } 255 }
311 256
312 /*! 257 /*!
@@ -318,38 +263,10 @@ public:
318 */ 263 */
319 void EpgEventStateChange(EPG_TAG *tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState) 264 void EpgEventStateChange(EPG_TAG *tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState)
320 { 265 {
321 return PVR_epg_event_state_change(m_Handle, m_Callbacks, tag, iUniqueChannelId, newState); 266 return m_Callbacks->EpgEventStateChange(m_Handle->addonData, tag, iUniqueChannelId, newState);
322 } 267 }
323 268
324protected:
325 void* (*PVR_register_me)(void*);
326 void (*PVR_unregister_me)(void*, void*);
327 void (*PVR_transfer_epg_entry)(void*, void*, const ADDON_HANDLE, const EPG_TAG*);
328 void (*PVR_transfer_channel_entry)(void*, void*, const ADDON_HANDLE, const PVR_CHANNEL*);
329 void (*PVR_transfer_timer_entry)(void*, void*, const ADDON_HANDLE, const PVR_TIMER*);
330 void (*PVR_transfer_recording_entry)(void*, void*, const ADDON_HANDLE, const PVR_RECORDING*);
331 void (*PVR_add_menu_hook)(void*, void*, PVR_MENUHOOK*);
332 void (*PVR_recording)(void*, void*, const char*, const char*, bool);
333 void (*PVR_trigger_channel_update)(void*, void*);
334 void (*PVR_trigger_channel_groups_update)(void*, void*);
335 void (*PVR_trigger_timer_update)(void*, void*);
336 void (*PVR_trigger_recording_update)(void* , void*);
337 void (*PVR_trigger_epg_update)(void*, void*, unsigned int);
338 void (*PVR_transfer_channel_group)(void*, void*, const ADDON_HANDLE, const PVR_CHANNEL_GROUP*);
339 void (*PVR_transfer_channel_group_member)(void*, void*, const ADDON_HANDLE, const PVR_CHANNEL_GROUP_MEMBER*);
340#ifdef USE_DEMUX
341 void (*PVR_free_demux_packet)(void*, void*, DemuxPacket*);
342 DemuxPacket* (*PVR_allocate_demux_packet)(void*, void*, int);
343#endif
344 void (*PVR_connection_state_change)(void*, void*, const char*, PVR_CONNECTION_STATE, const char*);
345 void (*PVR_epg_event_state_change)(void*, void*, EPG_TAG*, unsigned int, EPG_EVENT_STATE);
346
347private: 269private:
348 void* m_libXBMC_pvr; 270 AddonCB* m_Handle;
349 void* m_Handle; 271 KodiAPI::V1::PVR::CB_PVRLib *m_Callbacks;
350 void* m_Callbacks;
351 struct cb_array
352 {
353 const char* libPath;
354 };
355}; 272};
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
index 2cf558a..57bb129 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
@@ -589,7 +589,7 @@ extern "C"
589 * @return True if the seek operation was possible 589 * @return True if the seek operation was possible
590 * @remarks Optional, and only used if addon has its own demuxer. Return False if this add-on won't provide this function. 590 * @remarks Optional, and only used if addon has its own demuxer. Return False if this add-on won't provide this function.
591 */ 591 */
592 bool SeekTime(int time, bool backwards, double *startpts); 592 bool SeekTime(double time, bool backwards, double *startpts);
593 593
594 /*! 594 /*!
595 * Notify the pvr addon/demuxer that XBMC wishes to change playback speed 595 * Notify the pvr addon/demuxer that XBMC wishes to change playback speed
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 08ae183..dbc7217 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
@@ -78,10 +78,10 @@ struct DemuxPacket;
78#define PVR_STREAM_MAX_STREAMS 20 78#define PVR_STREAM_MAX_STREAMS 20
79 79
80/* current PVR API version */ 80/* current PVR API version */
81#define XBMC_PVR_API_VERSION "5.2.0" 81#define XBMC_PVR_API_VERSION "5.2.1"
82 82
83/* min. PVR API version */ 83/* min. PVR API version */
84#define XBMC_PVR_MIN_API_VERSION "5.2.0" 84#define XBMC_PVR_MIN_API_VERSION "5.2.1"
85 85
86#ifdef __cplusplus 86#ifdef __cplusplus
87extern "C" { 87extern "C" {
@@ -594,7 +594,7 @@ extern "C" {
594 bool (__cdecl* CanPauseStream)(void); 594 bool (__cdecl* CanPauseStream)(void);
595 void (__cdecl* PauseStream)(bool); 595 void (__cdecl* PauseStream)(bool);
596 bool (__cdecl* CanSeekStream)(void); 596 bool (__cdecl* CanSeekStream)(void);
597 bool (__cdecl* SeekTime)(int, bool, double*); 597 bool (__cdecl* SeekTime)(double, bool, double*);
598 void (__cdecl* SetSpeed)(int); 598 void (__cdecl* SetSpeed)(int);
599 time_t (__cdecl* GetPlayingTime)(void); 599 time_t (__cdecl* GetPlayingTime)(void);
600 time_t (__cdecl* GetBufferTimeStart)(void); 600 time_t (__cdecl* GetBufferTimeStart)(void);
diff --git a/xbmc/input/XBMC_vkeys.h b/xbmc/input/XBMC_vkeys.h
new file mode 100644
index 0000000..4e3787c
--- /dev/null
+++ b/xbmc/input/XBMC_vkeys.h
@@ -0,0 +1,286 @@
1/*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with XBMC; see the file COPYING. If not, see
17 <http://www.gnu.org/licenses/>.
18
19 Sam Lantinga
20 slouken@libsdl.org
21*/
22
23#ifndef XBMC_vkeys_h
24#define XBMC_vkeys_h
25
26// The XBMC_vkey identifies a key that is mapped to an action or function.
27// The keysym.sym generated by SDL_KEYDOWN is mapped to a vkey and the vkey
28// is used to lookup an action in the global mapping table.
29// The vkey values are the ASCII code of the character where this is possible.
30// Non-printing keypresses get a value in the range 0x80 - 0xFF.
31// Note that the vkey is a byte value so it cannot be greater than 0xFF.
32
33typedef enum {
34 XBMCVK_BACK = 0x08,
35 XBMCVK_TAB = 0x09,
36 XBMCVK_RETURN = 0x0D,
37 XBMCVK_ESCAPE = 0x1B,
38
39 XBMCVK_SPACE = 0x20,
40 XBMCVK_EXCLAIM = 0x21,
41 XBMCVK_QUOTEDBL = 0x22,
42 XBMCVK_HASH = 0x23,
43 XBMCVK_DOLLAR = 0x24,
44 XBMCVK_PERCENT = 0x25,
45 XBMCVK_AMPERSAND = 0x26,
46 XBMCVK_QUOTE = 0x27,
47 XBMCVK_LEFTPAREN = 0x28,
48 XBMCVK_RIGHTPAREN = 0x29,
49 XBMCVK_ASTERISK = 0x2A,
50 XBMCVK_PLUS = 0x2B,
51 XBMCVK_COMMA = 0x2C,
52 XBMCVK_MINUS = 0x2D,
53 XBMCVK_PERIOD = 0x2E,
54 XBMCVK_SLASH = 0x2F,
55
56 XBMCVK_0 = 0x30,
57 XBMCVK_1 = 0x31,
58 XBMCVK_2 = 0x32,
59 XBMCVK_3 = 0x33,
60 XBMCVK_4 = 0x34,
61 XBMCVK_5 = 0x35,
62 XBMCVK_6 = 0x36,
63 XBMCVK_7 = 0x37,
64 XBMCVK_8 = 0x38,
65 XBMCVK_9 = 0x39,
66
67 XBMCVK_COLON = 0x3A,
68 XBMCVK_SEMICOLON = 0x3B,
69 XBMCVK_LESS = 0x3C,
70 XBMCVK_EQUALS = 0x3D,
71 XBMCVK_GREATER = 0x3E,
72 XBMCVK_QUESTION = 0x3F,
73 XBMCVK_AT = 0x40,
74
75 XBMCVK_A = 0x41,
76 XBMCVK_B = 0x42,
77 XBMCVK_C = 0x43,
78 XBMCVK_D = 0x44,
79 XBMCVK_E = 0x45,
80 XBMCVK_F = 0x46,
81 XBMCVK_G = 0x47,
82 XBMCVK_H = 0x48,
83 XBMCVK_I = 0x49,
84 XBMCVK_J = 0x4A,
85 XBMCVK_K = 0x4B,
86 XBMCVK_L = 0x4C,
87 XBMCVK_M = 0x4D,
88 XBMCVK_N = 0x4E,
89 XBMCVK_O = 0x4F,
90 XBMCVK_P = 0x50,
91 XBMCVK_Q = 0x51,
92 XBMCVK_R = 0x52,
93 XBMCVK_S = 0x53,
94 XBMCVK_T = 0x54,
95 XBMCVK_U = 0x55,
96 XBMCVK_V = 0x56,
97 XBMCVK_W = 0x57,
98 XBMCVK_X = 0x58,
99 XBMCVK_Y = 0x59,
100 XBMCVK_Z = 0x5A,
101
102 XBMCVK_LEFTBRACKET = 0x5B,
103 XBMCVK_BACKSLASH = 0x5C,
104 XBMCVK_RIGHTBRACKET = 0x5D,
105 XBMCVK_CARET = 0x5E,
106 XBMCVK_UNDERSCORE = 0x5F,
107 XBMCVK_BACKQUOTE = 0x60,
108
109// Lowercase letters 0x61 - 0x7a have the same vkey as uppercase, so
110// use this block for the numpad keys
111 XBMCVK_NUMPADDIVIDE = 0x61,
112 XBMCVK_NUMPADTIMES = 0x62,
113 XBMCVK_NUMPADMINUS = 0x63,
114 XBMCVK_NUMPADPLUS = 0x64,
115 XBMCVK_NUMPADENTER = 0x65,
116 XBMCVK_NUMPADPERIOD = 0x66,
117 XBMCVK_NUMPAD0 = 0x70,
118 XBMCVK_NUMPAD1 = 0x71,
119 XBMCVK_NUMPAD2 = 0x72,
120 XBMCVK_NUMPAD3 = 0x73,
121 XBMCVK_NUMPAD4 = 0x74,
122 XBMCVK_NUMPAD5 = 0x75,
123 XBMCVK_NUMPAD6 = 0x76,
124 XBMCVK_NUMPAD7 = 0x77,
125 XBMCVK_NUMPAD8 = 0x78,
126 XBMCVK_NUMPAD9 = 0x79,
127
128 XBMCVK_LEFTBRACE = 0x7B,
129 XBMCVK_PIPE = 0x7C,
130 XBMCVK_RIGHTBRACE = 0x7D,
131 XBMCVK_TILDE = 0x7E,
132
133// Non-printing characters
134
135 XBMCVK_UP = 0x80,
136 XBMCVK_DOWN = 0x81,
137 XBMCVK_LEFT = 0x82,
138 XBMCVK_RIGHT = 0x83,
139 XBMCVK_PAGEUP = 0x84,
140 XBMCVK_PAGEDOWN = 0x85,
141 XBMCVK_INSERT = 0x86,
142 XBMCVK_DELETE = 0x87,
143 XBMCVK_HOME = 0x88,
144 XBMCVK_END = 0x89,
145
146 XBMCVK_F1 = 0x90,
147 XBMCVK_F2 = 0x91,
148 XBMCVK_F3 = 0x92,
149 XBMCVK_F4 = 0x93,
150 XBMCVK_F5 = 0x94,
151 XBMCVK_F6 = 0x95,
152 XBMCVK_F7 = 0x96,
153 XBMCVK_F8 = 0x97,
154 XBMCVK_F9 = 0x98,
155 XBMCVK_F10 = 0x99,
156 XBMCVK_F11 = 0x9A,
157 XBMCVK_F12 = 0x9B,
158 XBMCVK_F13 = 0x9C,
159 XBMCVK_F14 = 0x9D,
160 XBMCVK_F15 = 0x9E,
161 XBMCVK_F16 = 0x9F,
162 XBMCVK_F17 = 0xA0,
163 XBMCVK_F18 = 0xA1,
164 XBMCVK_F19 = 0xA2,
165 XBMCVK_F20 = 0xA3,
166 XBMCVK_F21 = 0xA4,
167 XBMCVK_F22 = 0xA5,
168 XBMCVK_F23 = 0xA6,
169 XBMCVK_F24 = 0xA7,
170
171 XBMCVK_BROWSER_BACK = 0xB0,
172 XBMCVK_BROWSER_FORWARD = 0xB1,
173 XBMCVK_BROWSER_REFRESH = 0xB2,
174 XBMCVK_BROWSER_STOP = 0xB3,
175 XBMCVK_BROWSER_SEARCH = 0xB4,
176 XBMCVK_BROWSER_FAVORITES = 0xB5,
177 XBMCVK_BROWSER_HOME = 0xB6,
178 XBMCVK_VOLUME_MUTE = 0xB7,
179 XBMCVK_VOLUME_DOWN = 0xB8,
180 XBMCVK_VOLUME_UP = 0xB9,
181 XBMCVK_MEDIA_NEXT_TRACK = 0xBA,
182 XBMCVK_MEDIA_PREV_TRACK = 0xBB,
183 XBMCVK_MEDIA_STOP = 0xBC,
184 XBMCVK_MEDIA_PLAY_PAUSE = 0xBD,
185 XBMCVK_LAUNCH_MAIL = 0xBE,
186 XBMCVK_LAUNCH_MEDIA_SELECT = 0xBF,
187 XBMCVK_LAUNCH_APP1 = 0xC0,
188 XBMCVK_LAUNCH_APP2 = 0xC1,
189 XBMCVK_LAUNCH_FILE_BROWSER = 0xC2,
190 XBMCVK_LAUNCH_MEDIA_CENTER = 0xC3,
191 XBMCVK_MEDIA_REWIND = 0xC4,
192 XBMCVK_MEDIA_FASTFORWARD = 0xC5,
193 XBMCVK_MEDIA_RECORD = 0xC6,
194
195 XBMCVK_LCONTROL = 0xD0,
196 XBMCVK_RCONTROL = 0xD1,
197 XBMCVK_LSHIFT = 0xD2,
198 XBMCVK_RSHIFT = 0xD3,
199 XBMCVK_LMENU = 0xD4,
200 XBMCVK_RMENU = 0xD5,
201 XBMCVK_LWIN = 0xD6,
202 XBMCVK_RWIN = 0xD7,
203 XBMCVK_MENU = 0xD8,
204 XBMCVK_CAPSLOCK = 0xD9,
205 XBMCVK_NUMLOCK = 0xDA,
206
207 XBMCVK_PRINTSCREEN = 0xDB,
208 XBMCVK_SCROLLLOCK = 0xDC,
209 XBMCVK_PAUSE = 0XDD,
210 XBMCVK_POWER = 0XDE,
211 XBMCVK_SLEEP = 0XDF,
212 XBMCVK_GUIDE = 0xE0,
213 XBMCVK_SETTINGS = 0xE1,
214 XBMCVK_INFO = 0xE2,
215 XBMCVK_RED = 0xE3,
216 XBMCVK_GREEN = 0xE4,
217 XBMCVK_YELLOW = 0xE5,
218 XBMCVK_BLUE = 0xE6,
219 XBMCVK_ZOOM = 0xE7,
220 XBMCVK_TEXT = 0xE8,
221 XBMCVK_FAVORITES = 0xE9,
222 XBMCVK_HOMEPAGE = 0xEA,
223 XBMCVK_CONFIG = 0xEB,
224 XBMCVK_EPG = 0xEC,
225
226 XBMCVK_LAST = 0xFF
227} XBMCVKey;
228
229// These should be in winuser.h. Not sure why they have been defined here
230#ifndef VK_0
231#define VK_0 '0'
232#define VK_1 '1'
233#define VK_2 '2'
234#define VK_3 '3'
235#define VK_4 '4'
236#define VK_5 '5'
237#define VK_6 '6'
238#define VK_7 '7'
239#define VK_8 '8'
240#define VK_9 '9'
241#define VK_A 'A'
242#define VK_B 'B'
243#define VK_C 'C'
244#define VK_D 'D'
245#define VK_E 'E'
246#define VK_F 'F'
247#define VK_G 'G'
248#define VK_H 'H'
249#define VK_I 'I'
250#define VK_J 'J'
251#define VK_K 'K'
252#define VK_L 'L'
253#define VK_M 'M'
254#define VK_N 'N'
255#define VK_O 'O'
256#define VK_P 'P'
257#define VK_Q 'Q'
258#define VK_R 'R'
259#define VK_S 'S'
260#define VK_T 'T'
261#define VK_U 'U'
262#define VK_V 'V'
263#define VK_W 'W'
264#define VK_X 'X'
265#define VK_Y 'Y'
266#define VK_Z 'Z'
267#endif /* VK_0 */
268
269/* These keys haven't been defined, but were experimentally determined */
270#ifndef VK_SEMICOLON
271#define VK_SEMICOLON 0xBA
272#define VK_EQUALS 0xBB
273#define VK_COMMA 0xBC
274#define VK_MINUS 0xBD
275#define VK_PERIOD 0xBE
276#define VK_SLASH 0xBF
277#define VK_GRAVE 0xC0
278#define VK_LBRACKET 0xDB
279#define VK_BACKSLASH 0xDC
280#define VK_RBRACKET 0xDD
281#define VK_APOSTROPHE 0xDE
282#define VK_BACKTICK 0xDF
283#define VK_OEM_102 0xE2
284#endif
285
286#endif // XBMC_vkeys_h