diff options
| author | manuel <manuel@mausz.at> | 2018-04-17 00:15:38 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2018-04-17 00:15:38 +0200 |
| commit | b3d195f0188758a14875a5a2f270e4fd190a679f (patch) | |
| tree | cbe6a2d51afd7be095e29fd612107044cf1f391e | |
| parent | a51f51db67e3eab80ac2ed28d403a6d77f7acc45 (diff) | |
| download | kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.tar.gz kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.tar.bz2 kodi-pvr-build-b3d195f0188758a14875a5a2f270e4fd190a679f.zip | |
sync with upstream
91 files changed, 1228 insertions, 2475 deletions
diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in index 58dfc40..2a572e7 100644 --- a/cmake/KodiConfig.cmake.in +++ b/cmake/KodiConfig.cmake.in | |||
| @@ -16,6 +16,7 @@ endif() | |||
| 16 | if(NOT @APP_NAME_UC@_DATA_DIR) | 16 | if(NOT @APP_NAME_UC@_DATA_DIR) |
| 17 | set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@) | 17 | set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@) |
| 18 | endif() | 18 | endif() |
| 19 | set(APP_RENDER_SYSTEM @APP_RENDER_SYSTEM@) | ||
| 19 | if(NOT WIN32) | 20 | if(NOT WIN32) |
| 20 | set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") | 21 | set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") |
| 21 | endif() | 22 | endif() |
diff --git a/cmake/README.md b/cmake/README.md index 0848f2d..c1b953f 100644 --- a/cmake/README.md +++ b/cmake/README.md | |||
| @@ -36,7 +36,7 @@ dependencies have to be installed as explained in | |||
| 36 | ### Windows | 36 | ### Windows |
| 37 | 37 | ||
| 38 | For Windows the dependencies can be found in the | 38 | For Windows the dependencies can be found in the |
| 39 | [Wiki](http://kodi.wiki/view/HOW-TO:Compile_Kodi_for_Windows) (Step 1-4). If not already available on your pc, you should | 39 | [Wiki](https://kodi.wiki/view/HOW-TO:Compile_Kodi_for_Windows#Setting_up_the_build_Environment) (Step 1-4). If not already available on your pc, you should |
| 40 | install the [Windows Software Development Kit (SDK)](https://dev.windows.com/en-us/downloads/sdk-archive) for your Windows version. This is required for HLSL shader offline compiling with the [Effect-Compiler Tool](https://msdn.microsoft.com/de-de/library/windows/desktop/bb232919(v=vs.85).aspx) (fxc.exe). | 40 | install the [Windows Software Development Kit (SDK)](https://dev.windows.com/en-us/downloads/sdk-archive) for your Windows version. This is required for HLSL shader offline compiling with the [Effect-Compiler Tool](https://msdn.microsoft.com/de-de/library/windows/desktop/bb232919(v=vs.85).aspx) (fxc.exe). |
| 41 | 41 | ||
| 42 | On Windows, the CMake based buildsystem requires that the binary dependencies | 42 | On Windows, the CMake based buildsystem requires that the binary dependencies |
| @@ -113,6 +113,8 @@ cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) | |||
| 113 | ``` | 113 | ``` |
| 114 | 114 | ||
| 115 | ### Windows with Visual Studio project files | 115 | ### Windows with Visual Studio project files |
| 116 | These instructions are for Visual Studio 2015. If you want to build for Visal Studio 2017, you need to target `Visual Studio 15` instead of `Visual Studio 14`. | ||
| 117 | |||
| 116 | #### Build for win32 | 118 | #### Build for win32 |
| 117 | ``` | 119 | ``` |
| 118 | cmake -G "Visual Studio 14" <KODI_SRC> | 120 | cmake -G "Visual Studio 14" <KODI_SRC> |
diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt index fd1d448..5db5dba 100644 --- a/cmake/addons/CMakeLists.txt +++ b/cmake/addons/CMakeLists.txt | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.1) | 1 | cmake_minimum_required(VERSION 3.3) |
| 2 | project(kodi-addons) | 2 | project(kodi-addons) |
| 3 | 3 | ||
| 4 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) | 4 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) |
| @@ -403,8 +403,12 @@ foreach(addon ${addons}) | |||
| 403 | endif() | 403 | endif() |
| 404 | 404 | ||
| 405 | # create a forwarding target to the addon-package target | 405 | # create a forwarding target to the addon-package target |
| 406 | get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) | ||
| 407 | if(_isMultiConfig) | ||
| 408 | set(config --config $<CONFIG>) | ||
| 409 | endif() | ||
| 406 | add_custom_target(package-${id} | 410 | add_custom_target(package-${id} |
| 407 | COMMAND ${CMAKE_COMMAND} --build ${id}-prefix/src/${id}-build --target addon-package | 411 | COMMAND ${CMAKE_COMMAND} --build ${id}-prefix/src/${id}-build ${config} --target addon-package |
| 408 | DEPENDS ${id}) | 412 | DEPENDS ${id}) |
| 409 | add_dependencies(package-addons package-${id}) | 413 | add_dependencies(package-addons package-${id}) |
| 410 | 414 | ||
diff --git a/cmake/addons/depends/common/kodi-platform/kodi-platform.txt b/cmake/addons/depends/common/kodi-platform/kodi-platform.txt index 1b5c8bf..c553769 100644 --- a/cmake/addons/depends/common/kodi-platform/kodi-platform.txt +++ b/cmake/addons/depends/common/kodi-platform/kodi-platform.txt | |||
| @@ -1 +1 @@ | |||
| kodi-platform https://github.com/xbmc/kodi-platform 36fb49371dbce49bf470a5bb1fc51b74b4a3612d | kodi-platform https://github.com/xbmc/kodi-platform e8574b883ffa2131f2eeb96ff3724d60b21130f7 | ||
diff --git a/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt b/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt deleted file mode 100644 index 02d9724..0000000 --- a/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.1) | ||
| 2 | project(mingw) | ||
| 3 | |||
| 4 | function(generate_mingw32_wrapper cmd) | ||
| 5 | set(CMD ${cmd}) | ||
| 6 | configure_file(${PROJECT_SOURCE_DIR}/mingw32-cmd.bat.in ${MINGW_PATH}/bin/${CMD}.bat @ONLY) | ||
| 7 | endfunction() | ||
| 8 | |||
| 9 | get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../.. REALPATH) | ||
| 10 | |||
| 11 | set(MSYS_PATH "${CORE_SOURCE_DIR}/project/BuildDependencies/msys64") | ||
| 12 | if(CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| 13 | set(MINGW_PATH "${MSYS_PATH}/mingw32") | ||
| 14 | elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| 15 | set(MINGW_PATH "${MSYS_PATH}/mingw64") | ||
| 16 | endif() | ||
| 17 | |||
| 18 | # configure the MinGW toolchain file | ||
| 19 | configure_file(${PROJECT_SOURCE_DIR}/Toolchain_mingw32.cmake.in ${CMAKE_INSTALL_PREFIX}/Toolchain_mingw32.cmake @ONLY) | ||
| 20 | |||
| 21 | # configure MinGWConfig.cmake | ||
| 22 | configure_file(${PROJECT_SOURCE_DIR}/MinGWConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/MinGWConfig.cmake) | ||
| 23 | |||
| 24 | # TODO: MinGW GCC 5.3.0-1 comes without cc.exe, Remove this once package is bumped to 5.3.0-p2 | ||
| 25 | # See https://github.com/Alexpux/MINGW-packages/pull/1034 | ||
| 26 | if(NOT EXISTS ${MINGW_PATH}/bin/cc.exe) | ||
| 27 | execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_PATH}/bin/gcc.exe ${MINGW_PATH}/bin/cc.exe) | ||
| 28 | endif() | ||
| 29 | |||
| 30 | # configure the MinGW wrapper batch scripts | ||
| 31 | generate_mingw32_wrapper("make") | ||
| 32 | generate_mingw32_wrapper("gcc") | ||
| 33 | generate_mingw32_wrapper("cc") | ||
| 34 | generate_mingw32_wrapper("g++") | ||
| 35 | generate_mingw32_wrapper("ar") | ||
| 36 | generate_mingw32_wrapper("ld") | ||
| 37 | generate_mingw32_wrapper("windres") | ||
diff --git a/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in b/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in deleted file mode 100644 index 2d6baa7..0000000 --- a/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | set(MINGW_INCLUDE_DIRS @MINGW_PATH@/include) | ||
| 2 | set(MINGW_MAKE @MINGW_PATH@/bin/make.bat -j$ENV{NUMBER_OF_PROCESSORS}) | ||
| 3 | set(MINGW_FOUND 1) | ||
diff --git a/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in b/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in deleted file mode 100644 index 01d281d..0000000 --- a/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | set(CMAKE_SYSTEM_VERSION 1) | ||
| 2 | set(CMAKE_SYSTEM_NAME Windows) | ||
| 3 | |||
| 4 | set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@ @CMAKE_INSTALL_PREFIX@ @MSYS_PATH@ @MINGW_PATH@) | ||
| 5 | |||
| 6 | # specify the cross compiler | ||
| 7 | set(CMAKE_C_COMPILER @MINGW_PATH@/bin/gcc.bat) | ||
| 8 | set(CMAKE_CXX_COMPILER @MINGW_PATH@/bin/g++.bat) | ||
| 9 | set(CMAKE_AR @MINGW_PATH@/bin/ar.bat CACHE FILEPATH "Archiver") | ||
| 10 | set(CMAKE_LINKER @MINGW_PATH@/bin/ld.bat CACHE FILEPATH "Linker") | ||
| 11 | SET(CMAKE_RC_COMPILER @MINGW_PATH@/bin/windres.bat) | ||
| 12 | |||
| 13 | # search for programs in the build host directories | ||
| 14 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| 15 | # for libraries and headers in the target directories | ||
| 16 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| 17 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
diff --git a/cmake/addons/depends/windows/cmake/mingw/mingw.txt b/cmake/addons/depends/windows/cmake/mingw/mingw.txt deleted file mode 100644 index 90aa6ae..0000000 --- a/cmake/addons/depends/windows/cmake/mingw/mingw.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | mingw | ||
diff --git a/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in b/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in deleted file mode 100644 index 44a0ea2..0000000 --- a/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | @ECHO OFF | ||
| 2 | SETLOCAL | ||
| 3 | |||
| 4 | SET PATH=@MINGW_PATH@/bin;@MSYS_PATH@/usr/bin;%PATH% | ||
| 5 | @CMD@.exe %* | ||
| 6 | |||
diff --git a/cmake/addons/depends/windows/cmake/mingw/noinstall.txt b/cmake/addons/depends/windows/cmake/mingw/noinstall.txt deleted file mode 100644 index e69de29..0000000 --- a/cmake/addons/depends/windows/cmake/mingw/noinstall.txt +++ /dev/null | |||
diff --git a/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt b/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt deleted file mode 100644 index 1c0536e..0000000 --- a/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.1) | ||
| 2 | project(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/cmake/addons/depends/windows/cmake/msys/msys.txt b/cmake/addons/depends/windows/cmake/msys/msys.txt deleted file mode 100644 index 00de9c2..0000000 --- a/cmake/addons/depends/windows/cmake/msys/msys.txt +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | msys | ||
diff --git a/cmake/addons/depends/windows/cmake/msys/noinstall.txt b/cmake/addons/depends/windows/cmake/msys/noinstall.txt deleted file mode 100644 index e69de29..0000000 --- a/cmake/addons/depends/windows/cmake/msys/noinstall.txt +++ /dev/null | |||
diff --git a/cmake/cpack/deb/packages/kodi.txt.in b/cmake/cpack/deb/packages/kodi.txt.in index 376fe80..90ae9ea 100644 --- a/cmake/cpack/deb/packages/kodi.txt.in +++ b/cmake/cpack/deb/packages/kodi.txt.in | |||
| @@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all | |||
| 15 | PACKAGE_SECTION video | 15 | PACKAGE_SECTION video |
| 16 | PACKAGE_PRIORITY optional | 16 | PACKAGE_PRIORITY optional |
| 17 | PACKAGE_SHLIBDEPS | 17 | PACKAGE_SHLIBDEPS |
| 18 | PACKAGE_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 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2 | 18 | PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2 |
| 19 | PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 | 19 | PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 |
| 20 | PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame | 20 | PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame |
| 21 | PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone | 21 | PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone |
diff --git a/cmake/installdata/common/addons.txt b/cmake/installdata/common/addons.txt index 9efba38..b8f763c 100644 --- a/cmake/installdata/common/addons.txt +++ b/cmake/installdata/common/addons.txt | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | addons/audioencoder.kodi.builtin.aac/* | 1 | addons/audioencoder.kodi.builtin.aac/* |
| 2 | addons/audioencoder.kodi.builtin.wma/* | 2 | addons/audioencoder.kodi.builtin.wma/* |
| 3 | addons/game.controller.default/* | 3 | addons/game.controller.default/* |
| 4 | addons/kodi.adsp/* | ||
| 5 | addons/kodi.audiodecoder/* | 4 | addons/kodi.audiodecoder/* |
| 6 | addons/kodi.game/* | 5 | addons/kodi.game/* |
| 7 | addons/kodi.imagedecoder/* | 6 | addons/kodi.imagedecoder/* |
diff --git a/cmake/installdata/windowsstore/certificates.txt b/cmake/installdata/windowsstore/certificates.txt new file mode 100644 index 0000000..14e74a7 --- /dev/null +++ b/cmake/installdata/windowsstore/certificates.txt | |||
| @@ -0,0 +1 @@ | |||
| tools/depends/target/openssl/cacert.pem system/certs \ No newline at end of file | |||
diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake index 5b9a859..602f5d9 100644 --- a/cmake/modules/FindAML.cmake +++ b/cmake/modules/FindAML.cmake | |||
| @@ -20,9 +20,23 @@ include(FindPackageHandleStandardArgs) | |||
| 20 | find_package_handle_standard_args(AML | 20 | find_package_handle_standard_args(AML |
| 21 | REQUIRED_VARS AML_INCLUDE_DIR) | 21 | REQUIRED_VARS AML_INCLUDE_DIR) |
| 22 | 22 | ||
| 23 | include(CheckCSourceCompiles) | ||
| 24 | set(CMAKE_REQUIRED_INCLUDES ${AML_INCLUDE_DIR}) | ||
| 25 | check_c_source_compiles("#include <amcodec/codec.h> | ||
| 26 | |||
| 27 | int main() | ||
| 28 | { | ||
| 29 | int i = VIDEO_DEC_FORMAT_VP9; | ||
| 30 | return 0; | ||
| 31 | } | ||
| 32 | " AML_HAS_VP9) | ||
| 33 | |||
| 23 | if(AML_FOUND) | 34 | if(AML_FOUND) |
| 24 | set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) | 35 | set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) |
| 25 | set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) | 36 | set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) |
| 37 | if(AML_HAS_VP9) | ||
| 38 | list(APPEND AML_DEFINITIONS -DHAS_LIBAMCODEC_VP9=1) | ||
| 39 | endif() | ||
| 26 | 40 | ||
| 27 | if(NOT TARGET AML::AML) | 41 | if(NOT TARGET AML::AML) |
| 28 | add_library(AML::AML UNKNOWN IMPORTED) | 42 | add_library(AML::AML UNKNOWN IMPORTED) |
diff --git a/cmake/modules/FindAlsa.cmake b/cmake/modules/FindAlsa.cmake index bed4faa..ae05817 100644 --- a/cmake/modules/FindAlsa.cmake +++ b/cmake/modules/FindAlsa.cmake | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | # ALSA::ALSA - The Alsa library | 15 | # ALSA::ALSA - The Alsa library |
| 16 | 16 | ||
| 17 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_ALSA alsa QUIET) | 18 | pkg_check_modules(PC_ALSA alsa>=1.0.27 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h | 21 | find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h |
diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake index 64f4bb8..cce7f2a 100644 --- a/cmake/modules/FindCdio.cmake +++ b/cmake/modules/FindCdio.cmake | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | # CDIO::CDIO - The cdio library | 14 | # CDIO::CDIO - The cdio library |
| 15 | 15 | ||
| 16 | if(PKG_CONFIG_FOUND) | 16 | if(PKG_CONFIG_FOUND) |
| 17 | pkg_check_modules(PC_CDIO libcdio libiso9660 QUIET) | 17 | pkg_check_modules(PC_CDIO libcdio>=0.78 libiso9660 QUIET) |
| 18 | endif() | 18 | endif() |
| 19 | 19 | ||
| 20 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h | 20 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h |
diff --git a/cmake/modules/FindCpluff.cmake b/cmake/modules/FindCpluff.cmake index 913d7ae..9e29e17 100644 --- a/cmake/modules/FindCpluff.cmake +++ b/cmake/modules/FindCpluff.cmake | |||
| @@ -6,8 +6,11 @@ | |||
| 6 | # | 6 | # |
| 7 | # and link Kodi against the cpluff libraries. | 7 | # and link Kodi against the cpluff libraries. |
| 8 | 8 | ||
| 9 | if(NOT WIN32) | 9 | find_package(EXPAT REQUIRED) |
| 10 | find_package(EXPAT REQUIRED) | 10 | if(CORE_SYSTEM_NAME MATCHES windows) |
| 11 | add_subdirectory(${CMAKE_SOURCE_DIR}/lib/cpluff) | ||
| 12 | set(CPLUFF_LIBRARIES $<TARGET_FILE:libcpluff> ${EXPAT_LIBRARIES}) | ||
| 13 | else() | ||
| 11 | string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") | 14 | string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") |
| 12 | get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) | 15 | get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) |
| 13 | set(ldflags "-L${expat_dir}") | 16 | set(ldflags "-L${expat_dir}") |
| @@ -31,7 +34,8 @@ if(NOT WIN32) | |||
| 31 | --host=${ARCH} | 34 | --host=${ARCH} |
| 32 | CFLAGS=${defines} | 35 | CFLAGS=${defines} |
| 33 | CPPFLAGS=${cppflags} | 36 | CPPFLAGS=${cppflags} |
| 34 | LDFLAGS=${ldflags}) | 37 | LDFLAGS=${ldflags} |
| 38 | BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libcpluff.a) | ||
| 35 | ExternalProject_Add_Step(libcpluff autoreconf | 39 | ExternalProject_Add_Step(libcpluff autoreconf |
| 36 | DEPENDEES download update patch | 40 | DEPENDEES download update patch |
| 37 | DEPENDERS configure | 41 | DEPENDERS configure |
| @@ -39,24 +43,9 @@ if(NOT WIN32) | |||
| 39 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif | 43 | COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif |
| 40 | WORKING_DIRECTORY <SOURCE_DIR>) | 44 | WORKING_DIRECTORY <SOURCE_DIR>) |
| 41 | 45 | ||
| 42 | set(ldflags "${ldflags};-lexpat") | 46 | set(CPLUFF_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a ${EXPAT_LIBRARIES}) |
| 43 | core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a | ||
| 44 | system/libcpluff libcpluff extras "${ldflags}") | ||
| 45 | set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) | ||
| 46 | set(CPLUFF_FOUND 1) | ||
| 47 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) | ||
| 48 | else() | ||
| 49 | find_path(CPLUFF_INCLUDE_DIR cpluff.h) | ||
| 50 | |||
| 51 | include(FindPackageHandleStandardArgs) | ||
| 52 | find_package_handle_standard_args(Cpluff | ||
| 53 | REQUIRED_VARS CPLUFF_INCLUDE_DIR) | ||
| 54 | |||
| 55 | if(CPLUFF_FOUND) | ||
| 56 | set(CPLUFF_INCLUDE_DIRS ${CPLUFF_INCLUDE_DIR}) | ||
| 57 | endif() | ||
| 58 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) | ||
| 59 | |||
| 60 | add_custom_target(libcpluff) | ||
| 61 | endif() | 47 | endif() |
| 48 | set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) | ||
| 49 | set(CPLUFF_FOUND 1) | ||
| 50 | mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_LIBRARIES) | ||
| 62 | set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") | 51 | set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") |
diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index d0759a6..17c1f01 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake | |||
| @@ -34,40 +34,6 @@ if(CURL_FOUND) | |||
| 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) | 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) |
| 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) | 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) |
| 36 | 36 | ||
| 37 | # Check whether OpenSSL inside libcurl is static. | ||
| 38 | if(UNIX) | ||
| 39 | if(NOT DEFINED HAS_CURL_STATIC) | ||
| 40 | get_filename_component(CURL_LIBRARY_DIR ${CURL_LIBRARY} DIRECTORY) | ||
| 41 | find_soname(CURL REQUIRED) | ||
| 42 | |||
| 43 | if(APPLE) | ||
| 44 | set(libchecker nm) | ||
| 45 | set(searchpattern "T [_]?CRYPTO_set_locking_call") | ||
| 46 | else() | ||
| 47 | set(libchecker readelf -s) | ||
| 48 | set(searchpattern "CRYPTO_set_locking_call") | ||
| 49 | endif() | ||
| 50 | execute_process( | ||
| 51 | COMMAND ${libchecker} ${CURL_LIBRARY_DIR}/${CURL_SONAME} | ||
| 52 | COMMAND grep -Eq ${searchpattern} | ||
| 53 | RESULT_VARIABLE HAS_CURL_STATIC) | ||
| 54 | unset(libchecker) | ||
| 55 | unset(searchpattern) | ||
| 56 | if(HAS_CURL_STATIC EQUAL 0) | ||
| 57 | set(HAS_CURL_STATIC TRUE) | ||
| 58 | else() | ||
| 59 | set(HAS_CURL_STATIC FALSE) | ||
| 60 | endif() | ||
| 61 | set(HAS_CURL_STATIC ${HAS_CURL_STATIC} CACHE INTERNAL | ||
| 62 | "OpenSSL is statically linked into Curl") | ||
| 63 | message(STATUS "OpenSSL is statically linked into Curl: ${HAS_CURL_STATIC}") | ||
| 64 | endif() | ||
| 65 | endif() | ||
| 66 | |||
| 67 | if(HAS_CURL_STATIC) | ||
| 68 | set(CURL_DEFINITIONS -DHAS_CURL_STATIC=1) | ||
| 69 | endif() | ||
| 70 | |||
| 71 | if(NOT TARGET Curl::Curl) | 37 | if(NOT TARGET Curl::Curl) |
| 72 | add_library(Curl::Curl UNKNOWN IMPORTED) | 38 | add_library(Curl::Curl UNKNOWN IMPORTED) |
| 73 | set_target_properties(Curl::Curl PROPERTIES | 39 | set_target_properties(Curl::Curl PROPERTIES |
diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index 689cf28..e2fbe8d 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake | |||
| @@ -67,7 +67,6 @@ endif() | |||
| 67 | # external FFMPEG | 67 | # external FFMPEG |
| 68 | if(NOT ENABLE_INTERNAL_FFMPEG OR KODI_DEPENDSBUILD) | 68 | if(NOT ENABLE_INTERNAL_FFMPEG OR KODI_DEPENDSBUILD) |
| 69 | if(FFMPEG_PATH) | 69 | if(FFMPEG_PATH) |
| 70 | set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig") | ||
| 71 | list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH}) | 70 | list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH}) |
| 72 | endif() | 71 | endif() |
| 73 | 72 | ||
| @@ -236,8 +235,6 @@ if(NOT FFMPEG_FOUND) | |||
| 236 | -DCROSSCOMPILING=${CMAKE_CROSSCOMPILING} | 235 | -DCROSSCOMPILING=${CMAKE_CROSSCOMPILING} |
| 237 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | 236 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} |
| 238 | -DOS=${OS} | 237 | -DOS=${OS} |
| 239 | -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| 240 | -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| 241 | -DCMAKE_AR=${CMAKE_AR}) | 238 | -DCMAKE_AR=${CMAKE_AR}) |
| 242 | endif() | 239 | endif() |
| 243 | 240 | ||
| @@ -253,6 +250,9 @@ if(NOT FFMPEG_FOUND) | |||
| 253 | -DCORE_PLATFORM_NAME=${CORE_PLATFORM_NAME_LC} | 250 | -DCORE_PLATFORM_NAME=${CORE_PLATFORM_NAME_LC} |
| 254 | -DCPU=${CPU} | 251 | -DCPU=${CPU} |
| 255 | -DENABLE_NEON=${ENABLE_NEON} | 252 | -DENABLE_NEON=${ENABLE_NEON} |
| 253 | -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| 254 | -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| 255 | -DENABLE_CCACHE=${ENABLE_CCACHE} | ||
| 256 | -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | 256 | -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} |
| 257 | -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | 257 | -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} |
| 258 | -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} | 258 | -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} |
| @@ -264,8 +264,12 @@ if(NOT FFMPEG_FOUND) | |||
| 264 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake | 264 | ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake |
| 265 | <SOURCE_DIR>) | 265 | <SOURCE_DIR>) |
| 266 | 266 | ||
| 267 | find_program(BASH_COMMAND bash) | ||
| 268 | if(NOT BASH_COMMAND) | ||
| 269 | message(FATAL_ERROR "Internal FFmpeg requires bash.") | ||
| 270 | endif() | ||
| 267 | file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper | 271 | file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper |
| 268 | "#!/bin/bash | 272 | "#!${BASH_COMMAND} |
| 269 | if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}${APP_BINARY_SUFFIX}* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] | 273 | if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}${APP_BINARY_SUFFIX}* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] |
| 270 | then | 274 | then |
| 271 | avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` | 275 | avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` |
diff --git a/cmake/modules/FindLircClient.cmake b/cmake/modules/FindLircClient.cmake new file mode 100644 index 0000000..528c38e --- /dev/null +++ b/cmake/modules/FindLircClient.cmake | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # FindLircClient | ||
| 2 | # ----------- | ||
| 3 | # Finds the liblirc_client library | ||
| 4 | # | ||
| 5 | # This will will define the following variables:: | ||
| 6 | # | ||
| 7 | # LIRCCLIENT_FOUND - if false, do not try to link to lirc_client | ||
| 8 | # LIRCCLIENT_INCLUDE_DIRS - where to find lirc/lirc_client.h | ||
| 9 | # LIRCCLIENT_LIBRARYS - the library to link against | ||
| 10 | # LIRCCLIENT_DEFINITIONS - the lirc definitions | ||
| 11 | |||
| 12 | if(PKG_CONFIG_FOUND) | ||
| 13 | pkg_check_modules(PC_LIRC lirc QUIET) | ||
| 14 | endif() | ||
| 15 | |||
| 16 | find_path(LIRCCLIENT_INCLUDE_DIR lirc/lirc_client.h PATHS ${PC_LIRC_INCLUDEDIR}) | ||
| 17 | find_library(LIRCCLIENT_LIBRARY lirc_client PATHS ${PC_LIRC_LIBDIR}) | ||
| 18 | |||
| 19 | include(FindPackageHandleStandardArgs) | ||
| 20 | find_package_handle_standard_args(LircClient | ||
| 21 | REQUIRED_VARS LIRCCLIENT_LIBRARY LIRCCLIENT_INCLUDE_DIR) | ||
| 22 | |||
| 23 | if(LIRCCLIENT_FOUND) | ||
| 24 | set(LIRCCLIENT_LIBRARIES ${LIRCCLIENT_LIBRARY}) | ||
| 25 | set(LIRCCLIENT_INCLUDE_DIRS ${LIRCCLIENT_INCLUDE_DIR}) | ||
| 26 | set(LIRCCLIENT_DEFINITIONS -DHAS_LIRC=1) | ||
| 27 | |||
| 28 | if(NOT TARGET LIRCCLIENT::LIRCCLIENT) | ||
| 29 | add_library(LIRCCLIENT::LIRCCLIENT UNKNOWN IMPORTED) | ||
| 30 | set_target_properties(LIRCCLIENT::LIRCCLIENT PROPERTIES | ||
| 31 | IMPORTED_LOCATION "${LIRCCLIENT_LIBRARYS}" | ||
| 32 | INTERFACE_INCLUDE_DIRECTORIES "${LIRCCLIENT_INCLUDE_DIRS}") | ||
| 33 | endif() | ||
| 34 | endif() | ||
| 35 | |||
| 36 | mark_as_advanced(LIRCCLIENT_LIBRARY LIRCCLIENT_INCLUDE_DIR) \ No newline at end of file | ||
diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake new file mode 100644 index 0000000..1e5e736 --- /dev/null +++ b/cmake/modules/FindMariaDBClient.cmake | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindMariaDBClient | ||
| 3 | # --------------- | ||
| 4 | # Finds the MariaDBClient library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # MARIADBCLIENT_FOUND - system has MariaDBClient | ||
| 9 | # MARIADBCLIENT_INCLUDE_DIRS - the MariaDBClient include directory | ||
| 10 | # MARIADBCLIENT_LIBRARIES - the MariaDBClient libraries | ||
| 11 | # MARIADBCLIENT_DEFINITIONS - the MariaDBClient compile definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # MariaDBClient::MariaDBClient - The MariaDBClient library | ||
| 16 | |||
| 17 | # Don't find system wide installed version on Windows | ||
| 18 | if(WIN32) | ||
| 19 | set(EXTRA_FIND_ARGS NO_SYSTEM_ENVIRONMENT_PATH) | ||
| 20 | else() | ||
| 21 | set(EXTRA_FIND_ARGS) | ||
| 22 | endif() | ||
| 23 | |||
| 24 | find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h) | ||
| 25 | find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient libmariadb | ||
| 26 | PATH_SUFFIXES mariadb | ||
| 27 | ${EXTRA_FIND_ARGS}) | ||
| 28 | find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient libmariadb | ||
| 29 | PATH_SUFFIXES mariadb | ||
| 30 | ${EXTRA_FIND_ARGS}) | ||
| 31 | |||
| 32 | if(MARIADBCLIENT_INCLUDE_DIR AND EXISTS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h") | ||
| 33 | file(STRINGS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h" mariadb_version_str REGEX "^#define[\t ]+MARIADB_CLIENT_VERSION_STR[\t ]+\".*\".*") | ||
| 34 | string(REGEX REPLACE "^#define[\t ]+MARIADB_CLIENT_VERSION_STR[\t ]+\"([^\"]+)\".*" "\\1" MARIADBCLIENT_VERSION_STRING "${mariadb_version_str}") | ||
| 35 | unset(mariadb_version_str) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | include(SelectLibraryConfigurations) | ||
| 39 | select_library_configurations(MARIADBCLIENT) | ||
| 40 | |||
| 41 | include(FindPackageHandleStandardArgs) | ||
| 42 | find_package_handle_standard_args(MariaDBClient | ||
| 43 | REQUIRED_VARS MARIADBCLIENT_LIBRARY MARIADBCLIENT_INCLUDE_DIR | ||
| 44 | VERSION_VAR MARIADBCLIENT_VERSION_STRING) | ||
| 45 | |||
| 46 | if(MARIADBCLIENT_FOUND) | ||
| 47 | set(MARIADBCLIENT_LIBRARIES ${MARIADBCLIENT_LIBRARY}) | ||
| 48 | set(MARIADBCLIENT_INCLUDE_DIRS ${MARIADBCLIENT_INCLUDE_DIR}) | ||
| 49 | set(MARIADBCLIENT_DEFINITIONS -DHAS_MARIADB=1) | ||
| 50 | |||
| 51 | if(NOT TARGET MariaDBClient::MariaDBClient) | ||
| 52 | add_library(MariaDBClient::MariaDBClient UNKNOWN IMPORTED) | ||
| 53 | if(MARIADBCLIENT_LIBRARY_RELEASE) | ||
| 54 | set_target_properties(MariaDBClient::MariaDBClient PROPERTIES | ||
| 55 | IMPORTED_CONFIGURATIONS RELEASE | ||
| 56 | IMPORTED_LOCATION "${MARIADBCLIENT_LIBRARY_RELEASE}") | ||
| 57 | endif() | ||
| 58 | if(MARIADBCLIENT_LIBRARY_DEBUG) | ||
| 59 | set_target_properties(MariaDBClient::MariaDBClient PROPERTIES | ||
| 60 | IMPORTED_CONFIGURATIONS DEBUG | ||
| 61 | IMPORTED_LOCATION "${MARIADBCLIENT_LIBRARY_DEBUG}") | ||
| 62 | endif() | ||
| 63 | set_target_properties(MariaDBClient::MariaDBClient PROPERTIES | ||
| 64 | INTERFACE_INCLUDE_DIRECTORIES "${MARIADBCLIENT_INCLUDE_DIR}" | ||
| 65 | INTERFACE_COMPILE_DEFINITIONS HAS_MARIADB=1) | ||
| 66 | endif() | ||
| 67 | endif() | ||
| 68 | |||
| 69 | mark_as_advanced(MARIADBCLIENT_INCLUDE_DIR MARIADBCLIENT_LIBRARY) | ||
diff --git a/cmake/modules/FindMicroHttpd.cmake b/cmake/modules/FindMicroHttpd.cmake index 232f8e5..d04878c 100644 --- a/cmake/modules/FindMicroHttpd.cmake +++ b/cmake/modules/FindMicroHttpd.cmake | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | # MicroHttpd::MicroHttpd - The MicroHttpd library | 15 | # MicroHttpd::MicroHttpd - The MicroHttpd library |
| 16 | 16 | ||
| 17 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.4 QUIET) | 18 | pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.9.40 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h | 21 | find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h |
diff --git a/cmake/modules/FindMir.cmake b/cmake/modules/FindMir.cmake index 47a441c..e66ff02 100644 --- a/cmake/modules/FindMir.cmake +++ b/cmake/modules/FindMir.cmake | |||
| @@ -21,7 +21,7 @@ find_library(MIR_LIBRARY NAMES mirclient | |||
| 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) | 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) |
| 22 | 22 | ||
| 23 | include (FindPackageHandleStandardArgs) | 23 | include (FindPackageHandleStandardArgs) |
| 24 | find_package_handle_standard_args (MIR | 24 | find_package_handle_standard_args (Mir |
| 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) | 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) |
| 26 | 26 | ||
| 27 | if (MIR_FOUND) | 27 | if (MIR_FOUND) |
diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake index ee65210..bf3837e 100644 --- a/cmake/modules/FindSSH.cmake +++ b/cmake/modules/FindSSH.cmake | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | # SSH::SSH - The SSH library | 15 | # SSH::SSH - The SSH library |
| 16 | 16 | ||
| 17 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 18 | pkg_check_modules(PC_SSH libssh QUIET) | 18 | pkg_check_modules(PC_SSH libssh>=0.6 QUIET) |
| 19 | endif() | 19 | endif() |
| 20 | 20 | ||
| 21 | find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h | 21 | find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h |
diff --git a/cmake/modules/FindWaylandProtocols.cmake b/cmake/modules/FindWaylandProtocols.cmake new file mode 100644 index 0000000..0b96ff0 --- /dev/null +++ b/cmake/modules/FindWaylandProtocols.cmake | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # FindWaylandProtocols | ||
| 2 | # -------------------- | ||
| 3 | # Find wayland-protocols | ||
| 4 | # | ||
| 5 | # This will will define the following variables:: | ||
| 6 | # | ||
| 7 | # WAYLAND_PROTOCOLS_DIR - directory containing the additional Wayland protocols | ||
| 8 | # from the wayland-protocols package | ||
| 9 | |||
| 10 | pkg_check_modules(PC_WAYLAND_PROTOCOLS wayland-protocols) | ||
| 11 | if(PC_WAYLAND_PROTOCOLS_FOUND) | ||
| 12 | pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) | ||
| 13 | endif() | ||
| 14 | |||
| 15 | # Promote to cache variables so all code can access it | ||
| 16 | set(WAYLAND_PROTOCOLS_DIR ${WAYLAND_PROTOCOLS_DIR} CACHE INTERNAL "") | ||
| 17 | |||
| 18 | include(FindPackageHandleStandardArgs) | ||
| 19 | find_package_handle_standard_args(WaylandProtocols | ||
| 20 | REQUIRED_VARS | ||
| 21 | PC_WAYLAND_PROTOCOLS_FOUND | ||
| 22 | WAYLAND_PROTOCOLS_DIR | ||
| 23 | VERSION_VAR | ||
| 24 | PC_WAYLAND_PROTOCOLS_VERSION) | ||
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake index 8a1cd74..336e613 100644 --- a/cmake/modules/FindWaylandpp.cmake +++ b/cmake/modules/FindWaylandpp.cmake | |||
| @@ -1,64 +1,39 @@ | |||
| 1 | # FindWaylandpp | 1 | # FindWaylandpp |
| 2 | # ----------- | 2 | # ------------- |
| 3 | # Finds the waylandpp library | 3 | # Finds the waylandpp library |
| 4 | # | 4 | # |
| 5 | # This will will define the following variables:: | 5 | # This will will define the following variables:: |
| 6 | # | 6 | # |
| 7 | # WAYLANDPP_FOUND - the system has Wayland | 7 | # WAYLANDPP_FOUND - the system has waylandpp |
| 8 | # WAYLANDPP_INCLUDE_DIRS - the Wayland include directory | 8 | # WAYLANDPP_INCLUDE_DIRS - the waylandpp include directory |
| 9 | # WAYLANDPP_LIBRARIES - the Wayland libraries | 9 | # WAYLANDPP_LIBRARIES - the waylandpp libraries |
| 10 | # WAYLANDPP_DEFINITIONS - the Wayland definitions | 10 | # WAYLANDPP_DEFINITIONS - the waylandpp definitions |
| 11 | 11 | # WAYLANDPP_SCANNER - path to wayland-scanner++ | |
| 12 | 12 | ||
| 13 | if(PKG_CONFIG_FOUND) | 13 | pkg_check_modules(WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++) |
| 14 | pkg_check_modules(PC_WAYLANDPP wayland-client++>=0.1 wayland-egl++ wayland-cursor++ wayland-scanner++ QUIET) | 14 | pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++) |
| 15 | pkg_check_modules(PC_WAYLAND_PROTOCOLS wayland-protocols>=1.7 QUIET) | 15 | if(WAYLANDPP_FOUND) |
| 16 | # TODO: Remove check when CMake minimum version is bumped globally | 16 | pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) |
| 17 | if(CMAKE_VERSION VERSION_EQUAL 3.4.0 OR CMAKE_VERSION VERSION_GREATER 3.4.0) | 17 | endif() |
| 18 | if(PC_WAYLANDPP_FOUND) | 18 | if(PC_WAYLANDPP_SCANNER_FOUND) |
| 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) | 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) |
| 20 | endif() | ||
| 21 | if(PC_WAYLAND_PROTOCOLS_FOUND) | ||
| 22 | pkg_get_variable(PC_WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) | ||
| 23 | endif() | ||
| 24 | endif() | ||
| 25 | endif() | 20 | endif() |
| 26 | 21 | ||
| 27 | find_path(WAYLANDPP_INCLUDE_DIR NAMES wayland-client.hpp | 22 | # Promote to cache variables so all code can access it |
| 28 | PATHS ${PC_WAYLANDPP_INCLUDE_DIRS}) | 23 | set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") |
| 29 | |||
| 30 | find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++ | ||
| 31 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 32 | |||
| 33 | find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++ | ||
| 34 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 35 | |||
| 36 | find_library(WAYLANDPP_EGL_LIBRARY NAMES wayland-egl++ | ||
| 37 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 38 | |||
| 39 | find_program(WAYLANDPP_SCANNER NAMES wayland-scanner++ | ||
| 40 | PATHS ${PC_WAYLANDPP_SCANNER}) | ||
| 41 | 24 | ||
| 42 | find_path(WAYLAND_PROTOCOLS_DIR NAMES unstable/xdg-shell/xdg-shell-unstable-v6.xml | 25 | # wayland-scanner++ is from native/host system in case of cross-compilation, so |
| 43 | PATHS ${PC_WAYLAND_PROTOCOLS_DIR} | 26 | # it's ok if we don't find it with pkgconfig |
| 44 | DOC "Directory containing additional Wayland protocols") | 27 | find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) |
| 45 | 28 | ||
| 46 | include (FindPackageHandleStandardArgs) | 29 | include (FindPackageHandleStandardArgs) |
| 47 | find_package_handle_standard_args (Waylandpp | 30 | find_package_handle_standard_args (Waylandpp |
| 48 | REQUIRED_VARS | 31 | REQUIRED_VARS |
| 49 | WAYLANDPP_INCLUDE_DIR | 32 | WAYLANDPP_FOUND |
| 50 | WAYLANDPP_CLIENT_LIBRARY | ||
| 51 | WAYLANDPP_CURSOR_LIBRARY | ||
| 52 | WAYLANDPP_EGL_LIBRARY | ||
| 53 | WAYLANDPP_SCANNER | 33 | WAYLANDPP_SCANNER |
| 54 | WAYLAND_PROTOCOLS_DIR | ||
| 55 | VERSION_VAR | 34 | VERSION_VAR |
| 56 | PC_WAYLANDPP_wayland-client++_VERSION) | 35 | WAYLANDPP_wayland-client++_VERSION) |
| 57 | |||
| 58 | if (WAYLANDPP_FOUND) | ||
| 59 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_CLIENT_LIBRARY} ${WAYLANDPP_CURSOR_LIBRARY} ${WAYLANDPP_EGL_LIBRARY}) | ||
| 60 | set(WAYLANDPP_INCLUDE_DIRS ${PC_WAYLANDPP_INCLUDE_DIRS}) | ||
| 61 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) | ||
| 62 | endif() | ||
| 63 | 36 | ||
| 64 | mark_as_advanced (WAYLANDPP_CLIENT_LIBRARY WAYLANDPP_CURSOR_LIBRARY WAYLANDPP_EGL_LIBRARY WAYLANDPP_INCLUDE_DIR) | 37 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) |
| 38 | # Also pass on library directories | ||
| 39 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_LDFLAGS}) | ||
diff --git a/cmake/modules/FindXkbcommon.cmake b/cmake/modules/FindXkbcommon.cmake index 88c6121..2a84fe5 100644 --- a/cmake/modules/FindXkbcommon.cmake +++ b/cmake/modules/FindXkbcommon.cmake | |||
| @@ -9,27 +9,13 @@ | |||
| 9 | # XKBCOMMON_LIBRARIES - the libxkbcommon libraries | 9 | # XKBCOMMON_LIBRARIES - the libxkbcommon libraries |
| 10 | # XKBCOMMON_DEFINITIONS - the libxkbcommon definitions | 10 | # XKBCOMMON_DEFINITIONS - the libxkbcommon definitions |
| 11 | 11 | ||
| 12 | 12 | pkg_check_modules (XKBCOMMON xkbcommon) | |
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules (PC_XKBCOMMON xkbcommon QUIET) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | find_path(XKBCOMMON_INCLUDE_DIR NAMES xkbcommon/xkbcommon.h | ||
| 18 | PATHS ${PC_XKBCOMMON_INCLUDE_DIRS}) | ||
| 19 | |||
| 20 | find_library(XKBCOMMON_LIBRARY NAMES xkbcommon | ||
| 21 | PATHS ${PC_XKBCOMMON_LIBRARIES} ${PC_XKBCOMMON_LIBRARY_DIRS}) | ||
| 22 | 13 | ||
| 23 | include (FindPackageHandleStandardArgs) | 14 | include (FindPackageHandleStandardArgs) |
| 24 | find_package_handle_standard_args (XKBCOMMON | 15 | find_package_handle_standard_args (Xkbcommon |
| 25 | REQUIRED_VARS | 16 | REQUIRED_VARS |
| 26 | XKBCOMMON_INCLUDE_DIR | 17 | XKBCOMMON_FOUND) |
| 27 | XKBCOMMON_LIBRARY) | ||
| 28 | |||
| 29 | if (XKBCOMMON_FOUND) | ||
| 30 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) | ||
| 31 | set(XKBCOMMON_INCLUDE_DIRS ${PC_XKBCOMMON_INCLUDE_DIRS}) | ||
| 32 | set(XKBCOMMON_DEFINITIONS -DHAVE_XKBCOMMON=1) | ||
| 33 | endif() | ||
| 34 | 18 | ||
| 35 | mark_as_advanced (XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) \ No newline at end of file | 19 | set(XKBCOMMON_DEFINITIONS -DHAVE_XKBCOMMON=1) |
| 20 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LDFLAGS}) | ||
| 21 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDEDIR}) | ||
diff --git a/cmake/platform/freebsd/wayland.cmake b/cmake/platform/freebsd/wayland.cmake index 55fbd8a..c9c1d00 100644 --- a/cmake/platform/freebsd/wayland.cmake +++ b/cmake/platform/freebsd/wayland.cmake | |||
| @@ -1,17 +1 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS EGL Waylandpp LibDRM Xkbcommon) | include(cmake/platform/linux/wayland.cmake) | |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) | ||
| 3 | |||
| 4 | set(WAYLAND_RENDER_SYSTEM "" CACHE STRING "Render system to use with Wayland: \"gl\" or \"gles\"") | ||
| 5 | |||
| 6 | if(WAYLAND_RENDER_SYSTEM STREQUAL "gl") | ||
| 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) | ||
| 8 | elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles") | ||
| 9 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) | ||
| 10 | else() | ||
| 11 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") | ||
| 12 | endif() | ||
| 13 | |||
| 14 | set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols) | ||
| 15 | set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}") | ||
| 16 | # for wayland-extra-protocols.hpp | ||
| 17 | include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}") | ||
diff --git a/cmake/platform/linux/aml.cmake b/cmake/platform/linux/aml.cmake index c1d464d..82e242b 100644 --- a/cmake/platform/linux/aml.cmake +++ b/cmake/platform/linux/aml.cmake | |||
| @@ -1 +1,3 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS OpenGLES AML EGL) | 1 | set(PLATFORM_REQUIRED_DEPS OpenGLES AML EGL) |
| 2 | set(APP_RENDER_SYSTEM gles) | ||
| 3 | list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS) | ||
diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake index 6a9165a..d8e73d0 100644 --- a/cmake/platform/linux/gbm.cmake +++ b/cmake/platform/linux/gbm.cmake | |||
| @@ -1,2 +1,4 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM) | 1 | set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) | 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) |
| 3 | set(APP_RENDER_SYSTEM gles) | ||
| 4 | list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DPLATFORM_SETTINGS_FILE=gbm.xml) | ||
diff --git a/cmake/platform/linux/mir.cmake b/cmake/platform/linux/mir.cmake index 7f20da8..0e672a9 100644 --- a/cmake/platform/linux/mir.cmake +++ b/cmake/platform/linux/mir.cmake | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS OpenGl EGL Mir LibDRM) | 1 | set(PLATFORM_REQUIRED_DEPS OpenGl EGL Mir LibDRM) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI OpenGLES) | 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI OpenGLES) |
| 3 | set(APP_RENDER_SYSTEM gl) | ||
diff --git a/cmake/platform/linux/rbpi.cmake b/cmake/platform/linux/rbpi.cmake index 4899857..fa9a1dc 100644 --- a/cmake/platform/linux/rbpi.cmake +++ b/cmake/platform/linux/rbpi.cmake | |||
| @@ -1 +1,3 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS OpenGLES EGL MMAL) | 1 | set(PLATFORM_REQUIRED_DEPS OpenGLES EGL MMAL) |
| 2 | set(APP_RENDER_SYSTEM gles) | ||
| 3 | list(APPEND PLATFORM_DEFINES -D_ARMEL -DTARGET_RASPBERRY_PI) | ||
diff --git a/cmake/platform/linux/wayland.cmake b/cmake/platform/linux/wayland.cmake index 3934834..f42dbf5 100644 --- a/cmake/platform/linux/wayland.cmake +++ b/cmake/platform/linux/wayland.cmake | |||
| @@ -1,12 +1,14 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS EGL Waylandpp LibDRM Xkbcommon) | 1 | set(PLATFORM_REQUIRED_DEPS EGL WaylandProtocols>=1.7 Waylandpp>=0.2.2 LibDRM Xkbcommon>=0.4.1) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) | 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) |
| 3 | 3 | ||
| 4 | set(WAYLAND_RENDER_SYSTEM "" CACHE STRING "Render system to use with Wayland: \"gl\" or \"gles\"") | 4 | set(WAYLAND_RENDER_SYSTEM "" CACHE STRING "Render system to use with Wayland: \"gl\" or \"gles\"") |
| 5 | 5 | ||
| 6 | if(WAYLAND_RENDER_SYSTEM STREQUAL "gl") | 6 | if(WAYLAND_RENDER_SYSTEM STREQUAL "gl") |
| 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) | 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) |
| 8 | set(APP_RENDER_SYSTEM gl) | ||
| 8 | elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles") | 9 | elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles") |
| 9 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) | 10 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) |
| 11 | set(APP_RENDER_SYSTEM gles) | ||
| 10 | else() | 12 | else() |
| 11 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") | 13 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") |
| 12 | endif() | 14 | endif() |
| @@ -14,4 +16,4 @@ endif() | |||
| 14 | set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols) | 16 | set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols) |
| 15 | set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}") | 17 | set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}") |
| 16 | # for wayland-extra-protocols.hpp | 18 | # for wayland-extra-protocols.hpp |
| 17 | include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}") \ No newline at end of file | 19 | include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}") |
diff --git a/cmake/platform/linux/x11.cmake b/cmake/platform/linux/x11.cmake index 656fd66..09cebde 100644 --- a/cmake/platform/linux/x11.cmake +++ b/cmake/platform/linux/x11.cmake | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) | 1 | set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) | 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) |
| 3 | set(APP_RENDER_SYSTEM gl) | ||
diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake index 03056fa..69bb88d 100644 --- a/cmake/scripts/android/ArchSetup.cmake +++ b/cmake/scripts/android/ArchSetup.cmake | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | if(NOT CMAKE_TOOLCHAIN_FILE) | 1 | if(NOT CMAKE_TOOLCHAIN_FILE) |
| 2 | message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${CMAKE_SOURCE_DIR}/cmake/README.md") | 2 | message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${CMAKE_SOURCE_DIR}/cmake/README.md") |
| 3 | elseif(NOT SDK_PLATFORM) | ||
| 4 | message(FATAL_ERROR "Toolchain did not define SDK_PLATFORM. Possibly outdated depends.") | ||
| 5 | endif() | 3 | endif() |
| 6 | 4 | ||
| 7 | set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) | 5 | set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) |
| @@ -34,7 +32,7 @@ else() | |||
| 34 | endif() | 32 | endif() |
| 35 | 33 | ||
| 36 | # Additional SYSTEM_DEFINES | 34 | # Additional SYSTEM_DEFINES |
| 37 | list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF) | 35 | list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF -DHAS_LINUX_NETWORK) |
| 38 | 36 | ||
| 39 | set(ENABLE_X11 OFF CACHE BOOL "" FORCE) | 37 | set(ENABLE_X11 OFF CACHE BOOL "" FORCE) |
| 40 | set(ENABLE_AML OFF CACHE BOOL "" FORCE) | 38 | set(ENABLE_AML OFF CACHE BOOL "" FORCE) |
diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake index cc52d51..cc53607 100644 --- a/cmake/scripts/android/Install.cmake +++ b/cmake/scripts/android/Install.cmake | |||
| @@ -53,29 +53,47 @@ endif() | |||
| 53 | unset(patch) | 53 | unset(patch) |
| 54 | 54 | ||
| 55 | set(package_files strings.xml | 55 | set(package_files strings.xml |
| 56 | activity_main.xml | ||
| 57 | colors.xml | 56 | colors.xml |
| 58 | searchable.xml | 57 | searchable.xml |
| 59 | AndroidManifest.xml | 58 | AndroidManifest.xml |
| 60 | build.gradle | 59 | build.gradle |
| 61 | src/Main.java | ||
| 62 | src/Splash.java | 60 | src/Splash.java |
| 61 | src/Main.java | ||
| 63 | src/XBMCBroadcastReceiver.java | 62 | src/XBMCBroadcastReceiver.java |
| 64 | src/XBMCImageContentProvider.java | ||
| 65 | src/XBMCInputDeviceListener.java | 63 | src/XBMCInputDeviceListener.java |
| 66 | src/XBMCJsonRPC.java | 64 | src/XBMCJsonRPC.java |
| 67 | src/XBMCMediaContentProvider.java | 65 | src/XBMCMainView.java |
| 68 | src/XBMCMediaSession.java | 66 | src/XBMCMediaSession.java |
| 69 | src/XBMCRecommendationBuilder.java | 67 | src/XBMCRecommendationBuilder.java |
| 70 | src/XBMCSearchableActivity.java | 68 | src/XBMCSearchableActivity.java |
| 71 | src/XBMCSettingsContentObserver.java | 69 | src/XBMCSettingsContentObserver.java |
| 72 | src/XBMCProperties.java | 70 | src/XBMCProperties.java |
| 73 | src/XBMCVideoView.java | 71 | src/XBMCVideoView.java |
| 72 | src/XBMCFile.java | ||
| 73 | src/channels/SyncChannelJobService.java | ||
| 74 | src/channels/SyncProgramsJobService.java | ||
| 75 | src/channels/model/XBMCDatabase.java | ||
| 76 | src/channels/model/Subscription.java | ||
| 77 | src/channels/util/SharedPreferencesHelper.java | ||
| 78 | src/channels/util/TvUtil.java | ||
| 74 | src/interfaces/XBMCAudioManagerOnAudioFocusChangeListener.java | 79 | src/interfaces/XBMCAudioManagerOnAudioFocusChangeListener.java |
| 75 | src/interfaces/XBMCSurfaceTextureOnFrameAvailableListener.java | 80 | src/interfaces/XBMCSurfaceTextureOnFrameAvailableListener.java |
| 76 | src/interfaces/XBMCNsdManagerDiscoveryListener.java | ||
| 77 | src/interfaces/XBMCNsdManagerRegistrationListener.java | ||
| 78 | src/interfaces/XBMCNsdManagerResolveListener.java | 81 | src/interfaces/XBMCNsdManagerResolveListener.java |
| 82 | src/interfaces/XBMCNsdManagerRegistrationListener.java | ||
| 83 | src/interfaces/XBMCNsdManagerDiscoveryListener.java | ||
| 84 | src/interfaces/XBMCMediaDrmOnEventListener.java | ||
| 85 | src/model/TVEpisode.java | ||
| 86 | src/model/Movie.java | ||
| 87 | src/model/TVShow.java | ||
| 88 | src/model/File.java | ||
| 89 | src/model/Album.java | ||
| 90 | src/model/Song.java | ||
| 91 | src/model/MusicVideo.java | ||
| 92 | src/model/Media.java | ||
| 93 | src/content/XBMCFileContentProvider.java | ||
| 94 | src/content/XBMCMediaContentProvider.java | ||
| 95 | src/content/XBMCContentProvider.java | ||
| 96 | src/content/XBMCYTDLContentProvider.java | ||
| 79 | ) | 97 | ) |
| 80 | foreach(file IN LISTS package_files) | 98 | foreach(file IN LISTS package_files) |
| 81 | configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in | 99 | configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in |
| @@ -154,7 +172,6 @@ foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean | |||
| 154 | DEPENDS_PATH=${DEPENDS_PATH} | 172 | DEPENDS_PATH=${DEPENDS_PATH} |
| 155 | NDKROOT=${NDKROOT} | 173 | NDKROOT=${NDKROOT} |
| 156 | SDKROOT=${SDKROOT} | 174 | SDKROOT=${SDKROOT} |
| 157 | SDK_PLATFORM=${SDK_PLATFORM} | ||
| 158 | STRIP=${CMAKE_STRIP} | 175 | STRIP=${CMAKE_STRIP} |
| 159 | AAPT=${AAPT_EXECUTABLE} | 176 | AAPT=${AAPT_EXECUTABLE} |
| 160 | DX=${DX_EXECUTABLE} | 177 | DX=${DX_EXECUTABLE} |
diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake index c11923e..5470940 100644 --- a/cmake/scripts/common/AddonHelpers.cmake +++ b/cmake/scripts/common/AddonHelpers.cmake | |||
| @@ -6,15 +6,20 @@ | |||
| 6 | # Sadly we cannot extend the 'package' target, as it is a builtin target, see | 6 | # Sadly we cannot extend the 'package' target, as it is a builtin target, see |
| 7 | # http://public.kitware.com/Bug/view.php?id=8438 | 7 | # http://public.kitware.com/Bug/view.php?id=8438 |
| 8 | # Thus, we have to add an 'addon-package' target. | 8 | # Thus, we have to add an 'addon-package' target. |
| 9 | add_custom_target(addon-package | 9 | get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) |
| 10 | COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) | 10 | if(_isMultiConfig) |
| 11 | add_custom_target(addon-package DEPENDS PACKAGE) | ||
| 12 | else() | ||
| 13 | add_custom_target(addon-package | ||
| 14 | COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) | ||
| 15 | endif() | ||
| 11 | 16 | ||
| 12 | macro(add_cpack_workaround target version ext) | 17 | macro(add_cpack_workaround target version ext) |
| 13 | if(NOT PACKAGE_DIR) | 18 | if(NOT PACKAGE_DIR) |
| 14 | set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips") | 19 | set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips") |
| 15 | endif() | 20 | endif() |
| 16 | 21 | ||
| 17 | add_custom_command(TARGET addon-package PRE_BUILD | 22 | add_custom_command(TARGET addon-package POST_BUILD |
| 18 | COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR} | 23 | COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR} |
| 19 | COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_DIRECTORY}/addon-${target}-${version}.${ext} ${PACKAGE_DIR}/${target}-${version}.${ext}) | 24 | COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_DIRECTORY}/addon-${target}-${version}.${ext} ${PACKAGE_DIR}/${target}-${version}.${ext}) |
| 20 | endmacro() | 25 | endmacro() |
| @@ -194,7 +199,7 @@ macro (build_addon target prefix libs) | |||
| 194 | endif() | 199 | endif() |
| 195 | 200 | ||
| 196 | string(CONFIGURE "${addon_file}" addon_file_conf @ONLY) | 201 | string(CONFIGURE "${addon_file}" addon_file_conf @ONLY) |
| 197 | file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") | 202 | file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") |
| 198 | if(${APP_NAME_UC}_BUILD_DIR) | 203 | if(${APP_NAME_UC}_BUILD_DIR) |
| 199 | file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/addon.xml CONTENT "${addon_file_conf}") | 204 | file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/addon.xml CONTENT "${addon_file_conf}") |
| 200 | endif() | 205 | endif() |
| @@ -207,7 +212,7 @@ macro (build_addon target prefix libs) | |||
| 207 | 212 | ||
| 208 | file(READ ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in settings_file) | 213 | file(READ ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in settings_file) |
| 209 | string(CONFIGURE "${settings_file}" settings_file_conf @ONLY) | 214 | string(CONFIGURE "${settings_file}" settings_file_conf @ONLY) |
| 210 | file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml CONTENT "${settings_file_conf}") | 215 | file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}/resources/settings.xml CONTENT "${settings_file_conf}") |
| 211 | if(${APP_NAME_UC}_BUILD_DIR) | 216 | if(${APP_NAME_UC}_BUILD_DIR) |
| 212 | file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources/settings.xml CONTENT "${settings_file_conf}") | 217 | file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources/settings.xml CONTENT "${settings_file_conf}") |
| 213 | endif() | 218 | endif() |
| @@ -230,7 +235,7 @@ macro (build_addon target prefix libs) | |||
| 230 | set(CPACK_COMPONENTS_IGNORE_GROUPS 1) | 235 | set(CPACK_COMPONENTS_IGNORE_GROUPS 1) |
| 231 | list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) | 236 | list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) |
| 232 | # Pack files together to create an archive | 237 | # Pack files together to create an archive |
| 233 | install(DIRECTORY ${target} DESTINATION ./ | 238 | install(DIRECTORY ${target} ${CMAKE_CURRENT_BINARY_DIR}/${target} DESTINATION ./ |
| 234 | COMPONENT ${target}-${${prefix}_VERSION} | 239 | COMPONENT ${target}-${${prefix}_VERSION} |
| 235 | REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE) | 240 | REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE) |
| 236 | if(WIN32) | 241 | if(WIN32) |
| @@ -247,21 +252,15 @@ macro (build_addon target prefix libs) | |||
| 247 | endif() | 252 | endif() |
| 248 | endif() | 253 | endif() |
| 249 | 254 | ||
| 250 | # in case of a VC++ project the installation location contains a $(Configuration) VS variable | ||
| 251 | # we replace it with ${CMAKE_BUILD_TYPE} (which doesn't cover the case when the build configuration | ||
| 252 | # is changed within Visual Studio) | ||
| 253 | string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" LIBRARY_LOCATION "${LIBRARY_LOCATION}") | ||
| 254 | |||
| 255 | if(${prefix}_SOURCES) | 255 | if(${prefix}_SOURCES) |
| 256 | # install the generated DLL file | 256 | # install the generated DLL file |
| 257 | install(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} | 257 | install(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} |
| 258 | COMPONENT ${target}-${${prefix}_VERSION}) | 258 | COMPONENT ${target}-${${prefix}_VERSION}) |
| 259 | 259 | ||
| 260 | if(CMAKE_BUILD_TYPE MATCHES Debug) | 260 | # for debug builds also install the PDB file |
| 261 | # for debug builds also install the PDB file | 261 | install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${target} |
| 262 | install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${target} | 262 | CONFIGURATIONS Debug RelWithDebInfo |
| 263 | COMPONENT ${target}-${${prefix}_VERSION}) | 263 | COMPONENT ${target}-${${prefix}_VERSION}) |
| 264 | endif() | ||
| 265 | endif() | 264 | endif() |
| 266 | if(${prefix}_CUSTOM_BINARY) | 265 | if(${prefix}_CUSTOM_BINARY) |
| 267 | install(FILES ${LIBRARY_LOCATION} DESTINATION ${target} RENAME ${LIBRARY_FILENAME}) | 266 | install(FILES ${LIBRARY_LOCATION} DESTINATION ${target} RENAME ${LIBRARY_FILENAME}) |
| @@ -325,7 +324,7 @@ macro (build_addon target prefix libs) | |||
| 325 | if (${prefix}_CUSTOM_BINARY) | 324 | if (${prefix}_CUSTOM_BINARY) |
| 326 | install(FILES ${LIBRARY_LOCATION} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${LIBRARY_FILENAME}) | 325 | install(FILES ${LIBRARY_LOCATION} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${LIBRARY_FILENAME}) |
| 327 | endif() | 326 | endif() |
| 328 | install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons | 327 | install(DIRECTORY ${target} ${CMAKE_CURRENT_BINARY_DIR}/${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons |
| 329 | REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE) | 328 | REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE) |
| 330 | if(${prefix}_CUSTOM_DATA) | 329 | if(${prefix}_CUSTOM_DATA) |
| 331 | install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources) | 330 | install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources) |
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 3b81533..c97929e 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake | |||
| @@ -153,6 +153,10 @@ if(NOT DEFINED NEON OR NEON) | |||
| 153 | endif() | 153 | endif() |
| 154 | endif() | 154 | endif() |
| 155 | 155 | ||
| 156 | if(PLATFORM_DEFINES) | ||
| 157 | add_options(ALL_LANGUAGES ALL_BUILDS ${PLATFORM_DEFINES}) | ||
| 158 | endif() | ||
| 159 | |||
| 156 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") | 160 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") |
| 157 | add_options (ALL_LANGUAGES DEBUG "-g" "-D_DEBUG" "-Wall") | 161 | add_options (ALL_LANGUAGES DEBUG "-g" "-D_DEBUG" "-Wall") |
| 158 | endif() | 162 | endif() |
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index 49e5ac8..fb110d6 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake | |||
| @@ -54,9 +54,6 @@ function(add_addon_depends addon searchpath) | |||
| 54 | if(EXISTS ${dir}/flags.txt) | 54 | if(EXISTS ${dir}/flags.txt) |
| 55 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) | 55 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) |
| 56 | file(STRINGS ${dir}/flags.txt extraflags) | 56 | file(STRINGS ${dir}/flags.txt extraflags) |
| 57 | |||
| 58 | # replace some custom placeholders | ||
| 59 | string(REPLACE "@MINGW_TOOLCHAIN_FILE@" "${OUTPUT_DIR}/Toolchain_mingw32.cmake" extraflags "${extraflags}") | ||
| 60 | string(REPLACE " " ";" extraflags ${extraflags}) | 57 | string(REPLACE " " ";" extraflags ${extraflags}) |
| 61 | 58 | ||
| 62 | message(STATUS "${id} extraflags: ${extraflags}") | 59 | message(STATUS "${id} extraflags: ${extraflags}") |
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index d508f87..c21069d 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake | |||
| @@ -338,15 +338,54 @@ macro(export_dep) | |||
| 338 | mark_as_advanced(${depup}_LIBRARIES) | 338 | mark_as_advanced(${depup}_LIBRARIES) |
| 339 | endmacro() | 339 | endmacro() |
| 340 | 340 | ||
| 341 | # add a required dependency of main application | 341 | # split dependency specification to name and version |
| 342 | # Arguments: | 342 | # Arguments: |
| 343 | # dep_list name of find rule for dependency, used uppercased for variable prefix | 343 | # depspec dependency specification that can optionally include a required |
| 344 | # also accepts a list of multiple dependencies | 344 | # package version |
| 345 | # syntax: [package name], [package name]>=[version] (minimum version), | ||
| 346 | # or [package name]=[version] (exact version) | ||
| 347 | # name_outvar variable that should receive the package name | ||
| 348 | # version_outvar variable that should receive the package version part (>=[version]) | ||
| 345 | # On return: | 349 | # On return: |
| 346 | # dependency added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} | 350 | # ${name_outvar} and ${version_outvar} in caller scope are set to respective values. |
| 351 | # ${version_outvar} may be unset if there is no specific version requested. | ||
| 352 | function(split_dependency_specification depspec name_outvar version_outvar) | ||
| 353 | if(${depspec} MATCHES "^([^>]*)(>?=[0-9.]+)$") | ||
| 354 | set(${name_outvar} ${CMAKE_MATCH_1} PARENT_SCOPE) | ||
| 355 | set(${version_outvar} ${CMAKE_MATCH_2} PARENT_SCOPE) | ||
| 356 | else() | ||
| 357 | set(${name_outvar} ${depspec} PARENT_SCOPE) | ||
| 358 | unset(${version_outvar} PARENT_SCOPE) | ||
| 359 | endif() | ||
| 360 | endfunction() | ||
| 361 | |||
| 362 | # helper macro to split version info from req and call find_package | ||
| 363 | macro(find_package_with_ver package) | ||
| 364 | set(_find_arguments "${ARGN}") | ||
| 365 | if("${ARGV1}" MATCHES "^(>)?=([0-9.]+)$") | ||
| 366 | # We have a version spec, parse it | ||
| 367 | list(REMOVE_AT _find_arguments 0) | ||
| 368 | # ">" not present? -> exact match | ||
| 369 | if(NOT CMAKE_MATCH_1) | ||
| 370 | list(INSERT _find_arguments 0 "EXACT") | ||
| 371 | endif() | ||
| 372 | find_package(${package} ${CMAKE_MATCH_2} ${_find_arguments}) | ||
| 373 | else() | ||
| 374 | find_package(${package} ${_find_arguments}) | ||
| 375 | endif() | ||
| 376 | unset(_find_arguments) | ||
| 377 | endmacro() | ||
| 378 | |||
| 379 | # add required dependencies of main application | ||
| 380 | # Arguments: | ||
| 381 | # dep_list One or many dependency specifications (see split_dependency_specification) | ||
| 382 | # for syntax). The dependency name is used uppercased as variable prefix. | ||
| 383 | # On return: | ||
| 384 | # dependencies added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} | ||
| 347 | function(core_require_dep) | 385 | function(core_require_dep) |
| 348 | foreach(dep ${ARGN}) | 386 | foreach(depspec ${ARGN}) |
| 349 | find_package(${dep} REQUIRED) | 387 | split_dependency_specification(${depspec} dep version) |
| 388 | find_package_with_ver(${dep} ${version} REQUIRED) | ||
| 350 | string(TOUPPER ${dep} depup) | 389 | string(TOUPPER ${dep} depup) |
| 351 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) | 390 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) |
| 352 | list(APPEND DEPLIBS ${${depup}_LIBRARIES}) | 391 | list(APPEND DEPLIBS ${${depup}_LIBRARIES}) |
| @@ -355,15 +394,16 @@ function(core_require_dep) | |||
| 355 | endforeach() | 394 | endforeach() |
| 356 | endfunction() | 395 | endfunction() |
| 357 | 396 | ||
| 358 | # add a required dyloaded dependency of main application | 397 | # add required dyloaded dependencies of main application |
| 359 | # Arguments: | 398 | # Arguments: |
| 360 | # dep_list name of find rule for dependency, used uppercased for variable prefix | 399 | # dep_list One or many dependency specifications (see split_dependency_specification) |
| 361 | # also accepts a list of multiple dependencies | 400 | # for syntax). The dependency name is used uppercased as variable prefix. |
| 362 | # On return: | 401 | # On return: |
| 363 | # dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up | 402 | # dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up |
| 364 | function(core_require_dyload_dep) | 403 | function(core_require_dyload_dep) |
| 365 | foreach(dep ${ARGN}) | 404 | foreach(depspec ${ARGN}) |
| 366 | find_package(${dep} REQUIRED) | 405 | split_dependency_specification(${depspec} dep version) |
| 406 | find_package_with_ver(${dep} ${version} REQUIRED) | ||
| 367 | string(TOUPPER ${dep} depup) | 407 | string(TOUPPER ${dep} depup) |
| 368 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) | 408 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) |
| 369 | list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) | 409 | list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) |
| @@ -385,20 +425,21 @@ macro(setup_enable_switch) | |||
| 385 | set(${enable_switch} "AUTO" CACHE STRING "Enable ${depup} support?") | 425 | set(${enable_switch} "AUTO" CACHE STRING "Enable ${depup} support?") |
| 386 | endmacro() | 426 | endmacro() |
| 387 | 427 | ||
| 388 | # add an optional dependency of main application | 428 | # add optional dependencies of main application |
| 389 | # Arguments: | 429 | # Arguments: |
| 390 | # dep_list name of find rule for dependency, used uppercased for variable prefix | 430 | # dep_list One or many dependency specifications (see split_dependency_specification) |
| 391 | # also accepts a list of multiple dependencies | 431 | # for syntax). The dependency name is used uppercased as variable prefix. |
| 392 | # On return: | 432 | # On return: |
| 393 | # dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} | 433 | # dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} |
| 394 | function(core_optional_dep) | 434 | function(core_optional_dep) |
| 395 | foreach(dep ${ARGN}) | 435 | foreach(depspec ${ARGN}) |
| 396 | set(_required False) | 436 | set(_required False) |
| 437 | split_dependency_specification(${depspec} dep version) | ||
| 397 | setup_enable_switch() | 438 | setup_enable_switch() |
| 398 | if(${enable_switch} STREQUAL AUTO) | 439 | if(${enable_switch} STREQUAL AUTO) |
| 399 | find_package(${dep}) | 440 | find_package_with_ver(${dep} ${version}) |
| 400 | elseif(${${enable_switch}}) | 441 | elseif(${${enable_switch}}) |
| 401 | find_package(${dep} REQUIRED) | 442 | find_package_with_ver(${dep} ${version} REQUIRED) |
| 402 | set(_required True) | 443 | set(_required True) |
| 403 | endif() | 444 | endif() |
| 404 | 445 | ||
| @@ -417,20 +458,21 @@ function(core_optional_dep) | |||
| 417 | set(final_message ${final_message} PARENT_SCOPE) | 458 | set(final_message ${final_message} PARENT_SCOPE) |
| 418 | endfunction() | 459 | endfunction() |
| 419 | 460 | ||
| 420 | # add an optional dyloaded dependency of main application | 461 | # add optional dyloaded dependencies of main application |
| 421 | # Arguments: | 462 | # Arguments: |
| 422 | # dep_list name of find rule for dependency, used uppercased for variable prefix | 463 | # dep_list One or many dependency specifications (see split_dependency_specification) |
| 423 | # also accepts a list of multiple dependencies | 464 | # for syntax). The dependency name is used uppercased as variable prefix. |
| 424 | # On return: | 465 | # On return: |
| 425 | # dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up | 466 | # dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up |
| 426 | function(core_optional_dyload_dep) | 467 | function(core_optional_dyload_dep) |
| 427 | foreach(dep ${ARGN}) | 468 | foreach(depspec ${ARGN}) |
| 428 | set(_required False) | 469 | set(_required False) |
| 429 | setup_enable_switch() | 470 | split_dependency_specification(${depspec} dep version) |
| 471 | setup_enable_switch() | ||
| 430 | if(${enable_switch} STREQUAL AUTO) | 472 | if(${enable_switch} STREQUAL AUTO) |
| 431 | find_package(${dep}) | 473 | find_package_with_ver(${dep} ${version}) |
| 432 | elseif(${${enable_switch}}) | 474 | elseif(${${enable_switch}}) |
| 433 | find_package(${dep} REQUIRED) | 475 | find_package_with_ver(${dep} ${version} REQUIRED) |
| 434 | set(_required True) | 476 | set(_required True) |
| 435 | endif() | 477 | endif() |
| 436 | 478 | ||
| @@ -592,6 +634,7 @@ function(core_find_git_rev stamp) | |||
| 592 | else() | 634 | else() |
| 593 | find_package(Git) | 635 | find_package(Git) |
| 594 | if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) | 636 | if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) |
| 637 | # get tree status i.e. clean working tree vs dirty (uncommited or unstashed changes, etc.) | ||
| 595 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules -q --refresh | 638 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules -q --refresh |
| 596 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 639 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
| 597 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- | 640 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- |
| @@ -602,21 +645,21 @@ function(core_find_git_rev stamp) | |||
| 602 | RESULT_VARIABLE status_code | 645 | RESULT_VARIABLE status_code |
| 603 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 646 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
| 604 | endif() | 647 | endif() |
| 648 | # get HEAD commit SHA-1 | ||
| 649 | execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD | ||
| 650 | OUTPUT_VARIABLE HASH | ||
| 651 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
| 652 | string(REPLACE "\"" "" HASH ${HASH}) | ||
| 653 | |||
| 605 | if(status_code) | 654 | if(status_code) |
| 606 | execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD | 655 | string(CONCAT HASH ${HASH} "-dirty") |
| 607 | OUTPUT_VARIABLE HASH | ||
| 608 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
| 609 | string(SUBSTRING ${HASH} 1 13 HASH) | ||
| 610 | else() | ||
| 611 | execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD | ||
| 612 | OUTPUT_VARIABLE HASH | ||
| 613 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
| 614 | string(SUBSTRING ${HASH} 1 7 HASH) | ||
| 615 | endif() | 656 | endif() |
| 657 | |||
| 658 | # get HEAD commit date | ||
| 616 | execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD | 659 | execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD |
| 617 | OUTPUT_VARIABLE DATE | 660 | OUTPUT_VARIABLE DATE |
| 618 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 661 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
| 619 | string(SUBSTRING ${DATE} 1 10 DATE) | 662 | string(REPLACE "\"" "" DATE ${DATE}) |
| 620 | string(REPLACE "-" "" DATE ${DATE}) | 663 | string(REPLACE "-" "" DATE ${DATE}) |
| 621 | else() | 664 | else() |
| 622 | string(TIMESTAMP DATE "%Y%m%d" UTC) | 665 | string(TIMESTAMP DATE "%Y%m%d" UTC) |
diff --git a/cmake/scripts/common/Uninstall.cmake b/cmake/scripts/common/Uninstall.cmake index 5660e19..5753857 100644 --- a/cmake/scripts/common/Uninstall.cmake +++ b/cmake/scripts/common/Uninstall.cmake | |||
| @@ -1,9 +1,40 @@ | |||
| 1 | macro(remove_empty_dirs) | ||
| 2 | list(REMOVE_DUPLICATES DIRECTORIES) | ||
| 3 | unset(PDIRECTORIES) | ||
| 4 | foreach(dir IN LISTS DIRECTORIES) | ||
| 5 | if(EXISTS $ENV{DESTDIR}${dir}) | ||
| 6 | file(GLOB _res $ENV{DESTDIR}${dir}/*) | ||
| 7 | list(LENGTH _res _len) | ||
| 8 | if(_len EQUAL 0 AND EXISTS $ENV{DESTDIR}${dir}) | ||
| 9 | message(STATUS "Removing empty dir: ${dir}") | ||
| 10 | execute_process( | ||
| 11 | COMMAND ${CMAKE_COMMAND} -E remove_directory $ENV{DESTDIR}${dir} | ||
| 12 | OUTPUT_VARIABLE rm_out | ||
| 13 | RESULT_VARIABLE rm_retval | ||
| 14 | ) | ||
| 15 | if(NOT "${rm_retval}" STREQUAL 0) | ||
| 16 | message(FATAL_ERROR "Failed to remove directory: $ENV{DESTDIR}${dir}") | ||
| 17 | endif() | ||
| 18 | get_filename_component(_pdir $ENV{DESTDIR}${dir} DIRECTORY) | ||
| 19 | list(APPEND PDIRECTORIES ${_pdir}) | ||
| 20 | endif() | ||
| 21 | endif() | ||
| 22 | endforeach() | ||
| 23 | list(LENGTH PDIRECTORIES _plen) | ||
| 24 | if(_plen GREATER 0) | ||
| 25 | set(DIRECTORIES ${PDIRECTORIES}) | ||
| 26 | remove_empty_dirs() | ||
| 27 | endif() | ||
| 28 | endmacro() | ||
| 29 | |||
| 1 | # Uninstall target | 30 | # Uninstall target |
| 2 | set(MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt) | 31 | set(MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt) |
| 3 | if(EXISTS ${MANIFEST}) | 32 | if(EXISTS ${MANIFEST}) |
| 4 | file(STRINGS ${MANIFEST} files) | 33 | file(STRINGS ${MANIFEST} files) |
| 5 | foreach(file IN LISTS files) | 34 | foreach(file IN LISTS files) |
| 6 | if(EXISTS $ENV{DESTDIR}${file}) | 35 | if(EXISTS $ENV{DESTDIR}${file}) |
| 36 | get_filename_component(_dir $ENV{DESTDIR}${file} DIRECTORY) | ||
| 37 | list(APPEND DIRECTORIES $ENV{DESTDIR}${_dir}) | ||
| 7 | message(STATUS "Uninstalling: ${file}") | 38 | message(STATUS "Uninstalling: ${file}") |
| 8 | execute_process( | 39 | execute_process( |
| 9 | COMMAND ${CMAKE_COMMAND} -E remove $ENV{DESTDIR}${file} | 40 | COMMAND ${CMAKE_COMMAND} -E remove $ENV{DESTDIR}${file} |
| @@ -17,6 +48,11 @@ if(EXISTS ${MANIFEST}) | |||
| 17 | message(STATUS "File does not exist: $ENV{DESTDIR}${file}") | 48 | message(STATUS "File does not exist: $ENV{DESTDIR}${file}") |
| 18 | endif() | 49 | endif() |
| 19 | endforeach(file) | 50 | endforeach(file) |
| 51 | |||
| 52 | # delete empty dirs | ||
| 53 | if(DIRECTORIES) | ||
| 54 | remove_empty_dirs() | ||
| 55 | endif() | ||
| 20 | else() | 56 | else() |
| 21 | message(STATUS "Cannot find install manifest: '${MANIFEST}'") | 57 | message(STATUS "Cannot find install manifest: '${MANIFEST}'") |
| 22 | endif() | 58 | endif() |
diff --git a/cmake/scripts/freebsd/ArchSetup.cmake b/cmake/scripts/freebsd/ArchSetup.cmake index 8ee78fc..db11bf8 100644 --- a/cmake/scripts/freebsd/ArchSetup.cmake +++ b/cmake/scripts/freebsd/ArchSetup.cmake | |||
| @@ -15,5 +15,10 @@ else() | |||
| 15 | endif() | 15 | endif() |
| 16 | endif() | 16 | endif() |
| 17 | 17 | ||
| 18 | # Disable ALSA by default | ||
| 19 | if(NOT ENABLE_ALSA) | ||
| 20 | option(ENABLE_ALSA "Enable alsa support?" OFF) | ||
| 21 | endif() | ||
| 22 | |||
| 18 | # Additional SYSTEM_DEFINES | 23 | # Additional SYSTEM_DEFINES |
| 19 | list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK) | 24 | list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK) |
diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/ios/ArchSetup.cmake index 0808eb2..bec8a7c 100644 --- a/cmake/scripts/ios/ArchSetup.cmake +++ b/cmake/scripts/ios/ArchSetup.cmake | |||
| @@ -39,7 +39,7 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" | |||
| 39 | set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) | 39 | set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) |
| 40 | set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) | 40 | set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) |
| 41 | 41 | ||
| 42 | set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "6.0") | 42 | set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "9.0") |
| 43 | set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") | 43 | set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") |
| 44 | 44 | ||
| 45 | set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) | 45 | set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) |
diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake index ee69c09..fcee675 100644 --- a/cmake/scripts/linux/ArchSetup.cmake +++ b/cmake/scripts/linux/ArchSetup.cmake | |||
| @@ -1,8 +1,5 @@ | |||
| 1 | set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX) | 1 | # we always want to use GNU features if available, so set _GNU_SOURCE |
| 2 | # temp until further cleanup is done | 2 | set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE) |
| 3 | if(CORE_PLATFORM_NAME_LC STREQUAL rbpi) | ||
| 4 | list(APPEND ARCH_DEFINES -D_ARMEL -DTARGET_RASPBERRY_PI) | ||
| 5 | endif() | ||
| 6 | set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED | 3 | set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED |
| 7 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) | 4 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) |
| 8 | set(PLATFORM_DIR platform/linux) | 5 | set(PLATFORM_DIR platform/linux) |
| @@ -21,14 +18,17 @@ else() | |||
| 21 | set(ARCH arm) | 18 | set(ARCH arm) |
| 22 | set(NEON False) | 19 | set(NEON False) |
| 23 | set(NEON_FLAGS "-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp") | 20 | set(NEON_FLAGS "-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp") |
| 24 | elseif(CPU MATCHES "cortex-a7" OR CPU MATCHES "cortex-a53") | 21 | elseif(CPU MATCHES "cortex-a7") |
| 25 | set(ARCH arm) | 22 | set(ARCH arm) |
| 26 | set(NEON True) | 23 | set(NEON True) |
| 27 | set(NEON_FLAGS "-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad") | 24 | set(NEON_FLAGS "-fPIC -mcpu=cortex-a7") |
| 25 | elseif(CPU MATCHES "cortex-a53") | ||
| 26 | set(ARCH arm) | ||
| 27 | set(NEON True) | ||
| 28 | set(NEON_FLAGS "-fPIC -mcpu=cortex-a53") | ||
| 28 | elseif(CPU MATCHES arm) | 29 | elseif(CPU MATCHES arm) |
| 29 | set(ARCH arm) | 30 | set(ARCH arm) |
| 30 | set(NEON True) | 31 | set(NEON True) |
| 31 | set(NEON_FLAGS "-mfpu=neon -mvectorize-with-neon-quad") | ||
| 32 | elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64) | 32 | elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64) |
| 33 | set(ARCH aarch64) | 33 | set(ARCH aarch64) |
| 34 | set(NEON True) | 34 | set(NEON True) |
| @@ -37,6 +37,16 @@ else() | |||
| 37 | endif() | 37 | endif() |
| 38 | endif() | 38 | endif() |
| 39 | 39 | ||
| 40 | # temp until further cleanup is done | ||
| 41 | # add Raspberry Pi 2 and 3 specific flags | ||
| 42 | if(CORE_PLATFORM_NAME_LC STREQUAL rbpi) | ||
| 43 | if(CPU MATCHES "cortex-a7") | ||
| 44 | set(NEON_FLAGS "-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad") | ||
| 45 | elseif(CPU MATCHES "cortex-a53") | ||
| 46 | set(NEON_FLAGS "-fPIC -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad") | ||
| 47 | endif() | ||
| 48 | endif() | ||
| 49 | |||
| 40 | if((CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel) | 50 | if((CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel) |
| 41 | AND CMAKE_COMPILER_IS_GNUCXX) | 51 | AND CMAKE_COMPILER_IS_GNUCXX) |
| 42 | # Make sure we strip binaries in Release build | 52 | # Make sure we strip binaries in Release build |
| @@ -84,7 +94,7 @@ set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") | |||
| 84 | check_symbol_exists("mkostemp" "stdlib.h" HAVE_MKOSTEMP) | 94 | check_symbol_exists("mkostemp" "stdlib.h" HAVE_MKOSTEMP) |
| 85 | set(CMAKE_REQUIRED_DEFINITIONS "") | 95 | set(CMAKE_REQUIRED_DEFINITIONS "") |
| 86 | if(HAVE_MKOSTEMP) | 96 | if(HAVE_MKOSTEMP) |
| 87 | list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1" "-D_GNU_SOURCE") | 97 | list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1") |
| 88 | endif() | 98 | endif() |
| 89 | 99 | ||
| 90 | # Additional SYSTEM_DEFINES | 100 | # Additional SYSTEM_DEFINES |
diff --git a/cmake/scripts/linux/ExtraTargets.cmake b/cmake/scripts/linux/ExtraTargets.cmake index 4753f73..37d196a 100644 --- a/cmake/scripts/linux/ExtraTargets.cmake +++ b/cmake/scripts/linux/ExtraTargets.cmake | |||
| @@ -17,7 +17,9 @@ endif() | |||
| 17 | if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") | 17 | if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") |
| 18 | # This cannot go into wayland.cmake since it requires the Wayland dependencies | 18 | # This cannot go into wayland.cmake since it requires the Wayland dependencies |
| 19 | # to already be resolved | 19 | # to already be resolved |
| 20 | set(PROTOCOL_XMLS "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml" | 20 | set(PROTOCOL_XMLS "${WAYLANDPP_PROTOCOLS_DIR}/presentation-time.xml" |
| 21 | "${WAYLANDPP_PROTOCOLS_DIR}/xdg-shell.xml" | ||
| 22 | "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml" | ||
| 21 | "${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml") | 23 | "${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml") |
| 22 | add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" | 24 | add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" |
| 23 | COMMAND "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" | 25 | COMMAND "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" |
| @@ -26,4 +28,4 @@ if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") | |||
| 26 | 28 | ||
| 27 | # Dummy target for dependencies | 29 | # Dummy target for dependencies |
| 28 | add_custom_target(generate-wayland-extra-protocols DEPENDS wayland-extra-protocols.hpp) | 30 | add_custom_target(generate-wayland-extra-protocols DEPENDS wayland-extra-protocols.hpp) |
| 29 | endif() \ No newline at end of file | 31 | endif() |
diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index 8e4f61d..b3963a6 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | # Minimum SDK version we support | ||
| 2 | set(VS_MINIMUM_SDK_VERSION 10.0.14393.0) | ||
| 3 | |||
| 4 | if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION) | ||
| 5 | message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n" | ||
| 6 | "Windows SDK ${VS_MINIMUM_SDK_VERSION} or higher is required.\n" | ||
| 7 | "INFO: Windows SDKs can be installed from the Visual Studio installer.") | ||
| 8 | endif() | ||
| 9 | |||
| 1 | # -------- Architecture settings --------- | 10 | # -------- Architecture settings --------- |
| 2 | 11 | ||
| 3 | if(CMAKE_SIZEOF_VOID_P EQUAL 4) | 12 | if(CMAKE_SIZEOF_VOID_P EQUAL 4) |
| @@ -12,6 +21,7 @@ endif() | |||
| 12 | # -------- Paths (mainly for find_package) --------- | 21 | # -------- Paths (mainly for find_package) --------- |
| 13 | 22 | ||
| 14 | set(PLATFORM_DIR platform/win32) | 23 | set(PLATFORM_DIR platform/win32) |
| 24 | set(APP_RENDER_SYSTEM dx11) | ||
| 15 | 25 | ||
| 16 | set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/WinMain.cpp) | 26 | set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/WinMain.cpp) |
| 17 | 27 | ||
| @@ -31,7 +41,7 @@ set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python) | |||
| 31 | 41 | ||
| 32 | add_options(CXX ALL_BUILDS "/wd\"4996\"") | 42 | add_options(CXX ALL_BUILDS "/wd\"4996\"") |
| 33 | set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_DESKTOP -D__SSE__ -D__SSE2__) | 43 | set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_DESKTOP -D__SSE__ -D__SSE2__) |
| 34 | set(SYSTEM_DEFINES -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS | 44 | set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS |
| 35 | -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING | 45 | -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING |
| 36 | -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" | 46 | -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" |
| 37 | -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" | 47 | -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" |
| @@ -43,7 +53,7 @@ if(${ARCH} STREQUAL win32) | |||
| 43 | endif() | 53 | endif() |
| 44 | 54 | ||
| 45 | # Additional SYSTEM_DEFINES | 55 | # Additional SYSTEM_DEFINES |
| 46 | list(APPEND SYSTEM_DEFINES -DHAS_IRSERVERSUITE -DHAS_WIN32_NETWORK -DHAS_FILESYSTEM_SMB) | 56 | list(APPEND SYSTEM_DEFINES -DHAS_WIN32_NETWORK -DHAS_FILESYSTEM_SMB) |
| 47 | 57 | ||
| 48 | # Make sure /FS is set for Visual Studio in order to prevent simultaneous access to pdb files. | 58 | # Make sure /FS is set for Visual Studio in order to prevent simultaneous access to pdb files. |
| 49 | if(CMAKE_GENERATOR MATCHES "Visual Studio") | 59 | if(CMAKE_GENERATOR MATCHES "Visual Studio") |
diff --git a/cmake/scripts/windows/tools/patch.cmake b/cmake/scripts/windows/tools/patch.cmake index 0a342fa..b955b4c 100644 --- a/cmake/scripts/windows/tools/patch.cmake +++ b/cmake/scripts/windows/tools/patch.cmake | |||
| @@ -2,7 +2,7 @@ find_program(PATCH_FOUND NAMES patch patch.exe) | |||
| 2 | if(PATCH_FOUND) | 2 | if(PATCH_FOUND) |
| 3 | message(STATUS "patch utility found at ${PATCH_FOUND}") | 3 | message(STATUS "patch utility found at ${PATCH_FOUND}") |
| 4 | else() | 4 | else() |
| 5 | set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3") | 5 | set(PATCH_ARCHIVE_NAME "patch-2.7.6-bin") |
| 6 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") | 6 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") |
| 7 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") | 7 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") |
| 8 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) | 8 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) |
| @@ -28,6 +28,11 @@ else() | |||
| 28 | 28 | ||
| 29 | # copy patch.exe into the output directory | 29 | # copy patch.exe into the output directory |
| 30 | file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) | 30 | file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) |
| 31 | # copy patch depends | ||
| 32 | file(GLOB PATCH_BINARIES ${PATCH_PATH}/bin/*.dll) | ||
| 33 | if(NOT "${PATCH_BINARIES}" STREQUAL "") | ||
| 34 | file(INSTALL ${PATCH_BINARIES} DESTINATION ${ADDON_DEPENDS_PATH}/bin) | ||
| 35 | endif() | ||
| 31 | 36 | ||
| 32 | # make sure that cmake can find the copied patch.exe | 37 | # make sure that cmake can find the copied patch.exe |
| 33 | find_program(PATCH_FOUND NAMES patch patch.exe) | 38 | find_program(PATCH_FOUND NAMES patch patch.exe) |
diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake index 6c6622c..a663bb9 100644 --- a/cmake/scripts/windowsstore/ArchSetup.cmake +++ b/cmake/scripts/windowsstore/ArchSetup.cmake | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | # Minimum SDK version we support | ||
| 2 | set(VS_MINIMUM_SDK_VERSION 10.0.14393.0) | ||
| 3 | |||
| 4 | if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION) | ||
| 5 | message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n" | ||
| 6 | "Windows SDK ${VS_MINIMUM_SDK_VERSION} or higher is required.\n" | ||
| 7 | "INFO: Windows SDKs can be installed from the Visual Studio installer.") | ||
| 8 | endif() | ||
| 9 | |||
| 1 | # -------- Architecture settings --------- | 10 | # -------- Architecture settings --------- |
| 2 | 11 | ||
| 3 | check_symbol_exists(_X86_ "Windows.h" _X86_) | 12 | check_symbol_exists(_X86_ "Windows.h" _X86_) |
| @@ -24,6 +33,7 @@ unset(_ARM_) | |||
| 24 | # -------- Paths (mainly for find_package) --------- | 33 | # -------- Paths (mainly for find_package) --------- |
| 25 | 34 | ||
| 26 | set(PLATFORM_DIR platform/win32) | 35 | set(PLATFORM_DIR platform/win32) |
| 36 | set(APP_RENDER_SYSTEM dx11) | ||
| 27 | set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/win10/main.cpp) | 37 | set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/win10/main.cpp) |
| 28 | 38 | ||
| 29 | # Precompiled headers fail with per target output directory. (needs CMake 3.1) | 39 | # Precompiled headers fail with per target output directory. (needs CMake 3.1) |
| @@ -57,7 +67,7 @@ set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DXBMC_EXPOR | |||
| 57 | if(NOT SDK_TARGET_ARCH STREQUAL arm) | 67 | if(NOT SDK_TARGET_ARCH STREQUAL arm) |
| 58 | list(APPEND ARCH_DEFINES -D__SSE__ -D__SSE2__) | 68 | list(APPEND ARCH_DEFINES -D__SSE__ -D__SSE2__) |
| 59 | endif() | 69 | endif() |
| 60 | set(SYSTEM_DEFINES -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS | 70 | set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS |
| 61 | -DFMT_HEADER_ONLY -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING | 71 | -DFMT_HEADER_ONLY -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING |
| 62 | -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" | 72 | -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" |
| 63 | -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" | 73 | -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" |
| @@ -65,7 +75,7 @@ set(SYSTEM_DEFINES -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS | |||
| 65 | $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>) | 75 | $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>) |
| 66 | 76 | ||
| 67 | # Additional SYSTEM_DEFINES | 77 | # Additional SYSTEM_DEFINES |
| 68 | list(APPEND SYSTEM_DEFINES -DHAS_IRSERVERSUITE -DHAS_WIN10_NETWORK) | 78 | list(APPEND SYSTEM_DEFINES -DHAS_WIN10_NETWORK) |
| 69 | 79 | ||
| 70 | # The /MP option enables /FS by default. | 80 | # The /MP option enables /FS by default. |
| 71 | set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /ZW /EHsc /await") | 81 | set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /ZW /EHsc /await") |
diff --git a/cmake/scripts/windowsstore/Macros.cmake b/cmake/scripts/windowsstore/Macros.cmake index 6e7d1d0..7240138 100644 --- a/cmake/scripts/windowsstore/Macros.cmake +++ b/cmake/scripts/windowsstore/Macros.cmake | |||
| @@ -128,7 +128,8 @@ macro(winstore_append_props target) | |||
| 128 | endforeach(_dll DEBUG_DLLS) | 128 | endforeach(_dll DEBUG_DLLS) |
| 129 | 129 | ||
| 130 | add_deployment_content_group($(BuildRootPath)/dlls "" *.dll "${DEBUG_DLLS_EXCLUDE}") | 130 | add_deployment_content_group($(BuildRootPath)/dlls "" *.dll "${DEBUG_DLLS_EXCLUDE}") |
| 131 | add_deployment_content_group($(BuildRootPath)/system system **/* "$(BuildRootPath)/**/*.glsl") | 131 | add_deployment_content_group($(BuildRootPath)/system system **/* "$(BuildRootPath)/**/shaders/**") |
| 132 | add_deployment_content_group($(BuildRootPath)/system/shaders system/shaders **/*.fx "") | ||
| 132 | add_deployment_content_group($(BuildRootPath)/media media **/* "") | 133 | add_deployment_content_group($(BuildRootPath)/media media **/* "") |
| 133 | add_deployment_content_group($(BuildRootPath)/userdata userdata **/* "") | 134 | add_deployment_content_group($(BuildRootPath)/userdata userdata **/* "") |
| 134 | add_deployment_content_group($(BuildRootPath)/addons addons **/* "") | 135 | add_deployment_content_group($(BuildRootPath)/addons addons **/* "") |
diff --git a/cmake/scripts/windowsstore/tools/patch.cmake b/cmake/scripts/windowsstore/tools/patch.cmake index 0a342fa..b955b4c 100644 --- a/cmake/scripts/windowsstore/tools/patch.cmake +++ b/cmake/scripts/windowsstore/tools/patch.cmake | |||
| @@ -2,7 +2,7 @@ find_program(PATCH_FOUND NAMES patch patch.exe) | |||
| 2 | if(PATCH_FOUND) | 2 | if(PATCH_FOUND) |
| 3 | message(STATUS "patch utility found at ${PATCH_FOUND}") | 3 | message(STATUS "patch utility found at ${PATCH_FOUND}") |
| 4 | else() | 4 | else() |
| 5 | set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3") | 5 | set(PATCH_ARCHIVE_NAME "patch-2.7.6-bin") |
| 6 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") | 6 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") |
| 7 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") | 7 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") |
| 8 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) | 8 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) |
| @@ -28,6 +28,11 @@ else() | |||
| 28 | 28 | ||
| 29 | # copy patch.exe into the output directory | 29 | # copy patch.exe into the output directory |
| 30 | file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) | 30 | file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) |
| 31 | # copy patch depends | ||
| 32 | file(GLOB PATCH_BINARIES ${PATCH_PATH}/bin/*.dll) | ||
| 33 | if(NOT "${PATCH_BINARIES}" STREQUAL "") | ||
| 34 | file(INSTALL ${PATCH_BINARIES} DESTINATION ${ADDON_DEPENDS_PATH}/bin) | ||
| 35 | endif() | ||
| 31 | 36 | ||
| 32 | # make sure that cmake can find the copied patch.exe | 37 | # make sure that cmake can find the copied patch.exe |
| 33 | find_program(PATCH_FOUND NAMES patch patch.exe) | 38 | find_program(PATCH_FOUND NAMES patch patch.exe) |
diff --git a/cmake/treedata/android/subdirs.txt b/cmake/treedata/android/subdirs.txt index b56618a..7f7fef5 100644 --- a/cmake/treedata/android/subdirs.txt +++ b/cmake/treedata/android/subdirs.txt | |||
| @@ -1,16 +1,17 @@ | |||
| 1 | xbmc/cores/RetroPlayer/process/android cores/RetroPlayer/process/android | 1 | xbmc/cores/RetroPlayer/process/android cores/RetroPlayer/process/android |
| 2 | xbmc/platform/linux platform/linux | ||
| 3 | xbmc/input/touch input/touch | 2 | xbmc/input/touch input/touch |
| 4 | xbmc/input/touch/generic input/touch/generic | 3 | xbmc/input/touch/generic input/touch/generic |
| 5 | xbmc/network/linux network/linux | ||
| 6 | xbmc/network/android network/android | ||
| 7 | xbmc/peripherals/bus/linux peripherals/bus/linux | ||
| 8 | xbmc/peripherals/bus/android peripherals/bus/android | ||
| 9 | xbmc/powermanagement/android powermanagement/android | ||
| 10 | xbmc/storage/android storage/android | ||
| 11 | xbmc/filesystem/posix filesystem/posix | ||
| 12 | xbmc/utils/posix utils_posix | ||
| 13 | xbmc/windowing/android windowing/android | 4 | xbmc/windowing/android windowing/android |
| 14 | xbmc/platform/posix posix | 5 | xbmc/platform/posix platform/posix |
| 15 | xbmc/platform/android/activity android_activity | 6 | xbmc/platform/posix/filesystem platform/posix/filesystem |
| 16 | xbmc/platform/android/bionic_supplement android_bionicsupplement | 7 | xbmc/platform/posix/utils platform/posix/utils |
| 8 | xbmc/platform/linux platform/linux | ||
| 9 | xbmc/platform/linux/network platform/linux/network | ||
| 10 | xbmc/platform/linux/peripherals platform/linux/peripherals | ||
| 11 | xbmc/platform/android/activity platform/android/activity | ||
| 12 | xbmc/platform/android/bionic_supplement platform/android/bionicsupplement | ||
| 13 | xbmc/platform/android/filesystem platform/android/filesystem | ||
| 14 | xbmc/platform/android/network platform/android/network | ||
| 15 | xbmc/platform/android/peripherals platform/android/peripherals | ||
| 16 | xbmc/platform/android/powermanagement platform/android/powermanagement | ||
| 17 | xbmc/platform/android/storage platform/android/storage | ||
diff --git a/cmake/treedata/common/games.txt b/cmake/treedata/common/games.txt index b2faead..7b63f6a 100644 --- a/cmake/treedata/common/games.txt +++ b/cmake/treedata/common/games.txt | |||
| @@ -1,10 +1,12 @@ | |||
| 1 | xbmc/games games | 1 | xbmc/games games |
| 2 | xbmc/games/addons games/addons | 2 | xbmc/games/addons games/addons |
| 3 | xbmc/games/addons/input games/addons/input | ||
| 3 | xbmc/games/addons/playback games/addons/playback | 4 | xbmc/games/addons/playback games/addons/playback |
| 4 | xbmc/games/addons/savestates games/addons/savestates | 5 | xbmc/games/addons/savestates games/addons/savestates |
| 5 | xbmc/games/controllers games/controllers | 6 | xbmc/games/controllers games/controllers |
| 6 | xbmc/games/controllers/dialogs games/controllers/dialogs | 7 | xbmc/games/controllers/dialogs games/controllers/dialogs |
| 7 | xbmc/games/controllers/guicontrols games/controllers/guicontrols | 8 | xbmc/games/controllers/guicontrols games/controllers/guicontrols |
| 9 | xbmc/games/controllers/types games/controllers/types | ||
| 8 | xbmc/games/controllers/windows games/controllers/windows | 10 | xbmc/games/controllers/windows games/controllers/windows |
| 9 | xbmc/games/dialogs games/dialogs | 11 | xbmc/games/dialogs games/dialogs |
| 10 | xbmc/games/dialogs/osd games/dialogs/osd | 12 | xbmc/games/dialogs/osd games/dialogs/osd |
diff --git a/cmake/treedata/common/retroplayer.txt b/cmake/treedata/common/retroplayer.txt index 97e27b3..0239801 100644 --- a/cmake/treedata/common/retroplayer.txt +++ b/cmake/treedata/common/retroplayer.txt | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | xbmc/cores/RetroPlayer cores/RetroPlayer | 1 | xbmc/cores/RetroPlayer cores/RetroPlayer |
| 2 | xbmc/cores/RetroPlayer/guibridge cores/RetroPlayer/guibridge | ||
| 2 | xbmc/cores/RetroPlayer/guicontrols cores/RetroPlayer/guicontrols | 3 | xbmc/cores/RetroPlayer/guicontrols cores/RetroPlayer/guicontrols |
| 4 | xbmc/cores/RetroPlayer/guiwindows cores/RetroPlayer/guiwindows | ||
| 3 | xbmc/cores/RetroPlayer/process cores/RetroPlayer/process | 5 | xbmc/cores/RetroPlayer/process cores/RetroPlayer/process |
| 4 | xbmc/cores/RetroPlayer/rendering cores/RetroPlayer/rendering | 6 | xbmc/cores/RetroPlayer/rendering cores/RetroPlayer/rendering |
| 5 | xbmc/cores/RetroPlayer/rendering/VideoRenderers cores/RetroPlayer/rendering/VideoRenderers | 7 | xbmc/cores/RetroPlayer/rendering/VideoRenderers cores/RetroPlayer/rendering/VideoRenderers |
| 6 | xbmc/cores/RetroPlayer/rendering/VideoShaders cores/RetroPlayer/rendering/VideoShaders | 8 | xbmc/cores/RetroPlayer/rendering/VideoShaders cores/RetroPlayer/rendering/VideoShaders |
| 7 | xbmc/cores/RetroPlayer/windows cores/RetroPlayer/windows | ||
diff --git a/cmake/treedata/common/subdirs.txt b/cmake/treedata/common/subdirs.txt index d5412b5..368f473 100644 --- a/cmake/treedata/common/subdirs.txt +++ b/cmake/treedata/common/subdirs.txt | |||
| @@ -17,8 +17,8 @@ xbmc/commons commons | |||
| 17 | xbmc/dbwrappers dbwrappers | 17 | xbmc/dbwrappers dbwrappers |
| 18 | xbmc/dialogs dialogs | 18 | xbmc/dialogs dialogs |
| 19 | xbmc/favourites favourites | 19 | xbmc/favourites favourites |
| 20 | xbmc/guiinfo guiinfo | ||
| 21 | xbmc/guilib guilib | 20 | xbmc/guilib guilib |
| 21 | xbmc/guilib/guiinfo guilib_guiinfo | ||
| 22 | xbmc/input input | 22 | xbmc/input input |
| 23 | xbmc/input/joysticks input/joysticks | 23 | xbmc/input/joysticks input/joysticks |
| 24 | xbmc/input/joysticks/dialogs input/joysticks/dialogs | 24 | xbmc/input/joysticks/dialogs input/joysticks/dialogs |
diff --git a/cmake/treedata/freebsd/subdirs.txt b/cmake/treedata/freebsd/subdirs.txt index f7651ee..fe0725c 100644 --- a/cmake/treedata/freebsd/subdirs.txt +++ b/cmake/treedata/freebsd/subdirs.txt | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | xbmc/platform/linux platform/linux | 1 | xbmc/platform/posix platform/posix |
| 2 | xbmc/platform/linux/input platform/linux/input | 2 | xbmc/platform/posix/filesystem platform/posix/filesystem |
| 3 | xbmc/input/touch input/touch | 3 | xbmc/platform/posix/utils platform/posix/utils |
| 4 | xbmc/input/touch/generic input/touch/generic | 4 | xbmc/platform/linux platform/linux |
| 5 | xbmc/network/linux network/linux | 5 | xbmc/platform/linux/input platform/linux/input |
| 6 | xbmc/peripherals/bus/linux peripherals/bus/linux | 6 | xbmc/platform/linux/network platform/linux/network |
| 7 | xbmc/powermanagement/linux powermanagement/linux | 7 | xbmc/platform/linux/peripherals platform/linux/peripherals |
| 8 | xbmc/storage/linux storage/linux | 8 | xbmc/platform/linux/powermanagement platform/linux/powermanagement |
| 9 | xbmc/filesystem/posix filesystem/posix | 9 | xbmc/platform/linux/storage platform/linux/storage |
| 10 | xbmc/utils/posix utils_posix | 10 | xbmc/input/touch input/touch |
| 11 | xbmc/platform/posix posix | 11 | xbmc/input/touch/generic input/touch/generic |
| 12 | xbmc/freebsd freebsdsupport | ||
diff --git a/cmake/treedata/ios/subdirs.txt b/cmake/treedata/ios/subdirs.txt index 00f5cf1..a287418 100644 --- a/cmake/treedata/ios/subdirs.txt +++ b/cmake/treedata/ios/subdirs.txt | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | xbmc/platform/linux platform/linux | 1 | xbmc/platform/linux platform/linux |
| 2 | xbmc/input/touch input/touch | 2 | xbmc/platform/linux/network platform/linux/network |
| 3 | xbmc/input/touch/generic input/touch/generic | 3 | xbmc/input/touch input/touch |
| 4 | xbmc/network/linux network/linux | 4 | xbmc/input/touch/generic input/touch/generic |
| 5 | xbmc/network/osx network/osx | 5 | xbmc/platform/posix posix |
| 6 | xbmc/peripherals/bus/osx peripherals/bus/osx | 6 | xbmc/platform/posix/filesystem platform/posix/filesystem |
| 7 | xbmc/powermanagement/osx powermanagement/osx | 7 | xbmc/platform/posix/utils platform/posix/utils |
| 8 | xbmc/storage/osx storage/osx | 8 | xbmc/platform/darwin platform/darwin |
| 9 | xbmc/platform/posix posix | 9 | xbmc/platform/darwin/ios platform/ios |
| 10 | xbmc/platform/darwin platform_darwin | 10 | xbmc/platform/darwin/ios-common platform/ios-common |
| 11 | xbmc/platform/darwin/ios platform_ios | 11 | xbmc/platform/darwin/osx/network platform/osx/network |
| 12 | xbmc/platform/darwin/ios-common platform_ios-common | 12 | xbmc/platform/darwin/osx/peripherals platform/osx/peripherals |
| 13 | xbmc/filesystem/posix filesystem/posix | 13 | xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement |
| 14 | xbmc/utils/posix utils_posix | 14 | xbmc/platform/darwin/osx/storage platform/osx/storage |
| 15 | xbmc/windowing/osx windowing/osx | 15 | xbmc/windowing/osx windowing/osx |
| 16 | xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios | 16 | xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios |
| 17 | xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios | 17 | xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios |
diff --git a/cmake/treedata/linux/subdirs.txt b/cmake/treedata/linux/subdirs.txt index b310b53..6e1d013 100644 --- a/cmake/treedata/linux/subdirs.txt +++ b/cmake/treedata/linux/subdirs.txt | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | xbmc/platform/linux platform/linux | 1 | xbmc/platform/posix platform/posix |
| 2 | xbmc/platform/linux/input platform/linux/input | 2 | xbmc/platform/posix/filesystem platform/posix/filesystem |
| 3 | xbmc/input/touch input/touch | 3 | xbmc/platform/posix/utils platform/posix/utils |
| 4 | xbmc/input/touch/generic input/touch/generic | 4 | xbmc/platform/linux platform/linux |
| 5 | xbmc/network/linux network/linux | 5 | xbmc/platform/linux/input platform/linux/input |
| 6 | xbmc/peripherals/bus/linux peripherals/bus/linux | 6 | xbmc/platform/linux/network platform/linux/network |
| 7 | xbmc/powermanagement/linux powermanagement/linux | 7 | xbmc/platform/linux/peripherals platform/linux/peripherals |
| 8 | xbmc/storage/linux storage/linux | 8 | xbmc/platform/linux/powermanagement platform/linux/powermanagement |
| 9 | xbmc/filesystem/posix filesystem/posix | 9 | xbmc/platform/linux/storage platform/linux/storage |
| 10 | xbmc/utils/posix utils_posix | 10 | xbmc/input/touch input/touch |
| 11 | xbmc/platform/posix posix | 11 | xbmc/input/touch/generic input/touch/generic |
| 12 | xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi | 12 | xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi |
| 13 | xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi | 13 | xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi |
| 14 | xbmc/windowing/linux windowing/linux | 14 | xbmc/windowing/linux windowing/linux |
diff --git a/cmake/treedata/osx/subdirs.txt b/cmake/treedata/osx/subdirs.txt index 5b1b302..166a966 100644 --- a/cmake/treedata/osx/subdirs.txt +++ b/cmake/treedata/osx/subdirs.txt | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | xbmc/platform/linux platform/linux | 1 | xbmc/platform/posix posix |
| 2 | xbmc/network/linux network/linux | 2 | xbmc/platform/posix/filesystem platform/posix/filesystem |
| 3 | xbmc/network/osx network/osx | 3 | xbmc/platform/posix/utils platform/posix/utils |
| 4 | xbmc/peripherals/bus/osx peripherals/bus/osx | 4 | xbmc/platform/linux platform/linux |
| 5 | xbmc/powermanagement/osx powermanagement/osx | 5 | xbmc/platform/linux/network platform/linux/network |
| 6 | xbmc/storage/osx storage/osx | 6 | xbmc/platform/darwin platform/darwin |
| 7 | xbmc/platform/posix posix | 7 | xbmc/platform/darwin/osx platform/osx |
| 8 | xbmc/platform/darwin platform_darwin | 8 | xbmc/platform/darwin/osx/network platform/osx/network |
| 9 | xbmc/platform/darwin/osx platform_osx | 9 | xbmc/platform/darwin/osx/peripherals platform/osx/peripherals |
| 10 | xbmc/filesystem/posix filesystem/posix | 10 | xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement |
| 11 | xbmc/utils/posix utils_posix | 11 | xbmc/platform/darwin/osx/storage platform/osx/storage |
| 12 | xbmc/windowing/osx windowing/osx | 12 | xbmc/windowing/osx windowing/osx |
| 13 | xbmc/cores/RetroPlayer/process/osx cores/RetroPlayer/process/osx | 13 | xbmc/cores/RetroPlayer/process/osx cores/RetroPlayer/process/osx |
| 14 | xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx | 14 | xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx |
diff --git a/cmake/treedata/windows/subdirs.txt b/cmake/treedata/windows/subdirs.txt index 8344320..a2c8c29 100644 --- a/cmake/treedata/windows/subdirs.txt +++ b/cmake/treedata/windows/subdirs.txt | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | xbmc/platform/win32 platform_win32 | 1 | xbmc/platform/win32 platform/win32 |
| 2 | xbmc/input/windows input/windows | 2 | xbmc/platform/win32/input platform/win32/input |
| 3 | xbmc/input/touch input/touch | 3 | xbmc/platform/win32/filesystem platform/win32/filesystem |
| 4 | xbmc/input/touch/generic input/touch/generic | 4 | xbmc/platform/win32/network platform/win32/network |
| 5 | xbmc/network/windows network/windows | 5 | xbmc/platform/win32/peripherals platform/win32/peripherals |
| 6 | xbmc/network/mdns network/mdns | 6 | xbmc/platform/win32/powermanagement platform/win32/powermanagement |
| 7 | xbmc/peripherals/bus/win32 peripherals/bus/win32 | 7 | xbmc/platform/win32/storage platform/win32/storage |
| 8 | xbmc/powermanagement/windows powermanagement/windows | 8 | xbmc/platform/win32/utils platform/win32/utils |
| 9 | xbmc/storage/windows storage/windows | 9 | xbmc/input/touch input/touch |
| 10 | xbmc/filesystem/win32 filesystem/win32 | 10 | xbmc/input/touch/generic input/touch/generic |
| 11 | xbmc/utils/win32 utils_win32 | 11 | xbmc/network/mdns network/mdns |
| 12 | xbmc/rendering/dx rendering_dx | 12 | xbmc/rendering/dx rendering/dx |
| 13 | xbmc/threads/platform/win threads_win | 13 | xbmc/threads/platform/win threads/win |
| 14 | xbmc/windowing/windows windowing/windows | 14 | xbmc/windowing/windows windowing/windows |
| 15 | xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows | 15 | xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows |
| 16 | xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows | 16 | xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows |
| 17 | xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows | 17 | xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows |
diff --git a/cmake/treedata/windowsstore/subdirs.txt b/cmake/treedata/windowsstore/subdirs.txt index 84150d5..604be08 100644 --- a/cmake/treedata/windowsstore/subdirs.txt +++ b/cmake/treedata/windowsstore/subdirs.txt | |||
| @@ -1,16 +1,15 @@ | |||
| 1 | xbmc/platform/win10 platform_win10 | 1 | xbmc/platform/win10 platform/win10 |
| 2 | xbmc/input/windows input/windows | 2 | xbmc/platform/win10/filesystem platform/win10/filesystem |
| 3 | xbmc/input/touch input/touch | 3 | xbmc/platform/win10/network platform/win10/network |
| 4 | xbmc/input/touch/generic input/touch/generic | 4 | xbmc/platform/win10/peripherals platform/win10/peripherals |
| 5 | xbmc/network/win10 network/win10 | 5 | xbmc/platform/win10/powermanagement platfrom/win10/powermanagement |
| 6 | xbmc/network/mdns network/mdns | 6 | xbmc/platform/win10/storage platfrom/win10/storage |
| 7 | xbmc/peripherals/bus/win10 peripherals/bus/win10 | 7 | xbmc/platform/win32/filesystem platform/win32/filesystem |
| 8 | xbmc/powermanagement/win10 powermanagement/win10 | 8 | xbmc/platform/win32/utils platform/win32/utils |
| 9 | xbmc/storage/win10 storage/win10 | 9 | xbmc/input/touch input/touch |
| 10 | xbmc/filesystem/win32 filesystem/win32 | 10 | xbmc/input/touch/generic input/touch/generic |
| 11 | xbmc/filesystem/win10 filesystem/win10 | 11 | xbmc/network/mdns network/mdns |
| 12 | xbmc/utils/win32 utils_win32 | 12 | xbmc/rendering/dx rendering/dx |
| 13 | xbmc/rendering/dx rendering_dx | 13 | xbmc/threads/platform/win threads/win |
| 14 | xbmc/threads/platform/win threads_win | 14 | xbmc/windowing/win10 windowing/win10 |
| 15 | xbmc/windowing/win10 windowing/win10 | ||
| 16 | xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows | 15 | xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows |
diff --git a/version.txt b/version.txt index 545f436..a9598ee 100644 --- a/version.txt +++ b/version.txt | |||
| @@ -3,9 +3,9 @@ COMPANY_NAME XBMC Foundation | |||
| 3 | WEBSITE http://kodi.tv | 3 | WEBSITE http://kodi.tv |
| 4 | VERSION_MAJOR 18 | 4 | VERSION_MAJOR 18 |
| 5 | VERSION_MINOR 0 | 5 | VERSION_MINOR 0 |
| 6 | VERSION_TAG ALPHA1 | 6 | VERSION_TAG ALPHA2 |
| 7 | VERSION_CODE 17.99.701 | 7 | VERSION_CODE 17.99.702 |
| 8 | ADDON_API 17.9.701 | 8 | ADDON_API 17.9.702 |
| 9 | APP_PACKAGE org.xbmc.kodi | 9 | APP_PACKAGE org.xbmc.kodi |
| 10 | PACKAGE_IDENTITY XBMCFoundation.Kodi | 10 | PACKAGE_IDENTITY XBMCFoundation.Kodi |
| 11 | PACKAGE_PUBLISHER C62BD90A-CDD8-477F-96C3-B25992247B97 | 11 | PACKAGE_PUBLISHER C62BD90A-CDD8-477F-96C3-B25992247B97 |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h index 432a1c3..7abd8e1 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h | |||
| @@ -40,13 +40,9 @@ | |||
| 40 | #undef PRAGMA_PACK_END | 40 | #undef PRAGMA_PACK_END |
| 41 | 41 | ||
| 42 | #if defined(__GNUC__) | 42 | #if defined(__GNUC__) |
| 43 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | 43 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) |
| 44 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) | 44 | #define PRAGMA_PACK 0 |
| 45 | #define PRAGMA_PACK 0 | 45 | #define ATTRIBUTE_HIDDEN __attribute__ ((visibility ("hidden"))) |
| 46 | #if __GNUC__ >= 4 | ||
| 47 | #define ATTRIBUTE_HIDDEN __attribute__ ((visibility ("hidden"))) | ||
| 48 | #endif | ||
| 49 | #endif | ||
| 50 | #endif | 46 | #endif |
| 51 | 47 | ||
| 52 | #if !defined(ATTRIBUTE_PACKED) | 48 | #if !defined(ATTRIBUTE_PACKED) |
| @@ -180,6 +176,8 @@ typedef struct AddonToKodiFuncTable_Addon | |||
| 180 | AddonToKodiFuncTable_kodi_filesystem* kodi_filesystem; | 176 | AddonToKodiFuncTable_kodi_filesystem* kodi_filesystem; |
| 181 | AddonToKodiFuncTable_kodi_gui* kodi_gui; | 177 | AddonToKodiFuncTable_kodi_gui* kodi_gui; |
| 182 | AddonToKodiFuncTable_kodi_network *kodi_network; | 178 | AddonToKodiFuncTable_kodi_network *kodi_network; |
| 179 | |||
| 180 | void* (*get_interface)(void* kodiBase, const char *name, const char *version); | ||
| 183 | } AddonToKodiFuncTable_Addon; | 181 | } AddonToKodiFuncTable_Addon; |
| 184 | 182 | ||
| 185 | /* | 183 | /* |
| @@ -605,6 +603,33 @@ inline std::string TranslateAddonStatus(ADDON_STATUS status) | |||
| 605 | } /* namespace kodi */ | 603 | } /* namespace kodi */ |
| 606 | //---------------------------------------------------------------------------- | 604 | //---------------------------------------------------------------------------- |
| 607 | 605 | ||
| 606 | //============================================================================== | ||
| 607 | namespace kodi { | ||
| 608 | /// | ||
| 609 | /// \ingroup cpp_kodi | ||
| 610 | /// @brief Returns a function table to a named interface | ||
| 611 | /// | ||
| 612 | /// @return pointer to struct containing interface functions | ||
| 613 | /// | ||
| 614 | /// | ||
| 615 | /// ------------------------------------------------------------------------ | ||
| 616 | /// | ||
| 617 | /// **Example:** | ||
| 618 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 619 | /// #include <kodi/General.h> | ||
| 620 | /// #include <kodi/platform/foo.h> | ||
| 621 | /// ... | ||
| 622 | /// FuncTable_foo *table = kodi::GetPlatformInfo(foo_name, foo_version); | ||
| 623 | /// ... | ||
| 624 | /// ~~~~~~~~~~~~~ | ||
| 625 | /// | ||
| 626 | inline void* GetInterface(const std::string &name, const std::string &version) | ||
| 627 | { | ||
| 628 | AddonToKodiFuncTable_Addon* toKodi = ::kodi::addon::CAddonBase::m_interface->toKodi; | ||
| 629 | |||
| 630 | return toKodi->get_interface(toKodi->kodiBase, name.c_str(), version.c_str()); | ||
| 631 | } | ||
| 632 | } /* namespace kodi */ | ||
| 608 | 633 | ||
| 609 | /*! addon creation macro | 634 | /*! addon creation macro |
| 610 | * @todo cleanup this stupid big macro | 635 | * @todo cleanup this stupid big macro |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AudioEngine.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AudioEngine.h deleted file mode 100644 index 02faf86..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AudioEngine.h +++ /dev/null | |||
| @@ -1,597 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2017 Team KODI | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with Kodi; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "AddonBase.h" | ||
| 23 | |||
| 24 | #ifdef BUILD_KODI_ADDON | ||
| 25 | #include "AEChannelData.h" | ||
| 26 | #else | ||
| 27 | #include "cores/AudioEngine/Utils/AEChannelData.h" | ||
| 28 | #endif | ||
| 29 | |||
| 30 | //============================================================================== | ||
| 31 | /// | ||
| 32 | /// \defgroup cpp_kodi_audioengine Interface - kodi::audioengine | ||
| 33 | /// \ingroup cpp | ||
| 34 | /// @brief **Audio engine functions** | ||
| 35 | /// | ||
| 36 | /// | ||
| 37 | /// It has the header \ref AudioEngine.h "#include <kodi/AudioEngine.h>" be included | ||
| 38 | /// to enjoy it. | ||
| 39 | /// | ||
| 40 | //------------------------------------------------------------------------------ | ||
| 41 | |||
| 42 | //============================================================================== | ||
| 43 | /// | ||
| 44 | /// \defgroup cpp_kodi_audioengine_Defs Definitions, structures and enumerators | ||
| 45 | /// \ingroup cpp_kodi_audioengine | ||
| 46 | /// @brief **Library definition values** | ||
| 47 | /// | ||
| 48 | //------------------------------------------------------------------------------ | ||
| 49 | |||
| 50 | extern "C" | ||
| 51 | { | ||
| 52 | |||
| 53 | //============================================================================ | ||
| 54 | /// \ingroup cpp_kodi_audioengine_Defs | ||
| 55 | /// @brief Bit options to pass to CAddonAEStream | ||
| 56 | /// | ||
| 57 | typedef enum AudioEngineStreamOptions | ||
| 58 | { | ||
| 59 | /// force resample even if rates match | ||
| 60 | AUDIO_STREAM_FORCE_RESAMPLE = 1 << 0, | ||
| 61 | /// create the stream paused | ||
| 62 | AUDIO_STREAM_PAUSED = 1 << 1, | ||
| 63 | /// autostart the stream when enough data is buffered | ||
| 64 | AUDIO_STREAM_AUTOSTART = 1 << 2, | ||
| 65 | /// if this option is set the ADSP-System is bypassed and the raw stream | ||
| 66 | /// will be passed through IAESink | ||
| 67 | AUDIO_STREAM_BYPASS_ADSP = 1 << 3 | ||
| 68 | } AudioEngineStreamOptions; | ||
| 69 | //---------------------------------------------------------------------------- | ||
| 70 | |||
| 71 | //============================================================================ | ||
| 72 | /// \defgroup cpp_kodi_audioengine_Defs_AudioEngineFormat struct AudioEngineFormat | ||
| 73 | /// \ingroup cpp_kodi_audioengine_Defs | ||
| 74 | /// @brief The audio format structure that fully defines a stream's audio | ||
| 75 | /// information | ||
| 76 | /// | ||
| 77 | //@{ | ||
| 78 | struct AudioEngineFormat | ||
| 79 | { | ||
| 80 | /// The stream's data format (eg, AE_FMT_S16LE) | ||
| 81 | enum AEDataFormat m_dataFormat; | ||
| 82 | |||
| 83 | /// The stream's sample rate (eg, 48000) | ||
| 84 | unsigned int m_sampleRate; | ||
| 85 | |||
| 86 | /// The encoded streams sample rate if a bitstream, otherwise undefined | ||
| 87 | unsigned int m_encodedRate; | ||
| 88 | |||
| 89 | /// The amount of used speaker channels | ||
| 90 | unsigned int m_channelCount; | ||
| 91 | |||
| 92 | /// The stream's channel layout | ||
| 93 | enum AEChannel m_channels[AE_CH_MAX]; | ||
| 94 | |||
| 95 | /// The number of frames per period | ||
| 96 | unsigned int m_frames; | ||
| 97 | |||
| 98 | /// The size of one frame in bytes | ||
| 99 | unsigned int m_frameSize; | ||
| 100 | |||
| 101 | AudioEngineFormat() | ||
| 102 | { | ||
| 103 | m_dataFormat = AE_FMT_INVALID; | ||
| 104 | m_sampleRate = 0; | ||
| 105 | m_encodedRate = 0; | ||
| 106 | m_frames = 0; | ||
| 107 | m_frameSize = 0; | ||
| 108 | m_channelCount = 0; | ||
| 109 | |||
| 110 | for (unsigned int ch = 0; ch < AE_CH_MAX; ++ch) | ||
| 111 | { | ||
| 112 | m_channels[ch] = AE_CH_MAX; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | /// Function to compare the format structure with another | ||
| 117 | bool compareFormat(const AudioEngineFormat *fmt) | ||
| 118 | { | ||
| 119 | if (!fmt) | ||
| 120 | { | ||
| 121 | return false; | ||
| 122 | } | ||
| 123 | |||
| 124 | if (m_dataFormat != fmt->m_dataFormat || | ||
| 125 | m_sampleRate != fmt->m_sampleRate || | ||
| 126 | m_encodedRate != fmt->m_encodedRate || | ||
| 127 | m_frames != fmt->m_frames || | ||
| 128 | m_frameSize != fmt->m_frameSize || | ||
| 129 | m_channelCount != fmt->m_channelCount) | ||
| 130 | { | ||
| 131 | return false; | ||
| 132 | } | ||
| 133 | |||
| 134 | for (unsigned int ch = 0; ch < AE_CH_MAX; ++ch) | ||
| 135 | { | ||
| 136 | if (fmt->m_channels[ch] != m_channels[ch]) | ||
| 137 | { | ||
| 138 | return false; | ||
| 139 | } | ||
| 140 | } | ||
| 141 | |||
| 142 | return true; | ||
| 143 | } | ||
| 144 | }; | ||
| 145 | //@} | ||
| 146 | //---------------------------------------------------------------------------- | ||
| 147 | |||
| 148 | /* A stream handle pointer, which is only used internally by the addon stream handle */ | ||
| 149 | typedef void AEStreamHandle; | ||
| 150 | |||
| 151 | /* | ||
| 152 | * Function address structure, not need to visible on dev kit doxygen | ||
| 153 | * documentation | ||
| 154 | */ | ||
| 155 | typedef struct AddonToKodiFuncTable_kodi_audioengine | ||
| 156 | { | ||
| 157 | AEStreamHandle* (*make_stream)(void *kodiBase, AudioEngineFormat* format, unsigned int options); | ||
| 158 | void (*free_stream)(void *kodiBase, AEStreamHandle *stream); | ||
| 159 | bool (*get_current_sink_format)(void *kodiBase, AudioEngineFormat* sink_format); | ||
| 160 | |||
| 161 | // Audio Engine Stream definitions | ||
| 162 | unsigned int (*aestream_get_space)(void *kodiBase, AEStreamHandle *handle); | ||
| 163 | unsigned int (*aestream_add_data)(void *kodiBase, AEStreamHandle *handle, uint8_t* const *data, | ||
| 164 | unsigned int offset, unsigned int frames, double pts); | ||
| 165 | double (*aestream_get_delay)(void *kodiBase, AEStreamHandle *handle); | ||
| 166 | bool (*aestream_is_buffering)(void *kodiBase, AEStreamHandle *handle); | ||
| 167 | double (*aestream_get_cache_time)(void *kodiBase, AEStreamHandle *handle); | ||
| 168 | double (*aestream_get_cache_total)(void *kodiBase, AEStreamHandle *handle); | ||
| 169 | void (*aestream_pause)(void *kodiBase, AEStreamHandle *handle); | ||
| 170 | void (*aestream_resume)(void *kodiBase, AEStreamHandle *handle); | ||
| 171 | void (*aestream_drain)(void *kodiBase, AEStreamHandle *handle, bool wait); | ||
| 172 | bool (*aestream_is_draining)(void *kodiBase, AEStreamHandle *handle); | ||
| 173 | bool (*aestream_is_drained)(void *kodiBase, AEStreamHandle *handle); | ||
| 174 | void (*aestream_flush)(void *kodiBase, AEStreamHandle *handle); | ||
| 175 | float (*aestream_get_volume)(void *kodiBase, AEStreamHandle *handle); | ||
| 176 | void (*aestream_set_volume)(void *kodiBase, AEStreamHandle *handle, float volume); | ||
| 177 | float (*aestream_get_amplification)(void *kodiBase, AEStreamHandle *handle); | ||
| 178 | void (*aestream_set_amplification)(void *kodiBase, AEStreamHandle *handle, float amplify); | ||
| 179 | unsigned int (*aestream_get_frame_size)(void *kodiBase, AEStreamHandle *handle); | ||
| 180 | unsigned int (*aestream_get_channel_count)(void *kodiBase, AEStreamHandle *handle); | ||
| 181 | unsigned int (*aestream_get_sample_rate)(void *kodiBase, AEStreamHandle *handle); | ||
| 182 | AEDataFormat (*aestream_get_data_format)(void *kodiBase, AEStreamHandle *handle); | ||
| 183 | double (*aestream_get_resample_ratio)(void *kodiBase, AEStreamHandle *handle); | ||
| 184 | void (*aestream_set_resample_ratio)(void *kodiBase, AEStreamHandle *handle, double ratio); | ||
| 185 | } AddonToKodiFuncTable_kodi_audioengine; | ||
| 186 | |||
| 187 | } /* extern "C" */ | ||
| 188 | |||
| 189 | namespace kodi | ||
| 190 | { | ||
| 191 | namespace audioengine | ||
| 192 | { | ||
| 193 | |||
| 194 | //============================================================================ | ||
| 195 | /// | ||
| 196 | /// \defgroup cpp_kodi_audioengine_CAddonAEStream class CAddonAEStream | ||
| 197 | /// \ingroup cpp_kodi_audioengine | ||
| 198 | /// @brief **Audio Engine Stream Class** | ||
| 199 | /// | ||
| 200 | /// | ||
| 201 | /// It has the header \ref AudioEngine.h "#include <kodi/AudioEngine.h>" be | ||
| 202 | /// included to enjoy it. | ||
| 203 | /// | ||
| 204 | //---------------------------------------------------------------------------- | ||
| 205 | class CAddonAEStream | ||
| 206 | { | ||
| 207 | public: | ||
| 208 | //========================================================================== | ||
| 209 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 210 | /// @brief Contructs new class to an Kodi IAEStream in the format specified. | ||
| 211 | /// | ||
| 212 | /// @param[in] format The data format the incoming audio will be in | ||
| 213 | /// (e.g. \ref AE_FMT_S16LE) | ||
| 214 | /// @param[in] options [opt] A bit field of stream options (see: enum \ref AudioEngineStreamOptions) | ||
| 215 | /// | ||
| 216 | /// | ||
| 217 | /// ------------------------------------------------------------------------ | ||
| 218 | /// | ||
| 219 | /// **Audio engine format information:** | ||
| 220 | /// @code | ||
| 221 | /// /* | ||
| 222 | /// * Audio engine format information | ||
| 223 | /// * | ||
| 224 | /// * Only as example shown here! See always the original structure on related header. | ||
| 225 | /// */ | ||
| 226 | /// typedef struct AudioEngineFormat | ||
| 227 | /// { | ||
| 228 | /// enum AEDataFormat m_dataFormat; /* The stream's data format (eg, AE_FMT_S16LE) */ | ||
| 229 | /// unsigned int m_sampleRate; /* The stream's sample rate (eg, 48000) */ | ||
| 230 | /// unsigned int m_encodedRate; /* The encoded streams sample rate if a bitstream, otherwise undefined */ | ||
| 231 | /// unsigned int m_channelCount; /* The amount of used speaker channels */ | ||
| 232 | /// enum AEChannel m_channels[AE_CH_MAX]; /* The stream's channel layout */ | ||
| 233 | /// unsigned int m_frames; /* The number of frames per period */ | ||
| 234 | /// unsigned int m_frameSamples; /* The number of samples in one frame */ | ||
| 235 | /// unsigned int m_frameSize; /* The size of one frame in bytes */ | ||
| 236 | /// | ||
| 237 | /// /* Function to compare the format structure with another */ | ||
| 238 | /// bool compareFormat(const AudioEngineFormat *fmt); | ||
| 239 | /// } AudioEngineFormat; | ||
| 240 | /// @endcode | ||
| 241 | /// | ||
| 242 | /// ------------------------------------------------------------------------ | ||
| 243 | /// | ||
| 244 | /// **Bit options to pass to CAELib_Stream (on Kodi by <c>IAE::MakeStream</c>)** | ||
| 245 | /// | ||
| 246 | /// | enum AEStreamOptions | Value: | Description: | ||
| 247 | /// |----------------------------:|:------:|:----------------------------------- | ||
| 248 | /// | AUDIO_STREAM_FORCE_RESAMPLE | 1 << 0 | Force resample even if rates match | ||
| 249 | /// | AUDIO_STREAM_PAUSED | 1 << 1 | Create the stream paused | ||
| 250 | /// | AUDIO_STREAM_AUTOSTART | 1 << 2 | Autostart the stream when enough data is buffered | ||
| 251 | /// | AUDIO_STREAM_BYPASS_ADSP | 1 << 3 | if this option is set the ADSP-System is bypassed and the raw stream will be passed through IAESink. | ||
| 252 | /// | ||
| 253 | /// | ||
| 254 | /// ------------------------------------------------------------------------ | ||
| 255 | /// | ||
| 256 | /// **Example:** | ||
| 257 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 258 | /// | ||
| 259 | /// #include <kodi/AudioEngine.h> | ||
| 260 | /// | ||
| 261 | /// using namespace kodi::audioengine; | ||
| 262 | /// | ||
| 263 | /// ... | ||
| 264 | /// | ||
| 265 | /// AudioEngineFormat format; | ||
| 266 | /// format.m_dataFormat = AE_FMT_FLOAT; | ||
| 267 | /// format.m_channelCount = 2; | ||
| 268 | /// format.m_channels[0] = AE_CH_FL; | ||
| 269 | /// format.m_channels[1] = AE_CH_FR; | ||
| 270 | /// format.m_channels[2] = AE_CH_NULL; | ||
| 271 | /// format.m_sampleRate = 48000; | ||
| 272 | /// format.m_frameSize = sizeof(float)*format.m_channelCount; | ||
| 273 | /// format.m_frames = 512; | ||
| 274 | /// CAddonAEStream* stream = new CAddonAEStream(format, AE_STREAM_AUTOSTART | AE_STREAM_BYPASS_ADSP); | ||
| 275 | /// | ||
| 276 | /// ~~~~~~~~~~~~~ | ||
| 277 | /// | ||
| 278 | CAddonAEStream(AudioEngineFormat format, unsigned int options = 0) | ||
| 279 | : m_kodiBase(::kodi::addon::CAddonBase::m_interface->toKodi->kodiBase), | ||
| 280 | m_cb(::kodi::addon::CAddonBase::m_interface->toKodi->kodi_audioengine) | ||
| 281 | { | ||
| 282 | m_StreamHandle = m_cb->make_stream(m_kodiBase, &format, options); | ||
| 283 | if (m_StreamHandle == nullptr) | ||
| 284 | { | ||
| 285 | kodi::Log(ADDON_LOG_FATAL, "CAddonAEStream: make_stream failed!"); | ||
| 286 | } | ||
| 287 | } | ||
| 288 | //-------------------------------------------------------------------------- | ||
| 289 | |||
| 290 | //========================================================================== | ||
| 291 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 292 | /// @brief Class destructor | ||
| 293 | /// | ||
| 294 | ~CAddonAEStream() | ||
| 295 | { | ||
| 296 | if (m_StreamHandle) | ||
| 297 | { | ||
| 298 | m_cb->free_stream(m_kodiBase, m_StreamHandle); | ||
| 299 | m_StreamHandle = nullptr; | ||
| 300 | } | ||
| 301 | } | ||
| 302 | //-------------------------------------------------------------------------- | ||
| 303 | |||
| 304 | //========================================================================== | ||
| 305 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 306 | /// @brief Returns the amount of space available in the stream | ||
| 307 | /// | ||
| 308 | /// @return The number of bytes AddData will consume | ||
| 309 | /// | ||
| 310 | unsigned int GetSpace() | ||
| 311 | { | ||
| 312 | return m_cb->aestream_get_space(m_kodiBase, m_StreamHandle); | ||
| 313 | } | ||
| 314 | //-------------------------------------------------------------------------- | ||
| 315 | |||
| 316 | //========================================================================== | ||
| 317 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 318 | /// @brief Add planar or interleaved PCM data to the stream | ||
| 319 | /// | ||
| 320 | /// @param[in] data array of pointers to the planes | ||
| 321 | /// @param[in] offset to frame in frames | ||
| 322 | /// @param[in] frames number of frames | ||
| 323 | /// @param[in] pts presentation timestamp | ||
| 324 | /// @return The number of frames consumed | ||
| 325 | /// | ||
| 326 | unsigned int AddData(uint8_t* const *data, unsigned int offset, unsigned int frames, double pts = 0.0) | ||
| 327 | { | ||
| 328 | return m_cb->aestream_add_data(m_kodiBase, m_StreamHandle, data, offset, frames, pts); | ||
| 329 | } | ||
| 330 | //-------------------------------------------------------------------------- | ||
| 331 | |||
| 332 | //========================================================================== | ||
| 333 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 334 | /// @brief Returns the time in seconds that it will take for the next added | ||
| 335 | /// packet to be heard from the speakers. | ||
| 336 | /// | ||
| 337 | /// @return seconds | ||
| 338 | /// | ||
| 339 | double GetDelay() | ||
| 340 | { | ||
| 341 | return m_cb->aestream_get_delay(m_kodiBase, m_StreamHandle); | ||
| 342 | } | ||
| 343 | //-------------------------------------------------------------------------- | ||
| 344 | |||
| 345 | //========================================================================== | ||
| 346 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 347 | /// @brief Returns if the stream is buffering | ||
| 348 | /// | ||
| 349 | /// @return True if the stream is buffering | ||
| 350 | /// | ||
| 351 | bool IsBuffering() | ||
| 352 | { | ||
| 353 | return m_cb->aestream_is_buffering(m_kodiBase, m_StreamHandle); | ||
| 354 | } | ||
| 355 | //-------------------------------------------------------------------------- | ||
| 356 | |||
| 357 | //========================================================================== | ||
| 358 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 359 | /// @brief Returns the time in seconds of the stream's cached audio samples. | ||
| 360 | /// Engine buffers excluded. | ||
| 361 | /// | ||
| 362 | /// @return seconds | ||
| 363 | /// | ||
| 364 | double GetCacheTime() | ||
| 365 | { | ||
| 366 | return m_cb->aestream_get_cache_time(m_kodiBase, m_StreamHandle); | ||
| 367 | } | ||
| 368 | //-------------------------------------------------------------------------- | ||
| 369 | |||
| 370 | //========================================================================== | ||
| 371 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 372 | /// @brief Returns the total time in seconds of the cache | ||
| 373 | /// | ||
| 374 | /// @return seconds | ||
| 375 | /// | ||
| 376 | double GetCacheTotal() | ||
| 377 | { | ||
| 378 | return m_cb->aestream_get_cache_total(m_kodiBase, m_StreamHandle); | ||
| 379 | } | ||
| 380 | //-------------------------------------------------------------------------- | ||
| 381 | |||
| 382 | //========================================================================== | ||
| 383 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 384 | /// @brief Pauses the stream playback | ||
| 385 | /// | ||
| 386 | void Pause() | ||
| 387 | { | ||
| 388 | return m_cb->aestream_pause(m_kodiBase, m_StreamHandle); | ||
| 389 | } | ||
| 390 | //-------------------------------------------------------------------------- | ||
| 391 | |||
| 392 | //========================================================================== | ||
| 393 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 394 | /// @brief Resumes the stream after pausing | ||
| 395 | /// | ||
| 396 | void Resume() | ||
| 397 | { | ||
| 398 | return m_cb->aestream_resume(m_kodiBase, m_StreamHandle); | ||
| 399 | } | ||
| 400 | //-------------------------------------------------------------------------- | ||
| 401 | |||
| 402 | //========================================================================== | ||
| 403 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 404 | /// @brief Start draining the stream | ||
| 405 | /// | ||
| 406 | /// @param[in] wait [opt] Wait until drain is finished if set to | ||
| 407 | /// true, otherwise it returns direct | ||
| 408 | /// | ||
| 409 | /// @note Once called AddData will not consume more data. | ||
| 410 | /// | ||
| 411 | void Drain(bool wait = true) | ||
| 412 | { | ||
| 413 | return m_cb->aestream_drain(m_kodiBase, m_StreamHandle, wait); | ||
| 414 | } | ||
| 415 | //-------------------------------------------------------------------------- | ||
| 416 | |||
| 417 | //========================================================================== | ||
| 418 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 419 | /// @brief Returns true if the is stream draining | ||
| 420 | /// | ||
| 421 | bool IsDraining() | ||
| 422 | { | ||
| 423 | return m_cb->aestream_is_draining(m_kodiBase, m_StreamHandle); | ||
| 424 | } | ||
| 425 | //-------------------------------------------------------------------------- | ||
| 426 | |||
| 427 | //========================================================================== | ||
| 428 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 429 | /// @brief Returns true if the is stream has finished draining | ||
| 430 | /// | ||
| 431 | bool IsDrained() | ||
| 432 | { | ||
| 433 | return m_cb->aestream_is_drained(m_kodiBase, m_StreamHandle); | ||
| 434 | } | ||
| 435 | //-------------------------------------------------------------------------- | ||
| 436 | |||
| 437 | //========================================================================== | ||
| 438 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 439 | /// @brief Flush all buffers dropping the audio data | ||
| 440 | /// | ||
| 441 | void Flush() | ||
| 442 | { | ||
| 443 | return m_cb->aestream_flush(m_kodiBase, m_StreamHandle); | ||
| 444 | } | ||
| 445 | //-------------------------------------------------------------------------- | ||
| 446 | |||
| 447 | //========================================================================== | ||
| 448 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 449 | /// @brief Return the stream's current volume level | ||
| 450 | /// | ||
| 451 | /// @return The volume level between 0.0 and 1.0 | ||
| 452 | /// | ||
| 453 | float GetVolume() | ||
| 454 | { | ||
| 455 | return m_cb->aestream_get_volume(m_kodiBase, m_StreamHandle); | ||
| 456 | } | ||
| 457 | //-------------------------------------------------------------------------- | ||
| 458 | |||
| 459 | //========================================================================== | ||
| 460 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 461 | /// @brief Set the stream's volume level | ||
| 462 | /// | ||
| 463 | /// @param[in] volume The new volume level between 0.0 and 1.0 | ||
| 464 | /// | ||
| 465 | void SetVolume(float volume) | ||
| 466 | { | ||
| 467 | return m_cb->aestream_set_volume(m_kodiBase, m_StreamHandle, volume); | ||
| 468 | } | ||
| 469 | //-------------------------------------------------------------------------- | ||
| 470 | |||
| 471 | //========================================================================== | ||
| 472 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 473 | /// @brief Gets the stream's volume amplification in linear units. | ||
| 474 | /// | ||
| 475 | /// @return The volume amplification factor between 1.0 and 1000.0 | ||
| 476 | /// | ||
| 477 | float GetAmplification() | ||
| 478 | { | ||
| 479 | return m_cb->aestream_get_amplification(m_kodiBase, m_StreamHandle); | ||
| 480 | } | ||
| 481 | //-------------------------------------------------------------------------- | ||
| 482 | |||
| 483 | //========================================================================== | ||
| 484 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 485 | /// @brief Sets the stream's volume amplification in linear units. | ||
| 486 | /// | ||
| 487 | /// @param[in] amplify The volume amplification factor between | ||
| 488 | /// 1.0 and 1000.0 | ||
| 489 | /// | ||
| 490 | void SetAmplification(float amplify) | ||
| 491 | { | ||
| 492 | return m_cb->aestream_set_amplification(m_kodiBase, m_StreamHandle, amplify); | ||
| 493 | } | ||
| 494 | //-------------------------------------------------------------------------- | ||
| 495 | |||
| 496 | //========================================================================== | ||
| 497 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 498 | /// @brief Returns the size of one audio frame in bytes (channelCount * resolution) | ||
| 499 | /// | ||
| 500 | /// @return The size in bytes of one frame | ||
| 501 | /// | ||
| 502 | unsigned int GetFrameSize() const | ||
| 503 | { | ||
| 504 | return m_cb->aestream_get_frame_size(m_kodiBase, m_StreamHandle); | ||
| 505 | } | ||
| 506 | //-------------------------------------------------------------------------- | ||
| 507 | |||
| 508 | //========================================================================== | ||
| 509 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 510 | /// @brief Returns the number of channels the stream is configured to accept | ||
| 511 | /// | ||
| 512 | /// @return The channel count | ||
| 513 | /// | ||
| 514 | unsigned int GetChannelCount() const | ||
| 515 | { | ||
| 516 | return m_cb->aestream_get_channel_count(m_kodiBase, m_StreamHandle); | ||
| 517 | } | ||
| 518 | //-------------------------------------------------------------------------- | ||
| 519 | |||
| 520 | //========================================================================== | ||
| 521 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 522 | /// @brief Returns the stream's sample rate, if the stream is using a dynamic | ||
| 523 | /// sample rate, this value will NOT reflect any changes made by calls to | ||
| 524 | /// SetResampleRatio() | ||
| 525 | /// | ||
| 526 | /// @return The stream's sample rate (eg, 48000) | ||
| 527 | /// | ||
| 528 | unsigned int GetSampleRate() const | ||
| 529 | { | ||
| 530 | return m_cb->aestream_get_sample_rate(m_kodiBase, m_StreamHandle); | ||
| 531 | } | ||
| 532 | //-------------------------------------------------------------------------- | ||
| 533 | |||
| 534 | //========================================================================== | ||
| 535 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 536 | /// @brief Return the data format the stream has been configured with | ||
| 537 | /// | ||
| 538 | /// @return The stream's data format (eg, AUDIOENGINE_FMT_S16LE) | ||
| 539 | /// | ||
| 540 | AEDataFormat GetDataFormat() const | ||
| 541 | { | ||
| 542 | return m_cb->aestream_get_data_format(m_kodiBase, m_StreamHandle); | ||
| 543 | } | ||
| 544 | //-------------------------------------------------------------------------- | ||
| 545 | |||
| 546 | //========================================================================== | ||
| 547 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 548 | /// @brief Return the resample ratio | ||
| 549 | /// | ||
| 550 | /// @note This will return an undefined value if the stream is not resampling | ||
| 551 | /// | ||
| 552 | /// @return the current resample ratio or undefined if the stream is not resampling | ||
| 553 | /// | ||
| 554 | double GetResampleRatio() | ||
| 555 | { | ||
| 556 | return m_cb->aestream_get_resample_ratio(m_kodiBase, m_StreamHandle); | ||
| 557 | } | ||
| 558 | //-------------------------------------------------------------------------- | ||
| 559 | |||
| 560 | //========================================================================== | ||
| 561 | /// @ingroup cpp_kodi_audioengine_CAddonAEStream | ||
| 562 | /// @brief Sets the resample ratio | ||
| 563 | /// | ||
| 564 | /// @note This function may return false if the stream is not resampling, if | ||
| 565 | /// you wish to use this be sure to set the AESTREAM_FORCE_RESAMPLE option | ||
| 566 | /// | ||
| 567 | /// @param[in] ratio the new sample rate ratio, calculated by | ||
| 568 | /// ((double)desiredRate / (double)GetSampleRate()) | ||
| 569 | /// | ||
| 570 | void SetResampleRatio(double ratio) | ||
| 571 | { | ||
| 572 | m_cb->aestream_set_resample_ratio(m_kodiBase, m_StreamHandle, ratio); | ||
| 573 | } | ||
| 574 | //-------------------------------------------------------------------------- | ||
| 575 | |||
| 576 | private: | ||
| 577 | void* m_kodiBase; | ||
| 578 | AddonToKodiFuncTable_kodi_audioengine* m_cb; | ||
| 579 | AEStreamHandle *m_StreamHandle; | ||
| 580 | }; | ||
| 581 | |||
| 582 | //============================================================================ | ||
| 583 | /// @ingroup cpp_kodi_audioengine | ||
| 584 | /// @brief Get the current sink data format | ||
| 585 | /// | ||
| 586 | /// @param[in] format Current sink data format. For more details see AudioEngineFormat. | ||
| 587 | /// @return Returns true on success, else false. | ||
| 588 | /// | ||
| 589 | inline bool GetCurrentSinkFormat(AudioEngineFormat &format) | ||
| 590 | { | ||
| 591 | using namespace kodi::addon; | ||
| 592 | return CAddonBase::m_interface->toKodi->kodi_audioengine->get_current_sink_format(CAddonBase::m_interface->toKodi->kodiBase, &format); | ||
| 593 | } | ||
| 594 | //---------------------------------------------------------------------------- | ||
| 595 | |||
| 596 | } /* audioengine */ | ||
| 597 | } /* kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt index 80e9275..2b98154 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | set(HEADERS AddonBase.h | 1 | set(HEADERS AddonBase.h |
| 2 | AudioEngine.h | ||
| 3 | Filesystem.h | 2 | Filesystem.h |
| 4 | General.h | 3 | General.h |
| 5 | Network.h | 4 | Network.h |
| @@ -19,6 +18,10 @@ set(HEADERS AddonBase.h | |||
| 19 | xbmc_pvr_dll.h | 18 | xbmc_pvr_dll.h |
| 20 | xbmc_pvr_types.h) | 19 | xbmc_pvr_types.h) |
| 21 | 20 | ||
| 21 | if(CORE_SYSTEM_NAME STREQUAL android) | ||
| 22 | list(APPEND SOURCES platform/android/System.h) | ||
| 23 | endif() | ||
| 24 | |||
| 22 | if(NOT ENABLE_STATIC_LIBS) | 25 | if(NOT ENABLE_STATIC_LIBS) |
| 23 | core_add_library(addons_kodi-addon-dev-kit_include_kodi) | 26 | core_add_library(addons_kodi-addon-dev-kit_include_kodi) |
| 24 | endif() | 27 | endif() |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDSP.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDSP.h deleted file mode 100644 index 3587a33..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDSP.h +++ /dev/null | |||
| @@ -1,1288 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2015 Team Kodi | ||
| 5 | * http://kodi.tv | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with Kodi; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #include "../AddonBase.h" | ||
| 24 | |||
| 25 | #define AE_DSP_STREAM_MAX_STREAMS 8 | ||
| 26 | #define AE_DSP_STREAM_MAX_MODES 32 | ||
| 27 | |||
| 28 | /*! | ||
| 29 | * @file Addon.h | ||
| 30 | * @section sec1 Basic audio dsp addon interface description | ||
| 31 | * @author Team Kodi | ||
| 32 | * @date 10. May 2014 | ||
| 33 | * @version 0.1.5 | ||
| 34 | * | ||
| 35 | * @subsection sec1_1 General | ||
| 36 | * @li The basic support on the addon is supplied with the | ||
| 37 | * AE_DSP_ADDON_CAPABILITIES data which becomes asked over | ||
| 38 | * GetCapabilities(...), further the addon must register his available | ||
| 39 | * modes on startup with the RegisterMode(...) callback function. | ||
| 40 | * If one of this two points is not set the addon becomes | ||
| 41 | * ignored for the chain step. | ||
| 42 | * | ||
| 43 | * @subsection sec1_2 Processing | ||
| 44 | * @li On start of new stream the addon becomes called with StreamCreate(...) | ||
| 45 | * to check about given values that it support it basically and can create | ||
| 46 | * his structure, if nothing is supported it can return AE_DSP_ERROR_IGNORE_ME. | ||
| 47 | * | ||
| 48 | * @li As next step StreamIsModeSupported(...) becomes called for every | ||
| 49 | * available and enabled modes, is separated due to more as one available mode | ||
| 50 | * on the addon is possible, if the mode is not supported it can also be return | ||
| 51 | * AE_DSP_ERROR_IGNORE_ME. | ||
| 52 | * - If mode is a resample mode and returns no error it becomes asked with | ||
| 53 | * InputResampleSampleRate(...) or OutputResampleSampleRate(...) (relevant | ||
| 54 | * to his type) about his given sample rate. | ||
| 55 | * - About the from user selected master processing mode the related addon | ||
| 56 | * becomes called now with MasterProcessSetMode(...) to handle it's | ||
| 57 | * selectionon the addon given by the own addon type identifier or by | ||
| 58 | * KODI's useddatabase id, also the currently used stream type (e.g. | ||
| 59 | * Music or Video) is send. | ||
| 60 | * - If the addon supports only one master mode it can ignore this function | ||
| 61 | * and return always AE_DSP_ERROR_NO_ERROR. | ||
| 62 | * - If the master mode is set the addon becomes asked about the from him | ||
| 63 | * given output channel layout related to up- or downmix modes, if | ||
| 64 | * nothing becomes changed on the layout it can return -1. | ||
| 65 | * - The MasterProcessSetMode(...) is also called if from user a another | ||
| 66 | * mode becomes selected. | ||
| 67 | * | ||
| 68 | * @li Then as last step shortly before the first process call becomes executed | ||
| 69 | * the addon is called one time with StreamInitialize(...) to inform that | ||
| 70 | * processing is started on the given settings. | ||
| 71 | * - This function becomes also called on all add-ons if the master process | ||
| 72 | * becomes changed. | ||
| 73 | * - Also every process after StreamInitialize on the addon mode becomes asked | ||
| 74 | * with _..._ProcessNeededSamplesize(...) about required memory size for the | ||
| 75 | * output of his data, if no other size is required it can return 0. | ||
| 76 | * | ||
| 77 | * @li From now the processing becomes handled for the different steps with | ||
| 78 | * _..._Process(...). | ||
| 79 | * - Further it becomes asked with _..._GetDelay(...) about his processing | ||
| 80 | * time as float value in seconds, needed for video and audio alignment. | ||
| 81 | * | ||
| 82 | * @li On the end of the processing if the source becomes stopped the | ||
| 83 | * StreamDestroy(...) function becomes called on all active processing add-ons. | ||
| 84 | * | ||
| 85 | * @note | ||
| 86 | * The StreamCreate(...) can be becomes called for a new stream before the | ||
| 87 | * previous was closed with StreamDestroy(...) ! To have a speed improve. | ||
| 88 | */ | ||
| 89 | |||
| 90 | namespace kodi { namespace addon { class CInstanceAudioDSP; }} | ||
| 91 | |||
| 92 | extern "C" { | ||
| 93 | |||
| 94 | typedef void* ADSPHANDLE; | ||
| 95 | |||
| 96 | typedef unsigned int AE_DSP_STREAM_ID; | ||
| 97 | |||
| 98 | /*! | ||
| 99 | * @brief Audio DSP add-on error codes | ||
| 100 | */ | ||
| 101 | typedef enum | ||
| 102 | { | ||
| 103 | AE_DSP_ERROR_NO_ERROR = 0, /*!< @brief no error occurred */ | ||
| 104 | AE_DSP_ERROR_UNKNOWN = -1, /*!< @brief an unknown error occurred */ | ||
| 105 | AE_DSP_ERROR_IGNORE_ME = -2, /*!< @brief the used input stream can not processed and add-on want to ignore */ | ||
| 106 | AE_DSP_ERROR_NOT_IMPLEMENTED = -3, /*!< @brief the method that KODI called is not implemented by the add-on */ | ||
| 107 | AE_DSP_ERROR_REJECTED = -4, /*!< @brief the command was rejected by the DSP */ | ||
| 108 | AE_DSP_ERROR_INVALID_PARAMETERS = -5, /*!< @brief the parameters of the method that was called are invalid for this operation */ | ||
| 109 | AE_DSP_ERROR_INVALID_SAMPLERATE = -6, /*!< @brief the processed samplerate is not supported */ | ||
| 110 | AE_DSP_ERROR_INVALID_IN_CHANNELS = -7, /*!< @brief the processed input channel format is not supported */ | ||
| 111 | AE_DSP_ERROR_INVALID_OUT_CHANNELS = -8, /*!< @brief the processed output channel format is not supported */ | ||
| 112 | AE_DSP_ERROR_FAILED = -9, /*!< @brief the command failed */ | ||
| 113 | } AE_DSP_ERROR; | ||
| 114 | |||
| 115 | /*! | ||
| 116 | * @brief The possible DSP channels (used as pointer inside arrays) | ||
| 117 | */ | ||
| 118 | typedef enum | ||
| 119 | { | ||
| 120 | AE_DSP_CH_INVALID = -1, | ||
| 121 | AE_DSP_CH_FL = 0, | ||
| 122 | AE_DSP_CH_FR, | ||
| 123 | AE_DSP_CH_FC, | ||
| 124 | AE_DSP_CH_LFE, | ||
| 125 | AE_DSP_CH_BL, | ||
| 126 | AE_DSP_CH_BR, | ||
| 127 | AE_DSP_CH_FLOC, | ||
| 128 | AE_DSP_CH_FROC, | ||
| 129 | AE_DSP_CH_BC, | ||
| 130 | AE_DSP_CH_SL, | ||
| 131 | AE_DSP_CH_SR, | ||
| 132 | AE_DSP_CH_TFL, | ||
| 133 | AE_DSP_CH_TFR, | ||
| 134 | AE_DSP_CH_TFC, | ||
| 135 | AE_DSP_CH_TC, | ||
| 136 | AE_DSP_CH_TBL, | ||
| 137 | AE_DSP_CH_TBR, | ||
| 138 | AE_DSP_CH_TBC, | ||
| 139 | AE_DSP_CH_BLOC, | ||
| 140 | AE_DSP_CH_BROC, | ||
| 141 | |||
| 142 | AE_DSP_CH_MAX | ||
| 143 | } AE_DSP_CHANNEL; | ||
| 144 | |||
| 145 | /*! | ||
| 146 | * @brief Present channel flags | ||
| 147 | */ | ||
| 148 | typedef enum | ||
| 149 | { | ||
| 150 | AE_DSP_PRSNT_CH_UNDEFINED = 0, | ||
| 151 | AE_DSP_PRSNT_CH_FL = 1<<AE_DSP_CH_FL, | ||
| 152 | AE_DSP_PRSNT_CH_FR = 1<<AE_DSP_CH_FR, | ||
| 153 | AE_DSP_PRSNT_CH_FC = 1<<AE_DSP_CH_FC, | ||
| 154 | AE_DSP_PRSNT_CH_LFE = 1<<AE_DSP_CH_LFE, | ||
| 155 | AE_DSP_PRSNT_CH_BL = 1<<AE_DSP_CH_BL, | ||
| 156 | AE_DSP_PRSNT_CH_BR = 1<<AE_DSP_CH_BR, | ||
| 157 | AE_DSP_PRSNT_CH_FLOC = 1<<AE_DSP_CH_FLOC, | ||
| 158 | AE_DSP_PRSNT_CH_FROC = 1<<AE_DSP_CH_FROC, | ||
| 159 | AE_DSP_PRSNT_CH_BC = 1<<AE_DSP_CH_BC, | ||
| 160 | AE_DSP_PRSNT_CH_SL = 1<<AE_DSP_CH_SL, | ||
| 161 | AE_DSP_PRSNT_CH_SR = 1<<AE_DSP_CH_SR, | ||
| 162 | AE_DSP_PRSNT_CH_TFL = 1<<AE_DSP_CH_TFL, | ||
| 163 | AE_DSP_PRSNT_CH_TFR = 1<<AE_DSP_CH_TFR, | ||
| 164 | AE_DSP_PRSNT_CH_TFC = 1<<AE_DSP_CH_TFC, | ||
| 165 | AE_DSP_PRSNT_CH_TC = 1<<AE_DSP_CH_TC, | ||
| 166 | AE_DSP_PRSNT_CH_TBL = 1<<AE_DSP_CH_TBL, | ||
| 167 | AE_DSP_PRSNT_CH_TBR = 1<<AE_DSP_CH_TBR, | ||
| 168 | AE_DSP_PRSNT_CH_TBC = 1<<AE_DSP_CH_TBC, | ||
| 169 | AE_DSP_PRSNT_CH_BLOC = 1<<AE_DSP_CH_BLOC, | ||
| 170 | AE_DSP_PRSNT_CH_BROC = 1<<AE_DSP_CH_BROC | ||
| 171 | } AE_DSP_CHANNEL_PRESENT; | ||
| 172 | |||
| 173 | /** | ||
| 174 | * @brief The various stream type formats | ||
| 175 | * Used for audio DSP processing to know input audio type | ||
| 176 | */ | ||
| 177 | typedef enum | ||
| 178 | { | ||
| 179 | AE_DSP_ASTREAM_INVALID = -1, | ||
| 180 | AE_DSP_ASTREAM_BASIC = 0, | ||
| 181 | AE_DSP_ASTREAM_MUSIC, | ||
| 182 | AE_DSP_ASTREAM_MOVIE, | ||
| 183 | AE_DSP_ASTREAM_GAME, | ||
| 184 | AE_DSP_ASTREAM_APP, | ||
| 185 | AE_DSP_ASTREAM_PHONE, | ||
| 186 | AE_DSP_ASTREAM_MESSAGE, | ||
| 187 | |||
| 188 | AE_DSP_ASTREAM_AUTO, | ||
| 189 | AE_DSP_ASTREAM_MAX | ||
| 190 | } AE_DSP_STREAMTYPE; | ||
| 191 | |||
| 192 | /*! | ||
| 193 | * @brief Add-ons supported audio stream type flags | ||
| 194 | * used on master mode information on AE_DSP_MODES to know | ||
| 195 | * on which audio stream the master mode is supported | ||
| 196 | */ | ||
| 197 | typedef enum | ||
| 198 | { | ||
| 199 | AE_DSP_PRSNT_ASTREAM_BASIC = 1<<AE_DSP_ASTREAM_BASIC, | ||
| 200 | AE_DSP_PRSNT_ASTREAM_MUSIC = 1<<AE_DSP_ASTREAM_MUSIC, | ||
| 201 | AE_DSP_PRSNT_ASTREAM_MOVIE = 1<<AE_DSP_ASTREAM_MOVIE, | ||
| 202 | AE_DSP_PRSNT_ASTREAM_GAME = 1<<AE_DSP_ASTREAM_GAME, | ||
| 203 | AE_DSP_PRSNT_ASTREAM_APP = 1<<AE_DSP_ASTREAM_APP, | ||
| 204 | AE_DSP_PRSNT_ASTREAM_PHONE = 1<<AE_DSP_ASTREAM_PHONE, | ||
| 205 | AE_DSP_PRSNT_ASTREAM_MESSAGE = 1<<AE_DSP_ASTREAM_MESSAGE, | ||
| 206 | } AE_DSP_ASTREAM_PRESENT; | ||
| 207 | |||
| 208 | /** | ||
| 209 | * @brief The various base type formats | ||
| 210 | * Used for audio DSP processing to know input audio source | ||
| 211 | */ | ||
| 212 | typedef enum | ||
| 213 | { | ||
| 214 | AE_DSP_ABASE_INVALID = -1, | ||
| 215 | AE_DSP_ABASE_STEREO = 0, | ||
| 216 | AE_DSP_ABASE_MONO, | ||
| 217 | AE_DSP_ABASE_MULTICHANNEL, | ||
| 218 | AE_DSP_ABASE_AC3, | ||
| 219 | AE_DSP_ABASE_EAC3, | ||
| 220 | AE_DSP_ABASE_DTS, | ||
| 221 | AE_DSP_ABASE_DTSHD_MA, | ||
| 222 | AE_DSP_ABASE_DTSHD_HRA, | ||
| 223 | AE_DSP_ABASE_TRUEHD, | ||
| 224 | AE_DSP_ABASE_MLP, | ||
| 225 | AE_DSP_ABASE_FLAC, | ||
| 226 | |||
| 227 | AE_DSP_ABASE_MAX | ||
| 228 | } AE_DSP_BASETYPE; | ||
| 229 | |||
| 230 | |||
| 231 | /** | ||
| 232 | * @brief The from KODI in settings requested audio process quality. | ||
| 233 | * The KODI internal used quality levels is translated to this values | ||
| 234 | * for usage on DSP processing add-ons. Is present on iQualityLevel | ||
| 235 | * inside AE_DSP_SETTINGS. | ||
| 236 | */ | ||
| 237 | typedef enum | ||
| 238 | { | ||
| 239 | AE_DSP_QUALITY_UNKNOWN = -1, /*!< @brief Unset, unknown or incorrect quality level */ | ||
| 240 | AE_DSP_QUALITY_DEFAULT = 0, /*!< @brief Engine's default quality level */ | ||
| 241 | |||
| 242 | /* Basic quality levels */ | ||
| 243 | AE_DSP_QUALITY_LOW = 20, /*!< @brief Low quality level */ | ||
| 244 | AE_DSP_QUALITY_MID = 30, /*!< @brief Standard quality level */ | ||
| 245 | AE_DSP_QUALITY_HIGH = 50, /*!< @brief Best sound processing quality */ | ||
| 246 | |||
| 247 | /* Optional quality levels */ | ||
| 248 | AE_DSP_QUALITY_REALLYHIGH = 100 /*!< @brief Uncompromising optional quality level, usually with unmeasurable and unnoticeable improvement */ | ||
| 249 | } AE_DSP_QUALITY; | ||
| 250 | |||
| 251 | /*! | ||
| 252 | * @brief Audio DSP menu hook categories. | ||
| 253 | * Used to identify on AE_DSP_MENUHOOK given add-on related skin dialog/windows. | ||
| 254 | * Except AE_DSP_MENUHOOK_ALL and AE_DSP_MENUHOOK_SETTING are the menus available | ||
| 255 | * from DSP playback dialogue which can be opened over KODI file context menu and over | ||
| 256 | * button on full screen OSD window. | ||
| 257 | * | ||
| 258 | * Menu hook AE_DSP_MENUHOOK_SETTING is available from DSP processing setup dialogue. | ||
| 259 | */ | ||
| 260 | typedef enum | ||
| 261 | { | ||
| 262 | AE_DSP_MENUHOOK_UNKNOWN =-1, /*!< @brief unknown menu hook */ | ||
| 263 | AE_DSP_MENUHOOK_ALL = 0, /*!< @brief all categories */ | ||
| 264 | AE_DSP_MENUHOOK_PRE_PROCESS = 1, /*!< @brief for pre processing */ | ||
| 265 | AE_DSP_MENUHOOK_MASTER_PROCESS = 2, /*!< @brief for master processing */ | ||
| 266 | AE_DSP_MENUHOOK_POST_PROCESS = 3, /*!< @brief for post processing */ | ||
| 267 | AE_DSP_MENUHOOK_RESAMPLE = 4, /*!< @brief for re sample */ | ||
| 268 | AE_DSP_MENUHOOK_MISCELLANEOUS = 5, /*!< @brief for miscellaneous dialogues */ | ||
| 269 | AE_DSP_MENUHOOK_INFORMATION = 6, /*!< @brief dialogue to show processing information */ | ||
| 270 | AE_DSP_MENUHOOK_SETTING = 7, /*!< @brief for settings */ | ||
| 271 | } AE_DSP_MENUHOOK_CAT; | ||
| 272 | |||
| 273 | /*! | ||
| 274 | * @brief Menu hooks that are available in the menus while playing a stream via this add-on. | ||
| 275 | */ | ||
| 276 | typedef struct AE_DSP_MENUHOOK | ||
| 277 | { | ||
| 278 | unsigned int iHookId; /*!< @brief (required) this hook's identifier */ | ||
| 279 | unsigned int iLocalizedStringId; /*!< @brief (required) the id of the label for this hook in g_localizeStrings */ | ||
| 280 | AE_DSP_MENUHOOK_CAT category; /*!< @brief (required) category of menu hook */ | ||
| 281 | unsigned int iRelevantModeId; /*!< @brief (required) except category AE_DSP_MENUHOOK_SETTING and AE_DSP_MENUHOOK_ALL must be the related mode id present here */ | ||
| 282 | bool bNeedPlayback; /*!< @brief (required) set to true if menu hook need playback and active processing */ | ||
| 283 | } ATTRIBUTE_PACKED AE_DSP_MENUHOOK; | ||
| 284 | |||
| 285 | /*! | ||
| 286 | * @brief Audio DSP add-on capabilities. All capabilities are set to "false" as default. | ||
| 287 | * If a capability is set to true, then the corresponding methods from kodi_audiodsp_dll.h need to be implemented. | ||
| 288 | */ | ||
| 289 | typedef struct AE_DSP_ADDON_CAPABILITIES | ||
| 290 | { | ||
| 291 | bool bSupportsInputProcess; /*!< @brief true if this add-on provides audio input processing */ | ||
| 292 | bool bSupportsInputResample; /*!< @brief true if this add-on provides audio resample before master handling */ | ||
| 293 | bool bSupportsPreProcess; /*!< @brief true if this add-on provides audio pre processing */ | ||
| 294 | bool bSupportsMasterProcess; /*!< @brief true if this add-on provides audio master processing */ | ||
| 295 | bool bSupportsPostProcess; /*!< @brief true if this add-on provides audio post processing */ | ||
| 296 | bool bSupportsOutputResample; /*!< @brief true if this add-on provides audio re sample after master handling */ | ||
| 297 | } ATTRIBUTE_PACKED AE_DSP_ADDON_CAPABILITIES; | ||
| 298 | |||
| 299 | /*! | ||
| 300 | * @brief Audio processing settings for in and out arrays | ||
| 301 | * Send on creation and before first processed audio packet to add-on | ||
| 302 | */ | ||
| 303 | typedef struct AE_DSP_SETTINGS | ||
| 304 | { | ||
| 305 | AE_DSP_STREAM_ID iStreamID; /*!< @brief id of the audio stream packets */ | ||
| 306 | AE_DSP_STREAMTYPE iStreamType; /*!< @brief the input stream type source eg, Movie or Music */ | ||
| 307 | int iInChannels; /*!< @brief the amount of input channels */ | ||
| 308 | unsigned long lInChannelPresentFlags; /*!< @brief the exact channel mapping flags of input */ | ||
| 309 | int iInFrames; /*!< @brief the input frame size from KODI */ | ||
| 310 | unsigned int iInSamplerate; /*!< @brief the basic sample rate of the audio packet */ | ||
| 311 | int iProcessFrames; /*!< @brief the processing frame size inside add-on's */ | ||
| 312 | unsigned int iProcessSamplerate; /*!< @brief the sample rate after input resample present in master processing */ | ||
| 313 | int iOutChannels; /*!< @brief the amount of output channels */ | ||
| 314 | unsigned long lOutChannelPresentFlags; /*!< @brief the exact channel mapping flags for output */ | ||
| 315 | int iOutFrames; /*!< @brief the final out frame size for KODI */ | ||
| 316 | unsigned int iOutSamplerate; /*!< @brief the final sample rate of the audio packet */ | ||
| 317 | bool bInputResamplingActive; /*!< @brief if a re-sampling is performed before master processing this flag is set to true */ | ||
| 318 | bool bStereoUpmix; /*!< @brief true if the stereo upmix setting on kodi is set */ | ||
| 319 | int iQualityLevel; /*!< @brief the from KODI selected quality level for signal processing */ | ||
| 320 | /*! | ||
| 321 | * @note about "iProcessSamplerate" and "iProcessFrames" is set from KODI after call of StreamCreate on input re sample add-on, if re-sampling | ||
| 322 | * and processing is handled inside the same add-on, this value must be ignored! | ||
| 323 | */ | ||
| 324 | } ATTRIBUTE_PACKED AE_DSP_SETTINGS; | ||
| 325 | |||
| 326 | /*! | ||
| 327 | * @brief Stream profile properties | ||
| 328 | * Can be used to detect best master processing mode and for post processing methods. | ||
| 329 | */ | ||
| 330 | //@{ | ||
| 331 | |||
| 332 | /*! | ||
| 333 | * @brief Dolby profile types. Given from several formats, e.g. Dolby Digital or TrueHD | ||
| 334 | * Used on AE_DSP_PROFILE_AC3_EAC3 and AE_DSP_PROFILE_MLP_TRUEHD | ||
| 335 | */ | ||
| 336 | #define AE_DSP_PROFILE_DOLBY_NONE 0 | ||
| 337 | #define AE_DSP_PROFILE_DOLBY_SURROUND 1 | ||
| 338 | #define AE_DSP_PROFILE_DOLBY_PLII 2 | ||
| 339 | #define AE_DSP_PROFILE_DOLBY_PLIIX 3 | ||
| 340 | #define AE_DSP_PROFILE_DOLBY_PLIIZ 4 | ||
| 341 | #define AE_DSP_PROFILE_DOLBY_EX 5 | ||
| 342 | #define AE_DSP_PROFILE_DOLBY_HEADPHONE 6 | ||
| 343 | |||
| 344 | /*! | ||
| 345 | * @brief DTS/DTS HD profile types | ||
| 346 | * Used on AE_DSP_PROFILE_DTS_DTSHD | ||
| 347 | */ | ||
| 348 | #define AE_DSP_PROFILE_DTS 0 | ||
| 349 | #define AE_DSP_PROFILE_DTS_ES 1 | ||
| 350 | #define AE_DSP_PROFILE_DTS_96_24 2 | ||
| 351 | #define AE_DSP_PROFILE_DTS_HD_HRA 3 | ||
| 352 | #define AE_DSP_PROFILE_DTS_HD_MA 4 | ||
| 353 | |||
| 354 | /*! | ||
| 355 | * @brief AC3/EAC3 based service types | ||
| 356 | * Used on AE_DSP_PROFILE_AC3_EAC3 | ||
| 357 | */ | ||
| 358 | #define AE_DSP_SERVICE_TYPE_MAIN 0 | ||
| 359 | #define AE_DSP_SERVICE_TYPE_EFFECTS 1 | ||
| 360 | #define AE_DSP_SERVICE_TYPE_VISUALLY_IMPAIRED 2 | ||
| 361 | #define AE_DSP_SERVICE_TYPE_HEARING_IMPAIRED 3 | ||
| 362 | #define AE_DSP_SERVICE_TYPE_DIALOGUE 4 | ||
| 363 | #define AE_DSP_SERVICE_TYPE_COMMENTARY 5 | ||
| 364 | #define AE_DSP_SERVICE_TYPE_EMERGENCY 6 | ||
| 365 | #define AE_DSP_SERVICE_TYPE_VOICE_OVER 7 | ||
| 366 | #define AE_DSP_SERVICE_TYPE_KARAOKE 8 | ||
| 367 | |||
| 368 | /*! | ||
| 369 | * @brief AC3/EAC3 based room types | ||
| 370 | * Present on AE_DSP_PROFILE_AC3_EAC3 and can be used for frequency corrections | ||
| 371 | * at post processing, e.g. THX Re-Equalization | ||
| 372 | */ | ||
| 373 | #define AE_DSP_ROOM_TYPE_UNDEFINED 0 | ||
| 374 | #define AE_DSP_ROOM_TYPE_SMALL 1 | ||
| 375 | #define AE_DSP_ROOM_TYPE_LARGE 2 | ||
| 376 | |||
| 377 | /*! | ||
| 378 | * @brief AC3/EAC3 stream profile properties | ||
| 379 | */ | ||
| 380 | //! @todo add handling for it (currently never becomes set) | ||
| 381 | typedef struct AE_DSP_PROFILE_AC3_EAC3 | ||
| 382 | { | ||
| 383 | unsigned int iProfile; /*!< defined by AE_DSP_PROFILE_DOLBY_* */ | ||
| 384 | unsigned int iServiceType; /*!< defined by AE_DSP_SERVICE_TYPE_* */ | ||
| 385 | unsigned int iRoomType; /*!< defined by AE_DSP_ROOM_TYPE_* (NOTICE: Information about it currently not supported from ffmpeg and must be implemented) */ | ||
| 386 | } ATTRIBUTE_PACKED AE_DSP_PROFILE_AC3_EAC3; | ||
| 387 | |||
| 388 | /*! | ||
| 389 | * @brief MLP/Dolby TrueHD stream profile properties | ||
| 390 | */ | ||
| 391 | //! @todo add handling for it (currently never becomes set) | ||
| 392 | typedef struct AE_DSP_PROFILE_MLP_TRUEHD | ||
| 393 | { | ||
| 394 | unsigned int iProfile; /*!< defined by AE_DSP_PROFILE_DOLBY_* */ | ||
| 395 | } ATTRIBUTE_PACKED AE_DSP_PROFILE_MLP_TRUEHD; | ||
| 396 | |||
| 397 | /*! | ||
| 398 | * @brief DTS/DTS HD stream profile properties | ||
| 399 | */ | ||
| 400 | //! @todo add handling for it (currently never becomes set) | ||
| 401 | typedef struct AE_DSP_PROFILE_DTS_DTSHD | ||
| 402 | { | ||
| 403 | unsigned int iProfile; /*!< defined by AE_DSP_PROFILE_DTS* */ | ||
| 404 | bool bSurroundMatrix; /*!< if set to true given 2.0 stream is surround encoded */ | ||
| 405 | } ATTRIBUTE_PACKED AE_DSP_PROFILE_DTS_DTSHD; | ||
| 406 | |||
| 407 | union AE_DSP_PROFILE | ||
| 408 | { | ||
| 409 | AE_DSP_PROFILE_AC3_EAC3 ac3_eac3; /*!< Dolby Digital/Digital+ profile data */ | ||
| 410 | AE_DSP_PROFILE_MLP_TRUEHD mlp_truehd; /*!< MLP or Dolby TrueHD profile data */ | ||
| 411 | AE_DSP_PROFILE_DTS_DTSHD dts_dtshd; /*!< DTS/DTS-HD profile data */ | ||
| 412 | }; | ||
| 413 | //@} | ||
| 414 | |||
| 415 | /*! | ||
| 416 | * @brief Audio DSP stream properties | ||
| 417 | * Used to check for the DSP add-on that the stream is supported, | ||
| 418 | * as example Dolby Digital Ex processing is only required on Dolby Digital with 5.1 layout | ||
| 419 | */ | ||
| 420 | typedef struct AE_DSP_STREAM_PROPERTIES | ||
| 421 | { | ||
| 422 | AE_DSP_STREAM_ID iStreamID; /*!< @brief stream id of the audio stream packets */ | ||
| 423 | AE_DSP_STREAMTYPE iStreamType; /*!< @brief the input stream type source eg, Movie or Music */ | ||
| 424 | int iBaseType; /*!< @brief the input stream base type source eg, Dolby Digital */ | ||
| 425 | const char* strName; /*!< @brief the audio stream name */ | ||
| 426 | const char* strCodecId; /*!< @brief codec id string of the audio stream */ | ||
| 427 | const char* strLanguage; /*!< @brief language id of the audio stream */ | ||
| 428 | int iIdentifier; /*!< @brief audio stream id inside player */ | ||
| 429 | int iChannels; /*!< @brief amount of basic channels */ | ||
| 430 | int iSampleRate; /*!< @brief sample rate */ | ||
| 431 | AE_DSP_PROFILE Profile; /*!< @brief current running stream profile data */ | ||
| 432 | } ATTRIBUTE_PACKED AE_DSP_STREAM_PROPERTIES; | ||
| 433 | |||
| 434 | /*! | ||
| 435 | * @brief Audio DSP mode categories | ||
| 436 | */ | ||
| 437 | typedef enum | ||
| 438 | { | ||
| 439 | AE_DSP_MODE_TYPE_UNDEFINED = -1, /*!< @brief undefined type, never be used from add-on! */ | ||
| 440 | AE_DSP_MODE_TYPE_INPUT_RESAMPLE = 0, /*!< @brief for input re sample */ | ||
| 441 | AE_DSP_MODE_TYPE_PRE_PROCESS = 1, /*!< @brief for preprocessing */ | ||
| 442 | AE_DSP_MODE_TYPE_MASTER_PROCESS = 2, /*!< @brief for master processing */ | ||
| 443 | AE_DSP_MODE_TYPE_POST_PROCESS = 3, /*!< @brief for post processing */ | ||
| 444 | AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE = 4, /*!< @brief for output re sample */ | ||
| 445 | AE_DSP_MODE_TYPE_MAX = 5 | ||
| 446 | } AE_DSP_MODE_TYPE; | ||
| 447 | |||
| 448 | /*! | ||
| 449 | * @brief Audio DSP master mode information | ||
| 450 | * Used to get all available modes for current input stream | ||
| 451 | */ | ||
| 452 | typedef struct AE_DSP_MODES | ||
| 453 | { | ||
| 454 | unsigned int iModesCount; /*!< @brief (required) count of how much modes are in AE_DSP_MODES */ | ||
| 455 | struct AE_DSP_MODE | ||
| 456 | { | ||
| 457 | int iUniqueDBModeId; /*!< @brief (required) the inside add-on used identifier for the mode, set by KODI's audio DSP database */ | ||
| 458 | AE_DSP_MODE_TYPE iModeType; /*!< @brief (required) the processong mode type, see AE_DSP_MODE_TYPE */ | ||
| 459 | char strModeName[ADDON_STANDARD_STRING_LENGTH]; /*!< @brief (required) the addon name of the mode, used on KODI's logs */ | ||
| 460 | |||
| 461 | unsigned int iModeNumber; /*!< @brief (required) number of this mode on the add-on, is used on process functions with value "mode_id" */ | ||
| 462 | unsigned int iModeSupportTypeFlags; /*!< @brief (required) flags about supported input types for this mode, see AE_DSP_ASTREAM_PRESENT */ | ||
| 463 | bool bHasSettingsDialog; /*!< @brief (required) if setting dialog(s) are available it must be set to true */ | ||
| 464 | bool bIsDisabled; /*!< @brief (optional) true if this mode is marked as disabled and not enabled default, only relevant for master processes, all other types always disabled as default */ | ||
| 465 | |||
| 466 | unsigned int iModeName; /*!< @brief (required) the name id of the mode for this hook in g_localizeStrings */ | ||
| 467 | unsigned int iModeSetupName; /*!< @brief (optional) the name id of the mode inside settings for this hook in g_localizeStrings */ | ||
| 468 | unsigned int iModeDescription; /*!< @brief (optional) the description id of the mode for this hook in g_localizeStrings */ | ||
| 469 | unsigned int iModeHelp; /*!< @brief (optional) help string id for inside DSP settings dialog of the mode for this hook in g_localizeStrings */ | ||
| 470 | |||
| 471 | char strOwnModeImage[ADDON_STANDARD_STRING_LENGTH]; /*!< @brief (optional) flag image for the mode */ | ||
| 472 | char strOverrideModeImage[ADDON_STANDARD_STRING_LENGTH];/*!< @brief (optional) image to override KODI Image for the mode, eg. Dolby Digital with Dolby Digital Ex (only used on master modes) */ | ||
| 473 | } mode[AE_DSP_STREAM_MAX_MODES]; /*!< @brief Modes array storage */ | ||
| 474 | } ATTRIBUTE_PACKED AE_DSP_MODES; | ||
| 475 | |||
| 476 | /*! | ||
| 477 | * @brief Audio DSP menu hook data | ||
| 478 | */ | ||
| 479 | typedef struct AE_DSP_MENUHOOK_DATA | ||
| 480 | { | ||
| 481 | AE_DSP_MENUHOOK_CAT category; /*!< @brief (required) related menuhook data category */ | ||
| 482 | union data { | ||
| 483 | AE_DSP_STREAM_ID iStreamId; /*!< @brief currently only stream id is used, is used as union to have extension possibility */ | ||
| 484 | } data; /*!< @brief related category related data */ | ||
| 485 | } ATTRIBUTE_PACKED AE_DSP_MENUHOOK_DATA; | ||
| 486 | |||
| 487 | /*! | ||
| 488 | * @brief Properties passed to the Create() method of an add-on. | ||
| 489 | */ | ||
| 490 | typedef struct AddonProps_AudioDSP | ||
| 491 | { | ||
| 492 | const char* strUserPath; /*!< @brief path to the user profile */ | ||
| 493 | const char* strAddonPath; /*!< @brief path to this add-on */ | ||
| 494 | } AddonProps_AudioDSP; | ||
| 495 | |||
| 496 | typedef struct AddonToKodiFuncTable_AudioDSP | ||
| 497 | { | ||
| 498 | void* kodiInstance; | ||
| 499 | void (*add_menu_hook)(void* kodiInstance, AE_DSP_MENUHOOK *hook); | ||
| 500 | void (*remove_menu_hook)(void* kodiInstance, AE_DSP_MENUHOOK *hook); | ||
| 501 | void (*register_mode)(void* kodiInstance, AE_DSP_MODES::AE_DSP_MODE *mode); | ||
| 502 | void (*unregister_mode)(void* kodiInstance, AE_DSP_MODES::AE_DSP_MODE *mode); | ||
| 503 | } AddonToKodiFuncTable_AudioDSP; | ||
| 504 | |||
| 505 | struct AddonInstance_AudioDSP; | ||
| 506 | typedef struct KodiToAddonFuncTable_AudioDSP | ||
| 507 | { | ||
| 508 | kodi::addon::CInstanceAudioDSP* addonInstance; | ||
| 509 | void (__cdecl* get_capabilities)(AddonInstance_AudioDSP const* addonInstance, AE_DSP_ADDON_CAPABILITIES*); | ||
| 510 | const char* (__cdecl* get_dsp_name)(AddonInstance_AudioDSP const* addonInstance); | ||
| 511 | const char* (__cdecl* get_dsp_version)(AddonInstance_AudioDSP const* addonInstance); | ||
| 512 | AE_DSP_ERROR (__cdecl* menu_hook)(AddonInstance_AudioDSP const* addonInstance, const AE_DSP_MENUHOOK*, const AE_DSP_MENUHOOK_DATA*); | ||
| 513 | |||
| 514 | AE_DSP_ERROR (__cdecl* stream_create)(AddonInstance_AudioDSP const* addonInstance, const AE_DSP_SETTINGS*, const AE_DSP_STREAM_PROPERTIES*, ADDON_HANDLE); | ||
| 515 | AE_DSP_ERROR (__cdecl* stream_destroy)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 516 | AE_DSP_ERROR (__cdecl* stream_is_mode_supported)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, AE_DSP_MODE_TYPE, unsigned int, int); | ||
| 517 | AE_DSP_ERROR (__cdecl* stream_initialize)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, const AE_DSP_SETTINGS*); | ||
| 518 | |||
| 519 | bool (__cdecl* input_process)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, const float**, unsigned int); | ||
| 520 | |||
| 521 | unsigned int (__cdecl* input_resample_process_needed_samplesize)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 522 | unsigned int (__cdecl* input_resample_process)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, const float**, float**, unsigned int); | ||
| 523 | float (__cdecl* input_resample_get_delay)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 524 | int (__cdecl* input_resample_samplerate)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 525 | |||
| 526 | unsigned int (__cdecl* pre_process_needed_samplesize)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned int); | ||
| 527 | float (__cdecl* pre_process_get_delay)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned int); | ||
| 528 | unsigned int (__cdecl* pre_process)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned int, const float**, float**, unsigned int); | ||
| 529 | |||
| 530 | AE_DSP_ERROR (__cdecl* master_process_set_mode)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, AE_DSP_STREAMTYPE, unsigned int, int); | ||
| 531 | unsigned int (__cdecl* master_process_needed_samplesize)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 532 | float (__cdecl* master_process_get_delay)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 533 | int (__cdecl* master_process_get_out_channels)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned long*); | ||
| 534 | unsigned int (__cdecl* master_process)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, const float**, float**, unsigned int); | ||
| 535 | const char* (__cdecl* master_process_get_stream_info_string)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 536 | |||
| 537 | unsigned int (__cdecl* post_process_needed_samplesize)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned int); | ||
| 538 | float (__cdecl* post_process_get_delay)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned int); | ||
| 539 | unsigned int (__cdecl* post_process)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, unsigned int, const float**, float**, unsigned int); | ||
| 540 | |||
| 541 | unsigned int (__cdecl* output_resample_process_needed_samplesize)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 542 | unsigned int (__cdecl* output_resample_process)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE, const float**, float**, unsigned int); | ||
| 543 | float (__cdecl* output_resample_get_delay)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 544 | int (__cdecl* output_resample_samplerate)(AddonInstance_AudioDSP const* addonInstance, const ADDON_HANDLE); | ||
| 545 | } KodiToAddonFuncTable_AudioDSP; | ||
| 546 | |||
| 547 | typedef struct AddonInstance_AudioDSP | ||
| 548 | { | ||
| 549 | AddonProps_AudioDSP props; | ||
| 550 | AddonToKodiFuncTable_AudioDSP toKodi; | ||
| 551 | KodiToAddonFuncTable_AudioDSP toAddon; | ||
| 552 | } AddonInstance_AudioDSP; | ||
| 553 | |||
| 554 | } /* extern "C" */ | ||
| 555 | |||
| 556 | namespace kodi { | ||
| 557 | namespace addon { | ||
| 558 | |||
| 559 | class CInstanceAudioDSP : public IAddonInstance | ||
| 560 | { | ||
| 561 | public: | ||
| 562 | //========================================================================== | ||
| 563 | /// @brief Class constructor | ||
| 564 | /// | ||
| 565 | CInstanceAudioDSP() | ||
| 566 | : IAddonInstance(ADDON_INSTANCE_ADSP) | ||
| 567 | { | ||
| 568 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | ||
| 569 | throw std::logic_error("kodi::addon::CInstanceAudioDSP: Creation of more as one in single instance way is not allowed!"); | ||
| 570 | |||
| 571 | SetAddonStruct(CAddonBase::m_interface->firstKodiInstance); | ||
| 572 | CAddonBase::m_interface->globalSingleInstance = this; | ||
| 573 | } | ||
| 574 | //-------------------------------------------------------------------------- | ||
| 575 | |||
| 576 | //========================================================================== | ||
| 577 | /// @brief Class constructor | ||
| 578 | /// | ||
| 579 | /// @param[in] instance The from Kodi given instance given be | ||
| 580 | /// add-on CreateInstance call with instance | ||
| 581 | /// id ADDON_INSTANCE_ADSP. | ||
| 582 | /// | ||
| 583 | explicit CInstanceAudioDSP(KODI_HANDLE instance) | ||
| 584 | : IAddonInstance(ADDON_INSTANCE_ADSP) | ||
| 585 | { | ||
| 586 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | ||
| 587 | throw std::logic_error("kodi::addon::CInstanceAudioDSP: Creation of multiple together with single instance way is not allowed!"); | ||
| 588 | |||
| 589 | SetAddonStruct(instance); | ||
| 590 | } | ||
| 591 | //-------------------------------------------------------------------------- | ||
| 592 | |||
| 593 | /*! @name Audio DSP add-on methods */ | ||
| 594 | //@{ | ||
| 595 | //========================================================================== | ||
| 596 | /// | ||
| 597 | /// @brief Get the list of features that this add-on provides. | ||
| 598 | /// Called by KODI to query the add-ons capabilities. | ||
| 599 | /// Used to check which options should be presented in the DSP, which methods | ||
| 600 | /// to call, etc. | ||
| 601 | /// All capabilities that the add-on supports should be set to true. | ||
| 602 | /// @param capabilities The add-ons capabilities. | ||
| 603 | /// @remarks Valid implementation required. | ||
| 604 | /// | ||
| 605 | virtual void GetCapabilities(AE_DSP_ADDON_CAPABILITIES& capabilities) = 0; | ||
| 606 | //-------------------------------------------------------------------------- | ||
| 607 | |||
| 608 | //========================================================================== | ||
| 609 | /// | ||
| 610 | /// @return The name reported by the back end that will be displayed in the | ||
| 611 | /// UI. | ||
| 612 | /// @remarks Valid implementation required. | ||
| 613 | /// | ||
| 614 | virtual std::string GetDSPName() = 0; | ||
| 615 | //-------------------------------------------------------------------------- | ||
| 616 | |||
| 617 | //========================================================================== | ||
| 618 | /// | ||
| 619 | /// @return The version string reported by the back end that will be displayed | ||
| 620 | /// in the UI. | ||
| 621 | /// @remarks Valid implementation required. | ||
| 622 | /// | ||
| 623 | virtual std::string GetDSPVersion() = 0; | ||
| 624 | //-------------------------------------------------------------------------- | ||
| 625 | |||
| 626 | //========================================================================== | ||
| 627 | /// | ||
| 628 | /// @brief Call one of the menu hooks (if supported). | ||
| 629 | /// Supported AE_DSP_MENUHOOK instances have to be added in ADDON_Create(), | ||
| 630 | /// by calling AddMenuHook() on the callback. | ||
| 631 | /// @param menuhook The hook to call. | ||
| 632 | /// @param item The selected item for which the hook was called. | ||
| 633 | /// @return AE_DSP_ERROR_NO_ERROR if the hook was called successfully. | ||
| 634 | /// @remarks Optional. Return AE_DSP_ERROR_NOT_IMPLEMENTED if this add-on | ||
| 635 | /// won't provide this function. | ||
| 636 | /// | ||
| 637 | virtual AE_DSP_ERROR MenuHook(const AE_DSP_MENUHOOK& menuhook, const AE_DSP_MENUHOOK_DATA& item) { return AE_DSP_ERROR_NOT_IMPLEMENTED; } | ||
| 638 | //-------------------------------------------------------------------------- | ||
| 639 | //@} | ||
| 640 | |||
| 641 | //========================================================================== | ||
| 642 | /// @name DSP processing control, used to open and close a stream | ||
| 643 | /// @remarks Valid implementation required. | ||
| 644 | /// | ||
| 645 | //@{ | ||
| 646 | /// | ||
| 647 | /// @brief Set up Audio DSP with selected audio settings (use the basic | ||
| 648 | /// present audio stream data format). | ||
| 649 | /// Used to detect available add-ons for present stream, as example stereo | ||
| 650 | /// surround upmix not needed on 5.1 audio stream. | ||
| 651 | /// @param addonSettings The add-ons audio settings. | ||
| 652 | /// @param properties The properties of the currently playing stream. | ||
| 653 | /// @param handle On this becomes addon informated about stream id and can set function addresses which need on calls | ||
| 654 | /// @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully | ||
| 655 | /// and data can be performed. AE_DSP_ERROR_IGNORE_ME if format is not | ||
| 656 | /// supported, but without fault. | ||
| 657 | /// @remarks Valid implementation required. | ||
| 658 | /// | ||
| 659 | virtual AE_DSP_ERROR StreamCreate(const AE_DSP_SETTINGS& addonSettings, const AE_DSP_STREAM_PROPERTIES& properties, ADDON_HANDLE handle) = 0; | ||
| 660 | //-------------------------------------------------------------------------- | ||
| 661 | |||
| 662 | //========================================================================== | ||
| 663 | /// | ||
| 664 | /// Remove the selected id from currently used DSP processes | ||
| 665 | /// @param handle identification data for stream | ||
| 666 | /// @return AE_DSP_ERROR_NO_ERROR if the becomes found and removed | ||
| 667 | /// @remarks Valid implementation required. | ||
| 668 | /// | ||
| 669 | virtual AE_DSP_ERROR StreamDestroy(const ADDON_HANDLE handle) = 0; | ||
| 670 | //-------------------------------------------------------------------------- | ||
| 671 | |||
| 672 | //========================================================================== | ||
| 673 | /// | ||
| 674 | /// @brief Ask the add-on about a requested processing mode that it is | ||
| 675 | /// supported on the current stream. Is called about every add-on mode after | ||
| 676 | /// successed StreamCreate. | ||
| 677 | /// @param handle identification data for stream | ||
| 678 | /// @param type The processing mode type, see AE_DSP_MODE_TYPE for definitions | ||
| 679 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 680 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 681 | /// RegisterMode callback, | ||
| 682 | /// @param unique_db_mode_id The Mode unique id generated from dsp database. | ||
| 683 | /// @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully | ||
| 684 | /// or if the stream is not supported the add-on must return | ||
| 685 | /// AE_DSP_ERROR_IGNORE_ME. | ||
| 686 | /// @remarks Valid implementation required. | ||
| 687 | /// | ||
| 688 | virtual AE_DSP_ERROR StreamIsModeSupported(const ADDON_HANDLE handle, AE_DSP_MODE_TYPE type, unsigned int mode_id, int unique_db_mode_id) = 0; | ||
| 689 | //-------------------------------------------------------------------------- | ||
| 690 | |||
| 691 | //========================================================================== | ||
| 692 | /// | ||
| 693 | /// @brief Set up Audio DSP with selected audio settings (detected on data of | ||
| 694 | /// first present audio packet) | ||
| 695 | /// @param addonSettings The add-ons audio settings. | ||
| 696 | /// @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully. | ||
| 697 | /// @remarks Valid implementation required. | ||
| 698 | /// | ||
| 699 | virtual AE_DSP_ERROR StreamInitialize(const ADDON_HANDLE handle, const AE_DSP_SETTINGS& addonSettings) = 0; | ||
| 700 | //-------------------------------------------------------------------------- | ||
| 701 | |||
| 702 | //@} | ||
| 703 | |||
| 704 | /// @name DSP input processing | ||
| 705 | /// @remarks Only used by KODI if bSupportsInputProcess is set to true. | ||
| 706 | /// | ||
| 707 | //@{ | ||
| 708 | //========================================================================== | ||
| 709 | /// | ||
| 710 | /// @brief DSP input processing | ||
| 711 | /// Can be used to have unchanged stream.. | ||
| 712 | /// All DSP add-ons allowed to-do this. | ||
| 713 | /// @param handle identification data for stream | ||
| 714 | /// @param array_in Pointer to data memory | ||
| 715 | /// @param samples Amount of samples inside array_in | ||
| 716 | /// @return true if work was OK | ||
| 717 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 718 | /// GetCapabilities | ||
| 719 | /// | ||
| 720 | virtual bool InputProcess(const ADDON_HANDLE handle, const float** array_in, unsigned int samples) { return true; } | ||
| 721 | //-------------------------------------------------------------------------- | ||
| 722 | //@} | ||
| 723 | |||
| 724 | /// @name DSP pre-resampling | ||
| 725 | /// @remarks Only used by KODI if bSupportsInputResample is set to true. | ||
| 726 | /// | ||
| 727 | //@{ | ||
| 728 | //========================================================================== | ||
| 729 | /// | ||
| 730 | /// @brief If the add-on operate with buffered arrays and the output size can | ||
| 731 | /// be higher as the input it becomes asked about needed size before any | ||
| 732 | /// InputResampleProcess call. | ||
| 733 | /// @param handle identification data for stream | ||
| 734 | /// @return The needed size of output array or 0 if no changes within it | ||
| 735 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 736 | /// GetCapabilities | ||
| 737 | /// | ||
| 738 | virtual unsigned int InputResampleProcessNeededSamplesize(const ADDON_HANDLE handle) { return 0; } | ||
| 739 | //-------------------------------------------------------------------------- | ||
| 740 | |||
| 741 | //========================================================================== | ||
| 742 | /// | ||
| 743 | /// @brief DSP re sample processing before master. | ||
| 744 | /// Here a high quality resample can be performed. | ||
| 745 | /// Only one DSP add-on is allowed to-do this! | ||
| 746 | /// @param handle identification data for stream | ||
| 747 | /// @param array_in Pointer to input data memory | ||
| 748 | /// @param array_out Pointer to output data memory | ||
| 749 | /// @param samples Amount of samples inside array_in | ||
| 750 | /// @return Amount of samples processed | ||
| 751 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 752 | /// GetCapabilities | ||
| 753 | /// | ||
| 754 | virtual unsigned int InputResampleProcess(const ADDON_HANDLE handle, const float** array_in, float** array_out, unsigned int samples) { return 0; } | ||
| 755 | //-------------------------------------------------------------------------- | ||
| 756 | |||
| 757 | //========================================================================== | ||
| 758 | /// | ||
| 759 | /// @brief Returns the re-sampling generated new sample rate used before the | ||
| 760 | /// master process | ||
| 761 | /// @param handle identification data for stream | ||
| 762 | /// @return The new sample rate | ||
| 763 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 764 | /// GetCapabilities | ||
| 765 | /// | ||
| 766 | virtual int InputResampleSampleRate(const ADDON_HANDLE handle) { return 0; } | ||
| 767 | //-------------------------------------------------------------------------- | ||
| 768 | |||
| 769 | //========================================================================== | ||
| 770 | /// | ||
| 771 | /// @brief Returns the time in seconds that it will take | ||
| 772 | /// for the next added packet to be returned to KODI. | ||
| 773 | /// @param handle identification data for stream | ||
| 774 | /// @return the delay in seconds | ||
| 775 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 776 | /// GetCapabilities | ||
| 777 | /// | ||
| 778 | virtual float InputResampleGetDelay(const ADDON_HANDLE handle) { return 0.0f; } | ||
| 779 | //-------------------------------------------------------------------------- | ||
| 780 | //@} | ||
| 781 | |||
| 782 | /** @name DSP Pre processing | ||
| 783 | * @remarks Only used by KODI if bSupportsPreProcess is set to true. | ||
| 784 | */ | ||
| 785 | //@{ | ||
| 786 | //========================================================================== | ||
| 787 | /// | ||
| 788 | /// @brief If the addon operate with buffered arrays and the output size can | ||
| 789 | /// be higher as the input it becomes asked about needed size before any | ||
| 790 | /// PreProcess call. | ||
| 791 | /// @param handle identification data for stream | ||
| 792 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 793 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 794 | /// RegisterMode callback and can be defined from add-on as a structure | ||
| 795 | /// pointer or anything else what is needed to find it. | ||
| 796 | /// @return The needed size of output array or 0 if no changes within it | ||
| 797 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 798 | /// GetCapabilities | ||
| 799 | /// | ||
| 800 | virtual unsigned int PreProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id) { return 0; } | ||
| 801 | //-------------------------------------------------------------------------- | ||
| 802 | |||
| 803 | //========================================================================== | ||
| 804 | /// | ||
| 805 | /// @brief Returns the time in seconds that it will take | ||
| 806 | /// for the next added packet to be returned to KODI. | ||
| 807 | /// @param handle identification data for stream | ||
| 808 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 809 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 810 | /// RegisterMode callback and can be defined from add-on as a structure | ||
| 811 | /// pointer or anything else what is needed to find it. | ||
| 812 | /// @return the delay in seconds | ||
| 813 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 814 | /// GetCapabilities | ||
| 815 | /// | ||
| 816 | virtual float PreProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id) { return 0.0f; } | ||
| 817 | //-------------------------------------------------------------------------- | ||
| 818 | |||
| 819 | //========================================================================== | ||
| 820 | /// | ||
| 821 | /// @brief DSP preprocessing | ||
| 822 | /// All DSP add-ons allowed to-do this. | ||
| 823 | /// @param handle identification data for stream | ||
| 824 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 825 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 826 | /// RegisterMode callback and can be defined from add-on as a structure | ||
| 827 | /// pointer or anything else what is needed to find it. | ||
| 828 | /// @param array_in Pointer to input data memory | ||
| 829 | /// @param array_out Pointer to output data memory | ||
| 830 | /// @param samples Amount of samples inside array_in | ||
| 831 | /// @return Amount of samples processed | ||
| 832 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 833 | /// GetCapabilities | ||
| 834 | /// | ||
| 835 | virtual unsigned int PreProcess(const ADDON_HANDLE handle, unsigned int mode_id, const float** array_in, float** array_out, unsigned int samples) { return 0; } | ||
| 836 | //-------------------------------------------------------------------------- | ||
| 837 | //@} | ||
| 838 | |||
| 839 | /** @name DSP Master processing | ||
| 840 | * @remarks Only used by KODI if bSupportsMasterProcess is set to true. | ||
| 841 | */ | ||
| 842 | //@{ | ||
| 843 | //========================================================================== | ||
| 844 | /// | ||
| 845 | /// @brief Set the active master process mode | ||
| 846 | /// @param handle identification data for stream | ||
| 847 | /// @param type Requested stream type for the selected master mode | ||
| 848 | /// @param mode_id The Mode identifier. | ||
| 849 | /// @param unique_db_mode_id The Mode unique id generated from DSP database. | ||
| 850 | /// @return AE_DSP_ERROR_NO_ERROR if the setup was successful | ||
| 851 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 852 | /// GetCapabilities | ||
| 853 | /// | ||
| 854 | virtual AE_DSP_ERROR MasterProcessSetMode(const ADDON_HANDLE handle, AE_DSP_STREAMTYPE type, unsigned int mode_id, int unique_db_mode_id) { return AE_DSP_ERROR_NOT_IMPLEMENTED; } | ||
| 855 | //-------------------------------------------------------------------------- | ||
| 856 | |||
| 857 | //========================================================================== | ||
| 858 | /// | ||
| 859 | /// @brief If the add-on operate with buffered arrays and the output size can | ||
| 860 | /// be higher as the input it becomes asked about needed size before any | ||
| 861 | /// MasterProcess call. | ||
| 862 | /// @param handle identification data for stream | ||
| 863 | /// @return The needed size of output array or 0 if no changes within it | ||
| 864 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 865 | /// GetCapabilities | ||
| 866 | /// | ||
| 867 | virtual unsigned int MasterProcessNeededSamplesize(const ADDON_HANDLE handle) { return 0; } | ||
| 868 | //-------------------------------------------------------------------------- | ||
| 869 | |||
| 870 | //========================================================================== | ||
| 871 | /// | ||
| 872 | /// @brief Returns the time in seconds that it will take | ||
| 873 | /// for the next added packet to be returned to KODI. | ||
| 874 | /// @param handle identification data for stream | ||
| 875 | /// @return the delay in seconds | ||
| 876 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 877 | /// GetCapabilities | ||
| 878 | /// | ||
| 879 | virtual float MasterProcessGetDelay(const ADDON_HANDLE handle) { return 0.0f; } | ||
| 880 | //-------------------------------------------------------------------------- | ||
| 881 | |||
| 882 | //========================================================================== | ||
| 883 | /// | ||
| 884 | /// @brief Returns the from selected master mode performed channel alignment | ||
| 885 | /// @param handle identification data for stream | ||
| 886 | /// @retval out_channel_present_flags the exact channel present flags after | ||
| 887 | /// performed up-/downmix | ||
| 888 | /// @return the amount channels | ||
| 889 | /// @remarks Optional. Must be used and set if a channel up- or downmix is | ||
| 890 | /// processed from the active master mode | ||
| 891 | /// | ||
| 892 | virtual int MasterProcessGetOutChannels(const ADDON_HANDLE handle, unsigned long& out_channel_present_flags) { return 0; } | ||
| 893 | //-------------------------------------------------------------------------- | ||
| 894 | |||
| 895 | //========================================================================== | ||
| 896 | /// | ||
| 897 | /// @brief Master processing becomes performed with it | ||
| 898 | /// Here a channel up-mix/down-mix for stereo surround sound can be performed | ||
| 899 | /// Only one DSP add-on is allowed to-do this! | ||
| 900 | /// @param handle identification data for stream | ||
| 901 | /// @param array_in Pointer to input data memory | ||
| 902 | /// @param array_out Pointer to output data memory | ||
| 903 | /// @param samples Amount of samples inside array_in | ||
| 904 | /// @return Amount of samples processed | ||
| 905 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 906 | /// GetCapabilities | ||
| 907 | /// | ||
| 908 | virtual unsigned int MasterProcess(const ADDON_HANDLE handle, const float** array_in, float** array_out, unsigned int samples) { return 0; } | ||
| 909 | //-------------------------------------------------------------------------- | ||
| 910 | |||
| 911 | //========================================================================== | ||
| 912 | /// | ||
| 913 | /// Used to get a information string about the processed work to show on skin | ||
| 914 | /// @return A string to show | ||
| 915 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 916 | /// GetCapabilities | ||
| 917 | /// | ||
| 918 | virtual std::string MasterProcessGetStreamInfoString(const ADDON_HANDLE handle) { return ""; } | ||
| 919 | //-------------------------------------------------------------------------- | ||
| 920 | //@} | ||
| 921 | |||
| 922 | /** @name DSP Post processing | ||
| 923 | * @remarks Only used by KODI if bSupportsPostProcess is set to true. | ||
| 924 | */ | ||
| 925 | //@{ | ||
| 926 | //========================================================================== | ||
| 927 | /// | ||
| 928 | /// If the add-on operate with buffered arrays and the output size can be | ||
| 929 | /// higher as the input it becomes asked about needed size before any | ||
| 930 | /// PostProcess call. | ||
| 931 | /// @param handle identification data for stream | ||
| 932 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 933 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 934 | /// RegisterMode callback, and can be defined from add-on as a structure | ||
| 935 | /// pointer or anything else what is needed to find it. | ||
| 936 | /// @return The needed size of output array or 0 if no changes within it | ||
| 937 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 938 | /// GetCapabilities | ||
| 939 | /// | ||
| 940 | virtual unsigned int PostProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id) { return 0; } | ||
| 941 | //-------------------------------------------------------------------------- | ||
| 942 | |||
| 943 | //========================================================================== | ||
| 944 | /// | ||
| 945 | /// Returns the time in seconds that it will take | ||
| 946 | /// for the next added packet to be returned to KODI. | ||
| 947 | /// @param handle identification data for stream | ||
| 948 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 949 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 950 | /// RegisterMode callback, and can be defined from add-on as a structure | ||
| 951 | /// pointer or anything else what is needed to find it. | ||
| 952 | /// @return the delay in seconds | ||
| 953 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 954 | /// GetCapabilities | ||
| 955 | /// | ||
| 956 | virtual float PostProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id) { return 0.0f; } | ||
| 957 | //-------------------------------------------------------------------------- | ||
| 958 | |||
| 959 | //========================================================================== | ||
| 960 | |||
| 961 | /// | ||
| 962 | /// @brief DSP post processing | ||
| 963 | /// On the post processing can be things performed with additional channel | ||
| 964 | /// upmix like 6.1 to 7.1 | ||
| 965 | /// or frequency/volume corrections, speaker distance handling, equalizer... . | ||
| 966 | /// All DSP add-ons allowed to-do this. | ||
| 967 | /// @param handle identification data for stream | ||
| 968 | /// @param mode_id The mode inside add-on which must be performed on call. Id | ||
| 969 | /// is set from add-on by iModeNumber on AE_DSP_MODE structure during | ||
| 970 | /// RegisterMode callback, and can be defined from add-on as a structure | ||
| 971 | /// pointer or anything else what is needed to find it. | ||
| 972 | /// @param array_in Pointer to input data memory | ||
| 973 | /// @param array_out Pointer to output data memory | ||
| 974 | /// @param samples Amount of samples inside array_in | ||
| 975 | /// @return Amount of samples processed | ||
| 976 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 977 | /// GetCapabilities | ||
| 978 | /// | ||
| 979 | virtual unsigned int PostProcess(const ADDON_HANDLE handle, unsigned int mode_id, const float** array_in, float** array_out, unsigned int samples) { return 0; } | ||
| 980 | |||
| 981 | //-------------------------------------------------------------------------- | ||
| 982 | //@} | ||
| 983 | |||
| 984 | /** @name DSP Post re-sampling | ||
| 985 | * @remarks Only used by KODI if bSupportsOutputResample is set to true. | ||
| 986 | */ | ||
| 987 | //@{ | ||
| 988 | //========================================================================== | ||
| 989 | /// | ||
| 990 | /// @brief If the add-on operate with buffered arrays and the output size | ||
| 991 | /// can be higher as the input | ||
| 992 | /// it becomes asked about needed size before any OutputResampleProcess call. | ||
| 993 | /// @param handle identification data for stream | ||
| 994 | /// @return The needed size of output array or 0 if no changes within it | ||
| 995 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 996 | /// GetCapabilities | ||
| 997 | /// | ||
| 998 | virtual unsigned int OutputResampleProcessNeededSamplesize(const ADDON_HANDLE handle) { return 0; } | ||
| 999 | //-------------------------------------------------------------------------- | ||
| 1000 | |||
| 1001 | //========================================================================== | ||
| 1002 | /// | ||
| 1003 | /// @brief Re-sampling after master processing becomes performed with it if | ||
| 1004 | /// needed, only | ||
| 1005 | /// one add-on can perform it. | ||
| 1006 | /// @param handle identification data for stream | ||
| 1007 | /// @param array_in Pointer to input data memory | ||
| 1008 | /// @param array_out Pointer to output data memory | ||
| 1009 | /// @param samples Amount of samples inside array_in | ||
| 1010 | /// @return Amount of samples processed | ||
| 1011 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 1012 | /// GetCapabilities | ||
| 1013 | /// | ||
| 1014 | virtual unsigned int OutputResampleProcess(const ADDON_HANDLE handle, const float** array_in, float** array_out, unsigned int samples) { return 0; } | ||
| 1015 | //-------------------------------------------------------------------------- | ||
| 1016 | |||
| 1017 | //========================================================================== | ||
| 1018 | /// | ||
| 1019 | /// @brief Returns the re-sampling generated new sample rate used after the | ||
| 1020 | /// master process. | ||
| 1021 | /// @param handle identification data for stream | ||
| 1022 | /// @return The new sample rate | ||
| 1023 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 1024 | /// GetCapabilities | ||
| 1025 | /// | ||
| 1026 | virtual int OutputResampleSampleRate(const ADDON_HANDLE handle) { return 0; } | ||
| 1027 | //-------------------------------------------------------------------------- | ||
| 1028 | |||
| 1029 | //========================================================================== | ||
| 1030 | /// | ||
| 1031 | /// @brief Returns the time in seconds that it will take for the next added | ||
| 1032 | /// packet to be returned to KODI. | ||
| 1033 | /// @param handle identification data for stream | ||
| 1034 | /// @return the delay in seconds | ||
| 1035 | /// @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with | ||
| 1036 | /// GetCapabilities | ||
| 1037 | /// | ||
| 1038 | virtual float OutputResampleGetDelay(const ADDON_HANDLE handle) { return 0.0f; } | ||
| 1039 | //-------------------------------------------------------------------------- | ||
| 1040 | //@} | ||
| 1041 | |||
| 1042 | //========================================================================== | ||
| 1043 | /// | ||
| 1044 | /// @brief Add or replace a menu hook for the context menu for this add-on | ||
| 1045 | /// @param hook The hook to add | ||
| 1046 | /// | ||
| 1047 | void AddMenuHook(AE_DSP_MENUHOOK* hook) | ||
| 1048 | { | ||
| 1049 | return m_instanceData->toKodi.add_menu_hook(m_instanceData->toKodi.kodiInstance, hook); | ||
| 1050 | } | ||
| 1051 | //-------------------------------------------------------------------------- | ||
| 1052 | |||
| 1053 | //========================================================================== | ||
| 1054 | /// | ||
| 1055 | /// @brief Remove a menu hook for the context menu for this add-on | ||
| 1056 | /// @param hook The hook to remove | ||
| 1057 | /// | ||
| 1058 | void RemoveMenuHook(AE_DSP_MENUHOOK* hook) | ||
| 1059 | { | ||
| 1060 | return m_instanceData->toKodi.remove_menu_hook(m_instanceData->toKodi.kodiInstance, hook); | ||
| 1061 | } | ||
| 1062 | //-------------------------------------------------------------------------- | ||
| 1063 | |||
| 1064 | //========================================================================== | ||
| 1065 | /// | ||
| 1066 | /// @brief Add or replace master mode information inside audio dsp database. | ||
| 1067 | /// Becomes identifier written inside mode to iModeID if it was 0 (undefined) | ||
| 1068 | /// @param mode The master mode to add or update inside database | ||
| 1069 | /// | ||
| 1070 | void RegisterMode(AE_DSP_MODES::AE_DSP_MODE* mode) | ||
| 1071 | { | ||
| 1072 | return m_instanceData->toKodi.register_mode(m_instanceData->toKodi.kodiInstance, mode); | ||
| 1073 | } | ||
| 1074 | //-------------------------------------------------------------------------- | ||
| 1075 | |||
| 1076 | //========================================================================== | ||
| 1077 | /// | ||
| 1078 | /// @brief Remove a master mode from audio dsp database | ||
| 1079 | /// @param mode The Mode to remove | ||
| 1080 | /// | ||
| 1081 | void UnregisterMode(AE_DSP_MODES::AE_DSP_MODE* mode) | ||
| 1082 | { | ||
| 1083 | return m_instanceData->toKodi.unregister_mode(m_instanceData->toKodi.kodiInstance, mode); | ||
| 1084 | } | ||
| 1085 | //-------------------------------------------------------------------------- | ||
| 1086 | |||
| 1087 | private: | ||
| 1088 | void SetAddonStruct(KODI_HANDLE instance) | ||
| 1089 | { | ||
| 1090 | if (instance == nullptr) | ||
| 1091 | throw std::logic_error("kodi::addon::CInstanceAudioDSP: Null pointer instance passed."); | ||
| 1092 | |||
| 1093 | m_instanceData = static_cast<AddonInstance_AudioDSP*>(instance); | ||
| 1094 | |||
| 1095 | m_instanceData->toAddon.get_capabilities = ADDON_GetCapabilities; | ||
| 1096 | m_instanceData->toAddon.get_dsp_name = ADDON_GetDSPName; | ||
| 1097 | m_instanceData->toAddon.get_dsp_version = ADDON_GetDSPVersion; | ||
| 1098 | m_instanceData->toAddon.menu_hook = ADDON_MenuHook; | ||
| 1099 | |||
| 1100 | m_instanceData->toAddon.stream_create = ADDON_StreamCreate; | ||
| 1101 | m_instanceData->toAddon.stream_destroy = ADDON_StreamDestroy; | ||
| 1102 | m_instanceData->toAddon.stream_is_mode_supported = ADDON_StreamIsModeSupported; | ||
| 1103 | m_instanceData->toAddon.stream_initialize = ADDON_StreamInitialize; | ||
| 1104 | |||
| 1105 | m_instanceData->toAddon.input_process = ADDON_InputProcess; | ||
| 1106 | |||
| 1107 | m_instanceData->toAddon.input_resample_process_needed_samplesize = ADDON_InputResampleProcessNeededSamplesize; | ||
| 1108 | m_instanceData->toAddon.input_resample_process = ADDON_InputResampleProcess; | ||
| 1109 | m_instanceData->toAddon.input_resample_get_delay = ADDON_InputResampleGetDelay; | ||
| 1110 | m_instanceData->toAddon.input_resample_samplerate = ADDON_InputResampleSampleRate; | ||
| 1111 | |||
| 1112 | m_instanceData->toAddon.pre_process_needed_samplesize = ADDON_PreProcessNeededSamplesize; | ||
| 1113 | m_instanceData->toAddon.pre_process_get_delay = ADDON_PreProcessGetDelay; | ||
| 1114 | m_instanceData->toAddon.pre_process = ADDON_PreProcess; | ||
| 1115 | |||
| 1116 | m_instanceData->toAddon.master_process_set_mode = ADDON_MasterProcessSetMode; | ||
| 1117 | m_instanceData->toAddon.master_process_needed_samplesize = ADDON_MasterProcessNeededSamplesize; | ||
| 1118 | m_instanceData->toAddon.master_process_get_delay = ADDON_MasterProcessGetDelay; | ||
| 1119 | m_instanceData->toAddon.master_process_get_out_channels = ADDON_MasterProcessGetOutChannels; | ||
| 1120 | m_instanceData->toAddon.master_process = ADDON_MasterProcess; | ||
| 1121 | m_instanceData->toAddon.master_process_get_stream_info_string = ADDON_MasterProcessGetStreamInfoString; | ||
| 1122 | |||
| 1123 | m_instanceData->toAddon.post_process_needed_samplesize = ADDON_PostProcessNeededSamplesize; | ||
| 1124 | m_instanceData->toAddon.post_process_get_delay = ADDON_PostProcessGetDelay; | ||
| 1125 | m_instanceData->toAddon.post_process = ADDON_PostProcess; | ||
| 1126 | |||
| 1127 | m_instanceData->toAddon.output_resample_process_needed_samplesize = ADDON_OutputResampleProcessNeededSamplesize; | ||
| 1128 | m_instanceData->toAddon.output_resample_process = ADDON_OutputResampleProcess; | ||
| 1129 | m_instanceData->toAddon.output_resample_get_delay = ADDON_OutputResampleGetDelay; | ||
| 1130 | m_instanceData->toAddon.output_resample_samplerate = ADDON_OutputResampleSampleRate; | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | static inline void ADDON_GetCapabilities(AddonInstance_AudioDSP const* instance, AE_DSP_ADDON_CAPABILITIES *capabilities) | ||
| 1134 | { | ||
| 1135 | instance->toAddon.addonInstance->GetCapabilities(*capabilities); | ||
| 1136 | } | ||
| 1137 | |||
| 1138 | static inline const char* ADDON_GetDSPName(AddonInstance_AudioDSP const* instance) | ||
| 1139 | { | ||
| 1140 | instance->toAddon.addonInstance->m_dspName = instance->toAddon.addonInstance->GetDSPName(); | ||
| 1141 | return instance->toAddon.addonInstance->m_dspName.c_str(); | ||
| 1142 | } | ||
| 1143 | |||
| 1144 | static inline const char* ADDON_GetDSPVersion(AddonInstance_AudioDSP const* instance) | ||
| 1145 | { | ||
| 1146 | instance->toAddon.addonInstance->m_dspVersion = instance->toAddon.addonInstance->GetDSPVersion(); | ||
| 1147 | return instance->toAddon.addonInstance->m_dspVersion.c_str(); | ||
| 1148 | } | ||
| 1149 | |||
| 1150 | static inline AE_DSP_ERROR ADDON_MenuHook(AddonInstance_AudioDSP const* instance, const AE_DSP_MENUHOOK* menuhook, const AE_DSP_MENUHOOK_DATA* item) | ||
| 1151 | { | ||
| 1152 | return instance->toAddon.addonInstance->MenuHook(*menuhook, *item); | ||
| 1153 | } | ||
| 1154 | |||
| 1155 | static inline AE_DSP_ERROR ADDON_StreamCreate(AddonInstance_AudioDSP const* instance, const AE_DSP_SETTINGS *addonSettings, const AE_DSP_STREAM_PROPERTIES* properties, ADDON_HANDLE handle) | ||
| 1156 | { | ||
| 1157 | return instance->toAddon.addonInstance->StreamCreate(*addonSettings, *properties, handle); | ||
| 1158 | } | ||
| 1159 | |||
| 1160 | static inline AE_DSP_ERROR ADDON_StreamDestroy(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1161 | { | ||
| 1162 | return instance->toAddon.addonInstance->StreamDestroy(handle); | ||
| 1163 | } | ||
| 1164 | |||
| 1165 | static inline AE_DSP_ERROR ADDON_StreamIsModeSupported(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, AE_DSP_MODE_TYPE type, unsigned int mode_id, int unique_db_mode_id) | ||
| 1166 | { | ||
| 1167 | return instance->toAddon.addonInstance->StreamIsModeSupported(handle, type, mode_id, unique_db_mode_id); | ||
| 1168 | } | ||
| 1169 | |||
| 1170 | static inline AE_DSP_ERROR ADDON_StreamInitialize(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, const AE_DSP_SETTINGS *addonSettings) | ||
| 1171 | { | ||
| 1172 | return instance->toAddon.addonInstance->StreamInitialize(handle, *addonSettings); | ||
| 1173 | } | ||
| 1174 | |||
| 1175 | static inline bool ADDON_InputProcess(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, const float** array_in, unsigned int samples) | ||
| 1176 | { | ||
| 1177 | return instance->toAddon.addonInstance->InputProcess(handle, array_in, samples); | ||
| 1178 | } | ||
| 1179 | |||
| 1180 | static inline unsigned int ADDON_InputResampleProcessNeededSamplesize(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1181 | { | ||
| 1182 | return instance->toAddon.addonInstance->InputResampleProcessNeededSamplesize(handle); | ||
| 1183 | } | ||
| 1184 | |||
| 1185 | static inline unsigned int ADDON_InputResampleProcess(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, const float** array_in, float** array_out, unsigned int samples) | ||
| 1186 | { | ||
| 1187 | return instance->toAddon.addonInstance->InputResampleProcess(handle, array_in, array_out, samples); | ||
| 1188 | } | ||
| 1189 | |||
| 1190 | static inline int ADDON_InputResampleSampleRate(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1191 | { | ||
| 1192 | return instance->toAddon.addonInstance->InputResampleSampleRate(handle); | ||
| 1193 | } | ||
| 1194 | |||
| 1195 | static inline float ADDON_InputResampleGetDelay(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1196 | { | ||
| 1197 | return instance->toAddon.addonInstance->InputResampleGetDelay(handle); | ||
| 1198 | } | ||
| 1199 | |||
| 1200 | static inline unsigned int ADDON_PreProcessNeededSamplesize(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned int mode_id) | ||
| 1201 | { | ||
| 1202 | return instance->toAddon.addonInstance->PreProcessNeededSamplesize(handle, mode_id); | ||
| 1203 | } | ||
| 1204 | |||
| 1205 | static inline float ADDON_PreProcessGetDelay(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned int mode_id) | ||
| 1206 | { | ||
| 1207 | return instance->toAddon.addonInstance->PreProcessGetDelay(handle, mode_id); | ||
| 1208 | } | ||
| 1209 | |||
| 1210 | static inline unsigned int ADDON_PreProcess(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned int mode_id, const float** array_in, float** array_out, unsigned int samples) | ||
| 1211 | { | ||
| 1212 | return instance->toAddon.addonInstance->PreProcess(handle, mode_id, array_in, array_out, samples); | ||
| 1213 | } | ||
| 1214 | |||
| 1215 | static inline AE_DSP_ERROR ADDON_MasterProcessSetMode(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, AE_DSP_STREAMTYPE type, unsigned int mode_id, int unique_db_mode_id) | ||
| 1216 | { | ||
| 1217 | return instance->toAddon.addonInstance->MasterProcessSetMode(handle, type, mode_id, unique_db_mode_id); | ||
| 1218 | } | ||
| 1219 | |||
| 1220 | static inline unsigned int ADDON_MasterProcessNeededSamplesize(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1221 | { | ||
| 1222 | return instance->toAddon.addonInstance->MasterProcessNeededSamplesize(handle); | ||
| 1223 | } | ||
| 1224 | |||
| 1225 | static inline float ADDON_MasterProcessGetDelay(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1226 | { | ||
| 1227 | return instance->toAddon.addonInstance->MasterProcessGetDelay(handle); | ||
| 1228 | } | ||
| 1229 | |||
| 1230 | static inline int ADDON_MasterProcessGetOutChannels(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned long* out_channel_present_flags) | ||
| 1231 | { | ||
| 1232 | return instance->toAddon.addonInstance->MasterProcessGetOutChannels(handle, *out_channel_present_flags); | ||
| 1233 | } | ||
| 1234 | |||
| 1235 | static inline unsigned int ADDON_MasterProcess(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, const float** array_in, float** array_out, unsigned int samples) | ||
| 1236 | { | ||
| 1237 | return instance->toAddon.addonInstance->MasterProcess(handle, array_in, array_out, samples); | ||
| 1238 | } | ||
| 1239 | |||
| 1240 | static inline const char* ADDON_MasterProcessGetStreamInfoString(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1241 | { | ||
| 1242 | instance->toAddon.addonInstance->m_streamInfoString = instance->toAddon.addonInstance->MasterProcessGetStreamInfoString(handle); | ||
| 1243 | return instance->toAddon.addonInstance->m_streamInfoString.c_str(); | ||
| 1244 | } | ||
| 1245 | |||
| 1246 | static inline unsigned int ADDON_PostProcessNeededSamplesize(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned int mode_id) | ||
| 1247 | { | ||
| 1248 | return instance->toAddon.addonInstance->PostProcessNeededSamplesize(handle, mode_id); | ||
| 1249 | } | ||
| 1250 | |||
| 1251 | static inline float ADDON_PostProcessGetDelay(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned int mode_id) | ||
| 1252 | { | ||
| 1253 | return instance->toAddon.addonInstance->PostProcessGetDelay(handle, mode_id); | ||
| 1254 | } | ||
| 1255 | |||
| 1256 | static inline unsigned int ADDON_PostProcess(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, unsigned int mode_id, const float** array_in, float** array_out, unsigned int samples) | ||
| 1257 | { | ||
| 1258 | return instance->toAddon.addonInstance->PostProcess(handle, mode_id, array_in, array_out, samples); | ||
| 1259 | } | ||
| 1260 | |||
| 1261 | static inline unsigned int ADDON_OutputResampleProcessNeededSamplesize(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1262 | { | ||
| 1263 | return instance->toAddon.addonInstance->OutputResampleProcessNeededSamplesize(handle); | ||
| 1264 | } | ||
| 1265 | |||
| 1266 | static inline unsigned int ADDON_OutputResampleProcess(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle, const float** array_in, float** array_out, unsigned int samples) | ||
| 1267 | { | ||
| 1268 | return instance->toAddon.addonInstance->OutputResampleProcess(handle, array_in, array_out, samples); | ||
| 1269 | } | ||
| 1270 | |||
| 1271 | static inline int ADDON_OutputResampleSampleRate(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1272 | { | ||
| 1273 | return instance->toAddon.addonInstance->OutputResampleSampleRate(handle); | ||
| 1274 | } | ||
| 1275 | |||
| 1276 | static inline float ADDON_OutputResampleGetDelay(AddonInstance_AudioDSP const* instance, const ADDON_HANDLE handle) | ||
| 1277 | { | ||
| 1278 | return instance->toAddon.addonInstance->OutputResampleGetDelay(handle); | ||
| 1279 | } | ||
| 1280 | |||
| 1281 | std::string m_dspName; | ||
| 1282 | std::string m_dspVersion; | ||
| 1283 | std::string m_streamInfoString; | ||
| 1284 | AddonInstance_AudioDSP* m_instanceData; | ||
| 1285 | }; | ||
| 1286 | |||
| 1287 | } /* namespace addon */ | ||
| 1288 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt index ba4f889..44aaf05 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | set(HEADERS AudioDSP.h | 1 | set(HEADERS AudioDecoder.h |
| 2 | AudioDecoder.h | ||
| 3 | AudioEncoder.h | 2 | AudioEncoder.h |
| 4 | ImageDecoder.h | 3 | ImageDecoder.h |
| 5 | Inputstream.h | 4 | Inputstream.h |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h index 0dae06c..75be27e 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h | |||
| @@ -34,6 +34,10 @@ extern "C" | |||
| 34 | 34 | ||
| 35 | /// @name Peripheral types | 35 | /// @name Peripheral types |
| 36 | ///{ | 36 | ///{ |
| 37 | |||
| 38 | /*! | ||
| 39 | * @brief API error codes | ||
| 40 | */ | ||
| 37 | typedef enum PERIPHERAL_ERROR | 41 | typedef enum PERIPHERAL_ERROR |
| 38 | { | 42 | { |
| 39 | PERIPHERAL_NO_ERROR = 0, // no error occurred | 43 | PERIPHERAL_NO_ERROR = 0, // no error occurred |
| @@ -45,6 +49,9 @@ extern "C" | |||
| 45 | PERIPHERAL_ERROR_CONNECTION_FAILED = -6, // peripherals are connected, but command was interrupted | 49 | PERIPHERAL_ERROR_CONNECTION_FAILED = -6, // peripherals are connected, but command was interrupted |
| 46 | } PERIPHERAL_ERROR; | 50 | } PERIPHERAL_ERROR; |
| 47 | 51 | ||
| 52 | /*! | ||
| 53 | * @brief Peripheral types | ||
| 54 | */ | ||
| 48 | typedef enum PERIPHERAL_TYPE | 55 | typedef enum PERIPHERAL_TYPE |
| 49 | { | 56 | { |
| 50 | PERIPHERAL_TYPE_UNKNOWN, | 57 | PERIPHERAL_TYPE_UNKNOWN, |
| @@ -52,6 +59,9 @@ extern "C" | |||
| 52 | PERIPHERAL_TYPE_KEYBOARD, | 59 | PERIPHERAL_TYPE_KEYBOARD, |
| 53 | } PERIPHERAL_TYPE; | 60 | } PERIPHERAL_TYPE; |
| 54 | 61 | ||
| 62 | /*! | ||
| 63 | * @brief Information shared between peripherals | ||
| 64 | */ | ||
| 55 | typedef struct PERIPHERAL_INFO | 65 | typedef struct PERIPHERAL_INFO |
| 56 | { | 66 | { |
| 57 | PERIPHERAL_TYPE type; /*!< @brief type of peripheral */ | 67 | PERIPHERAL_TYPE type; /*!< @brief type of peripheral */ |
| @@ -63,8 +73,6 @@ extern "C" | |||
| 63 | 73 | ||
| 64 | /*! | 74 | /*! |
| 65 | * @brief Peripheral add-on capabilities. | 75 | * @brief Peripheral add-on capabilities. |
| 66 | * If a capability is set to true, then the corresponding methods from | ||
| 67 | * kodi_peripheral_dll.h need to be implemented. | ||
| 68 | */ | 76 | */ |
| 69 | typedef struct PERIPHERAL_CAPABILITIES | 77 | typedef struct PERIPHERAL_CAPABILITIES |
| 70 | { | 78 | { |
| @@ -77,6 +85,10 @@ extern "C" | |||
| 77 | 85 | ||
| 78 | /// @name Event types | 86 | /// @name Event types |
| 79 | ///{ | 87 | ///{ |
| 88 | |||
| 89 | /*! | ||
| 90 | * @brief Types of events that can be sent and received | ||
| 91 | */ | ||
| 80 | typedef enum PERIPHERAL_EVENT_TYPE | 92 | typedef enum PERIPHERAL_EVENT_TYPE |
| 81 | { | 93 | { |
| 82 | PERIPHERAL_EVENT_TYPE_NONE, /*!< @brief unknown event */ | 94 | PERIPHERAL_EVENT_TYPE_NONE, /*!< @brief unknown event */ |
| @@ -86,12 +98,18 @@ extern "C" | |||
| 86 | PERIPHERAL_EVENT_TYPE_SET_MOTOR, /*!< @brief set the state for joystick rumble motor */ | 98 | PERIPHERAL_EVENT_TYPE_SET_MOTOR, /*!< @brief set the state for joystick rumble motor */ |
| 87 | } PERIPHERAL_EVENT_TYPE; | 99 | } PERIPHERAL_EVENT_TYPE; |
| 88 | 100 | ||
| 101 | /*! | ||
| 102 | * @brief States a button can have | ||
| 103 | */ | ||
| 89 | typedef enum JOYSTICK_STATE_BUTTON | 104 | typedef enum JOYSTICK_STATE_BUTTON |
| 90 | { | 105 | { |
| 91 | JOYSTICK_STATE_BUTTON_UNPRESSED = 0x0, /*!< @brief button is released */ | 106 | JOYSTICK_STATE_BUTTON_UNPRESSED = 0x0, /*!< @brief button is released */ |
| 92 | JOYSTICK_STATE_BUTTON_PRESSED = 0x1, /*!< @brief button is pressed */ | 107 | JOYSTICK_STATE_BUTTON_PRESSED = 0x1, /*!< @brief button is pressed */ |
| 93 | } JOYSTICK_STATE_BUTTON; | 108 | } JOYSTICK_STATE_BUTTON; |
| 94 | 109 | ||
| 110 | /*! | ||
| 111 | * @brief States a D-pad (also called a hat) can have | ||
| 112 | */ | ||
| 95 | typedef enum JOYSTICK_STATE_HAT | 113 | typedef enum JOYSTICK_STATE_HAT |
| 96 | { | 114 | { |
| 97 | JOYSTICK_STATE_HAT_UNPRESSED = 0x0, /*!< @brief no directions are pressed */ | 115 | JOYSTICK_STATE_HAT_UNPRESSED = 0x0, /*!< @brief no directions are pressed */ |
| @@ -106,7 +124,7 @@ extern "C" | |||
| 106 | } JOYSTICK_STATE_HAT; | 124 | } JOYSTICK_STATE_HAT; |
| 107 | 125 | ||
| 108 | /*! | 126 | /*! |
| 109 | * @brief value in the closed interval [-1.0, 1.0] | 127 | * @brief Axis value in the closed interval [-1.0, 1.0] |
| 110 | * | 128 | * |
| 111 | * The axis state uses the XInput coordinate system: | 129 | * The axis state uses the XInput coordinate system: |
| 112 | * - Negative values signify down or to the left | 130 | * - Negative values signify down or to the left |
| @@ -114,13 +132,25 @@ extern "C" | |||
| 114 | */ | 132 | */ |
| 115 | typedef float JOYSTICK_STATE_AXIS; | 133 | typedef float JOYSTICK_STATE_AXIS; |
| 116 | 134 | ||
| 135 | /*! | ||
| 136 | * @brief Motor value in the closed interval [0.0, 1.0] | ||
| 137 | */ | ||
| 117 | typedef float JOYSTICK_STATE_MOTOR; | 138 | typedef float JOYSTICK_STATE_MOTOR; |
| 118 | 139 | ||
| 140 | /*! | ||
| 141 | * @brief Event information | ||
| 142 | */ | ||
| 119 | typedef struct PERIPHERAL_EVENT | 143 | typedef struct PERIPHERAL_EVENT |
| 120 | { | 144 | { |
| 121 | unsigned int peripheral_index; | 145 | /*! @brief Index of the peripheral handling/receiving the event */ |
| 122 | PERIPHERAL_EVENT_TYPE type; | 146 | unsigned int peripheral_index; |
| 123 | unsigned int driver_index; | 147 | |
| 148 | /*! @brief Type of the event used to determine which enum field to access below */ | ||
| 149 | PERIPHERAL_EVENT_TYPE type; | ||
| 150 | |||
| 151 | /*! @brief The index of the event source */ | ||
| 152 | unsigned int driver_index; | ||
| 153 | |||
| 124 | JOYSTICK_STATE_BUTTON driver_button_state; | 154 | JOYSTICK_STATE_BUTTON driver_button_state; |
| 125 | JOYSTICK_STATE_HAT driver_hat_state; | 155 | JOYSTICK_STATE_HAT driver_hat_state; |
| 126 | JOYSTICK_STATE_AXIS driver_axis_state; | 156 | JOYSTICK_STATE_AXIS driver_axis_state; |
| @@ -130,6 +160,10 @@ extern "C" | |||
| 130 | 160 | ||
| 131 | /// @name Joystick types | 161 | /// @name Joystick types |
| 132 | ///{ | 162 | ///{ |
| 163 | |||
| 164 | /*! | ||
| 165 | * @brief Info specific to joystick peripherals | ||
| 166 | */ | ||
| 133 | typedef struct JOYSTICK_INFO | 167 | typedef struct JOYSTICK_INFO |
| 134 | { | 168 | { |
| 135 | PERIPHERAL_INFO peripheral; /*!< @brief peripheral info for this joystick */ | 169 | PERIPHERAL_INFO peripheral; /*!< @brief peripheral info for this joystick */ |
| @@ -142,6 +176,15 @@ extern "C" | |||
| 142 | bool supports_poweroff; /*!< @brief whether the joystick supports being powered off */ | 176 | bool supports_poweroff; /*!< @brief whether the joystick supports being powered off */ |
| 143 | } ATTRIBUTE_PACKED JOYSTICK_INFO; | 177 | } ATTRIBUTE_PACKED JOYSTICK_INFO; |
| 144 | 178 | ||
| 179 | /*! | ||
| 180 | * @brief Driver input primitives | ||
| 181 | * | ||
| 182 | * Mapping lower-level driver values to higher-level controller features is | ||
| 183 | * non-injective; two triggers can share a single axis. | ||
| 184 | * | ||
| 185 | * To handle this, driver values are subdivided into "primitives" that map | ||
| 186 | * injectively to higher-level features. | ||
| 187 | */ | ||
| 145 | typedef enum JOYSTICK_DRIVER_PRIMITIVE_TYPE | 188 | typedef enum JOYSTICK_DRIVER_PRIMITIVE_TYPE |
| 146 | { | 189 | { |
| 147 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN, | 190 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN, |
| @@ -149,13 +192,22 @@ extern "C" | |||
| 149 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION, | 192 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION, |
| 150 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS, | 193 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS, |
| 151 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, | 194 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, |
| 195 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY, | ||
| 196 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON, | ||
| 197 | JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION, | ||
| 152 | } JOYSTICK_DRIVER_PRIMITIVE_TYPE; | 198 | } JOYSTICK_DRIVER_PRIMITIVE_TYPE; |
| 153 | 199 | ||
| 200 | /*! | ||
| 201 | * @brief Button primitive | ||
| 202 | */ | ||
| 154 | typedef struct JOYSTICK_DRIVER_BUTTON | 203 | typedef struct JOYSTICK_DRIVER_BUTTON |
| 155 | { | 204 | { |
| 156 | int index; | 205 | int index; |
| 157 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_BUTTON; | 206 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_BUTTON; |
| 158 | 207 | ||
| 208 | /*! | ||
| 209 | * @brief Hat direction | ||
| 210 | */ | ||
| 159 | typedef enum JOYSTICK_DRIVER_HAT_DIRECTION | 211 | typedef enum JOYSTICK_DRIVER_HAT_DIRECTION |
| 160 | { | 212 | { |
| 161 | JOYSTICK_DRIVER_HAT_UNKNOWN, | 213 | JOYSTICK_DRIVER_HAT_UNKNOWN, |
| @@ -165,12 +217,18 @@ extern "C" | |||
| 165 | JOYSTICK_DRIVER_HAT_DOWN, | 217 | JOYSTICK_DRIVER_HAT_DOWN, |
| 166 | } JOYSTICK_DRIVER_HAT_DIRECTION; | 218 | } JOYSTICK_DRIVER_HAT_DIRECTION; |
| 167 | 219 | ||
| 220 | /*! | ||
| 221 | * @brief Hat direction primitive | ||
| 222 | */ | ||
| 168 | typedef struct JOYSTICK_DRIVER_HAT | 223 | typedef struct JOYSTICK_DRIVER_HAT |
| 169 | { | 224 | { |
| 170 | int index; | 225 | int index; |
| 171 | JOYSTICK_DRIVER_HAT_DIRECTION direction; | 226 | JOYSTICK_DRIVER_HAT_DIRECTION direction; |
| 172 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_HAT; | 227 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_HAT; |
| 173 | 228 | ||
| 229 | /*! | ||
| 230 | * @brief Semiaxis direction | ||
| 231 | */ | ||
| 174 | typedef enum JOYSTICK_DRIVER_SEMIAXIS_DIRECTION | 232 | typedef enum JOYSTICK_DRIVER_SEMIAXIS_DIRECTION |
| 175 | { | 233 | { |
| 176 | JOYSTICK_DRIVER_SEMIAXIS_NEGATIVE = -1, /*!< @brief negative half of the axis */ | 234 | JOYSTICK_DRIVER_SEMIAXIS_NEGATIVE = -1, /*!< @brief negative half of the axis */ |
| @@ -178,6 +236,9 @@ extern "C" | |||
| 178 | JOYSTICK_DRIVER_SEMIAXIS_POSITIVE = 1, /*!< @brief positive half of the axis */ | 236 | JOYSTICK_DRIVER_SEMIAXIS_POSITIVE = 1, /*!< @brief positive half of the axis */ |
| 179 | } JOYSTICK_DRIVER_SEMIAXIS_DIRECTION; | 237 | } JOYSTICK_DRIVER_SEMIAXIS_DIRECTION; |
| 180 | 238 | ||
| 239 | /*! | ||
| 240 | * @brief Semiaxis primitive | ||
| 241 | */ | ||
| 181 | typedef struct JOYSTICK_DRIVER_SEMIAXIS | 242 | typedef struct JOYSTICK_DRIVER_SEMIAXIS |
| 182 | { | 243 | { |
| 183 | int index; | 244 | int index; |
| @@ -186,11 +247,70 @@ extern "C" | |||
| 186 | unsigned int range; | 247 | unsigned int range; |
| 187 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_SEMIAXIS; | 248 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_SEMIAXIS; |
| 188 | 249 | ||
| 250 | /*! | ||
| 251 | * @brief Motor primitive | ||
| 252 | */ | ||
| 189 | typedef struct JOYSTICK_DRIVER_MOTOR | 253 | typedef struct JOYSTICK_DRIVER_MOTOR |
| 190 | { | 254 | { |
| 191 | int index; | 255 | int index; |
| 192 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_MOTOR; | 256 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_MOTOR; |
| 193 | 257 | ||
| 258 | /*! | ||
| 259 | * @brief Keyboard key primitive | ||
| 260 | */ | ||
| 261 | typedef struct JOYSTICK_DRIVER_KEY | ||
| 262 | { | ||
| 263 | char keycode[16]; | ||
| 264 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_KEY; | ||
| 265 | |||
| 266 | /*! | ||
| 267 | * @brief Mouse buttons | ||
| 268 | */ | ||
| 269 | typedef enum JOYSTICK_DRIVER_MOUSE_INDEX | ||
| 270 | { | ||
| 271 | JOYSTICK_DRIVER_MOUSE_INDEX_UNKNOWN, | ||
| 272 | JOYSTICK_DRIVER_MOUSE_INDEX_LEFT, | ||
| 273 | JOYSTICK_DRIVER_MOUSE_INDEX_RIGHT, | ||
| 274 | JOYSTICK_DRIVER_MOUSE_INDEX_MIDDLE, | ||
| 275 | JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON4, | ||
| 276 | JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON5, | ||
| 277 | JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_UP, | ||
| 278 | JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_DOWN, | ||
| 279 | JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_LEFT, | ||
| 280 | JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_RIGHT, | ||
| 281 | } JOYSTICK_DRIVER_MOUSE_INDEX; | ||
| 282 | |||
| 283 | /*! | ||
| 284 | * @brief Mouse button primitive | ||
| 285 | */ | ||
| 286 | typedef struct JOYSTICK_DRIVER_MOUSE_BUTTON | ||
| 287 | { | ||
| 288 | JOYSTICK_DRIVER_MOUSE_INDEX button; | ||
| 289 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_MOUSE_BUTTON; | ||
| 290 | |||
| 291 | /*! | ||
| 292 | * @brief Relative pointer direction | ||
| 293 | */ | ||
| 294 | typedef enum JOYSTICK_DRIVER_RELPOINTER_DIRECTION | ||
| 295 | { | ||
| 296 | JOYSTICK_DRIVER_RELPOINTER_UNKNOWN, | ||
| 297 | JOYSTICK_DRIVER_RELPOINTER_LEFT, | ||
| 298 | JOYSTICK_DRIVER_RELPOINTER_RIGHT, | ||
| 299 | JOYSTICK_DRIVER_RELPOINTER_UP, | ||
| 300 | JOYSTICK_DRIVER_RELPOINTER_DOWN, | ||
| 301 | } JOYSTICK_DRIVER_RELPOINTER_DIRECTION; | ||
| 302 | |||
| 303 | /*! | ||
| 304 | * @brief Relative pointer direction primitive | ||
| 305 | */ | ||
| 306 | typedef struct JOYSTICK_DRIVER_RELPOINTER | ||
| 307 | { | ||
| 308 | JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction; | ||
| 309 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_RELPOINTER; | ||
| 310 | |||
| 311 | /*! | ||
| 312 | * @brief Driver primitive struct | ||
| 313 | */ | ||
| 194 | typedef struct JOYSTICK_DRIVER_PRIMITIVE | 314 | typedef struct JOYSTICK_DRIVER_PRIMITIVE |
| 195 | { | 315 | { |
| 196 | JOYSTICK_DRIVER_PRIMITIVE_TYPE type; | 316 | JOYSTICK_DRIVER_PRIMITIVE_TYPE type; |
| @@ -200,9 +320,18 @@ extern "C" | |||
| 200 | struct JOYSTICK_DRIVER_HAT hat; | 320 | struct JOYSTICK_DRIVER_HAT hat; |
| 201 | struct JOYSTICK_DRIVER_SEMIAXIS semiaxis; | 321 | struct JOYSTICK_DRIVER_SEMIAXIS semiaxis; |
| 202 | struct JOYSTICK_DRIVER_MOTOR motor; | 322 | struct JOYSTICK_DRIVER_MOTOR motor; |
| 323 | struct JOYSTICK_DRIVER_KEY key; | ||
| 324 | struct JOYSTICK_DRIVER_MOUSE_BUTTON mouse; | ||
| 325 | struct JOYSTICK_DRIVER_RELPOINTER relpointer; | ||
| 203 | }; | 326 | }; |
| 204 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_PRIMITIVE; | 327 | } ATTRIBUTE_PACKED JOYSTICK_DRIVER_PRIMITIVE; |
| 205 | 328 | ||
| 329 | /*! | ||
| 330 | * @brief Controller feature | ||
| 331 | * | ||
| 332 | * Controller features are an abstraction over driver values. Each feature | ||
| 333 | * maps to one or more driver primitives. | ||
| 334 | */ | ||
| 206 | typedef enum JOYSTICK_FEATURE_TYPE | 335 | typedef enum JOYSTICK_FEATURE_TYPE |
| 207 | { | 336 | { |
| 208 | JOYSTICK_FEATURE_TYPE_UNKNOWN, | 337 | JOYSTICK_FEATURE_TYPE_UNKNOWN, |
| @@ -214,11 +343,15 @@ extern "C" | |||
| 214 | JOYSTICK_FEATURE_TYPE_ABSPOINTER, | 343 | JOYSTICK_FEATURE_TYPE_ABSPOINTER, |
| 215 | JOYSTICK_FEATURE_TYPE_WHEEL, | 344 | JOYSTICK_FEATURE_TYPE_WHEEL, |
| 216 | JOYSTICK_FEATURE_TYPE_THROTTLE, | 345 | JOYSTICK_FEATURE_TYPE_THROTTLE, |
| 346 | JOYSTICK_FEATURE_TYPE_KEY, | ||
| 217 | } JOYSTICK_FEATURE_TYPE; | 347 | } JOYSTICK_FEATURE_TYPE; |
| 218 | 348 | ||
| 349 | /*! | ||
| 350 | * @brief Indices used to access a feature's driver primitives | ||
| 351 | */ | ||
| 219 | typedef enum JOYSTICK_FEATURE_PRIMITIVE | 352 | typedef enum JOYSTICK_FEATURE_PRIMITIVE |
| 220 | { | 353 | { |
| 221 | // Scalar feature | 354 | // Scalar feature (a button, hat direction or semiaxis) |
| 222 | JOYSTICK_SCALAR_PRIMITIVE = 0, | 355 | JOYSTICK_SCALAR_PRIMITIVE = 0, |
| 223 | 356 | ||
| 224 | // Analog stick | 357 | // Analog stick |
| @@ -243,10 +376,25 @@ extern "C" | |||
| 243 | JOYSTICK_THROTTLE_UP = 0, | 376 | JOYSTICK_THROTTLE_UP = 0, |
| 244 | JOYSTICK_THROTTLE_DOWN = 1, | 377 | JOYSTICK_THROTTLE_DOWN = 1, |
| 245 | 378 | ||
| 379 | // Key | ||
| 380 | JOYSTICK_KEY_PRIMITIVE = 0, | ||
| 381 | |||
| 382 | // Mouse button | ||
| 383 | JOYSTICK_MOUSE_BUTTON = 0, | ||
| 384 | |||
| 385 | // Relative pointer direction | ||
| 386 | JOYSTICK_RELPOINTER_UP = 0, | ||
| 387 | JOYSTICK_RELPOINTER_DOWN = 1, | ||
| 388 | JOYSTICK_RELPOINTER_RIGHT = 2, | ||
| 389 | JOYSTICK_RELPOINTER_LEFT = 3, | ||
| 390 | |||
| 246 | // Maximum number of primitives | 391 | // Maximum number of primitives |
| 247 | JOYSTICK_PRIMITIVE_MAX = 4, | 392 | JOYSTICK_PRIMITIVE_MAX = 4, |
| 248 | } JOYSTICK_FEATURE_PRIMITIVE; | 393 | } JOYSTICK_FEATURE_PRIMITIVE; |
| 249 | 394 | ||
| 395 | /*! | ||
| 396 | * @brief Mapping between higher-level controller feature and its driver primitives | ||
| 397 | */ | ||
| 250 | typedef struct JOYSTICK_FEATURE | 398 | typedef struct JOYSTICK_FEATURE |
| 251 | { | 399 | { |
| 252 | char* name; | 400 | char* name; |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h index 3c4cab3..c2efc05 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h | |||
| @@ -23,8 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | #include <array> // Requires c++11 | 24 | #include <array> // Requires c++11 |
| 25 | #include <cstring> | 25 | #include <cstring> |
| 26 | #include <map> | ||
| 27 | #include <string> | 26 | #include <string> |
| 27 | #include <utility> | ||
| 28 | #include <vector> | 28 | #include <vector> |
| 29 | 29 | ||
| 30 | #define PERIPHERAL_SAFE_DELETE(x) do { delete (x); (x) = NULL; } while (0) | 30 | #define PERIPHERAL_SAFE_DELETE(x) do { delete (x); (x) = NULL; } while (0) |
| @@ -164,62 +164,70 @@ namespace addon | |||
| 164 | class PeripheralEvent | 164 | class PeripheralEvent |
| 165 | { | 165 | { |
| 166 | public: | 166 | public: |
| 167 | PeripheralEvent(void) : | 167 | PeripheralEvent(void) |
| 168 | m_event() | ||
| 169 | { | 168 | { |
| 170 | } | 169 | } |
| 171 | 170 | ||
| 172 | PeripheralEvent(unsigned int peripheralIndex, unsigned int buttonIndex, JOYSTICK_STATE_BUTTON state) : | 171 | PeripheralEvent(unsigned int peripheralIndex, unsigned int buttonIndex, JOYSTICK_STATE_BUTTON state) : |
| 173 | m_event() | 172 | m_type(PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON), |
| 173 | m_peripheralIndex(peripheralIndex), | ||
| 174 | m_driverIndex(buttonIndex), | ||
| 175 | m_buttonState(state) | ||
| 174 | { | 176 | { |
| 175 | SetType(PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON); | ||
| 176 | SetPeripheralIndex(peripheralIndex); | ||
| 177 | SetDriverIndex(buttonIndex); | ||
| 178 | SetButtonState(state); | ||
| 179 | } | 177 | } |
| 180 | 178 | ||
| 181 | PeripheralEvent(unsigned int peripheralIndex, unsigned int hatIndex, JOYSTICK_STATE_HAT state) : | 179 | PeripheralEvent(unsigned int peripheralIndex, unsigned int hatIndex, JOYSTICK_STATE_HAT state) : |
| 182 | m_event() | 180 | m_type(PERIPHERAL_EVENT_TYPE_DRIVER_HAT), |
| 181 | m_peripheralIndex(peripheralIndex), | ||
| 182 | m_driverIndex(hatIndex), | ||
| 183 | m_hatState(state) | ||
| 183 | { | 184 | { |
| 184 | SetType(PERIPHERAL_EVENT_TYPE_DRIVER_HAT); | ||
| 185 | SetPeripheralIndex(peripheralIndex); | ||
| 186 | SetDriverIndex(hatIndex); | ||
| 187 | SetHatState(state); | ||
| 188 | } | 185 | } |
| 189 | 186 | ||
| 190 | PeripheralEvent(unsigned int peripheralIndex, unsigned int axisIndex, JOYSTICK_STATE_AXIS state) : | 187 | PeripheralEvent(unsigned int peripheralIndex, unsigned int axisIndex, JOYSTICK_STATE_AXIS state) : |
| 191 | m_event() | 188 | m_type(PERIPHERAL_EVENT_TYPE_DRIVER_AXIS), |
| 189 | m_peripheralIndex(peripheralIndex), | ||
| 190 | m_driverIndex(axisIndex), | ||
| 191 | m_axisState(state) | ||
| 192 | { | 192 | { |
| 193 | SetType(PERIPHERAL_EVENT_TYPE_DRIVER_AXIS); | ||
| 194 | SetPeripheralIndex(peripheralIndex); | ||
| 195 | SetDriverIndex(axisIndex); | ||
| 196 | SetAxisState(state); | ||
| 197 | } | 193 | } |
| 198 | 194 | ||
| 199 | explicit PeripheralEvent(const PERIPHERAL_EVENT& event) : | 195 | explicit PeripheralEvent(const PERIPHERAL_EVENT& event) : |
| 200 | m_event(event) | 196 | m_type(event.type), |
| 201 | { | 197 | m_peripheralIndex(event.peripheral_index), |
| 202 | } | 198 | m_driverIndex(event.driver_index), |
| 203 | 199 | m_buttonState(event.driver_button_state), | |
| 204 | PERIPHERAL_EVENT_TYPE Type(void) const { return m_event.type; } | 200 | m_hatState(event.driver_hat_state), |
| 205 | unsigned int PeripheralIndex(void) const { return m_event.peripheral_index; } | 201 | m_axisState(event.driver_axis_state), |
| 206 | unsigned int DriverIndex(void) const { return m_event.driver_index; } | 202 | m_motorState(event.motor_state) |
| 207 | JOYSTICK_STATE_BUTTON ButtonState(void) const { return m_event.driver_button_state; } | 203 | { |
| 208 | JOYSTICK_STATE_HAT HatState(void) const { return m_event.driver_hat_state; } | 204 | } |
| 209 | JOYSTICK_STATE_AXIS AxisState(void) const { return m_event.driver_axis_state; } | 205 | |
| 210 | JOYSTICK_STATE_MOTOR MotorState(void) const { return m_event.motor_state; } | 206 | PERIPHERAL_EVENT_TYPE Type(void) const { return m_type; } |
| 211 | 207 | unsigned int PeripheralIndex(void) const { return m_peripheralIndex; } | |
| 212 | void SetType(PERIPHERAL_EVENT_TYPE type) { m_event.type = type; } | 208 | unsigned int DriverIndex(void) const { return m_driverIndex; } |
| 213 | void SetPeripheralIndex(unsigned int index) { m_event.peripheral_index = index; } | 209 | JOYSTICK_STATE_BUTTON ButtonState(void) const { return m_buttonState; } |
| 214 | void SetDriverIndex(unsigned int index) { m_event.driver_index = index; } | 210 | JOYSTICK_STATE_HAT HatState(void) const { return m_hatState; } |
| 215 | void SetButtonState(JOYSTICK_STATE_BUTTON state) { m_event.driver_button_state = state; } | 211 | JOYSTICK_STATE_AXIS AxisState(void) const { return m_axisState; } |
| 216 | void SetHatState(JOYSTICK_STATE_HAT state) { m_event.driver_hat_state = state; } | 212 | JOYSTICK_STATE_MOTOR MotorState(void) const { return m_motorState; } |
| 217 | void SetAxisState(JOYSTICK_STATE_AXIS state) { m_event.driver_axis_state = state; } | 213 | |
| 218 | void SetMotorState(JOYSTICK_STATE_MOTOR state) { m_event.motor_state = state; } | 214 | void SetType(PERIPHERAL_EVENT_TYPE type) { m_type = type; } |
| 215 | void SetPeripheralIndex(unsigned int index) { m_peripheralIndex = index; } | ||
| 216 | void SetDriverIndex(unsigned int index) { m_driverIndex = index; } | ||
| 217 | void SetButtonState(JOYSTICK_STATE_BUTTON state) { m_buttonState = state; } | ||
| 218 | void SetHatState(JOYSTICK_STATE_HAT state) { m_hatState = state; } | ||
| 219 | void SetAxisState(JOYSTICK_STATE_AXIS state) { m_axisState = state; } | ||
| 220 | void SetMotorState(JOYSTICK_STATE_MOTOR state) { m_motorState = state; } | ||
| 219 | 221 | ||
| 220 | void ToStruct(PERIPHERAL_EVENT& event) const | 222 | void ToStruct(PERIPHERAL_EVENT& event) const |
| 221 | { | 223 | { |
| 222 | event = m_event; | 224 | event.type = m_type; |
| 225 | event.peripheral_index = m_peripheralIndex; | ||
| 226 | event.driver_index = m_driverIndex; | ||
| 227 | event.driver_button_state = m_buttonState; | ||
| 228 | event.driver_hat_state = m_hatState; | ||
| 229 | event.driver_axis_state = m_axisState; | ||
| 230 | event.motor_state = m_motorState; | ||
| 223 | } | 231 | } |
| 224 | 232 | ||
| 225 | static void FreeStruct(PERIPHERAL_EVENT& event) | 233 | static void FreeStruct(PERIPHERAL_EVENT& event) |
| @@ -228,7 +236,13 @@ namespace addon | |||
| 228 | } | 236 | } |
| 229 | 237 | ||
| 230 | private: | 238 | private: |
| 231 | PERIPHERAL_EVENT m_event; | 239 | PERIPHERAL_EVENT_TYPE m_type = PERIPHERAL_EVENT_TYPE_NONE; |
| 240 | unsigned int m_peripheralIndex = 0; | ||
| 241 | unsigned int m_driverIndex = 0; | ||
| 242 | JOYSTICK_STATE_BUTTON m_buttonState = JOYSTICK_STATE_BUTTON_UNPRESSED; | ||
| 243 | JOYSTICK_STATE_HAT m_hatState = JOYSTICK_STATE_HAT_UNPRESSED; | ||
| 244 | JOYSTICK_STATE_AXIS m_axisState = 0.0f; | ||
| 245 | JOYSTICK_STATE_MOTOR m_motorState = 0.0f; | ||
| 232 | }; | 246 | }; |
| 233 | 247 | ||
| 234 | typedef PeripheralVector<PeripheralEvent, PERIPHERAL_EVENT> PeripheralEvents; | 248 | typedef PeripheralVector<PeripheralEvent, PERIPHERAL_EVENT> PeripheralEvents; |
| @@ -298,9 +312,6 @@ namespace addon | |||
| 298 | unsigned int MotorCount(void) const { return m_motorCount; } | 312 | unsigned int MotorCount(void) const { return m_motorCount; } |
| 299 | bool SupportsPowerOff(void) const { return m_supportsPowerOff; } | 313 | bool SupportsPowerOff(void) const { return m_supportsPowerOff; } |
| 300 | 314 | ||
| 301 | // Derived property: Counts are unknown if all are zero | ||
| 302 | bool AreElementCountsKnown(void) const { return m_buttonCount != 0 || m_hatCount != 0 || m_axisCount != 0; } | ||
| 303 | |||
| 304 | void SetProvider(const std::string& provider) { m_provider = provider; } | 315 | void SetProvider(const std::string& provider) { m_provider = provider; } |
| 305 | void SetRequestedPort(int requestedPort) { m_requestedPort = requestedPort; } | 316 | void SetRequestedPort(int requestedPort) { m_requestedPort = requestedPort; } |
| 306 | void SetButtonCount(unsigned int buttonCount) { m_buttonCount = buttonCount; } | 317 | void SetButtonCount(unsigned int buttonCount) { m_buttonCount = buttonCount; } |
| @@ -352,6 +363,9 @@ namespace addon | |||
| 352 | * 2) a hat direction | 363 | * 2) a hat direction |
| 353 | * 3) a semiaxis (either the positive or negative half of an axis) | 364 | * 3) a semiaxis (either the positive or negative half of an axis) |
| 354 | * 4) a motor | 365 | * 4) a motor |
| 366 | * 5) a keyboard key | ||
| 367 | * 6) a mouse button | ||
| 368 | * 7) a relative pointer direction | ||
| 355 | * | 369 | * |
| 356 | * The type determines the fields in use: | 370 | * The type determines the fields in use: |
| 357 | * | 371 | * |
| @@ -370,6 +384,15 @@ namespace addon | |||
| 370 | * | 384 | * |
| 371 | * Motor: | 385 | * Motor: |
| 372 | * - driver index | 386 | * - driver index |
| 387 | * | ||
| 388 | * Key: | ||
| 389 | * - key code | ||
| 390 | * | ||
| 391 | * Mouse button: | ||
| 392 | * - driver index | ||
| 393 | * | ||
| 394 | * Relative pointer direction: | ||
| 395 | * - relative pointer direction | ||
| 373 | */ | 396 | */ |
| 374 | struct DriverPrimitive | 397 | struct DriverPrimitive |
| 375 | { | 398 | { |
| @@ -383,7 +406,8 @@ namespace addon | |||
| 383 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | 406 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), |
| 384 | m_center(0), | 407 | m_center(0), |
| 385 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), | 408 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), |
| 386 | m_range(1) | 409 | m_range(1), |
| 410 | m_relPointerDirection(JOYSTICK_DRIVER_RELPOINTER_UNKNOWN) | ||
| 387 | { | 411 | { |
| 388 | } | 412 | } |
| 389 | 413 | ||
| @@ -397,12 +421,13 @@ namespace addon | |||
| 397 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | 421 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), |
| 398 | m_center(0), | 422 | m_center(0), |
| 399 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), | 423 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), |
| 400 | m_range(1) | 424 | m_range(1), |
| 425 | m_relPointerDirection(JOYSTICK_DRIVER_RELPOINTER_UNKNOWN) | ||
| 401 | { | 426 | { |
| 402 | } | 427 | } |
| 403 | 428 | ||
| 404 | /*! | 429 | /*! |
| 405 | * \brief Construct a driver primitive representing a button | 430 | * \brief Construct a driver primitive representing a joystick button |
| 406 | */ | 431 | */ |
| 407 | static DriverPrimitive CreateButton(unsigned int buttonIndex) | 432 | static DriverPrimitive CreateButton(unsigned int buttonIndex) |
| 408 | { | 433 | { |
| @@ -419,7 +444,8 @@ namespace addon | |||
| 419 | m_hatDirection(direction), | 444 | m_hatDirection(direction), |
| 420 | m_center(0), | 445 | m_center(0), |
| 421 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), | 446 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), |
| 422 | m_range(1) | 447 | m_range(1), |
| 448 | m_relPointerDirection(JOYSTICK_DRIVER_RELPOINTER_UNKNOWN) | ||
| 423 | { | 449 | { |
| 424 | } | 450 | } |
| 425 | 451 | ||
| @@ -433,7 +459,8 @@ namespace addon | |||
| 433 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | 459 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), |
| 434 | m_center(center), | 460 | m_center(center), |
| 435 | m_semiAxisDirection(direction), | 461 | m_semiAxisDirection(direction), |
| 436 | m_range(range) | 462 | m_range(range), |
| 463 | m_relPointerDirection(JOYSTICK_DRIVER_RELPOINTER_UNKNOWN) | ||
| 437 | { | 464 | { |
| 438 | } | 465 | } |
| 439 | 466 | ||
| @@ -445,13 +472,52 @@ namespace addon | |||
| 445 | return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, motorIndex); | 472 | return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, motorIndex); |
| 446 | } | 473 | } |
| 447 | 474 | ||
| 475 | /*! | ||
| 476 | * \brief Construct a driver primitive representing a key on a keyboard | ||
| 477 | */ | ||
| 478 | DriverPrimitive(std::string keycode) : | ||
| 479 | m_type(JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY), | ||
| 480 | m_driverIndex(0), | ||
| 481 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | ||
| 482 | m_center(0), | ||
| 483 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), | ||
| 484 | m_range(1), | ||
| 485 | m_keycode(std::move(keycode)), | ||
| 486 | m_relPointerDirection(JOYSTICK_DRIVER_RELPOINTER_UNKNOWN) | ||
| 487 | { | ||
| 488 | } | ||
| 489 | |||
| 490 | /*! | ||
| 491 | * \brief Construct a driver primitive representing a mouse button | ||
| 492 | */ | ||
| 493 | static DriverPrimitive CreateMouseButton(JOYSTICK_DRIVER_MOUSE_INDEX buttonIndex) | ||
| 494 | { | ||
| 495 | return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON, static_cast<unsigned int>(buttonIndex)); | ||
| 496 | } | ||
| 497 | |||
| 498 | /*! | ||
| 499 | * \brief Construct a driver primitive representing one of the four | ||
| 500 | * direction in which a relative pointer can move | ||
| 501 | */ | ||
| 502 | DriverPrimitive(JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction) : | ||
| 503 | m_type(JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION), | ||
| 504 | m_driverIndex(0), | ||
| 505 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | ||
| 506 | m_center(0), | ||
| 507 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), | ||
| 508 | m_range(1), | ||
| 509 | m_relPointerDirection(direction) | ||
| 510 | { | ||
| 511 | } | ||
| 512 | |||
| 448 | explicit DriverPrimitive(const JOYSTICK_DRIVER_PRIMITIVE& primitive) : | 513 | explicit DriverPrimitive(const JOYSTICK_DRIVER_PRIMITIVE& primitive) : |
| 449 | m_type(primitive.type), | 514 | m_type(primitive.type), |
| 450 | m_driverIndex(0), | 515 | m_driverIndex(0), |
| 451 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | 516 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), |
| 452 | m_center(0), | 517 | m_center(0), |
| 453 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), | 518 | m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN), |
| 454 | m_range(1) | 519 | m_range(1), |
| 520 | m_relPointerDirection(JOYSTICK_DRIVER_RELPOINTER_UNKNOWN) | ||
| 455 | { | 521 | { |
| 456 | switch (m_type) | 522 | switch (m_type) |
| 457 | { | 523 | { |
| @@ -479,6 +545,21 @@ namespace addon | |||
| 479 | m_driverIndex = primitive.motor.index; | 545 | m_driverIndex = primitive.motor.index; |
| 480 | break; | 546 | break; |
| 481 | } | 547 | } |
| 548 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY: | ||
| 549 | { | ||
| 550 | m_keycode = primitive.key.keycode; | ||
| 551 | break; | ||
| 552 | } | ||
| 553 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON: | ||
| 554 | { | ||
| 555 | m_driverIndex = primitive.mouse.button; | ||
| 556 | break; | ||
| 557 | } | ||
| 558 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION: | ||
| 559 | { | ||
| 560 | m_relPointerDirection = primitive.relpointer.direction; | ||
| 561 | break; | ||
| 562 | } | ||
| 482 | default: | 563 | default: |
| 483 | break; | 564 | break; |
| 484 | } | 565 | } |
| @@ -490,6 +571,9 @@ namespace addon | |||
| 490 | int Center(void) const { return m_center; } | 571 | int Center(void) const { return m_center; } |
| 491 | JOYSTICK_DRIVER_SEMIAXIS_DIRECTION SemiAxisDirection(void) const { return m_semiAxisDirection; } | 572 | JOYSTICK_DRIVER_SEMIAXIS_DIRECTION SemiAxisDirection(void) const { return m_semiAxisDirection; } |
| 492 | unsigned int Range(void) const { return m_range; } | 573 | unsigned int Range(void) const { return m_range; } |
| 574 | const std::string& Keycode(void) const { return m_keycode; } | ||
| 575 | JOYSTICK_DRIVER_MOUSE_INDEX MouseIndex(void) const { return static_cast<JOYSTICK_DRIVER_MOUSE_INDEX>(m_driverIndex); } | ||
| 576 | JOYSTICK_DRIVER_RELPOINTER_DIRECTION RelPointerDirection(void) const { return m_relPointerDirection; } | ||
| 493 | 577 | ||
| 494 | bool operator==(const DriverPrimitive& other) const | 578 | bool operator==(const DriverPrimitive& other) const |
| 495 | { | 579 | { |
| @@ -498,7 +582,6 @@ namespace addon | |||
| 498 | switch (m_type) | 582 | switch (m_type) |
| 499 | { | 583 | { |
| 500 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON: | 584 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON: |
| 501 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR: | ||
| 502 | { | 585 | { |
| 503 | return m_driverIndex == other.m_driverIndex; | 586 | return m_driverIndex == other.m_driverIndex; |
| 504 | } | 587 | } |
| @@ -514,6 +597,22 @@ namespace addon | |||
| 514 | m_semiAxisDirection == other.m_semiAxisDirection && | 597 | m_semiAxisDirection == other.m_semiAxisDirection && |
| 515 | m_range == other.m_range; | 598 | m_range == other.m_range; |
| 516 | } | 599 | } |
| 600 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY: | ||
| 601 | { | ||
| 602 | return m_keycode == other.m_keycode; | ||
| 603 | } | ||
| 604 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR: | ||
| 605 | { | ||
| 606 | return m_driverIndex == other.m_driverIndex; | ||
| 607 | } | ||
| 608 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON: | ||
| 609 | { | ||
| 610 | return m_driverIndex == other.m_driverIndex; | ||
| 611 | } | ||
| 612 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION: | ||
| 613 | { | ||
| 614 | return m_relPointerDirection == other.m_relPointerDirection; | ||
| 615 | } | ||
| 517 | default: | 616 | default: |
| 518 | break; | 617 | break; |
| 519 | } | 618 | } |
| @@ -550,6 +649,23 @@ namespace addon | |||
| 550 | driver_primitive.motor.index = m_driverIndex; | 649 | driver_primitive.motor.index = m_driverIndex; |
| 551 | break; | 650 | break; |
| 552 | } | 651 | } |
| 652 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY: | ||
| 653 | { | ||
| 654 | const size_t size = sizeof(driver_primitive.key.keycode); | ||
| 655 | std::strncpy(driver_primitive.key.keycode, m_keycode.c_str(), size - 1); | ||
| 656 | driver_primitive.key.keycode[size - 1] = '\0'; | ||
| 657 | break; | ||
| 658 | } | ||
| 659 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON: | ||
| 660 | { | ||
| 661 | driver_primitive.mouse.button = static_cast<JOYSTICK_DRIVER_MOUSE_INDEX>(m_driverIndex); | ||
| 662 | break; | ||
| 663 | } | ||
| 664 | case JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION: | ||
| 665 | { | ||
| 666 | driver_primitive.relpointer.direction = m_relPointerDirection; | ||
| 667 | break; | ||
| 668 | } | ||
| 553 | default: | 669 | default: |
| 554 | break; | 670 | break; |
| 555 | } | 671 | } |
| @@ -567,6 +683,8 @@ namespace addon | |||
| 567 | int m_center; | 683 | int m_center; |
| 568 | JOYSTICK_DRIVER_SEMIAXIS_DIRECTION m_semiAxisDirection; | 684 | JOYSTICK_DRIVER_SEMIAXIS_DIRECTION m_semiAxisDirection; |
| 569 | unsigned int m_range; | 685 | unsigned int m_range; |
| 686 | std::string m_keycode; | ||
| 687 | JOYSTICK_DRIVER_RELPOINTER_DIRECTION m_relPointerDirection; | ||
| 570 | }; | 688 | }; |
| 571 | 689 | ||
| 572 | typedef PeripheralVector<DriverPrimitive, JOYSTICK_DRIVER_PRIMITIVE> DriverPrimitives; | 690 | typedef PeripheralVector<DriverPrimitive, JOYSTICK_DRIVER_PRIMITIVE> DriverPrimitives; |
| @@ -584,6 +702,7 @@ namespace addon | |||
| 584 | * 6) absolute pointer | 702 | * 6) absolute pointer |
| 585 | * 7) wheel | 703 | * 7) wheel |
| 586 | * 8) throttle | 704 | * 8) throttle |
| 705 | * 9) keyboard key | ||
| 587 | * | 706 | * |
| 588 | * [1] All three driver primitives (buttons, hats and axes) have a state that | 707 | * [1] All three driver primitives (buttons, hats and axes) have a state that |
| 589 | * can be represented using a single scalar value. For this reason, | 708 | * can be represented using a single scalar value. For this reason, |
| @@ -598,7 +717,7 @@ namespace addon | |||
| 598 | JoystickFeature(const std::string& name = "", JOYSTICK_FEATURE_TYPE type = JOYSTICK_FEATURE_TYPE_UNKNOWN) : | 717 | JoystickFeature(const std::string& name = "", JOYSTICK_FEATURE_TYPE type = JOYSTICK_FEATURE_TYPE_UNKNOWN) : |
| 599 | m_name(name), | 718 | m_name(name), |
| 600 | m_type(type), | 719 | m_type(type), |
| 601 | m_primitives() | 720 | m_primitives{} |
| 602 | { | 721 | { |
| 603 | } | 722 | } |
| 604 | 723 | ||
| @@ -672,4 +791,3 @@ namespace addon | |||
| 672 | 791 | ||
| 673 | } /* namespace addon */ | 792 | } /* namespace addon */ |
| 674 | } /* namespace kodi */ | 793 | } /* namespace kodi */ |
| 675 | |||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h index 8e688d7..637a991 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h | |||
| @@ -547,7 +547,7 @@ namespace addon | |||
| 547 | entries[i].properties = nullptr; | 547 | entries[i].properties = nullptr; |
| 548 | } | 548 | } |
| 549 | *retEntries = entries; | 549 | *retEntries = entries; |
| 550 | *num_entries = addonEntries.size(); | 550 | *num_entries = static_cast<int>(addonEntries.size()); |
| 551 | } | 551 | } |
| 552 | return ret; | 552 | return ret; |
| 553 | } | 553 | } |
| @@ -586,7 +586,7 @@ namespace addon | |||
| 586 | strncpy(rootpath, cppRootPath.c_str(), ADDON_STANDARD_STRING_LENGTH); | 586 | strncpy(rootpath, cppRootPath.c_str(), ADDON_STANDARD_STRING_LENGTH); |
| 587 | 587 | ||
| 588 | VFSDirEntry* entries = static_cast<VFSDirEntry*>(malloc(sizeof(VFSDirEntry) * addonEntries.size())); | 588 | VFSDirEntry* entries = static_cast<VFSDirEntry*>(malloc(sizeof(VFSDirEntry) * addonEntries.size())); |
| 589 | for (unsigned int i = 0; i < addonEntries.size(); ++i) | 589 | for (size_t i = 0; i < addonEntries.size(); ++i) |
| 590 | { | 590 | { |
| 591 | entries[i].label = strdup(addonEntries[i].Label().c_str()); | 591 | entries[i].label = strdup(addonEntries[i].Label().c_str()); |
| 592 | entries[i].title = strdup(addonEntries[i].Title().c_str()); | 592 | entries[i].title = strdup(addonEntries[i].Title().c_str()); |
| @@ -610,7 +610,7 @@ namespace addon | |||
| 610 | entries[i].properties = nullptr; | 610 | entries[i].properties = nullptr; |
| 611 | } | 611 | } |
| 612 | *retEntries = entries; | 612 | *retEntries = entries; |
| 613 | *num_entries = addonEntries.size(); | 613 | *num_entries = static_cast<int>(addonEntries.size()); |
| 614 | } | 614 | } |
| 615 | return ret; | 615 | return ret; |
| 616 | } | 616 | } |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h index eb4351e..8a8779a 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2017 Team XBMC | 2 | * Copyright (C) 2017 Team XBMC |
| 3 | * http://xbmc.org | 3 | * http://kodi.tv |
| 4 | * | 4 | * |
| 5 | * This Program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h index 452085a..a2bef15 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h | |||
| @@ -745,7 +745,7 @@ namespace addon | |||
| 745 | addon->toAddon.addonInstance->m_instanceData->toKodi.transfer_preset(addon->toKodi.kodiInstance, it.c_str()); | 745 | addon->toAddon.addonInstance->m_instanceData->toKodi.transfer_preset(addon->toKodi.kodiInstance, it.c_str()); |
| 746 | } | 746 | } |
| 747 | 747 | ||
| 748 | return presets.size(); | 748 | return static_cast<unsigned int>(presets.size()); |
| 749 | } | 749 | } |
| 750 | 750 | ||
| 751 | inline static int ADDON_GetActivePreset(const AddonInstance_Visualization* addon) | 751 | inline static int ADDON_GetActivePreset(const AddonInstance_Visualization* addon) |
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 index 4ce5bbc..79ca778 100644 --- 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 | |||
| @@ -131,17 +131,6 @@ GAME_ERROR HwContextDestroy(void); | |||
| 131 | // --- Input operations -------------------------------------------------------- | 131 | // --- Input operations -------------------------------------------------------- |
| 132 | 132 | ||
| 133 | /*! | 133 | /*! |
| 134 | * \brief Notify the add-on of a status change on an open port | ||
| 135 | * | ||
| 136 | * Ports can be opened using the OpenPort() callback | ||
| 137 | * | ||
| 138 | * \param port Non-negative for a joystick port, or GAME_INPUT_PORT value otherwise | ||
| 139 | * \param collected True if a controller was connected, false if disconnected | ||
| 140 | * \param controller The connected controller | ||
| 141 | */ | ||
| 142 | void UpdatePort(int port, bool connected, const game_controller* controller); | ||
| 143 | |||
| 144 | /*! | ||
| 145 | * \brief Check if input is accepted for a feature on the controller | 134 | * \brief Check if input is accepted for a feature on the controller |
| 146 | * | 135 | * |
| 147 | * If only a subset of the controller profile is used, this can return false | 136 | * If only a subset of the controller profile is used, this can return false |
| @@ -156,6 +145,88 @@ void UpdatePort(int port, bool connected, const game_controller* controller); | |||
| 156 | bool HasFeature(const char* controller_id, const char* feature_name); | 145 | bool HasFeature(const char* controller_id, const char* feature_name); |
| 157 | 146 | ||
| 158 | /*! | 147 | /*! |
| 148 | * \brief Get the input topolgy that specifies which controllers can be connected | ||
| 149 | * | ||
| 150 | * \return The input topology, or null to use the default | ||
| 151 | * | ||
| 152 | * If this returns non-null, topology must be freed using FreeTopology(). | ||
| 153 | * | ||
| 154 | * If this returns null, the topology will default to a single port that can | ||
| 155 | * accept all controllers imported by addon.xml. The port ID is set to | ||
| 156 | * the DEFAULT_PORT_ID constant. | ||
| 157 | */ | ||
| 158 | game_input_topology* GetTopology(); | ||
| 159 | |||
| 160 | /*! | ||
| 161 | * \brief Free the topology's resources | ||
| 162 | * | ||
| 163 | * \param topology The topology returned by GetTopology() | ||
| 164 | */ | ||
| 165 | void FreeTopology(game_input_topology* topology); | ||
| 166 | |||
| 167 | /*! | ||
| 168 | * \brief Enable/disable keyboard input using the specified controller | ||
| 169 | * | ||
| 170 | * \param enable True to enable input, false otherwise | ||
| 171 | * \param controller The controller info if enabling, or unused if disabling | ||
| 172 | * | ||
| 173 | * \return True if keyboard input was enabled, false otherwise | ||
| 174 | */ | ||
| 175 | bool EnableKeyboard(bool enable, const game_controller* controller); | ||
| 176 | |||
| 177 | /*! | ||
| 178 | * \brief Enable/disable mouse input using the specified controller | ||
| 179 | * | ||
| 180 | * \param enable True to enable input, false otherwise | ||
| 181 | * \param controller The controller info if enabling, or unused if disabling | ||
| 182 | * | ||
| 183 | * \return True if mouse input was enabled, false otherwise | ||
| 184 | */ | ||
| 185 | bool EnableMouse(bool enable, const game_controller* controller); | ||
| 186 | |||
| 187 | /*! | ||
| 188 | * \brief Connect/disconnect a controller to a port on the virtual game console | ||
| 189 | * | ||
| 190 | * \param connect True to connect a controller, false to disconnect | ||
| 191 | * \param address The address of the port | ||
| 192 | * \param controller The controller info if connecting, or unused if disconnecting | ||
| 193 | * | ||
| 194 | * The address is a string that allows traversal of the controller topology. | ||
| 195 | * It is formed by alternating port IDs and controller IDs separated by "/". | ||
| 196 | * | ||
| 197 | * For example, assume that the topology represented in XML for Snes9x is: | ||
| 198 | * | ||
| 199 | * <logicaltopology> | ||
| 200 | * <port type="controller" id="1"> | ||
| 201 | * <accepts controller="game.controller.snes"/> | ||
| 202 | * <accepts controller="game.controller.snes.multitap"> | ||
| 203 | * <port type="controller" id="1"> | ||
| 204 | * <accepts controller="game.controller.snes"/> | ||
| 205 | * </port> | ||
| 206 | * <port type="controller" id="2"> | ||
| 207 | * <accepts controller="game.controller.snes"/> | ||
| 208 | * </port> | ||
| 209 | * ... | ||
| 210 | * </accepts> | ||
| 211 | * </port> | ||
| 212 | * </logicaltopology> | ||
| 213 | * | ||
| 214 | * To connect a multitap to the console's first port, the multitap's controller | ||
| 215 | * info is set using the port address: | ||
| 216 | * | ||
| 217 | * 1 | ||
| 218 | * | ||
| 219 | * To connect a SNES controller to the second port of the multitap, the | ||
| 220 | * controller info is next set using the address: | ||
| 221 | * | ||
| 222 | * 1/game.controller.multitap/2 | ||
| 223 | * | ||
| 224 | * Any attempts to connect a controller to a port on a disconnected multitap | ||
| 225 | * will return false. | ||
| 226 | */ | ||
| 227 | bool ConnectController(bool connect, const char* port_address, const game_controller* controller); | ||
| 228 | |||
| 229 | /*! | ||
| 159 | * \brief Notify the add-on of an input event | 230 | * \brief Notify the add-on of an input event |
| 160 | * | 231 | * |
| 161 | * \param event The input event | 232 | * \param event The input event |
| @@ -247,8 +318,12 @@ void __declspec(dllexport) get_addon(void* ptr) | |||
| 247 | pClient->toAddon.Reset = Reset; | 318 | pClient->toAddon.Reset = Reset; |
| 248 | pClient->toAddon.HwContextReset = HwContextReset; | 319 | pClient->toAddon.HwContextReset = HwContextReset; |
| 249 | pClient->toAddon.HwContextDestroy = HwContextDestroy; | 320 | pClient->toAddon.HwContextDestroy = HwContextDestroy; |
| 250 | pClient->toAddon.UpdatePort = UpdatePort; | ||
| 251 | pClient->toAddon.HasFeature = HasFeature; | 321 | pClient->toAddon.HasFeature = HasFeature; |
| 322 | pClient->toAddon.GetTopology = GetTopology; | ||
| 323 | pClient->toAddon.FreeTopology = FreeTopology; | ||
| 324 | pClient->toAddon.EnableKeyboard = EnableKeyboard; | ||
| 325 | pClient->toAddon.EnableMouse = EnableMouse; | ||
| 326 | pClient->toAddon.ConnectController = ConnectController; | ||
| 252 | pClient->toAddon.InputEvent = InputEvent; | 327 | pClient->toAddon.InputEvent = InputEvent; |
| 253 | pClient->toAddon.SerializeSize = SerializeSize; | 328 | pClient->toAddon.SerializeSize = SerializeSize; |
| 254 | pClient->toAddon.Serialize = Serialize; | 329 | pClient->toAddon.Serialize = Serialize; |
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 index d4568e7..758b0fa 100644 --- 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 | |||
| @@ -40,10 +40,8 @@ | |||
| 40 | #undef PRAGMA_PACK_END | 40 | #undef PRAGMA_PACK_END |
| 41 | 41 | ||
| 42 | #if defined(__GNUC__) | 42 | #if defined(__GNUC__) |
| 43 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | 43 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) |
| 44 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) | 44 | #define PRAGMA_PACK 0 |
| 45 | #define PRAGMA_PACK 0 | ||
| 46 | #endif | ||
| 47 | #endif | 45 | #endif |
| 48 | 46 | ||
| 49 | #if !defined(ATTRIBUTE_PACKED) | 47 | #if !defined(ATTRIBUTE_PACKED) |
| @@ -57,6 +55,9 @@ | |||
| 57 | #include "input/XBMC_vkeys.h" | 55 | #include "input/XBMC_vkeys.h" |
| 58 | #endif | 56 | #endif |
| 59 | 57 | ||
| 58 | /*! Port ID used when topology is unknown */ | ||
| 59 | #define DEFAULT_PORT_ID "1" | ||
| 60 | |||
| 60 | #ifdef __cplusplus | 61 | #ifdef __cplusplus |
| 61 | extern "C" { | 62 | extern "C" { |
| 62 | #endif | 63 | #endif |
| @@ -159,13 +160,6 @@ typedef enum GAME_HW_CONTEXT_TYPE | |||
| 159 | GAME_HW_CONTEXT_OPENGLES3, // GLES 3.0 | 160 | GAME_HW_CONTEXT_OPENGLES3, // GLES 3.0 |
| 160 | } GAME_HW_CONTEXT_TYPE; | 161 | } GAME_HW_CONTEXT_TYPE; |
| 161 | 162 | ||
| 162 | typedef enum GAME_INPUT_PORT | ||
| 163 | { | ||
| 164 | GAME_INPUT_PORT_JOYSTICK_START = 0, // Non-negative values are for joystick ports | ||
| 165 | GAME_INPUT_PORT_KEYBOARD = -1, | ||
| 166 | GAME_INPUT_PORT_MOUSE = -2, | ||
| 167 | } GAME_INPUT_PORT; | ||
| 168 | |||
| 169 | typedef enum GAME_INPUT_EVENT_SOURCE | 163 | typedef enum GAME_INPUT_EVENT_SOURCE |
| 170 | { | 164 | { |
| 171 | GAME_INPUT_EVENT_DIGITAL_BUTTON, | 165 | GAME_INPUT_EVENT_DIGITAL_BUTTON, |
| @@ -181,17 +175,17 @@ typedef enum GAME_INPUT_EVENT_SOURCE | |||
| 181 | 175 | ||
| 182 | typedef enum GAME_KEY_MOD | 176 | typedef enum GAME_KEY_MOD |
| 183 | { | 177 | { |
| 184 | GAME_KEY_MOD_NONE = 0x00, | 178 | GAME_KEY_MOD_NONE = 0x0000, |
| 185 | 179 | ||
| 186 | GAME_KEY_MOD_SHIFT = 0x01, | 180 | GAME_KEY_MOD_SHIFT = 0x0001, |
| 187 | GAME_KEY_MOD_CTRL = 0x02, | 181 | GAME_KEY_MOD_CTRL = 0x0002, |
| 188 | GAME_KEY_MOD_ALT = 0x04, | 182 | GAME_KEY_MOD_ALT = 0x0004, |
| 189 | GAME_KEY_MOD_RALT = 0x08, | 183 | GAME_KEY_MOD_META = 0x0008, |
| 190 | GAME_KEY_MOD_META = 0x10, | 184 | GAME_KEY_MOD_SUPER = 0x0010, |
| 191 | 185 | ||
| 192 | GAME_KEY_MOD_NUMLOCK = 0x20, | 186 | GAME_KEY_MOD_NUMLOCK = 0x0100, |
| 193 | GAME_KEY_MOD_CAPSLOCK = 0x40, | 187 | GAME_KEY_MOD_CAPSLOCK = 0x0200, |
| 194 | GAME_KEY_MOD_SCROLLOCK = 0x80, | 188 | GAME_KEY_MOD_SCROLLOCK = 0x0400, |
| 195 | } GAME_KEY_MOD; | 189 | } GAME_KEY_MOD; |
| 196 | 190 | ||
| 197 | /*! Returned from game_get_region() */ | 191 | /*! Returned from game_get_region() */ |
| @@ -203,9 +197,9 @@ typedef enum GAME_REGION | |||
| 203 | } GAME_REGION; | 197 | } GAME_REGION; |
| 204 | 198 | ||
| 205 | /*! | 199 | /*! |
| 206 | * Special game types passed into game_load_game_special(). Only used when | 200 | * Special game types passed into game_load_game_special(). Only used when |
| 207 | * multiple ROMs are required. | 201 | * multiple ROMs are required. |
| 208 | */ | 202 | */ |
| 209 | typedef enum SPECIAL_GAME_TYPE | 203 | typedef enum SPECIAL_GAME_TYPE |
| 210 | { | 204 | { |
| 211 | SPECIAL_GAME_TYPE_BSX, | 205 | SPECIAL_GAME_TYPE_BSX, |
| @@ -277,9 +271,21 @@ typedef enum GAME_ROTATION | |||
| 277 | GAME_ROTATION_270_CW, | 271 | GAME_ROTATION_270_CW, |
| 278 | } GAME_ROTATION; | 272 | } GAME_ROTATION; |
| 279 | 273 | ||
| 274 | /*! | ||
| 275 | * \brief Type of port on the virtual game console | ||
| 276 | */ | ||
| 277 | typedef enum GAME_PORT_TYPE | ||
| 278 | { | ||
| 279 | GAME_PORT_UNKNOWN, | ||
| 280 | GAME_PORT_KEYBOARD, | ||
| 281 | GAME_PORT_MOUSE, | ||
| 282 | GAME_PORT_CONTROLLER, | ||
| 283 | } GAME_PORT_TYPE; | ||
| 284 | |||
| 280 | typedef struct game_controller | 285 | typedef struct game_controller |
| 281 | { | 286 | { |
| 282 | const char* controller_id; | 287 | const char* controller_id; |
| 288 | bool provides_input; // False for multitaps | ||
| 283 | unsigned int digital_button_count; | 289 | unsigned int digital_button_count; |
| 284 | unsigned int analog_button_count; | 290 | unsigned int analog_button_count; |
| 285 | unsigned int analog_stick_count; | 291 | unsigned int analog_stick_count; |
| @@ -290,6 +296,48 @@ typedef struct game_controller | |||
| 290 | unsigned int motor_count; | 296 | unsigned int motor_count; |
| 291 | } ATTRIBUTE_PACKED game_controller; | 297 | } ATTRIBUTE_PACKED game_controller; |
| 292 | 298 | ||
| 299 | struct game_input_port; | ||
| 300 | |||
| 301 | /*! | ||
| 302 | * \brief Device that can provide input | ||
| 303 | */ | ||
| 304 | typedef struct game_input_device | ||
| 305 | { | ||
| 306 | const char* controller_id; // ID used in the Kodi controller API | ||
| 307 | const char* port_address; | ||
| 308 | game_input_port* available_ports; | ||
| 309 | unsigned int port_count; | ||
| 310 | } ATTRIBUTE_PACKED game_input_device; | ||
| 311 | |||
| 312 | /*! | ||
| 313 | * \brief Port that can provide input | ||
| 314 | * | ||
| 315 | * Ports can accept multiple devices and devices can have multiple ports, so | ||
| 316 | * the topology of possible configurations is a tree structure of alternating | ||
| 317 | * port and device nodes. | ||
| 318 | */ | ||
| 319 | typedef struct game_input_port | ||
| 320 | { | ||
| 321 | GAME_PORT_TYPE type; | ||
| 322 | const char* port_id; // Required for GAME_PORT_CONTROLLER type | ||
| 323 | game_input_device* accepted_devices; | ||
| 324 | unsigned int device_count; | ||
| 325 | } ATTRIBUTE_PACKED game_input_port; | ||
| 326 | |||
| 327 | /*! | ||
| 328 | * \brief The input topology is the possible ways to connect input devices | ||
| 329 | * | ||
| 330 | * This represents the logical topology, which is the possible connections that | ||
| 331 | * the game client's logic can handle. It is strictly a subset of the physical | ||
| 332 | * topology. Loops are not allowed. | ||
| 333 | */ | ||
| 334 | typedef struct game_input_topology | ||
| 335 | { | ||
| 336 | game_input_port *ports; //! The list of ports on the virtual game console | ||
| 337 | unsigned int port_count; //! The number of ports | ||
| 338 | int player_limit; //! A limit on the number of input-providing devices, or -1 for no limit | ||
| 339 | } ATTRIBUTE_PACKED game_input_topology; | ||
| 340 | |||
| 293 | typedef struct game_digital_button_event | 341 | typedef struct game_digital_button_event |
| 294 | { | 342 | { |
| 295 | bool pressed; | 343 | bool pressed; |
| @@ -321,7 +369,14 @@ typedef struct game_accelerometer_event | |||
| 321 | typedef struct game_key_event | 369 | typedef struct game_key_event |
| 322 | { | 370 | { |
| 323 | bool pressed; | 371 | bool pressed; |
| 324 | XBMCVKey character; | 372 | |
| 373 | /*! | ||
| 374 | * If the keypress generates a printing character, the unicode value | ||
| 375 | * contains the character generated. If the key is a non-printing character, | ||
| 376 | * e.g. a function or arrow key, the unicode value is zero. | ||
| 377 | */ | ||
| 378 | uint32_t unicode; | ||
| 379 | |||
| 325 | GAME_KEY_MOD modifiers; | 380 | GAME_KEY_MOD modifiers; |
| 326 | } ATTRIBUTE_PACKED game_key_event; | 381 | } ATTRIBUTE_PACKED game_key_event; |
| 327 | 382 | ||
| @@ -346,8 +401,9 @@ typedef struct game_motor_event | |||
| 346 | typedef struct game_input_event | 401 | typedef struct game_input_event |
| 347 | { | 402 | { |
| 348 | GAME_INPUT_EVENT_SOURCE type; | 403 | GAME_INPUT_EVENT_SOURCE type; |
| 349 | int port; | ||
| 350 | const char* controller_id; | 404 | const char* controller_id; |
| 405 | GAME_PORT_TYPE port_type; | ||
| 406 | const char* port_address; | ||
| 351 | const char* feature_name; | 407 | const char* feature_name; |
| 352 | union | 408 | union |
| 353 | { | 409 | { |
| @@ -474,8 +530,6 @@ typedef struct AddonToKodiFuncTable_Game | |||
| 474 | uintptr_t (*HwGetCurrentFramebuffer)(void* kodiInstance); | 530 | uintptr_t (*HwGetCurrentFramebuffer)(void* kodiInstance); |
| 475 | game_proc_address_t (*HwGetProcAddress)(void* kodiInstance, const char* symbol); | 531 | game_proc_address_t (*HwGetProcAddress)(void* kodiInstance, const char* symbol); |
| 476 | void (*RenderFrame)(void* kodiInstance); | 532 | void (*RenderFrame)(void* kodiInstance); |
| 477 | bool (*OpenPort)(void* kodiInstance, unsigned int port); | ||
| 478 | void (*ClosePort)(void* kodiInstance, unsigned int port); | ||
| 479 | bool (*InputEvent)(void* kodiInstance, const game_input_event* event); | 533 | bool (*InputEvent)(void* kodiInstance, const game_input_event* event); |
| 480 | 534 | ||
| 481 | } AddonToKodiFuncTable_Game; | 535 | } AddonToKodiFuncTable_Game; |
| @@ -493,8 +547,12 @@ typedef struct KodiToAddonFuncTable_Game | |||
| 493 | GAME_ERROR (__cdecl* Reset)(void); | 547 | GAME_ERROR (__cdecl* Reset)(void); |
| 494 | GAME_ERROR (__cdecl* HwContextReset)(void); | 548 | GAME_ERROR (__cdecl* HwContextReset)(void); |
| 495 | GAME_ERROR (__cdecl* HwContextDestroy)(void); | 549 | GAME_ERROR (__cdecl* HwContextDestroy)(void); |
| 496 | void (__cdecl* UpdatePort)(int, bool, const game_controller*); | 550 | bool (__cdecl* HasFeature)(const char*, const char*); |
| 497 | bool (__cdecl* HasFeature)(const char* controller_id, const char* feature_name); | 551 | game_input_topology* (__cdecl* GetTopology)(); |
| 552 | void (__cdecl* FreeTopology)(game_input_topology*); | ||
| 553 | bool (__cdecl* EnableKeyboard)(bool, const game_controller*); | ||
| 554 | bool (__cdecl* EnableMouse)(bool, const game_controller*); | ||
| 555 | bool (__cdecl* ConnectController)(bool, const char*, const game_controller*); | ||
| 498 | bool (__cdecl* InputEvent)(const game_input_event*); | 556 | bool (__cdecl* InputEvent)(const game_input_event*); |
| 499 | size_t (__cdecl* SerializeSize)(void); | 557 | size_t (__cdecl* SerializeSize)(void); |
| 500 | GAME_ERROR (__cdecl* Serialize)(uint8_t*, size_t); | 558 | GAME_ERROR (__cdecl* Serialize)(uint8_t*, size_t); |
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 index 1ca91a4..2774afd 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h | |||
| @@ -188,28 +188,6 @@ public: | |||
| 188 | // --- Input callbacks ------------------------------------------------------- | 188 | // --- Input callbacks ------------------------------------------------------- |
| 189 | 189 | ||
| 190 | /*! | 190 | /*! |
| 191 | * \brief Begin reporting events for the specified joystick port | ||
| 192 | * | ||
| 193 | * \param port The zero-indexed port number | ||
| 194 | * | ||
| 195 | * \return true if the port was opened, false otherwise | ||
| 196 | */ | ||
| 197 | bool OpenPort(unsigned int port) | ||
| 198 | { | ||
| 199 | return m_callbacks->toKodi.OpenPort(m_callbacks->toKodi.kodiInstance, port); | ||
| 200 | } | ||
| 201 | |||
| 202 | /*! | ||
| 203 | * \brief End reporting events for the specified port | ||
| 204 | * | ||
| 205 | * \param port The port number passed to OpenPort() | ||
| 206 | */ | ||
| 207 | void ClosePort(unsigned int port) | ||
| 208 | { | ||
| 209 | return m_callbacks->toKodi.ClosePort(m_callbacks->toKodi.kodiInstance, port); | ||
| 210 | } | ||
| 211 | |||
| 212 | /*! | ||
| 213 | * \brief Notify the port of an input event | 191 | * \brief Notify the port of an input event |
| 214 | * | 192 | * |
| 215 | * \param event The input event | 193 | * \param event The input event |
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 c844c73..045d5fe 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 | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | /* | 2 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 3 | * Copyright (C) 2005-2013 Team XBMC |
| 4 | * http://xbmc.org | 4 | * http://kodi.tv |
| 5 | * | 5 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 6 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
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 5ef6bdc..271df98 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 | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | /* | 2 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 3 | * Copyright (C) 2005-2013 Team XBMC |
| 4 | * http://xbmc.org | 4 | * http://kodi.tv |
| 5 | * | 5 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 6 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
| @@ -71,8 +71,6 @@ typedef void* (*KODIGUILib_RegisterMe)(void *addonData); | |||
| 71 | typedef void (*KODIGUILib_UnRegisterMe)(void *addonData, void *cbTable); | 71 | typedef void (*KODIGUILib_UnRegisterMe)(void *addonData, void *cbTable); |
| 72 | typedef void* (*KODIPVRLib_RegisterMe)(void *addonData); | 72 | typedef void* (*KODIPVRLib_RegisterMe)(void *addonData); |
| 73 | typedef void (*KODIPVRLib_UnRegisterMe)(void *addonData, void *cbTable); | 73 | typedef void (*KODIPVRLib_UnRegisterMe)(void *addonData, void *cbTable); |
| 74 | typedef void* (*KODIADSPLib_RegisterMe)(void *addonData); | ||
| 75 | typedef void (*KODIADSPLib_UnRegisterMe)(void *addonData, void *cbTable); | ||
| 76 | typedef void* (*KODICodecLib_RegisterMe)(void *addonData); | 74 | typedef void* (*KODICodecLib_RegisterMe)(void *addonData); |
| 77 | typedef void (*KODICodecLib_UnRegisterMe)(void *addonData, void *cbTable); | 75 | typedef void (*KODICodecLib_UnRegisterMe)(void *addonData, void *cbTable); |
| 78 | typedef void* (*KODIINPUTSTREAMLib_RegisterMe)(void *addonData); | 76 | typedef void* (*KODIINPUTSTREAMLib_RegisterMe)(void *addonData); |
| @@ -96,8 +94,6 @@ typedef struct AddonCB | |||
| 96 | KODIGUILib_UnRegisterMe GUILib_UnRegisterMe; | 94 | KODIGUILib_UnRegisterMe GUILib_UnRegisterMe; |
| 97 | KODIPVRLib_RegisterMe PVRLib_RegisterMe; | 95 | KODIPVRLib_RegisterMe PVRLib_RegisterMe; |
| 98 | KODIPVRLib_UnRegisterMe PVRLib_UnRegisterMe; | 96 | KODIPVRLib_UnRegisterMe PVRLib_UnRegisterMe; |
| 99 | KODIADSPLib_RegisterMe ADSPLib_RegisterMe; | ||
| 100 | KODIADSPLib_UnRegisterMe ADSPLib_UnRegisterMe; | ||
| 101 | KODIINPUTSTREAMLib_RegisterMe INPUTSTREAMLib_RegisterMe; | 97 | KODIINPUTSTREAMLib_RegisterMe INPUTSTREAMLib_RegisterMe; |
| 102 | KODIINPUTSTREAMLib_UnRegisterMe INPUTSTREAMLib_UnRegisterMe; | 98 | KODIINPUTSTREAMLib_UnRegisterMe INPUTSTREAMLib_UnRegisterMe; |
| 103 | KODIPeripheralLib_RegisterMe PeripheralLib_RegisterMe; | 99 | KODIPeripheralLib_RegisterMe PeripheralLib_RegisterMe; |
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 f470566..11ea50c 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 | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | /* | 2 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 3 | * Copyright (C) 2005-2013 Team XBMC |
| 4 | * http://xbmc.org | 4 | * http://kodi.tv |
| 5 | * | 5 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 6 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h new file mode 100644 index 0000000..bee00ef --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2018 Team Kodi | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with KODI; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "../../AddonBase.h" | ||
| 23 | |||
| 24 | /* | ||
| 25 | * For interface between add-on and kodi. | ||
| 26 | * | ||
| 27 | * This structure defines the addresses of functions stored inside Kodi which | ||
| 28 | * are then available for the add-on to call | ||
| 29 | * | ||
| 30 | * All function pointers there are used by the C++ interface functions below. | ||
| 31 | * You find the set of them on xbmc/addons/interfaces/General.cpp | ||
| 32 | * | ||
| 33 | * Note: For add-on development itself this is not needed | ||
| 34 | */ | ||
| 35 | |||
| 36 | static const char* INTERFACE_ANDROID_SYSTEM_NAME = "ANDROID_SYSTEM"; | ||
| 37 | static const char* INTERFACE_ANDROID_SYSTEM_VERSION = "1.0.0"; | ||
| 38 | static const char* INTERFACE_ANDROID_SYSTEM_VERSION_MIN = "1.0.0"; | ||
| 39 | |||
| 40 | struct AddonToKodiFuncTable_android_system | ||
| 41 | { | ||
| 42 | void* (*get_jni_env)(); | ||
| 43 | int (*get_sdk_version)(); | ||
| 44 | }; | ||
| 45 | |||
| 46 | //============================================================================== | ||
| 47 | /// | ||
| 48 | /// \defgroup cpp_kodi_platform Interface - kodi::platform | ||
| 49 | /// \ingroup cpp | ||
| 50 | /// @brief **Android platform specific functions** | ||
| 51 | /// | ||
| 52 | /// #include <kodi/platform/android/System.h>" | ||
| 53 | /// | ||
| 54 | //------------------------------------------------------------------------------ | ||
| 55 | |||
| 56 | namespace kodi | ||
| 57 | { | ||
| 58 | namespace platform | ||
| 59 | { | ||
| 60 | class CInterfaceAndroidSystem | ||
| 61 | { | ||
| 62 | public: | ||
| 63 | CInterfaceAndroidSystem() | ||
| 64 | : m_interface(static_cast<AddonToKodiFuncTable_android_system*>(GetInterface(INTERFACE_ANDROID_SYSTEM_NAME, INTERFACE_ANDROID_SYSTEM_VERSION))) | ||
| 65 | {}; | ||
| 66 | |||
| 67 | //============================================================================ | ||
| 68 | /// | ||
| 69 | /// \ingroup cpp_kodi_platform | ||
| 70 | /// @brief request an JNI env pointer for the calling thread. | ||
| 71 | /// JNI env has to be controlled by kodi because of the underlying | ||
| 72 | /// threading concep. | ||
| 73 | /// | ||
| 74 | /// @param[in]: | ||
| 75 | /// @return JNI env pointer for the calling thread | ||
| 76 | /// | ||
| 77 | inline void * GetJNIEnv() | ||
| 78 | { | ||
| 79 | if (m_interface) | ||
| 80 | return m_interface->get_jni_env(); | ||
| 81 | |||
| 82 | return nullptr; | ||
| 83 | } | ||
| 84 | //---------------------------------------------------------------------------- | ||
| 85 | |||
| 86 | //============================================================================ | ||
| 87 | /// | ||
| 88 | /// \ingroup cpp_kodi_platform | ||
| 89 | /// @brief request the android sdk version to e.g. initialize JNIBase. | ||
| 90 | /// | ||
| 91 | /// @param[in]: | ||
| 92 | /// @return Android SDK version | ||
| 93 | /// | ||
| 94 | inline int GetSDKVersion() | ||
| 95 | { | ||
| 96 | if (m_interface) | ||
| 97 | return m_interface->get_sdk_version(); | ||
| 98 | |||
| 99 | return 0; | ||
| 100 | } | ||
| 101 | |||
| 102 | private: | ||
| 103 | AddonToKodiFuncTable_android_system *m_interface; | ||
| 104 | }; | ||
| 105 | //---------------------------------------------------------------------------- | ||
| 106 | } /* namespace platform */ | ||
| 107 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h index db8508e..b61cb35 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | * overview. | 41 | * overview. |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | #define ADDON_GLOBAL_VERSION_MAIN "1.0.12" | 44 | #define ADDON_GLOBAL_VERSION_MAIN "1.0.13" |
| 45 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12" | 45 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12" |
| 46 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" | 46 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" |
| 47 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ | 47 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ |
| @@ -76,11 +76,6 @@ | |||
| 76 | #define ADDON_GLOBAL_VERSION_NETWORK_XML_ID "kodi.binary.global.network" | 76 | #define ADDON_GLOBAL_VERSION_NETWORK_XML_ID "kodi.binary.global.network" |
| 77 | #define ADDON_GLOBAL_VERSION_NETWORK_DEPENDS "Network.h" | 77 | #define ADDON_GLOBAL_VERSION_NETWORK_DEPENDS "Network.h" |
| 78 | 78 | ||
| 79 | #define ADDON_INSTANCE_VERSION_ADSP "0.2.0" | ||
| 80 | #define ADDON_INSTANCE_VERSION_ADSP_MIN "0.2.0" | ||
| 81 | #define ADDON_INSTANCE_VERSION_ADSP_XML_ID "kodi.binary.instance.adsp" | ||
| 82 | #define ADDON_INSTANCE_VERSION_ADSP_DEPENDS "addon-instance/AudioDSP.h" | ||
| 83 | |||
| 84 | #define ADDON_INSTANCE_VERSION_AUDIODECODER "2.0.0" | 79 | #define ADDON_INSTANCE_VERSION_AUDIODECODER "2.0.0" |
| 85 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_MIN "2.0.0" | 80 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_MIN "2.0.0" |
| 86 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_XML_ID "kodi.binary.instance.audiodecoder" | 81 | #define ADDON_INSTANCE_VERSION_AUDIODECODER_XML_ID "kodi.binary.instance.audiodecoder" |
| @@ -91,8 +86,8 @@ | |||
| 91 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" | 86 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" |
| 92 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" | 87 | #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" |
| 93 | 88 | ||
| 94 | #define ADDON_INSTANCE_VERSION_GAME "1.0.33" | 89 | #define ADDON_INSTANCE_VERSION_GAME "1.0.36" |
| 95 | #define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.33" | 90 | #define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.36" |
| 96 | #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" | 91 | #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" |
| 97 | #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ | 92 | #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ |
| 98 | "kodi_game_types.h" \ | 93 | "kodi_game_types.h" \ |
| @@ -108,14 +103,14 @@ | |||
| 108 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream" | 103 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream" |
| 109 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "addon-instance/Inputstream.h" | 104 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "addon-instance/Inputstream.h" |
| 110 | 105 | ||
| 111 | #define ADDON_INSTANCE_VERSION_PERIPHERAL "1.3.5" | 106 | #define ADDON_INSTANCE_VERSION_PERIPHERAL "1.3.7" |
| 112 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "1.3.4" | 107 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "1.3.4" |
| 113 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_XML_ID "kodi.binary.instance.peripheral" | 108 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_XML_ID "kodi.binary.instance.peripheral" |
| 114 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ | 109 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ |
| 115 | "addon-instance/PeripheralUtils.h" | 110 | "addon-instance/PeripheralUtils.h" |
| 116 | 111 | ||
| 117 | #define ADDON_INSTANCE_VERSION_PVR "5.8.0" | 112 | #define ADDON_INSTANCE_VERSION_PVR "5.9.0" |
| 118 | #define ADDON_INSTANCE_VERSION_PVR_MIN "5.8.0" | 113 | #define ADDON_INSTANCE_VERSION_PVR_MIN "5.9.0" |
| 119 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" | 114 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" |
| 120 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ | 115 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ |
| 121 | "xbmc_pvr_types.h" \ | 116 | "xbmc_pvr_types.h" \ |
| @@ -164,7 +159,6 @@ typedef enum ADDON_TYPE | |||
| 164 | ADDON_GLOBAL_MAX = 5, // Last used global id, used in loops to check versions. Need to change if new global type becomes added. | 159 | ADDON_GLOBAL_MAX = 5, // Last used global id, used in loops to check versions. Need to change if new global type becomes added. |
| 165 | 160 | ||
| 166 | /* addon type instances */ | 161 | /* addon type instances */ |
| 167 | ADDON_INSTANCE_ADSP = 101, | ||
| 168 | ADDON_INSTANCE_AUDIODECODER = 102, | 162 | ADDON_INSTANCE_AUDIODECODER = 102, |
| 169 | ADDON_INSTANCE_AUDIOENCODER = 103, | 163 | ADDON_INSTANCE_AUDIOENCODER = 103, |
| 170 | ADDON_INSTANCE_GAME = 104, | 164 | ADDON_INSTANCE_GAME = 104, |
| @@ -224,10 +218,6 @@ inline const char* GetTypeVersion(int type) | |||
| 224 | #endif | 218 | #endif |
| 225 | 219 | ||
| 226 | /* addon type instances */ | 220 | /* addon type instances */ |
| 227 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_ADSP_USED) | ||
| 228 | case ADDON_INSTANCE_ADSP: | ||
| 229 | return ADDON_INSTANCE_VERSION_ADSP; | ||
| 230 | #endif | ||
| 231 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_AUDIODECODER_USED) | 221 | #if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_AUDIODECODER_USED) |
| 232 | case ADDON_INSTANCE_AUDIODECODER: | 222 | case ADDON_INSTANCE_AUDIODECODER: |
| 233 | return ADDON_INSTANCE_VERSION_AUDIODECODER; | 223 | return ADDON_INSTANCE_VERSION_AUDIODECODER; |
| @@ -303,8 +293,6 @@ inline const char* GetTypeMinVersion(int type) | |||
| 303 | return ADDON_GLOBAL_VERSION_NETWORK_MIN; | 293 | return ADDON_GLOBAL_VERSION_NETWORK_MIN; |
| 304 | 294 | ||
| 305 | /* addon type instances */ | 295 | /* addon type instances */ |
| 306 | case ADDON_INSTANCE_ADSP: | ||
| 307 | return ADDON_INSTANCE_VERSION_ADSP_MIN; | ||
| 308 | case ADDON_INSTANCE_AUDIODECODER: | 296 | case ADDON_INSTANCE_AUDIODECODER: |
| 309 | return ADDON_INSTANCE_VERSION_AUDIODECODER_MIN; | 297 | return ADDON_INSTANCE_VERSION_AUDIODECODER_MIN; |
| 310 | case ADDON_INSTANCE_AUDIOENCODER: | 298 | case ADDON_INSTANCE_AUDIOENCODER: |
| @@ -357,8 +345,6 @@ inline const char* GetTypeName(int type) | |||
| 357 | return "Network"; | 345 | return "Network"; |
| 358 | 346 | ||
| 359 | /* addon type instances */ | 347 | /* addon type instances */ |
| 360 | case ADDON_INSTANCE_ADSP: | ||
| 361 | return "ADSP"; | ||
| 362 | case ADDON_INSTANCE_AUDIODECODER: | 348 | case ADDON_INSTANCE_AUDIODECODER: |
| 363 | return "AudioDecoder"; | 349 | return "AudioDecoder"; |
| 364 | case ADDON_INSTANCE_AUDIOENCODER: | 350 | case ADDON_INSTANCE_AUDIOENCODER: |
| @@ -408,8 +394,6 @@ inline int GetTypeId(const char* name) | |||
| 408 | return ADDON_GLOBAL_FILESYSTEM; | 394 | return ADDON_GLOBAL_FILESYSTEM; |
| 409 | else if (strcmp(name, "network") == 0) | 395 | else if (strcmp(name, "network") == 0) |
| 410 | return ADDON_GLOBAL_NETWORK; | 396 | return ADDON_GLOBAL_NETWORK; |
| 411 | else if (strcmp(name, "adsp") == 0) | ||
| 412 | return ADDON_INSTANCE_ADSP; | ||
| 413 | else if (strcmp(name, "audiodecoder") == 0) | 397 | else if (strcmp(name, "audiodecoder") == 0) |
| 414 | return ADDON_INSTANCE_AUDIODECODER; | 398 | return ADDON_INSTANCE_AUDIODECODER; |
| 415 | else if (strcmp(name, "audioencoder") == 0) | 399 | else if (strcmp(name, "audioencoder") == 0) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h index 1ba12bd..c0a900b 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | /* | 2 | /* |
| 3 | * Copyright (C) 2005-2013 Team XBMC | 3 | * Copyright (C) 2005-2013 Team XBMC |
| 4 | * http://xbmc.org | 4 | * http://kodi.tv |
| 5 | * | 5 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 6 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
| @@ -27,11 +27,9 @@ | |||
| 27 | #undef PRAGMA_PACK_END | 27 | #undef PRAGMA_PACK_END |
| 28 | 28 | ||
| 29 | #if defined(__GNUC__) | 29 | #if defined(__GNUC__) |
| 30 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | ||
| 31 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) | 30 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) |
| 32 | #define PRAGMA_PACK 0 | 31 | #define PRAGMA_PACK 0 |
| 33 | #endif | 32 | #endif |
| 34 | #endif | ||
| 35 | 33 | ||
| 36 | #if !defined(ATTRIBUTE_PACKED) | 34 | #if !defined(ATTRIBUTE_PACKED) |
| 37 | #define ATTRIBUTE_PACKED | 35 | #define ATTRIBUTE_PACKED |
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 25cacb4..d36effa 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 | |||
| @@ -115,6 +115,16 @@ extern "C" | |||
| 115 | * @remarks Required if add-on supports playing epg tags. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | 115 | * @remarks Required if add-on supports playing epg tags. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. |
| 116 | */ | 116 | */ |
| 117 | PVR_ERROR IsEPGTagPlayable(const EPG_TAG* tag, bool* bIsPlayable); | 117 | PVR_ERROR IsEPGTagPlayable(const EPG_TAG* tag, bool* bIsPlayable); |
| 118 | |||
| 119 | /*! | ||
| 120 | * Retrieve the edit decision list (EDL) of an EPG tag on the backend. | ||
| 121 | * @param epgTag The EPG tag. | ||
| 122 | * @param edl out: The function has to write the EDL list into this array. | ||
| 123 | * @param size in: The maximum size of the EDL, out: the actual size of the EDL. | ||
| 124 | * @return PVR_ERROR_NO_ERROR if the EDL was successfully read. | ||
| 125 | * @remarks Required if bSupportsEpgEdl is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | ||
| 126 | */ | ||
| 127 | PVR_ERROR GetEPGTagEdl(const EPG_TAG* epgTag, PVR_EDL_ENTRY edl[], int *size); | ||
| 118 | 128 | ||
| 119 | /*! | 129 | /*! |
| 120 | * Get the stream properties for an epg tag from the backend. | 130 | * Get the stream properties for an epg tag from the backend. |
| @@ -324,7 +334,7 @@ extern "C" | |||
| 324 | * @return PVR_ERROR_NO_ERROR if the EDL was successfully read. | 334 | * @return PVR_ERROR_NO_ERROR if the EDL was successfully read. |
| 325 | * @remarks Required if bSupportsRecordingEdl is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. | 335 | * @remarks Required if bSupportsRecordingEdl is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. |
| 326 | */ | 336 | */ |
| 327 | PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY edl[], int *size); | 337 | PVR_ERROR GetRecordingEdl(const PVR_RECORDING& recording, PVR_EDL_ENTRY edl[], int *size); |
| 328 | 338 | ||
| 329 | /*! | 339 | /*! |
| 330 | * Retrieve the timer types supported by the backend. | 340 | * Retrieve the timer types supported by the backend. |
| @@ -650,6 +660,7 @@ extern "C" | |||
| 650 | pClient->toAddon.GetEPGForChannel = GetEPGForChannel; | 660 | pClient->toAddon.GetEPGForChannel = GetEPGForChannel; |
| 651 | pClient->toAddon.IsEPGTagRecordable = IsEPGTagRecordable; | 661 | pClient->toAddon.IsEPGTagRecordable = IsEPGTagRecordable; |
| 652 | pClient->toAddon.IsEPGTagPlayable = IsEPGTagPlayable; | 662 | pClient->toAddon.IsEPGTagPlayable = IsEPGTagPlayable; |
| 663 | pClient->toAddon.GetEPGTagEdl = GetEPGTagEdl; | ||
| 653 | pClient->toAddon.GetEPGTagStreamProperties = GetEPGTagStreamProperties; | 664 | pClient->toAddon.GetEPGTagStreamProperties = GetEPGTagStreamProperties; |
| 654 | 665 | ||
| 655 | pClient->toAddon.GetChannelGroupsAmount = GetChannelGroupsAmount; | 666 | pClient->toAddon.GetChannelGroupsAmount = GetChannelGroupsAmount; |
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 623cb03..32303d4 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 | |||
| @@ -50,11 +50,9 @@ struct DemuxPacket; | |||
| 50 | #undef PRAGMA_PACK_END | 50 | #undef PRAGMA_PACK_END |
| 51 | 51 | ||
| 52 | #if defined(__GNUC__) | 52 | #if defined(__GNUC__) |
| 53 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | ||
| 54 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) | 53 | #define ATTRIBUTE_PACKED __attribute__ ((packed)) |
| 55 | #define PRAGMA_PACK 0 | 54 | #define PRAGMA_PACK 0 |
| 56 | #endif | 55 | #endif |
| 57 | #endif | ||
| 58 | 56 | ||
| 59 | #if !defined(ATTRIBUTE_PACKED) | 57 | #if !defined(ATTRIBUTE_PACKED) |
| 60 | #define ATTRIBUTE_PACKED | 58 | #define ATTRIBUTE_PACKED |
| @@ -305,6 +303,7 @@ extern "C" { | |||
| 305 | typedef struct PVR_ADDON_CAPABILITIES | 303 | typedef struct PVR_ADDON_CAPABILITIES |
| 306 | { | 304 | { |
| 307 | bool bSupportsEPG; /*!< @brief true if the add-on provides EPG information */ | 305 | bool bSupportsEPG; /*!< @brief true if the add-on provides EPG information */ |
| 306 | bool bSupportsEPGEdl; /*!< @brief true if the backend supports retrieving an edit decision list for an EPG tag. */ | ||
| 308 | bool bSupportsTV; /*!< @brief true if this add-on provides TV channels */ | 307 | bool bSupportsTV; /*!< @brief true if this add-on provides TV channels */ |
| 309 | bool bSupportsRadio; /*!< @brief true if this add-on supports radio channels */ | 308 | bool bSupportsRadio; /*!< @brief true if this add-on supports radio channels */ |
| 310 | bool bSupportsRecordings; /*!< @brief true if this add-on supports playback of recordings stored on the backend */ | 309 | bool bSupportsRecordings; /*!< @brief true if this add-on supports playback of recordings stored on the backend */ |
| @@ -645,6 +644,7 @@ extern "C" { | |||
| 645 | PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, const PVR_CHANNEL&, time_t, time_t); | 644 | PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, const PVR_CHANNEL&, time_t, time_t); |
| 646 | PVR_ERROR (__cdecl* IsEPGTagRecordable)(const EPG_TAG*, bool*); | 645 | PVR_ERROR (__cdecl* IsEPGTagRecordable)(const EPG_TAG*, bool*); |
| 647 | PVR_ERROR (__cdecl* IsEPGTagPlayable)(const EPG_TAG*, bool*); | 646 | PVR_ERROR (__cdecl* IsEPGTagPlayable)(const EPG_TAG*, bool*); |
| 647 | PVR_ERROR (__cdecl* GetEPGTagEdl)(const EPG_TAG*, PVR_EDL_ENTRY[], int*); | ||
| 648 | PVR_ERROR (__cdecl* GetEPGTagStreamProperties)(const EPG_TAG*, PVR_NAMED_VALUE*, unsigned int*); | 648 | PVR_ERROR (__cdecl* GetEPGTagStreamProperties)(const EPG_TAG*, PVR_NAMED_VALUE*, unsigned int*); |
| 649 | int (__cdecl* GetChannelGroupsAmount)(void); | 649 | int (__cdecl* GetChannelGroupsAmount)(void); |
| 650 | PVR_ERROR (__cdecl* GetChannelGroups)(ADDON_HANDLE, bool); | 650 | PVR_ERROR (__cdecl* GetChannelGroups)(ADDON_HANDLE, bool); |
diff --git a/xbmc/cores/AudioEngine/Utils/AEChannelData.h b/xbmc/cores/AudioEngine/Utils/AEChannelData.h index c74aabb..6b64f0d 100644 --- a/xbmc/cores/AudioEngine/Utils/AEChannelData.h +++ b/xbmc/cores/AudioEngine/Utils/AEChannelData.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | /* | 2 | /* |
| 3 | * Copyright (C) 2010-2013 Team XBMC | 3 | * Copyright (C) 2010-2013 Team XBMC |
| 4 | * http://xbmc.org | 4 | * http://kodi.tv |
| 5 | * | 5 | * |
| 6 | * This Program is free software; you can redistribute it and/or modify | 6 | * This Program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h index c77d000..e38e247 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2005-2016 Team XBMC | 2 | * Copyright (C) 2005-2016 Team XBMC |
| 3 | * http://xbmc.org | 3 | * http://kodi.tv |
| 4 | * | 4 | * |
| 5 | * This Program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h index 2d85ed9..b7404a3 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (C) 2012-2013 Team XBMC | 4 | * Copyright (C) 2012-2013 Team XBMC |
| 5 | * http://xbmc.org | 5 | * http://kodi.tv |
| 6 | * | 6 | * |
| 7 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h b/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h index b70128e..209897e 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (C) 2017 Team XBMC | 4 | * Copyright (C) 2017 Team XBMC |
| 5 | * http://xbmc.org | 5 | * http://kodi.tv |
| 6 | * | 6 | * |
| 7 | * This Program is free software; you can redistribute it and/or modify | 7 | * This Program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/filesystem/IFileTypes.h b/xbmc/filesystem/IFileTypes.h index a65a178..3962c0c 100644 --- a/xbmc/filesystem/IFileTypes.h +++ b/xbmc/filesystem/IFileTypes.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2005-2013 Team XBMC | 2 | * Copyright (C) 2005-2013 Team XBMC |
| 3 | * http://xbmc.org | 3 | * http://kodi.tv |
| 4 | * | 4 | * |
| 5 | * This Program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt index 3ab7cb3..35bc503 100644 --- a/xbmc/interfaces/json-rpc/schema/version.txt +++ b/xbmc/interfaces/json-rpc/schema/version.txt | |||
| @@ -1 +1 @@ | |||
| JSONRPC_VERSION 9.1.0 | JSONRPC_VERSION 9.2.0 | ||
