From e317daf081a1048904fdf0b548946fa3ba6593a7 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 29 Apr 2019 12:22:05 +0200 Subject: sync with upstream --- cmake/KodiConfig.cmake.in | 3 + .../bootstrap/repositories/binary-addons.txt | 2 +- cmake/cpack/CPackConfigDEB.cmake | 2 +- .../packages/kodi-eventclients-kodi-send.txt.in | 25 ++ .../packages/kodi-eventclients-xbmc-send.txt.in | 25 -- cmake/cpack/deb/packages/kodi.txt.in | 2 +- cmake/installdata/common/addons.txt | 2 +- cmake/installdata/test-reference-data.txt | 1 + cmake/installdata/windows/addons.txt | 1 - cmake/installdata/windows/dlls.txt | 1 - cmake/installdata/windowsstore/addons.txt | 3 +- cmake/installdata/windowsstore/dlls.txt | 1 - cmake/modules/FindCCache.cmake | 11 +- cmake/modules/FindCXX11.cmake | 18 -- cmake/modules/FindCurl.cmake | 19 +- cmake/modules/FindFmt.cmake | 1 + cmake/modules/FindFreeType.cmake | 3 +- cmake/modules/FindJsonSchemaBuilder.cmake | 38 ++- cmake/modules/FindLibDRM.cmake | 2 +- cmake/modules/FindMariaDBClient.cmake | 18 +- cmake/modules/FindMicroHttpd.cmake | 10 +- cmake/modules/FindYajl.cmake | 62 ---- cmake/platform/android/android.cmake | 1 + cmake/platform/freebsd/x11.cmake | 1 + cmake/platform/ios/ios.cmake | 1 + cmake/platform/osx/osx.cmake | 1 + cmake/platform/windows/windows.cmake | 3 +- cmake/platform/windowsstore/windowsstore.cmake | 3 +- cmake/scripts/common/AddonHelpers.cmake | 11 +- cmake/scripts/common/ArchSetup.cmake | 4 + cmake/scripts/common/GenerateVersionedFiles.cmake | 2 +- cmake/scripts/common/HandleDepends.cmake | 24 +- cmake/scripts/common/Macros.cmake | 31 +- cmake/scripts/common/PrepareEnv.cmake | 8 - cmake/scripts/ios/ArchSetup.cmake | 2 - cmake/scripts/ios/Install.cmake | 38 ++- cmake/scripts/linux/ArchSetup.cmake | 1 - cmake/scripts/linux/Install.cmake | 5 +- cmake/scripts/osx/ArchSetup.cmake | 2 - cmake/scripts/windows/ArchSetup.cmake | 13 +- cmake/scripts/windowsstore/ArchSetup.cmake | 10 +- cmake/treedata/android/subdirs.txt | 37 +-- cmake/treedata/common/drm.txt | 1 - cmake/treedata/common/filesystem.txt | 2 +- cmake/treedata/common/media.txt | 2 + cmake/treedata/common/subdirs.txt | 2 +- cmake/treedata/common/tests.txt | 5 +- cmake/treedata/common/videoplayer.txt | 2 +- cmake/treedata/freebsd/subdirs.txt | 14 +- cmake/treedata/ios/subdirs.txt | 22 +- cmake/treedata/linux/subdirs.txt | 14 +- cmake/treedata/optional/common/X.txt | 2 +- cmake/treedata/optional/common/aml.txt | 1 - cmake/treedata/optional/common/gbm.txt | 2 +- cmake/treedata/optional/common/wayland.txt | 4 +- cmake/treedata/osx/subdirs.txt | 18 +- cmake/treedata/windows/subdirs.txt | 14 +- cmake/treedata/windowsstore/subdirs.txt | 8 +- version.txt | 9 +- xbmc/addons/AddonBindings.cmake | 2 +- .../kodi-addon-dev-kit/include/kodi/AddonBase.h | 55 +++- .../kodi-addon-dev-kit/include/kodi/gui/General.h | 34 ++- .../kodi-addon-dev-kit/include/kodi/gui/Window.h | 2 +- .../include/kodi/gui/definitions.h | 1 + .../include/kodi/kodi_game_dll.h | 28 +- .../include/kodi/kodi_game_types.h | 21 +- .../kodi-addon-dev-kit/include/kodi/libKODI_game.h | 18 +- .../include/kodi/tools/CMakeLists.txt | 3 +- .../kodi-addon-dev-kit/include/kodi/tools/Time.h | 91 ++++++ .../kodi-addon-dev-kit/include/kodi/versions.h | 12 +- .../include/kodi/xbmc_addon_dll.h | 5 + .../include/kodi/xbmc_epg_types.h | 1 - .../kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | 23 +- .../include/kodi/xbmc_pvr_types.h | 14 +- .../VideoPlayer/Interface/Addon/DemuxPacket.h | 2 +- xbmc/filesystem/IFileTypes.h | 2 +- xbmc/input/actions/ActionIDs.h | 312 +++++++++++++++++++++ xbmc/interfaces/json-rpc/schema/version.txt | 2 +- 78 files changed, 838 insertions(+), 360 deletions(-) create mode 100644 cmake/cpack/deb/packages/kodi-eventclients-kodi-send.txt.in delete mode 100644 cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in delete mode 100644 cmake/modules/FindCXX11.cmake delete mode 100644 cmake/modules/FindYajl.cmake delete mode 100644 cmake/treedata/common/drm.txt create mode 100644 cmake/treedata/common/media.txt create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h create mode 100644 xbmc/input/actions/ActionIDs.h diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in index 560374d..9ec1215 100644 --- a/cmake/KodiConfig.cmake.in +++ b/cmake/KodiConfig.cmake.in @@ -28,5 +28,8 @@ add_definitions(${ARCH_DEFINES} -DBUILD_KODI_ADDON) set(CORE_SYSTEM_NAME @CORE_SYSTEM_NAME@) set(PLATFORM @CORE_SYSTEM_NAME@) set(PLATFORM_TAG @PLATFORM_TAG@) +set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@) +set(CMAKE_CXX_STANDARD_REQUIRED @CMAKE_CXX_STANDARD_REQUIRED@) +set(CMAKE_CXX_EXTENSIONS @CMAKE_CXX_EXTENSIONS@) include(AddonHelpers) diff --git a/cmake/addons/bootstrap/repositories/binary-addons.txt b/cmake/addons/bootstrap/repositories/binary-addons.txt index 8674f06..7e471ff 100644 --- a/cmake/addons/bootstrap/repositories/binary-addons.txt +++ b/cmake/addons/bootstrap/repositories/binary-addons.txt @@ -1 +1 @@ -binary-addons https://github.com/xbmc/repo-binary-addons.git master \ No newline at end of file +binary-addons https://github.com/xbmc/repo-binary-addons.git Matrix diff --git a/cmake/cpack/CPackConfigDEB.cmake b/cmake/cpack/CPackConfigDEB.cmake index 800daa5..9aa687d 100644 --- a/cmake/cpack/CPackConfigDEB.cmake +++ b/cmake/cpack/CPackConfigDEB.cmake @@ -182,7 +182,7 @@ install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1.gz COMPONENT kodi-eventclients-ps3) install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1.gz DESTINATION share/man/man1 - COMPONENT kodi-eventclients-xbmc-send) + COMPONENT kodi-eventclients-kodi-send) install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1.gz DESTINATION share/man/man1 COMPONENT kodi-eventclients-wiiremote) diff --git a/cmake/cpack/deb/packages/kodi-eventclients-kodi-send.txt.in b/cmake/cpack/deb/packages/kodi-eventclients-kodi-send.txt.in new file mode 100644 index 0000000..b5292de --- /dev/null +++ b/cmake/cpack/deb/packages/kodi-eventclients-kodi-send.txt.in @@ -0,0 +1,25 @@ +# kodi-eventclients-kodi-send debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to use dpkg-shlibdeps to +# automatically generate the package dependency list and append its output to +# PACKAGE_DEPENDS list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-eventclients-kodi-send +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@) +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS kodi-eventclients-xbmc-send +PACKAGE_REPLACES kodi-eventclients-xbmc-send +PACKAGE_PROVIDES kodi-eventclients-kodi-send +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (@APP_NAME@-send event client package) +PACKAGE_DESCRIPTION_FOOTER This is the Kodi-SEND package for @APP_NAME@'s event client. diff --git a/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in b/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in deleted file mode 100644 index 36a54a2..0000000 --- a/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in +++ /dev/null @@ -1,25 +0,0 @@ -# kodi-eventclients-xbmc-send debian package metadata -# -# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to use dpkg-shlibdeps to -# automatically generate the package dependency list and append its output to -# PACKAGE_DEPENDS list. Only useful for packages that contain binaries. -# -# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains -# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) -# based on build options. -# -# Remaining settings are (hopefully) self-explanatory. - -PACKAGE_NAME @APP_NAME_LC@-eventclients-xbmc-send -PACKAGE_ARCHITECTURE all -PACKAGE_SECTION video -PACKAGE_PRIORITY optional -PACKAGE_SHLIBDEPS -PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@) -PACKAGE_RECOMMENDS -PACKAGE_SUGGESTS -PACKAGE_BREAKS -PACKAGE_REPLACES -PACKAGE_PROVIDES xbmc-eventclients-xbmc-send -PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (@APP_NAME@-send event client package) -PACKAGE_DESCRIPTION_FOOTER This is the Kodi-SEND package for @APP_NAME@'s event client. diff --git a/cmake/cpack/deb/packages/kodi.txt.in b/cmake/cpack/deb/packages/kodi.txt.in index 5ab8905..4776622 100644 --- a/cmake/cpack/deb/packages/kodi.txt.in +++ b/cmake/cpack/deb/packages/kodi.txt.in @@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all PACKAGE_SECTION video PACKAGE_PRIORITY optional PACKAGE_SHLIBDEPS -PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2 +PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1 PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone diff --git a/cmake/installdata/common/addons.txt b/cmake/installdata/common/addons.txt index c0ffb72..13dbab3 100644 --- a/cmake/installdata/common/addons.txt +++ b/cmake/installdata/common/addons.txt @@ -40,5 +40,5 @@ addons/metadata.common.musicbrainz.org/* addons/metadata.common.theaudiodb.com/* addons/metadata.common.themoviedb.org/* addons/metadata.themoviedb.org/* -addons/metadata.tvdb.com/* +addons/metadata.tvshows.themoviedb.org/* addons/kodi.vfs/* diff --git a/cmake/installdata/test-reference-data.txt b/cmake/installdata/test-reference-data.txt index 895079a..b6c94a7 100644 --- a/cmake/installdata/test-reference-data.txt +++ b/cmake/installdata/test-reference-data.txt @@ -8,3 +8,4 @@ xbmc/filesystem/test/refRARstored.rar xbmc/network/test/data/test.html xbmc/network/test/data/test.png xbmc/network/test/data/test-ranges.txt +xbmc/playlists/test/test.xspf diff --git a/cmake/installdata/windows/addons.txt b/cmake/installdata/windows/addons.txt index a3bdd44..66b583a 100644 --- a/cmake/installdata/windows/addons.txt +++ b/cmake/installdata/windows/addons.txt @@ -1,3 +1,2 @@ -addons/repository.pvr-win32.xbmc.org/* project/BuildDependencies/${ARCH}/addons/script.module.pil KEEP_DIR_STRUCTURE addons project/BuildDependencies/${ARCH}/addons/script.module.pycryptodome KEEP_DIR_STRUCTURE addons diff --git a/cmake/installdata/windows/dlls.txt b/cmake/installdata/windows/dlls.txt index c17bd76..a4bfb79 100644 --- a/cmake/installdata/windows/dlls.txt +++ b/cmake/installdata/windows/dlls.txt @@ -1,3 +1,2 @@ project/BuildDependencies/${ARCH}/bin/libbluray*.jar . project/BuildDependencies/${ARCH}/bin/*.dll . -project/BuildDependencies/mingwlibs/${ARCH}/bin/*.dll . diff --git a/cmake/installdata/windowsstore/addons.txt b/cmake/installdata/windowsstore/addons.txt index 4b8678b..3b4d9a9 100644 --- a/cmake/installdata/windowsstore/addons.txt +++ b/cmake/installdata/windowsstore/addons.txt @@ -1,3 +1,2 @@ -addons/repository.pvr-win32.xbmc.org/* project/BuildDependencies/win10-${ARCH}/addons/* -system/addon-manifest-uwp.xml \ No newline at end of file +system/addon-manifest-uwp.xml diff --git a/cmake/installdata/windowsstore/dlls.txt b/cmake/installdata/windowsstore/dlls.txt index a927b3d..8b45449 100644 --- a/cmake/installdata/windowsstore/dlls.txt +++ b/cmake/installdata/windowsstore/dlls.txt @@ -1,2 +1 @@ project/BuildDependencies/win10-${ARCH}/bin/*.dll dlls -project/BuildDependencies/mingwlibs/win10-${ARCH}/bin/*.dll dlls diff --git a/cmake/modules/FindCCache.cmake b/cmake/modules/FindCCache.cmake index 956dee2..a18d4e0 100644 --- a/cmake/modules/FindCCache.cmake +++ b/cmake/modules/FindCCache.cmake @@ -12,7 +12,16 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CCache REQUIRED_VARS CCACHE_PROGRAM) if(CCACHE_FOUND) - # Supports Unix Makefiles and Ninja + # Supports Unix Makefiles, Ninja and Xcode set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}") + + file(WRITE "${CMAKE_BINARY_DIR}/launch-c" "exec \"${CCACHE_PROGRAM}\" \"${CMAKE_C_COMPILER}\" \"$@\"\n") + file(WRITE "${CMAKE_BINARY_DIR}/launch-cxx" "exec \"${CCACHE_PROGRAM}\" \"${CMAKE_CXX_COMPILER}\" \"$@\"\n") + execute_process(COMMAND chmod +x "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") + + set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c" PARENT_SCOPE) + set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx" PARENT_SCOPE) + set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c" PARENT_SCOPE) + set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx" PARENT_SCOPE) endif() diff --git a/cmake/modules/FindCXX11.cmake b/cmake/modules/FindCXX11.cmake deleted file mode 100644 index c0b9a52..0000000 --- a/cmake/modules/FindCXX11.cmake +++ /dev/null @@ -1,18 +0,0 @@ -include(TestCXXAcceptsFlag) - -# try to use compiler flag -std=c++11 -check_cxx_accepts_flag("-std=c++11" CXX_FLAG_CXX11) -if(CXX_FLAG_CXX11) - add_options (CXX ALL_BUILDS "-std=c++11") - set(CXX_STD11_FLAGS "-std=c++11") -else() - # try to use compiler flag -std=c++0x for older compilers - check_cxx_accepts_flag("-std=c++0x" CXX_FLAG_CXX0X) - if(CXX_FLAG_CXX0X) - add_options (CXX ALL_BUILDS "-std=c++0x") - set(CXX_STD11_FLAGS "-std=c++0x") - endif() -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS) diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index 6ccf44a..6411a92 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake @@ -25,6 +25,19 @@ find_library(CURL_LIBRARY NAMES curl libcurl libcurl_imp set(CURL_VERSION ${PC_CURL_VERSION}) +set(CURL_LIB_TYPE SHARED) +set(CURL_LDFLAGS ${PC_CURL_LDFLAGS}) + +# check if curl is statically linked +if(${CURL_LIBRARY} MATCHES ".+\.a$" AND PC_CURL_STATIC_LDFLAGS) + set(CURL_LIB_TYPE STATIC) + set(CURL_LDFLAGS ${PC_CURL_STATIC_LDFLAGS}) + + pkg_check_modules(PC_NGHTTP2 libnghttp2 QUIET) + find_library(NGHTTP2_LIBRARY NAMES libnghttp2 nghttp2 + PATHS ${PC_NGHTTP2_LIBDIR}) +endif() + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Curl REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR @@ -32,10 +45,10 @@ find_package_handle_standard_args(Curl if(CURL_FOUND) set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) - set(CURL_LIBRARIES ${CURL_LIBRARY}) + set(CURL_LIBRARIES ${CURL_LIBRARY} ${NGHTTP2_LIBRARY}) if(NOT TARGET Curl::Curl) - add_library(Curl::Curl UNKNOWN IMPORTED) + add_library(Curl::Curl ${CURL_LIB_TYPE} IMPORTED) set_target_properties(Curl::Curl PROPERTIES IMPORTED_LOCATION "${CURL_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") @@ -46,4 +59,4 @@ if(CURL_FOUND) endif() endif() -mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY) +mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY CURL_LDFLAGS) diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake index df18d85..47cf8be 100644 --- a/cmake/modules/FindFmt.cmake +++ b/cmake/modules/FindFmt.cmake @@ -40,6 +40,7 @@ if(ENABLE_INTERNAL_FMT) PREFIX ${CORE_BUILD_DIR}/fmt CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DCMAKE_INSTALL_LIBDIR=lib -DFMT_DOC=OFF -DFMT_TEST=OFF "${EXTRA_ARGS}" diff --git a/cmake/modules/FindFreeType.cmake b/cmake/modules/FindFreeType.cmake index 8a39555..771819e 100644 --- a/cmake/modules/FindFreeType.cmake +++ b/cmake/modules/FindFreeType.cmake @@ -19,7 +19,8 @@ endif() find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h PATHS ${PC_FREETYPE_INCLUDEDIR} - ${PC_FREETYPE_INCLUDE_DIRS}) + ${PC_FREETYPE_INCLUDE_DIRS} + PATH_SUFFIXES freetype2) find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT PATHS ${PC_FREETYPE_LIBDIR}) diff --git a/cmake/modules/FindJsonSchemaBuilder.cmake b/cmake/modules/FindJsonSchemaBuilder.cmake index 14aa2f5..094c2fa 100644 --- a/cmake/modules/FindJsonSchemaBuilder.cmake +++ b/cmake/modules/FindJsonSchemaBuilder.cmake @@ -3,24 +3,40 @@ # --------------------- # Finds the JsonSchemaBuilder # +# If WITH_JSONSCHEMABUILDER is defined and points to a directory, +# this path will be used to search for the JsonSchemaBuilder binary +# +# # This will define the following (imported) targets:: # # JsonSchemaBuilder::JsonSchemaBuilder - The JsonSchemaBuilder executable if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder) - if(KODI_DEPENDSBUILD OR CMAKE_CROSSCOMPILING) + if(KODI_DEPENDSBUILD) + add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) + set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES + IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") + elseif(CORE_SYSTEM_NAME STREQUAL windowsstore) add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) - if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) - set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES - IMPORTED_LOCATION "${DEPENDENCIES_DIR}/bin/json-rpc/JsonSchemaBuilder") + set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES + IMPORTED_LOCATION "${DEPENDENCIES_DIR}/bin/json-rpc/JsonSchemaBuilder") + else() + if(WITH_JSONSCHEMABUILDER) + get_filename_component(_jsbpath ${WITH_JSONSCHEMABUILDER} ABSOLUTE) + find_program(JSONSCHEMABUILDER_EXECUTABLE JsonSchemaBuilder PATHS ${_jsbpath}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(JsonSchemaBuilder DEFAULT_MSG JSONSCHEMABUILDER_EXECUTABLE) + if(JSONSCHEMABUILDER_FOUND) + add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) + set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES + IMPORTED_LOCATION "${JSONSCHEMABUILDER_EXECUTABLE}") + endif() + mark_as_advanced(JSONSCHEMABUILDER) else() - set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES - IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") + add_subdirectory(${CMAKE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) + add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) + set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools) endif() - set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES FOLDER Tools) - else() - add_subdirectory(${CMAKE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) - add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) - set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools) endif() endif() diff --git a/cmake/modules/FindLibDRM.cmake b/cmake/modules/FindLibDRM.cmake index ec30920..4b39de3 100644 --- a/cmake/modules/FindLibDRM.cmake +++ b/cmake/modules/FindLibDRM.cmake @@ -14,7 +14,7 @@ # LibDRM::LibDRM - The LibDRM library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_LIBDRM libdrm>=2.4.71 QUIET) + pkg_check_modules(PC_LIBDRM libdrm>=2.4.82 QUIET) endif() find_path(LIBDRM_INCLUDE_DIR NAMES drm.h diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake index 8a28670..7530ab5 100644 --- a/cmake/modules/FindMariaDBClient.cmake +++ b/cmake/modules/FindMariaDBClient.cmake @@ -21,15 +21,25 @@ else() set(EXTRA_FIND_ARGS) endif() -find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h) -find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient libmariadb +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_MARIADBCLIENT mariadb QUIET) +endif() + + +find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h + PATHS ${PC_MARIADBCLIENT_INCLUDEDIR}) +find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb + PATHS ${PC_MARIADBCLIENT_LIBDIR} PATH_SUFFIXES mariadb ${EXTRA_FIND_ARGS}) -find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient libmariadb +find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb + PATHS ${PC_MARIADBCLIENT_LIBDIR} PATH_SUFFIXES mariadb ${EXTRA_FIND_ARGS}) -if(MARIADBCLIENT_INCLUDE_DIR AND EXISTS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h") +if(PC_MARIADBCLIENT_VERSION) + set(MARIADBCLIENT_VERSION_STRING ${PC_MARIADBCLIENT_VERSION}) +elseif(MARIADBCLIENT_INCLUDE_DIR AND EXISTS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h") file(STRINGS "${MARIADBCLIENT_INCLUDE_DIR}/mariadb/mariadb_version.h" mariadb_version_str REGEX "^#define[\t ]+MARIADB_CLIENT_VERSION_STR[\t ]+\".*\".*") string(REGEX REPLACE "^#define[\t ]+MARIADB_CLIENT_VERSION_STR[\t ]+\"([^\"]+)\".*" "\\1" MARIADBCLIENT_VERSION_STRING "${mariadb_version_str}") unset(mariadb_version_str) diff --git a/cmake/modules/FindMicroHttpd.cmake b/cmake/modules/FindMicroHttpd.cmake index e6127f3..a0b91a0 100644 --- a/cmake/modules/FindMicroHttpd.cmake +++ b/cmake/modules/FindMicroHttpd.cmake @@ -35,15 +35,7 @@ if(MICROHTTPD_FOUND) set(MICROHTTPD_INCLUDE_DIRS ${MICROHTTPD_INCLUDE_DIR}) set(MICROHTTPD_DEFINITIONS -DHAS_WEB_SERVER=1 -DHAS_WEB_INTERFACE=1) - if(KODI_DEPENDSBUILD AND NOT WIN32) - find_library(GCRYPT_LIBRARY gcrypt) - find_library(GPGERROR_LIBRARY gpg-error) - list(APPEND MICROHTTPD_LIBRARIES ${GCRYPT_LIBRARY} ${GPGERROR_LIBRARY}) - mark_as_advanced(GCRYPT_LIBRARY GPGERROR_LIBRARY) - if(NOT APPLE AND NOT CORE_SYSTEM_NAME STREQUAL android) - list(APPEND MICROHTTPD_LIBRARIES rt) - endif() - else() + if(${MICROHTTPD_LIBRARY} MATCHES ".+\.a$" AND PC_MICROHTTPD_STATIC_LIBRARIES) list(APPEND MICROHTTPD_LIBRARIES ${PC_MICROHTTPD_STATIC_LIBRARIES}) endif() endif() diff --git a/cmake/modules/FindYajl.cmake b/cmake/modules/FindYajl.cmake deleted file mode 100644 index d8793e6..0000000 --- a/cmake/modules/FindYajl.cmake +++ /dev/null @@ -1,62 +0,0 @@ -#.rst: -# FindYajl -# -------- -# Finds the Yajl library -# -# This will define the following variables:: -# -# YAJL_FOUND - system has Yajl -# YAJL_INCLUDE_DIRS - Yajl include directory -# YAJL_LIBRARIES - the Yajl libraries -# -# and the following imported targets:: -# -# Yajl::Yajl - The Yajl library - -if(NOT Yajl_FIND_VERSION) - set(Yajl_FIND_VERSION 2.0.0) -endif() - -if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_YAJL yajl>=${Yajl_FIND_VERSION} QUIET) -endif() - -find_path(YAJL_INCLUDE_DIR NAMES yajl/yajl_common.h - PATHS ${PC_YAJL_INCLUDEDIR}) -find_library(YAJL_LIBRARY NAMES yajl - PATHS ${PC_YAJL_LIBDIR}) - -if(PC_YAJL_VERSION) - set(YAJL_VERSION_STRING ${PC_YAJL_VERSION}) -elseif(YAJL_INCLUDE_DIR AND EXISTS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h") - file(STRINGS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h" yajl_version_str REGEX "^[ \t]*#define[ \t]+YAJL_(MAJOR|MINOR|MICRO)") - string(REGEX REPLACE "YAJL_MAJOR ([0-9]+)" "\\1" YAJL_VERSION_MAJOR "${YAJL_VERSION_MAJOR}") - - string(REGEX REPLACE ".*YAJL_MAJOR ([0-9]+).*" "\\1" yajl_major "${yajl_version_str}") - string(REGEX REPLACE ".*YAJL_MINOR ([0-9]+).*" "\\1" yajl_minor "${yajl_version_str}") - string(REGEX REPLACE ".*YAJL_MICRO ([0-9]+).*" "\\1" yajl_micro "${yajl_version_str}") - set(YAJL_VERSION_STRING "${yajl_major}.${yajl_minor}.${yajl_micro}") - unset(yajl_version_str) - unset(yajl_major) - unset(yajl_minor) - unset(yajl_micro) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Yajl - REQUIRED_VARS YAJL_LIBRARY YAJL_INCLUDE_DIR - VERSION_VAR YAJL_VERSION_STRING) - -if(YAJL_FOUND) - set(YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR}) - set(YAJL_LIBRARIES ${YAJL_LIBRARY}) - - if(NOT TARGET Yajl::Yajl) - add_library(Yajl::Yajl UNKNOWN IMPORTED) - set_target_properties(Yajl::Yajl PROPERTIES - IMPORTED_LOCATION "${YAJL_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${YAJL_INCLUDE_DIR}") - endif() -endif() - -mark_as_advanced(YAJL_INCLUDE_DIR YAJL_LIBRARY) diff --git a/cmake/platform/android/android.cmake b/cmake/platform/android/android.cmake index c857cba..1450d28 100644 --- a/cmake/platform/android/android.cmake +++ b/cmake/platform/android/android.cmake @@ -1 +1,2 @@ set(PLATFORM_REQUIRED_DEPS OpenGLES EGL Zip) +set(APP_RENDER_SYSTEM gles) diff --git a/cmake/platform/freebsd/x11.cmake b/cmake/platform/freebsd/x11.cmake index 656fd66..09cebde 100644 --- a/cmake/platform/freebsd/x11.cmake +++ b/cmake/platform/freebsd/x11.cmake @@ -1,2 +1,3 @@ set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) +set(APP_RENDER_SYSTEM gl) diff --git a/cmake/platform/ios/ios.cmake b/cmake/platform/ios/ios.cmake index ab0f361..75c9b7b 100644 --- a/cmake/platform/ios/ios.cmake +++ b/cmake/platform/ios/ios.cmake @@ -1 +1,2 @@ set(PLATFORM_REQUIRED_DEPS OpenGLES) +set(APP_RENDER_SYSTEM gles) diff --git a/cmake/platform/osx/osx.cmake b/cmake/platform/osx/osx.cmake index e81703c..fbe8d96 100644 --- a/cmake/platform/osx/osx.cmake +++ b/cmake/platform/osx/osx.cmake @@ -1 +1,2 @@ set(PLATFORM_REQUIRED_DEPS OpenGl Sdl) +set(APP_RENDER_SYSTEM gl) diff --git a/cmake/platform/windows/windows.cmake b/cmake/platform/windows/windows.cmake index dbe9417..b0c2992 100644 --- a/cmake/platform/windows/windows.cmake +++ b/cmake/platform/windows/windows.cmake @@ -1 +1,2 @@ -# File intentionally left empty +set(PLATFORM_REQUIRED_DEPS D3DX11Effects) +set(APP_RENDER_SYSTEM dx11) diff --git a/cmake/platform/windowsstore/windowsstore.cmake b/cmake/platform/windowsstore/windowsstore.cmake index 266fb3e..b0c2992 100644 --- a/cmake/platform/windowsstore/windowsstore.cmake +++ b/cmake/platform/windowsstore/windowsstore.cmake @@ -1 +1,2 @@ -set(PLATFORM_REQUIRED_DEPS zlib) +set(PLATFORM_REQUIRED_DEPS D3DX11Effects) +set(APP_RENDER_SYSTEM dx11) diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake index a91e366..2f3f302 100644 --- a/cmake/scripts/common/AddonHelpers.cmake +++ b/cmake/scripts/common/AddonHelpers.cmake @@ -199,7 +199,7 @@ macro (build_addon target prefix libs) endif() # TODO: remove this hack after v18 - string(REPLACE "\@PLATFORM\@" "@PLATFORM_TAG@" addon_file "${addon_file}") + string(REPLACE "\@PLATFORM\@" "\@PLATFORM_TAG\@" addon_file "${addon_file}") string(CONFIGURE "${addon_file}" addon_file_conf @ONLY) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") @@ -289,10 +289,12 @@ macro (build_addon target prefix libs) COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_CUSTOM_DATA) - install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) + install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_ADDITIONAL_BINARY) - install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target}) + install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() endif() add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) @@ -341,10 +343,11 @@ macro (build_addon target prefix libs) if(${APP_NAME_UC}_BUILD_DIR) file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*) if(${prefix}_CUSTOM_DATA) + get_filename_component(dname ${${prefix}_CUSTOM_DATA} NAME) add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${${prefix}_CUSTOM_DATA} - ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources) + ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources/${dname}) endif() foreach(file ${files}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/${target}/" "" name "${file}") diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 4704193..07ce6d4 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake @@ -122,6 +122,10 @@ check_function_exists(localtime_r HAVE_LOCALTIME_R) if(HAVE_LOCALTIME_R) list(APPEND SYSTEM_DEFINES -DHAVE_LOCALTIME_R=1) endif() +check_function_exists(gmtime_r HAVE_GMTIME_R) +if(HAVE_GMTIME_R) +list(APPEND SYSTEM_DEFINES -DHAVE_GMTIME_R=1) +endif() if(HAVE_INTTYPES_H) list(APPEND SYSTEM_DEFINES -DHAVE_INTTYPES_H=1) endif() diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake index 011f495..1d324db 100644 --- a/cmake/scripts/common/GenerateVersionedFiles.cmake +++ b/cmake/scripts/common/GenerateVersionedFiles.cmake @@ -15,7 +15,7 @@ endfunction() file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in) # remove 'xbmc.json', will be created from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt' -list(REMOVE_ITEM ADDON_XML_IN_FILE xbmc.json) +list(REMOVE_ITEM ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in) foreach(loop_var ${ADDON_XML_IN_FILE}) list(GET loop_var 0 xml_name) diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index 47f7d9b..40e382b 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake @@ -88,16 +88,12 @@ function(add_addon_depends addon searchpath) message(${BUILD_ARGS}) endif() - # prepare patchfile. ensure we have a clean file after reconfiguring - set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake) - file(REMOVE ${PATCH_FILE}) + set(PATCH_COMMAND) # if there's a CMakeLists.txt use it to prepare the build if(EXISTS ${dir}/CMakeLists.txt) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt) - file(APPEND ${PATCH_FILE} - "file(COPY ${dir}/CMakeLists.txt - DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") + list(APPEND PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${dir}/CMakeLists.txt ${BUILD_DIR}/${id}/src/${id}) endif() # check if we have patches to apply @@ -124,14 +120,13 @@ function(add_addon_depends addon searchpath) file(READ ${patch} patch_content_hex HEX) # Force handle LF-only line endings if(NOT patch_content_hex MATCHES "0d0a") - set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") + list(APPEND PATCH_PROGRAM --binary) endif() endif() endif() set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch}) - file(APPEND ${PATCH_FILE} - "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n") + list(APPEND PATCH_COMMAND COMMAND ${PATCH_PROGRAM} -p1 -i ${patch}) endforeach() @@ -168,18 +163,11 @@ function(add_addon_depends addon searchpath) if(CROSS_AUTOCONF AND AUTOCONF_FILES) foreach(afile ${AUTOCONF_FILES}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile}) - file(APPEND ${PATCH_FILE} - "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n - file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") + list(APPEND PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E echo "AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}") + list(APPEND PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${afile} ${BUILD_DIR}/${id}/src/${id}) endforeach() endif() - # if the patch file exists we need to set the PATCH_COMMAND - set(PATCH_COMMAND "") - if(EXISTS ${PATCH_FILE}) - set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE}) - endif() - # prepare the setup of the call to externalproject_add() set(EXTERNALPROJECT_SETUP PREFIX ${BUILD_DIR}/${id} CMAKE_ARGS ${extraflags} ${BUILD_ARGS} diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index 0d89dd3..eefd7c8 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake @@ -72,11 +72,7 @@ function(core_add_library name) add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) set_target_properties(${name} PROPERTIES PREFIX "") set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) - set(lib_DEPS libcpluff ffmpeg crossguid ${PLATFORM_GLOBAL_TARGET_DEPS}) - if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore) - list(APPEND lib_DEPS dvdnav) - endif() - add_dependencies(${name} ${lib_DEPS}) + add_dependencies(${name} ${GLOBAL_TARGET_DEPS}) set(CORE_LIBRARY ${name} PARENT_SCOPE) # Add precompiled headers to Kodi main libraries @@ -106,11 +102,7 @@ function(core_add_test_library name) set_target_properties(${name} PROPERTIES PREFIX "" EXCLUDE_FROM_ALL 1 FOLDER "Build Utilities/tests") - set(lib_DEPS libcpluff ffmpeg crossguid ${PLATFORM_GLOBAL_TARGET_DEPS}) - if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore) - list(APPEND lib_DEPS dvdnav) - endif() - add_dependencies(${name} ${lib_DEPS}) + add_dependencies(${name} ${GLOBAL_TARGET_DEPS}) set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) endif() foreach(src IN LISTS SOURCES SUPPORTED_SOURCES HEADERS OTHERS) @@ -631,6 +623,8 @@ function(core_find_git_rev stamp) # allow manual setting GIT_VERSION if(GIT_VERSION) set(${stamp} ${GIT_VERSION} PARENT_SCOPE) + string(TIMESTAMP APP_BUILD_DATE "%Y%m%d" UTC) + set(APP_BUILD_DATE ${APP_BUILD_DATE} PARENT_SCOPE) else() find_package(Git) if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) @@ -661,12 +655,18 @@ function(core_find_git_rev stamp) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) string(REPLACE "\"" "" DATE ${DATE}) string(REPLACE "-" "" DATE ${DATE}) + + # build date + string(TIMESTAMP APP_BUILD_DATE "%Y%m%d" UTC) + set(APP_BUILD_DATE ${APP_BUILD_DATE} PARENT_SCOPE) else() if(EXISTS ${CMAKE_SOURCE_DIR}/BUILDDATE) file(STRINGS ${CMAKE_SOURCE_DIR}/BUILDDATE DATE LIMIT_INPUT 8) else() string(TIMESTAMP DATE "%Y%m%d" UTC) endif() + set(APP_BUILD_DATE ${DATE} PARENT_SCOPE) + if(EXISTS ${CMAKE_SOURCE_DIR}/VERSION) file(STRINGS ${CMAKE_SOURCE_DIR}/VERSION HASH LIMIT_INPUT 16) else() @@ -721,6 +721,7 @@ macro(core_find_versions) APP_NAME APP_PACKAGE COMPANY_NAME + COPYRIGHT_YEARS JSONRPC_VERSION PACKAGE_DESCRIPTION PACKAGE_IDENTITY @@ -784,6 +785,12 @@ endmacro() # find all folders containing addon.xml.in and used to define # ADDON_XML_OUTPUTS, ADDON_XML_DEPENDS and ADDON_INSTALL_DATA macro(find_addon_xml_in_files) + set(filter ${ARGV0}) + + if(filter AND VERBOSE) + message(STATUS "find_addon_xml_in_files: filtering ${filter}") + endif() + file(GLOB ADDON_XML_IN_FILE ${CMAKE_SOURCE_DIR}/addons/*/addon.xml.in) foreach(loop_var ${ADDON_XML_IN_FILE}) list(GET loop_var 0 xml_name) @@ -792,7 +799,9 @@ macro(find_addon_xml_in_files) string(REPLACE "${CORE_SOURCE_DIR}/" "" xml_name ${xml_name}) list(APPEND ADDON_XML_DEPENDS "${CORE_SOURCE_DIR}/${xml_name}/addon.xml.in") - list(APPEND ADDON_XML_OUTPUTS "${CMAKE_BINARY_DIR}/${xml_name}/addon.xml") + if(filter AND NOT xml_name MATCHES ${filter}) + list(APPEND ADDON_XML_OUTPUTS "${CMAKE_BINARY_DIR}/${xml_name}/addon.xml") + endif() # Read content of add-on folder to have on install file(GLOB ADDON_FILES "${CORE_SOURCE_DIR}/${xml_name}/*") diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake index 20dbaf6..753dca1 100644 --- a/cmake/scripts/common/PrepareEnv.cmake +++ b/cmake/scripts/common/PrepareEnv.cmake @@ -24,14 +24,6 @@ if(NOT EXISTS "${APP_INCLUDE_DIR}/") file(MAKE_DIRECTORY ${APP_INCLUDE_DIR}) endif() -# make sure C++11 is always set -if(NOT WIN32) - string(REGEX MATCH "-std=(gnu|c)\\+\\+11" cxx11flag "${CMAKE_CXX_FLAGS}") - if(NOT cxx11flag) - set(CXX11_SWITCH "-std=c++11") - endif() -endif() - if(NOT CORE_SYSTEM_NAME) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(CORE_SYSTEM_NAME "osx") diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/ios/ArchSetup.cmake index 6b053dc..b6c626f 100644 --- a/cmake/scripts/ios/ArchSetup.cmake +++ b/cmake/scripts/ios/ArchSetup.cmake @@ -28,8 +28,6 @@ endif() # Additional SYSTEM_DEFINES list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_ZEROCONF) -find_package(CXX11 REQUIRED) - list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake index 7b6c3de..7668e7c 100644 --- a/cmake/scripts/ios/Install.cmake +++ b/cmake/scripts/ios/Install.cmake @@ -1,11 +1,26 @@ # IOS packaging -set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-812h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-812h@3x.png +set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Landscape-2436h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Portrait-2436h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-568h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-667h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Landscape-736h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Portrait-736h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage@2x.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png @@ -21,19 +36,13 @@ set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) -if(CMAKE_GENERATOR STREQUAL Xcode) - set(RESOURCE_LOCATION ${APP_NAME}.app) -else() - set(RESOURCE_LOCATION ".") -endif() - target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES}) foreach(file IN LISTS BUNDLE_RESOURCES) - set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION ${RESOURCE_LOCATION}) + set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION .) endforeach() target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings) -set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "${RESOURCE_LOCATION}/English.lproj") +set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "./English.lproj") # Options for code signing propagated as env vars to Codesign.command via Xcode set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity") @@ -73,6 +82,7 @@ add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD "BUILT_PRODUCTS_DIR=$/.." "WRAPPER_NAME=${APP_NAME}.app" "APP_NAME=${APP_NAME}" + "CURRENT_ARCH=${ARCH}" ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command ) diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake index 624edf6..602ef3d 100644 --- a/cmake/scripts/linux/ArchSetup.cmake +++ b/cmake/scripts/linux/ArchSetup.cmake @@ -81,7 +81,6 @@ if(KODI_DEPENDSBUILD) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) endif() -find_package(CXX11 REQUIRED) include(LDGOLD) include(CheckIncludeFiles) diff --git a/cmake/scripts/linux/Install.cmake b/cmake/scripts/linux/Install.cmake index d64b98a..36c0299 100644 --- a/cmake/scripts/linux/Install.cmake +++ b/cmake/scripts/linux/Install.cmake @@ -20,7 +20,6 @@ set(APP_PREFIX ${prefix}) set(APP_LIB_DIR ${libdir}/${APP_NAME_LC}) set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC}) set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC}) -set(CXX11_SWITCH "-std=c++11") # Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone if(EXISTS ${CMAKE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) @@ -264,11 +263,11 @@ if(ENABLE_EVENTCLIENTS) COMPONENT kodi-eventclients-wiiremote) endif() - # Install kodi-eventclients-xbmc-send + # Install kodi-eventclients-kodi-send install(PROGRAMS ${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/KodiSend/kodi-send.py RENAME ${APP_NAME_LC}-send DESTINATION ${bindir} - COMPONENT kodi-eventclients-xbmc-send) + COMPONENT kodi-eventclients-kodi-send) endif() # Install XBT skin files diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake index 9ba0596..74f2ed4 100644 --- a/cmake/scripts/osx/ArchSetup.cmake +++ b/cmake/scripts/osx/ArchSetup.cmake @@ -25,8 +25,6 @@ endif() # Additional SYSTEM_DEFINES list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) -find_package(CXX11 REQUIRED) - list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit" diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index b94842f..032632c 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake @@ -32,9 +32,9 @@ set(DEPS_FOLDER_RELATIVE project/BuildDependencies) set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/${ARCH}) set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH}) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${MINGW_LIBS_DIR}) -list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${DEPENDENCIES_DIR}) +list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) +list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) +list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python) # -------- Compiler options --------- @@ -73,8 +73,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") link_directories(${DEPENDENCIES_DIR}/lib) # Additional libraries -list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib - PowrProf.lib setupapi.lib dwmapi.lib dxguid.lib DelayImp.lib) +list(APPEND DEPLIBS bcrypt.lib d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib + PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib) # NODEFAULTLIB option set(_nodefaultlibs_RELEASE libcmt) @@ -88,8 +88,7 @@ endforeach() # DELAYLOAD option set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll - avcodec-58.dll avfilter-7.dll avformat-58.dll avutil-56.dll - postproc-55.dll swresample-3.dll swscale-5.dll d3dcompiler_47.dll) + d3dcompiler_47.dll) foreach(_lib ${_delayloadlibs}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"") endforeach() diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake index e3e46e7..2e6d7cb 100644 --- a/cmake/scripts/windowsstore/ArchSetup.cmake +++ b/cmake/scripts/windowsstore/ArchSetup.cmake @@ -1,5 +1,5 @@ # Minimum SDK version we support -set(VS_MINIMUM_SDK_VERSION 10.0.16299.0) +set(VS_MINIMUM_SDK_VERSION 10.0.17763.0) if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION) message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n" @@ -49,10 +49,10 @@ set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/win10-${ARCH}) set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/win10-${ARCH}) # mingw libs -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${MINGW_LIBS_DIR}) -list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) +list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) +list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) # dependencies -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${DEPENDENCIES_DIR}) +list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) # for python set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python) @@ -91,7 +91,7 @@ set(gtest_force_shared_crt ON CACHE STRING "" FORCE) link_directories(${MINGW_LIBS_DIR}/lib ${DEPENDENCIES_DIR}/lib) -list(APPEND DEPLIBS d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib WindowsApp.lib) +list(APPEND DEPLIBS bcrypt.lib d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib WindowsApp.lib) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /WINMD:NO") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:msvcrt /DEBUG:FASTLINK /OPT:NOREF /OPT:NOICF") diff --git a/cmake/treedata/android/subdirs.txt b/cmake/treedata/android/subdirs.txt index 036fd24..335c331 100644 --- a/cmake/treedata/android/subdirs.txt +++ b/cmake/treedata/android/subdirs.txt @@ -1,17 +1,20 @@ -xbmc/cores/RetroPlayer/process/android cores/RetroPlayer/process/android -xbmc/input/touch input/touch -xbmc/input/touch/generic input/touch/generic -xbmc/windowing/android windowing/android -xbmc/platform/posix platform/posix -xbmc/platform/posix/filesystem platform/posix/filesystem -xbmc/platform/posix/utils platform/posix/utils -xbmc/platform/linux platform/linux -xbmc/platform/linux/peripherals platform/linux/peripherals -xbmc/platform/android/activity platform/android/activity -xbmc/platform/android/bionic_supplement platform/android/bionicsupplement -xbmc/platform/android/drm platform/android/drm -xbmc/platform/android/filesystem platform/android/filesystem -xbmc/platform/android/network platform/android/network -xbmc/platform/android/peripherals platform/android/peripherals -xbmc/platform/android/powermanagement platform/android/powermanagement -xbmc/platform/android/storage platform/android/storage +xbmc/cores/RetroPlayer/process/android cores/RetroPlayer/process/android +xbmc/cores/VideoPlayer/Process/android cores/VideoPlayer/Process/android +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic +xbmc/media/decoderfilter media/decoderfilter +xbmc/platform/android/activity platform/android/activity +xbmc/platform/android/bionic_supplement platform/android/bionicsupplement +xbmc/platform/android/filesystem platform/android/filesystem +xbmc/platform/android/media/decoderfilter platform/android/media/decoderfilter +xbmc/platform/android/media/drm platform/android/media/drm +xbmc/platform/android/network platform/android/network +xbmc/platform/android/peripherals platform/android/peripherals +xbmc/platform/android/powermanagement platform/android/powermanagement +xbmc/platform/android/storage platform/android/storage +xbmc/platform/linux platform/linux +xbmc/platform/linux/peripherals platform/linux/peripherals +xbmc/platform/posix platform/posix +xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/utils platform/posix/utils +xbmc/windowing/android windowing/android diff --git a/cmake/treedata/common/drm.txt b/cmake/treedata/common/drm.txt deleted file mode 100644 index fbcc906..0000000 --- a/cmake/treedata/common/drm.txt +++ /dev/null @@ -1 +0,0 @@ -xbmc/drm drm diff --git a/cmake/treedata/common/filesystem.txt b/cmake/treedata/common/filesystem.txt index 1c49a74..37a2536 100644 --- a/cmake/treedata/common/filesystem.txt +++ b/cmake/treedata/common/filesystem.txt @@ -1,3 +1,3 @@ xbmc/filesystem filesystem -xbmc/filesystem/VideoDatabaseDirectory filesystem/videodatabase xbmc/filesystem/MusicDatabaseDirectory filesystem/musicdatabase +xbmc/filesystem/VideoDatabaseDirectory filesystem/videodatabase diff --git a/cmake/treedata/common/media.txt b/cmake/treedata/common/media.txt new file mode 100644 index 0000000..519fece --- /dev/null +++ b/cmake/treedata/common/media.txt @@ -0,0 +1,2 @@ +xbmc/media media +xbmc/media/drm drm diff --git a/cmake/treedata/common/subdirs.txt b/cmake/treedata/common/subdirs.txt index 368f473..083e8ef 100644 --- a/cmake/treedata/common/subdirs.txt +++ b/cmake/treedata/common/subdirs.txt @@ -20,6 +20,7 @@ xbmc/favourites favourites xbmc/guilib guilib xbmc/guilib/guiinfo guilib_guiinfo xbmc/input input +xbmc/input/actions input/actions xbmc/input/joysticks input/joysticks xbmc/input/joysticks/dialogs input/joysticks/dialogs xbmc/input/joysticks/generic input/joysticks/generic @@ -29,7 +30,6 @@ xbmc/input/keyboard/generic input/keyboard/generic xbmc/input/mouse input/mouse xbmc/input/mouse/generic input/mouse/generic xbmc/listproviders listproviders -xbmc/media media xbmc/messaging messaging xbmc/messaging/helpers messagingHelpers xbmc/pictures pictures diff --git a/cmake/treedata/common/tests.txt b/cmake/treedata/common/tests.txt index 358bc4d..415eae6 100644 --- a/cmake/treedata/common/tests.txt +++ b/cmake/treedata/common/tests.txt @@ -1,10 +1,11 @@ -xbmc/test test xbmc/addons/test test/addons +xbmc/cores/AudioEngine/Sinks/test test/audioengine_sinks xbmc/filesystem/test test/filesystem xbmc/interfaces/python/test test/python xbmc/music/tags/test test/music_tags xbmc/network/test test/network +xbmc/playlists/test test/playlists +xbmc/test test xbmc/threads/test test/threads xbmc/utils/test test/utils xbmc/video/test test/video -xbmc/cores/AudioEngine/Sinks/test test/audioengine_sinks diff --git a/cmake/treedata/common/videoplayer.txt b/cmake/treedata/common/videoplayer.txt index 8c8d45d..ce6a757 100644 --- a/cmake/treedata/common/videoplayer.txt +++ b/cmake/treedata/common/videoplayer.txt @@ -8,5 +8,5 @@ xbmc/cores/VideoPlayer/DVDInputStreams cores/VideoPlayer/inputstream xbmc/cores/VideoPlayer/DVDSubtitles cores/VideoPlayer/subtitles xbmc/cores/VideoPlayer/Process cores/VideoPlayer/process xbmc/cores/VideoPlayer/VideoRenderers cores/VideoPlayer/videorenderers -xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders cores/VideoPlayer/videorenderers/shaders xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender cores/VideoPlayer/videorenderers/hwdec +xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders cores/VideoPlayer/videorenderers/shaders diff --git a/cmake/treedata/freebsd/subdirs.txt b/cmake/treedata/freebsd/subdirs.txt index e4edf23..fd8ed5f 100644 --- a/cmake/treedata/freebsd/subdirs.txt +++ b/cmake/treedata/freebsd/subdirs.txt @@ -1,6 +1,7 @@ -xbmc/platform/posix platform/posix -xbmc/platform/posix/filesystem platform/posix/filesystem -xbmc/platform/posix/utils platform/posix/utils +xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi +xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic xbmc/platform/freebsd platform/freebsd xbmc/platform/linux platform/linux xbmc/platform/linux/input platform/linux/input @@ -8,8 +9,7 @@ xbmc/platform/linux/network platform/linux/network xbmc/platform/linux/peripherals platform/linux/peripherals xbmc/platform/linux/powermanagement platform/linux/powermanagement xbmc/platform/linux/storage platform/linux/storage -xbmc/input/touch input/touch -xbmc/input/touch/generic input/touch/generic -xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi -xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi +xbmc/platform/posix platform/posix +xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/utils platform/posix/utils xbmc/windowing/linux windowing/linux diff --git a/cmake/treedata/ios/subdirs.txt b/cmake/treedata/ios/subdirs.txt index a287418..a3a03be 100644 --- a/cmake/treedata/ios/subdirs.txt +++ b/cmake/treedata/ios/subdirs.txt @@ -1,17 +1,15 @@ -xbmc/platform/linux platform/linux -xbmc/platform/linux/network platform/linux/network +xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios +xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios xbmc/input/touch input/touch xbmc/input/touch/generic input/touch/generic -xbmc/platform/posix posix -xbmc/platform/posix/filesystem platform/posix/filesystem -xbmc/platform/posix/utils platform/posix/utils xbmc/platform/darwin platform/darwin xbmc/platform/darwin/ios platform/ios xbmc/platform/darwin/ios-common platform/ios-common -xbmc/platform/darwin/osx/network platform/osx/network -xbmc/platform/darwin/osx/peripherals platform/osx/peripherals -xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement -xbmc/platform/darwin/osx/storage platform/osx/storage -xbmc/windowing/osx windowing/osx -xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios -xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios +xbmc/platform/darwin/network platform/darwin/network +xbmc/platform/darwin/storage platform/storage +xbmc/platform/linux platform/linux +xbmc/platform/linux/network platform/linux/network +xbmc/platform/posix posix +xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/utils platform/posix/utils +xbmc/windowing/ios windowing/ios diff --git a/cmake/treedata/linux/subdirs.txt b/cmake/treedata/linux/subdirs.txt index 6e1d013..7619e2e 100644 --- a/cmake/treedata/linux/subdirs.txt +++ b/cmake/treedata/linux/subdirs.txt @@ -1,14 +1,14 @@ -xbmc/platform/posix platform/posix -xbmc/platform/posix/filesystem platform/posix/filesystem -xbmc/platform/posix/utils platform/posix/utils +xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi +xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic xbmc/platform/linux platform/linux xbmc/platform/linux/input platform/linux/input xbmc/platform/linux/network platform/linux/network xbmc/platform/linux/peripherals platform/linux/peripherals xbmc/platform/linux/powermanagement platform/linux/powermanagement xbmc/platform/linux/storage platform/linux/storage -xbmc/input/touch input/touch -xbmc/input/touch/generic input/touch/generic -xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi -xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi +xbmc/platform/posix platform/posix +xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/utils platform/posix/utils xbmc/windowing/linux windowing/linux diff --git a/cmake/treedata/optional/common/X.txt b/cmake/treedata/optional/common/X.txt index e66ad80..a250537 100644 --- a/cmake/treedata/optional/common/X.txt +++ b/cmake/treedata/optional/common/X.txt @@ -1,3 +1,3 @@ -xbmc/windowing/X11 windowing/X11 # X xbmc/cores/RetroPlayer/process/X11 cores/RetroPlayer/process/X11 # X xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11 # X +xbmc/windowing/X11 windowing/X11 # X diff --git a/cmake/treedata/optional/common/aml.txt b/cmake/treedata/optional/common/aml.txt index 3d412d0..09bf2db 100644 --- a/cmake/treedata/optional/common/aml.txt +++ b/cmake/treedata/optional/common/aml.txt @@ -1,3 +1,2 @@ xbmc/cores/RetroPlayer/process/amlogic cores/RetroPlayer/process/amlogic # AML xbmc/windowing/amlogic windowing/amlogic # AML - diff --git a/cmake/treedata/optional/common/gbm.txt b/cmake/treedata/optional/common/gbm.txt index 196b323..5d898d4 100644 --- a/cmake/treedata/optional/common/gbm.txt +++ b/cmake/treedata/optional/common/gbm.txt @@ -1,2 +1,2 @@ xbmc/cores/RetroPlayer/process/gbm cores/RetroPlayer/process/gbm # GBM -xbmc/windowing/gbm windowing/gbm # GBM \ No newline at end of file +xbmc/windowing/gbm windowing/gbm # GBM diff --git a/cmake/treedata/optional/common/wayland.txt b/cmake/treedata/optional/common/wayland.txt index 4664b35..f8f77a6 100644 --- a/cmake/treedata/optional/common/wayland.txt +++ b/cmake/treedata/optional/common/wayland.txt @@ -1,3 +1,3 @@ -xbmc/windowing/wayland windowing/wayland # WAYLANDPP xbmc/cores/RetroPlayer/process/wayland cores/RetroPlayer/process/wayland # WAYLANDPP -xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland # WAYLANDPP \ No newline at end of file +xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland # WAYLANDPP +xbmc/windowing/wayland windowing/wayland # WAYLANDPP diff --git a/cmake/treedata/osx/subdirs.txt b/cmake/treedata/osx/subdirs.txt index 166a966..943c366 100644 --- a/cmake/treedata/osx/subdirs.txt +++ b/cmake/treedata/osx/subdirs.txt @@ -1,14 +1,14 @@ -xbmc/platform/posix posix -xbmc/platform/posix/filesystem platform/posix/filesystem -xbmc/platform/posix/utils platform/posix/utils -xbmc/platform/linux platform/linux -xbmc/platform/linux/network platform/linux/network +xbmc/cores/RetroPlayer/process/osx cores/RetroPlayer/process/osx +xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx xbmc/platform/darwin platform/darwin +xbmc/platform/darwin/network platform/darwin/network xbmc/platform/darwin/osx platform/osx -xbmc/platform/darwin/osx/network platform/osx/network xbmc/platform/darwin/osx/peripherals platform/osx/peripherals xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement -xbmc/platform/darwin/osx/storage platform/osx/storage +xbmc/platform/darwin/storage platform/storage +xbmc/platform/linux platform/linux +xbmc/platform/linux/network platform/linux/network +xbmc/platform/posix posix +xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/utils platform/posix/utils xbmc/windowing/osx windowing/osx -xbmc/cores/RetroPlayer/process/osx cores/RetroPlayer/process/osx -xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx diff --git a/cmake/treedata/windows/subdirs.txt b/cmake/treedata/windows/subdirs.txt index a2c8c29..0078758 100644 --- a/cmake/treedata/windows/subdirs.txt +++ b/cmake/treedata/windows/subdirs.txt @@ -1,17 +1,17 @@ +xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows +xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows +xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic +xbmc/network/mdns network/mdns xbmc/platform/win32 platform/win32 -xbmc/platform/win32/input platform/win32/input xbmc/platform/win32/filesystem platform/win32/filesystem +xbmc/platform/win32/input platform/win32/input xbmc/platform/win32/network platform/win32/network xbmc/platform/win32/peripherals platform/win32/peripherals xbmc/platform/win32/powermanagement platform/win32/powermanagement xbmc/platform/win32/storage platform/win32/storage xbmc/platform/win32/utils platform/win32/utils -xbmc/input/touch input/touch -xbmc/input/touch/generic input/touch/generic -xbmc/network/mdns network/mdns xbmc/rendering/dx rendering/dx xbmc/threads/platform/win threads/win xbmc/windowing/windows windowing/windows -xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows -xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows -xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows diff --git a/cmake/treedata/windowsstore/subdirs.txt b/cmake/treedata/windowsstore/subdirs.txt index 604be08..0644fd2 100644 --- a/cmake/treedata/windowsstore/subdirs.txt +++ b/cmake/treedata/windowsstore/subdirs.txt @@ -1,3 +1,7 @@ +xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic +xbmc/network/mdns network/mdns xbmc/platform/win10 platform/win10 xbmc/platform/win10/filesystem platform/win10/filesystem xbmc/platform/win10/network platform/win10/network @@ -6,10 +10,6 @@ xbmc/platform/win10/powermanagement platfrom/win10/powermanagement xbmc/platform/win10/storage platfrom/win10/storage xbmc/platform/win32/filesystem platform/win32/filesystem xbmc/platform/win32/utils platform/win32/utils -xbmc/input/touch input/touch -xbmc/input/touch/generic input/touch/generic -xbmc/network/mdns network/mdns xbmc/rendering/dx rendering/dx xbmc/threads/platform/win threads/win xbmc/windowing/win10 windowing/win10 -xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows diff --git a/version.txt b/version.txt index c27a42c..80f3277 100644 --- a/version.txt +++ b/version.txt @@ -1,11 +1,12 @@ APP_NAME Kodi COMPANY_NAME XBMC Foundation +COPYRIGHT_YEARS 2005-2018 WEBSITE http://kodi.tv -VERSION_MAJOR 18 +VERSION_MAJOR 19 VERSION_MINOR 0 -VERSION_TAG BETA4 -VERSION_CODE 17.99.804 -ADDON_API 17.9.804 +VERSION_TAG ALPHA1 +VERSION_CODE 18.9.701 +ADDON_API 18.9.701 APP_PACKAGE org.xbmc.kodi PACKAGE_IDENTITY XBMCFoundation.Kodi PACKAGE_PUBLISHER C62BD90A-CDD8-477F-96C3-B25992247B97 diff --git a/xbmc/addons/AddonBindings.cmake b/xbmc/addons/AddonBindings.cmake index 213b3e2..53a9801 100644 --- a/xbmc/addons/AddonBindings.cmake +++ b/xbmc/addons/AddonBindings.cmake @@ -6,7 +6,7 @@ set(CORE_ADDON_BINDINGS_FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h - ${CORE_SOURCE_DIR}/xbmc/input/ActionIDs.h + ${CORE_SOURCE_DIR}/xbmc/input/actions/ActionIDs.h ${CORE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h ) 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 42ce2e7..db39f86 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h @@ -43,6 +43,20 @@ #define ATTRIBUTE_HIDDEN #endif +#ifdef _MSC_VER + #define ATTRIBUTE_FORCEINLINE __forceinline +#elif defined(__GNUC__) + #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) +#elif defined(__CLANG__) + #if __has_attribute(__always_inline__) + #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) + #else + #define ATTRIBUTE_FORCEINLINE inline + #endif +#else + #define ATTRIBUTE_FORCEINLINE inline +#endif + #include "versions.h" namespace kodi { namespace addon { class CAddonBase; }} @@ -179,6 +193,7 @@ typedef struct KodiToAddonFuncTable_Addon ADDON_STATUS (*create_instance)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent); void (*destroy_instance)(int instanceType, KODI_HANDLE instance); ADDON_STATUS (*set_setting)(const char *settingName, const void *settingValue); + ADDON_STATUS(*create_instance_ex)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent, const char* version); } KodiToAddonFuncTable_Addon; /* @@ -237,6 +252,11 @@ public: return ADDON_STATUS_NOT_IMPLEMENTED; } + virtual ADDON_STATUS CreateInstanceEx(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance, const std::string &version) + { + return CreateInstance(instanceType, instanceID, instance, addonInstance); + } + const ADDON_TYPE m_type; }; } /* namespace addon */ @@ -278,6 +298,9 @@ public: CAddonBase::m_interface->toAddon->create_instance = ADDONBASE_CreateInstance; CAddonBase::m_interface->toAddon->destroy_instance = ADDONBASE_DestroyInstance; CAddonBase::m_interface->toAddon->set_setting = ADDONBASE_SetSetting; + // If version is present, we know that kodi has create_instance_ex implemented + if (!CAddonBase::m_strGlobalApiVersion.empty()) + CAddonBase::m_interface->toAddon->create_instance_ex = ADDONBASE_CreateInstanceEx; } virtual ~CAddonBase() = default; @@ -306,8 +329,14 @@ public: return ADDON_STATUS_UNKNOWN; } + virtual ADDON_STATUS CreateInstanceEx(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance, const std::string &version) + { + return CreateInstance(instanceType, instanceID, instance, addonInstance); + } + /* Global variables of class */ static AddonGlobalInterface* m_interface; // Interface function table to hold addresses on add-on and from kodi + static std::string m_strGlobalApiVersion; /*private:*/ /* Needed public as long the old call functions becomes used! */ static inline void ADDONBASE_Destroy() @@ -324,17 +353,22 @@ public: } static inline ADDON_STATUS ADDONBASE_CreateInstance(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent) + { + return ADDONBASE_CreateInstanceEx(instanceType, instanceID, instance, addonInstance, parent, ""); + } + + static inline ADDON_STATUS ADDONBASE_CreateInstanceEx(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent, const char* version) { ADDON_STATUS status = ADDON_STATUS_NOT_IMPLEMENTED; if (parent != nullptr) - status = static_cast(parent)->CreateInstance(instanceType, instanceID, instance, *addonInstance); + status = static_cast(parent)->CreateInstanceEx(instanceType, instanceID, instance, *addonInstance, version); if (status == ADDON_STATUS_NOT_IMPLEMENTED) - status = CAddonBase::m_interface->addonBase->CreateInstance(instanceType, instanceID, instance, *addonInstance); + status = CAddonBase::m_interface->addonBase->CreateInstanceEx(instanceType, instanceID, instance, *addonInstance, version); if (*addonInstance == nullptr) - throw std::logic_error("kodi::addon::CAddonBase CreateInstance returns a empty instance pointer!"); + throw std::logic_error("kodi::addon::CAddonBase CreateInstanceEx returns a empty instance pointer!"); if (static_cast<::kodi::addon::IAddonInstance*>(*addonInstance)->m_type != instanceType) - throw std::logic_error("kodi::addon::CAddonBase CreateInstance with difference on given and returned instance type!"); + throw std::logic_error("kodi::addon::CAddonBase CreateInstanceEx with difference on given and returned instance type!"); return status; } @@ -636,6 +670,11 @@ inline void* GetInterface(const std::string &name, const std::string &version) kodi::addon::CAddonBase::m_interface->addonBase = new AddonClass; \ return kodi::addon::CAddonBase::m_interface->addonBase->Create(); \ } \ + extern "C" __declspec(dllexport) ADDON_STATUS ADDON_CreateEx(KODI_HANDLE addonInterface, const char* globalApiVersion, void *unused) \ + { \ + kodi::addon::CAddonBase::m_strGlobalApiVersion = globalApiVersion; \ + return ADDON_Create(addonInterface, unused); \ + } \ extern "C" __declspec(dllexport) void ADDON_Destroy() \ { \ kodi::addon::CAddonBase::ADDONBASE_Destroy(); \ @@ -652,4 +691,10 @@ inline void* GetInterface(const std::string &name, const std::string &version) { \ return kodi::addon::GetTypeVersion(type); \ } \ - AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; + extern "C" __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) \ + { \ + return kodi::addon::GetTypeMinVersion(type); \ + } \ + AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; \ + std::string kodi::addon::CAddonBase::m_strGlobalApiVersion; + diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h index 30b6d89..a3b8bcb 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h @@ -106,7 +106,7 @@ namespace gui /// **Example:** /// ~~~~~~~~~~~~~{.cpp} /// .. - /// int wid = kodi::gui::GetCurrentWindowDialogId() + /// int wid = kodi::gui::GetCurrentWindowDialogId(); /// .. /// ~~~~~~~~~~~~~ /// @@ -130,7 +130,7 @@ namespace gui /// **Example:** /// ~~~~~~~~~~~~~{.cpp} /// .. - /// int wid = kodi::gui::GetCurrentWindowId() + /// int wid = kodi::gui::GetCurrentWindowId(); /// .. /// ~~~~~~~~~~~~~ /// @@ -141,5 +141,35 @@ namespace gui } //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui + /// \brief To get hardware specific device context interface + /// + /// \return The currently active device context + /// + /// \warning This function is only be supported under Windows, on all other + /// OS it return `nullptr`! + /// + /// \note Returned Windows class pointer is `ID3D11DeviceContext1`. + /// + /// + ///------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// #include + /// .. + /// ID3D11DeviceContext1* context = static_cast(kodi::gui::GetHWContext()); + /// .. + /// ~~~~~~~~~~~~~ + /// + inline void* GetHWContext() + { + using namespace ::kodi::addon; + return CAddonBase::m_interface->toKodi->kodi_gui->general->get_hw_context(CAddonBase::m_interface->toKodi->kodiBase); + } + //-------------------------------------------------------------------------- + } /* namespace gui */ } /* namespace kodi */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h index f188f34..e7a8a05 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h @@ -14,7 +14,7 @@ #ifdef BUILD_KODI_ADDON #include "../ActionIDs.h" #else -#include "input/ActionIDs.h" +#include "input/actions/ActionIDs.h" #endif namespace kodi diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h index 770a416..b8b4cbf 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h @@ -26,6 +26,7 @@ typedef struct AddonToKodiFuncTable_kodi_gui_general int (*get_video_resolution)(void* kodiBase); int (*get_current_window_dialog_id)(void* kodiBase); int (*get_current_window_id)(void* kodiBase); + void* (*get_hw_context)(void* kodiBase); } AddonToKodiFuncTable_kodi_gui_general; typedef struct AddonToKodiFuncTable_kodi_gui_control_button 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 478f81b..4338606 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 @@ -152,32 +152,43 @@ game_input_topology* GetTopology(); */ void FreeTopology(game_input_topology* topology); +/*! + * \brief Set the layouts for known controllers + * + * \param controllers The controller layouts + * \param controller_count The number of items in the array + * + * After loading the input topology, the frontend will call this with + * controller layouts for all controllers discovered in the topology. + */ +void SetControllerLayouts(const game_controller_layout* controllers, unsigned int controller_count); + /*! * \brief Enable/disable keyboard input using the specified controller * * \param enable True to enable input, false otherwise - * \param controller The controller info if enabling, or unused if disabling + * \param controller_id The controller ID if enabling, or unused if disabling * * \return True if keyboard input was enabled, false otherwise */ -bool EnableKeyboard(bool enable, const game_controller* controller); +bool EnableKeyboard(bool enable, const char* controller_id); /*! * \brief Enable/disable mouse input using the specified controller * * \param enable True to enable input, false otherwise - * \param controller The controller info if enabling, or unused if disabling + * \param controller_id The controller ID if enabling, or unused if disabling * * \return True if mouse input was enabled, false otherwise */ -bool EnableMouse(bool enable, const game_controller* controller); +bool EnableMouse(bool enable, const char* controller_id); /*! * \brief Connect/disconnect a controller to a port on the virtual game console * * \param connect True to connect a controller, false to disconnect * \param port_address The address of the port - * \param controller The controller info if connecting, or unused if disconnecting + * \param controller_id The controller ID if connecting, or unused if disconnecting * \return True if the \p controller was (dis-)connected to the port, false otherwise * * The address is a string that allows traversal of the controller topology. @@ -203,17 +214,17 @@ bool EnableMouse(bool enable, const game_controller* controller); * To connect a multitap to the console's first port, the multitap's controller * info is set using the port address: * - * 1 + * /1 * * To connect a SNES controller to the second port of the multitap, the * controller info is next set using the address: * - * 1/game.controller.multitap/2 + * /1/game.controller.multitap/2 * * Any attempts to connect a controller to a port on a disconnected multitap * will return false. */ -bool ConnectController(bool connect, const char* port_address, const game_controller* controller); +bool ConnectController(bool connect, const char* port_address, const char* controller_id); /*! * \brief Notify the add-on of an input event @@ -310,6 +321,7 @@ void __declspec(dllexport) get_addon(void* ptr) pClient->toAddon.HasFeature = HasFeature; pClient->toAddon.GetTopology = GetTopology; pClient->toAddon.FreeTopology = FreeTopology; + pClient->toAddon.SetControllerLayouts = SetControllerLayouts; pClient->toAddon.EnableKeyboard = EnableKeyboard; pClient->toAddon.EnableMouse = EnableMouse; pClient->toAddon.ConnectController = ConnectController; 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 e3187d2..ec9d472 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 @@ -446,19 +446,27 @@ typedef enum GAME_PORT_TYPE GAME_PORT_CONTROLLER, } GAME_PORT_TYPE; -typedef struct game_controller +typedef struct game_controller_layout { - const char* controller_id; + char* controller_id; bool provides_input; // False for multitaps + char** digital_buttons; unsigned int digital_button_count; + char** analog_buttons; unsigned int analog_button_count; + char** analog_sticks; unsigned int analog_stick_count; + char** accelerometers; unsigned int accelerometer_count; + char** keys; unsigned int key_count; + char** rel_pointers; unsigned int rel_pointer_count; + char** abs_pointers; unsigned int abs_pointer_count; + char** motors; unsigned int motor_count; -} ATTRIBUTE_PACKED game_controller; +} ATTRIBUTE_PACKED game_controller_layout; struct game_input_port; @@ -680,9 +688,10 @@ typedef struct KodiToAddonFuncTable_Game bool (__cdecl* HasFeature)(const char*, const char*); game_input_topology* (__cdecl* GetTopology)(); void (__cdecl* FreeTopology)(game_input_topology*); - bool (__cdecl* EnableKeyboard)(bool, const game_controller*); - bool (__cdecl* EnableMouse)(bool, const game_controller*); - bool (__cdecl* ConnectController)(bool, const char*, const game_controller*); + void (__cdecl* SetControllerLayouts)(const game_controller_layout*, unsigned int); + bool (__cdecl* EnableKeyboard)(bool, const char*); + bool (__cdecl* EnableMouse)(bool, const char*); + bool (__cdecl* ConnectController)(bool, const char*, const char*); bool (__cdecl* InputEvent)(const game_input_event*); size_t (__cdecl* SerializeSize)(void); 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 b518c28..2e6459b 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 @@ -135,15 +135,15 @@ public: // --- Input callbacks ------------------------------------------------------- /*! - * \brief Notify the port of an input event - * - * \param event The input event - * - * Input events can arrive for the following sources: - * - GAME_INPUT_EVENT_MOTOR - * - * \return true if the event was handled, false otherwise - */ + * \brief Notify the port of an input event + * + * \param event The input event + * + * Input events can arrive for the following sources: + * - GAME_INPUT_EVENT_MOTOR + * + * \return true if the event was handled, false otherwise + */ bool InputEvent(const game_input_event& event) { return m_callbacks->toKodi.InputEvent(m_callbacks->toKodi.kodiInstance, &event); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt index 939585c..ef2fa25 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt @@ -1,4 +1,5 @@ -set(HEADERS DllHelper.h ) +set(HEADERS DllHelper.h + Time.h) if(NOT ENABLE_STATIC_LIBS) core_add_library(addons_kodi-addon-dev-kit_include_kodi_tools) diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h new file mode 100644 index 0000000..31c29fd --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h @@ -0,0 +1,91 @@ +#pragma once +/* + * Copyright (C) 2005-2019 Team Kodi + * Copyright (C) 2011-2012 Pulse-Eight Limited. + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#if defined(TARGET_DARWIN) +#include +#include +#elif defined(TARGET_WINDOWS) +#include +#include +#else +#include +#endif + +namespace kodi +{ +namespace time +{ + +//=============================================================================== +/// @brief Function to get current time in milliseconds +/// +/// @return Current time in milliseconds as a double value +/// +/// +/// ----------------------------------------------------------------------------- +/// +/// **Example:** +/// ~~~~~~~~~~~~~{.cpp} +/// +/// #include +/// +/// ... +/// double time = kodi::time::GetTimeMs(); +/// ... +/// ~~~~~~~~~~~~~ +/// +inline double GetTimeMs() +{ +#if defined(TARGET_DARWIN) + return static_cast(CVGetCurrentHostTime() / static_cast(CVGetHostClockFrequency() * 0.001)); +#elif defined(TARGET_WINDOWS) + LARGE_INTEGER tickPerSecond; + LARGE_INTEGER tick; + if (QueryPerformanceFrequency(&tickPerSecond)) + { + QueryPerformanceCounter(&tick); + return static_cast(tick.QuadPart) / (tickPerSecond.QuadPart / 1000.0); + } + return 0.0; +#else + timespec time; + clock_gettime(CLOCK_MONOTONIC, &time); + return static_cast(time.tv_sec) * 1000.0 + time.tv_nsec / 1000000.0; +#endif +} +//------------------------------------------------------------------------------- + +//=============================================================================== +/// @brief Function to get current time in seconds +/// +/// @return Current time in seconds with the value type defined in the template +/// +/// +/// ----------------------------------------------------------------------------- +/// +/// **Example:** +/// ~~~~~~~~~~~~~{.cpp} +/// +/// #include +/// +/// ... +/// double time = kodi::time::GetTimeSec(); +/// ... +/// ~~~~~~~~~~~~~ +/// +template +inline T GetTimeSec() +{ + return static_cast(GetTimeMs()) / static_cast(1000.0); +} +//------------------------------------------------------------------------------- + +} /* namespace time */ +} /* 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 5127f7e..a9f1798 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h @@ -30,7 +30,7 @@ * overview. */ -#define ADDON_GLOBAL_VERSION_MAIN "1.0.13" +#define ADDON_GLOBAL_VERSION_MAIN "1.0.14" #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12" #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ @@ -44,7 +44,7 @@ #define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general" #define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h" -#define ADDON_GLOBAL_VERSION_GUI "5.12.0" +#define ADDON_GLOBAL_VERSION_GUI "5.12.1" #define ADDON_GLOBAL_VERSION_GUI_MIN "5.10.0" #define ADDON_GLOBAL_VERSION_GUI_XML_ID "kodi.binary.global.gui" #define ADDON_GLOBAL_VERSION_GUI_DEPENDS "libKODI_guilib.h" \ @@ -75,8 +75,8 @@ #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" -#define ADDON_INSTANCE_VERSION_GAME "1.0.38" -#define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.38" +#define ADDON_INSTANCE_VERSION_GAME "1.1.0" +#define ADDON_INSTANCE_VERSION_GAME_MIN "1.1.0" #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ "kodi_game_types.h" \ @@ -98,8 +98,8 @@ #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ "addon-instance/PeripheralUtils.h" -#define ADDON_INSTANCE_VERSION_PVR "5.10.3" -#define ADDON_INSTANCE_VERSION_PVR_MIN "5.10.0" +#define ADDON_INSTANCE_VERSION_PVR "6.0.0" +#define ADDON_INSTANCE_VERSION_PVR_MIN "6.0.0" #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ "xbmc_pvr_types.h" \ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h index e9e7d9a..ce2bc98 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h @@ -15,6 +15,7 @@ extern "C" { #endif ADDON_STATUS __declspec(dllexport) ADDON_Create(void *callbacks, void* props); + ADDON_STATUS __declspec(dllexport) ADDON_CreateEx(void *callbacks, const char* globalApiVersion, void* props); void __declspec(dllexport) ADDON_Destroy(); ADDON_STATUS __declspec(dllexport) ADDON_GetStatus(); ADDON_STATUS __declspec(dllexport) ADDON_SetSetting(const char *settingName, const void *settingValue); @@ -22,6 +23,10 @@ extern "C" { { return kodi::addon::GetTypeVersion(type); } + __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) + { + return kodi::addon::GetTypeMinVersion(type); + } #ifdef __cplusplus }; 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 7b11ed8..30503d5 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 @@ -100,7 +100,6 @@ extern "C" { time_t firstAired; /*!< @brief (optional) first aired in UTC */ int iParentalRating; /*!< @brief (optional) parental rating */ int iStarRating; /*!< @brief (optional) star rating */ - bool bNotify; /*!< @brief (optional) notify the user when this event starts */ int iSeriesNumber; /*!< @brief (optional) series number */ int iEpisodeNumber; /*!< @brief (optional) episode number */ int iEpisodePartNumber; /*!< @brief (optional) episode part number */ 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 27fa800..26e9099 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 @@ -78,14 +78,14 @@ extern "C" * Request the EPG for a channel from the backend. * EPG entries are added to Kodi by calling TransferEpgEntry() on the callback. * @param handle Handle to pass to the callback method. - * @param channel The channel to get the EPG table for. + * @param iChannelUid The UID of the channel to get the EPG table for. * @param iStart Get events after this time (UTC). * @param iEnd Get events before this time (UTC). * @return PVR_ERROR_NO_ERROR if the table has been fetched successfully. * @remarks Required if bSupportsEPG is set to true. * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ - PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channel, time_t iStart, time_t iEnd); + PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd); /* * Check if the given EPG tag can be recorded. @@ -413,6 +413,7 @@ extern "C" * @param channel The channel to stream. * @return True if the stream has been opened successfully, false otherwise. * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. + * CloseLiveStream() will always be called by Kodi prior to calling this function. * Return false if this add-on won't provide this function. */ bool OpenLiveStream(const PVR_CHANNEL& channel); @@ -497,7 +498,7 @@ extern "C" * Get the stream properties of the stream that's currently being read. * @param pProperties The properties of the currently playing stream. * @return PVR_ERROR_NO_ERROR if the properties have been fetched successfully. - * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. + * @remarks Required if bHandlesDemuxing is set to true. * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties); @@ -523,6 +524,7 @@ extern "C" * @param recording The recording to open. * @return True if the stream has been opened successfully, false otherwise. * @remarks Optional, and only used if bSupportsRecordings is set to true. + * CloseRecordedStream() will always be called by Kodi prior to calling this function. * Return false if this add-on won't provide this function. */ bool OpenRecordedStream(const PVR_RECORDING& recording); @@ -639,16 +641,17 @@ extern "C" void SetSpeed(int speed); /*! - * Get the hostname of the pvr backend server - * @return hostname as ip address or alias. If backend does not utilize a server, return empty string. + * Notify the pvr addon/demuxer that Kodi wishes to fill demux queue + * @param mode The requested filling mode + * @remarks Optional, and only used if addon has its own demuxer. */ - const char* GetBackendHostname(); + void FillBuffer(bool mode); /*! - * Check if timeshift is active - * @return true if timeshift is active + * Get the hostname of the pvr backend server + * @return hostname as ip address or alias. If backend does not utilize a server, return empty string. */ - bool IsTimeshifting(); + const char* GetBackendHostname(); /*! * Check for real-time streaming @@ -751,6 +754,7 @@ extern "C" pClient->toAddon.CanSeekStream = CanSeekStream; pClient->toAddon.SeekTime = SeekTime; pClient->toAddon.SetSpeed = SetSpeed; + pClient->toAddon.FillBuffer = FillBuffer; pClient->toAddon.OpenRecordedStream = OpenRecordedStream; pClient->toAddon.CloseRecordedStream = CloseRecordedStream; @@ -765,7 +769,6 @@ extern "C" pClient->toAddon.GetBackendHostname = GetBackendHostname; - pClient->toAddon.IsTimeshifting = IsTimeshifting; pClient->toAddon.IsRealTimeStream = IsRealTimeStream; pClient->toAddon.SetEPGTimeFrame = SetEPGTimeFrame; 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 f1562b6..999d3b3 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 @@ -55,8 +55,8 @@ struct DemuxPacket; #define PVR_ADDON_TIMERTYPE_ARRAY_SIZE 32 #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE 512 #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL 128 -#define PVR_ADDON_TIMERTYPE_STRING_LENGTH 64 -#define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 64 +#define PVR_ADDON_TIMERTYPE_STRING_LENGTH 128 +#define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 128 #define PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE 512 #define PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH 64 @@ -154,6 +154,7 @@ extern "C" { const unsigned int PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = 0x01000000; /*!< @brief this type supports 'any channel', for example when defining a timer rule that should match any channel instaed of a particular channel */ const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = 0x02000000; /*!< @brief this type should not appear on any create menus which don't provide an associated EPG tag with a series link */ const unsigned int PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = 0x04000000; /*!< @brief this type allows deletion of an otherwise read-only timer */ + const unsigned int PVR_TIMER_TYPE_IS_REMINDER = 0x08000000; /*!< @brief timers of this type do trigger a reminder if time is up by calling the Kodi callback 'ReminderNotification'. */ /*! * @brief PVR timer weekdays (PVR_TIMER.iWeekdays values) @@ -310,12 +311,10 @@ extern "C" { bool bSupportsRecordingsRename; /*!< @brief true if the backend supports renaming recordings. */ bool bSupportsRecordingsLifetimeChange; /*!< @brief true if the backend supports changing lifetime for recordings. */ bool bSupportsDescrambleInfo; /*!< @brief true if the backend supports descramble information for playing channels. */ + bool bSupportsAsyncEPGTransfer; /*!< @brief true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback function EpgEventStateChange. */ unsigned int iRecordingsLifetimesSize; /*!< @brief (required) Count of possible values for PVR_RECORDING.iLifetime. 0 means lifetime is not supported for recordings or no own value definition wanted, but to use Kodi defaults of 1..365. */ PVR_ATTRIBUTE_INT_VALUE recordingsLifetimeValues[PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE]; /*!< @brief (optional) Array containing the possible values for PVR_RECORDING.iLifetime. Must be filled if iLifetimesSize > 0 */ - - // TODO: cleanup: move this member up after the other bools with the next incompatible pvr addon api change. - bool bSupportsAsyncEPGTransfer; /*!< @brief true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback function EpgEventStateChange. */ } ATTRIBUTE_PACKED PVR_ADDON_CAPABILITIES; /*! @@ -402,6 +401,7 @@ extern "C" { unsigned int iEncryptionSystem; /*!< @brief (optional) the encryption ID or CaID of this channel */ char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) path to the channel icon (if present) */ bool bIsHidden; /*!< @brief (optional) true if this channel is marked as hidden */ + bool bHasArchive; /*!< @brief (optional) true if this channel has a server-side back buffer */ } ATTRIBUTE_PACKED PVR_CHANNEL; typedef struct PVR_CHANNEL_GROUP @@ -634,7 +634,7 @@ extern "C" { const char* (__cdecl* GetConnectionString)(void); PVR_ERROR (__cdecl* GetDriveSpace)(long long*, long long*); PVR_ERROR (__cdecl* MenuHook)(const PVR_MENUHOOK&, const PVR_MENUHOOK_DATA&); - PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, const PVR_CHANNEL&, time_t, time_t); + PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, int, time_t, time_t); PVR_ERROR (__cdecl* IsEPGTagRecordable)(const EPG_TAG*, bool*); PVR_ERROR (__cdecl* IsEPGTagPlayable)(const EPG_TAG*, bool*); PVR_ERROR (__cdecl* GetEPGTagEdl)(const EPG_TAG*, PVR_EDL_ENTRY[], int*); @@ -690,8 +690,8 @@ extern "C" { bool (__cdecl* CanSeekStream)(void); bool (__cdecl* SeekTime)(double, bool, double*); void (__cdecl* SetSpeed)(int); + void (__cdecl* FillBuffer)(bool); const char* (__cdecl* GetBackendHostname)(void); - bool (__cdecl* IsTimeshifting)(void); bool (__cdecl* IsRealTimeStream)(void); PVR_ERROR (__cdecl* SetEPGTimeFrame)(int); void (__cdecl* OnSystemSleep)(void); diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h index 5aed400..f8ceab2 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h @@ -24,7 +24,7 @@ typedef struct DemuxPacket uint8_t *pData = nullptr; int iSize = 0; int iStreamId = -1; - int64_t demuxerId; // id of the demuxer that created the packet + int64_t demuxerId = -1; // id of the demuxer that created the packet int iGroupId = -1; // the group this data belongs to, used to group data from different streams together void *pSideData = nullptr; diff --git a/xbmc/filesystem/IFileTypes.h b/xbmc/filesystem/IFileTypes.h index 7470b15..6817752 100644 --- a/xbmc/filesystem/IFileTypes.h +++ b/xbmc/filesystem/IFileTypes.h @@ -51,7 +51,7 @@ struct SCacheStatus uint64_t forward; /**< number of bytes cached forward of current position */ unsigned maxrate; /**< maximum number of bytes per second cache is allowed to fill */ unsigned currate; /**< average read rate from source file since last position change */ - float level; /**< cache level (0.0 - 1.0) */ + bool lowspeed; /**< cache low speed condition detected? */ }; typedef enum { diff --git a/xbmc/input/actions/ActionIDs.h b/xbmc/input/actions/ActionIDs.h new file mode 100644 index 0000000..9fd9d80 --- /dev/null +++ b/xbmc/input/actions/ActionIDs.h @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +/** + * \defgroup kodi_key_action_ids Action Id's + * \ingroup python_xbmcgui_window_cb + * \ingroup python_xbmcgui_action + * @{ + * @brief Actions that we have defined. + */ +#define ACTION_NONE 0 +#define ACTION_MOVE_LEFT 1 +#define ACTION_MOVE_RIGHT 2 +#define ACTION_MOVE_UP 3 +#define ACTION_MOVE_DOWN 4 +#define ACTION_PAGE_UP 5 +#define ACTION_PAGE_DOWN 6 +#define ACTION_SELECT_ITEM 7 +#define ACTION_HIGHLIGHT_ITEM 8 +#define ACTION_PARENT_DIR 9 +#define ACTION_PREVIOUS_MENU 10 +#define ACTION_SHOW_INFO 11 + +#define ACTION_PAUSE 12 +#define ACTION_STOP 13 +#define ACTION_NEXT_ITEM 14 +#define ACTION_PREV_ITEM 15 +#define ACTION_FORWARD 16 //!< Can be used to specify specific action in a window, Playback control is handled in ACTION_PLAYER_* +#define ACTION_REWIND 17 //!< Can be used to specify specific action in a window, Playback control is handled in ACTION_PLAYER_* + +#define ACTION_SHOW_GUI 18 //!< toggle between GUI and movie or GUI and visualisation. +#define ACTION_ASPECT_RATIO 19 //!< toggle quick-access zoom modes. Can b used in videoFullScreen.zml window id=2005 +#define ACTION_STEP_FORWARD 20 //!< seek +1% in the movie. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_STEP_BACK 21 //!< seek -1% in the movie. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_BIG_STEP_FORWARD 22 //!< seek +10% in the movie. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_BIG_STEP_BACK 23 //!< seek -10% in the movie. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_SHOW_OSD 24 //!< show/hide OSD. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_SHOW_SUBTITLES 25 //!< turn subtitles on/off. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_NEXT_SUBTITLE 26 //!< switch to next subtitle of movie. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_BROWSE_SUBTITLE 247 //!< Browse for subtitle. Can be used in videofullscreen +#define ACTION_PLAYER_DEBUG 27 //!< show debug info for VideoPlayer +#define ACTION_NEXT_PICTURE 28 //!< show next picture of slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_PREV_PICTURE 29 //!< show previous picture of slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_OUT 30 //!< zoom in picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_IN 31 //!< zoom out picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_TOGGLE_SOURCE_DEST 32 //!< used to toggle between source view and destination view. Can be used in myfiles.xml window id=3 +#define ACTION_SHOW_PLAYLIST 33 //!< used to toggle between current view and playlist view. Can b used in all mymusic xml files +#define ACTION_QUEUE_ITEM 34 //!< used to queue a item to the playlist. Can b used in all mymusic xml files +#define ACTION_REMOVE_ITEM 35 //!< not used anymore +#define ACTION_SHOW_FULLSCREEN 36 //!< not used anymore +#define ACTION_ZOOM_LEVEL_NORMAL 37 //!< zoom 1x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_1 38 //!< zoom 2x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_2 39 //!< zoom 3x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_3 40 //!< zoom 4x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_4 41 //!< zoom 5x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_5 42 //!< zoom 6x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_6 43 //!< zoom 7x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_7 44 //!< zoom 8x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_8 45 //!< zoom 9x picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ZOOM_LEVEL_9 46 //!< zoom 10x picture during slideshow. Can b used in slideshow.xml window id=2007 + +#define ACTION_CALIBRATE_SWAP_ARROWS 47 //!< select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11 +#define ACTION_CALIBRATE_RESET 48 //!< reset calibration to defaults. Can b used in: `settingsScreenCalibration.xml` windowid=11/settingsUICalibration.xml windowid=10 +#define ACTION_ANALOG_MOVE 49 //!< analog thumbstick move. Can b used in: `slideshow.xml` windowid=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10 + //!< @note see also ACTION_ANALOG_MOVE_X_LEFT, ACTION_ANALOG_MOVE_X_RIGHT, ACTION_ANALOG_MOVE_Y_UP, ACTION_ANALOG_MOVE_Y_DOWN +#define ACTION_ROTATE_PICTURE_CW 50 //!< rotate current picture clockwise during slideshow. Can be used in slideshow.xml window id=2007 +#define ACTION_ROTATE_PICTURE_CCW 51 //!< rotate current picture counterclockwise during slideshow. Can be used in slideshow.xml window id=2007 + +#define ACTION_SUBTITLE_DELAY_MIN 52 //!< Decrease subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_SUBTITLE_DELAY_PLUS 53 //!< Increase subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_AUDIO_DELAY_MIN 54 //!< Increase avsync delay. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_AUDIO_DELAY_PLUS 55 //!< Decrease avsync delay. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_AUDIO_NEXT_LANGUAGE 56 //!< Select next language in movie. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_CHANGE_RESOLUTION 57 //!< switch 2 next resolution. Can b used during screen calibration settingsScreenCalibration.xml windowid=11 + +#define REMOTE_0 58 //!< remote keys 0-9. are used by multiple windows +#define REMOTE_1 59 //!< for example in videoFullScreen.xml window id=2005 you can +#define REMOTE_2 60 //!< enter time (mmss) to jump to particular point in the movie +#define REMOTE_3 61 +#define REMOTE_4 62 //!< with spincontrols you can enter 3digit number to quickly set +#define REMOTE_5 63 //!< spincontrol to desired value +#define REMOTE_6 64 +#define REMOTE_7 65 +#define REMOTE_8 66 +#define REMOTE_9 67 + +#define ACTION_PLAYER_PROCESS_INFO 69 //!< show player process info (video decoder, pixel format, pvr signal strength and the like +#define ACTION_PLAYER_PROGRAM_SELECT 70 +#define ACTION_PLAYER_RESOLUTION_SELECT 71 +#define ACTION_SMALL_STEP_BACK 76 //!< jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005 + +#define ACTION_PLAYER_FORWARD 77 //!< FF in current file played. global action, can be used anywhere +#define ACTION_PLAYER_REWIND 78 //!< RW in current file played. global action, can be used anywhere +#define ACTION_PLAYER_PLAY 79 //!< Play current song. Unpauses song and sets playspeed to 1x. global action, can be used anywhere + +#define ACTION_DELETE_ITEM 80 //!< delete current selected item. Can be used in myfiles.xml window id=3 and in myvideoTitle.xml window id=25 +#define ACTION_COPY_ITEM 81 //!< copy current selected item. Can be used in myfiles.xml window id=3 +#define ACTION_MOVE_ITEM 82 //!< move current selected item. Can be used in myfiles.xml window id=3 +#define ACTION_TAKE_SCREENSHOT 85 //!< take a screenshot +#define ACTION_RENAME_ITEM 87 //!< rename item + +#define ACTION_VOLUME_UP 88 +#define ACTION_VOLUME_DOWN 89 +#define ACTION_VOLAMP 90 +#define ACTION_MUTE 91 +#define ACTION_NAV_BACK 92 +#define ACTION_VOLAMP_UP 93 +#define ACTION_VOLAMP_DOWN 94 + +#define ACTION_CREATE_EPISODE_BOOKMARK 95 //!< Creates an episode bookmark on the currently playing video file containing more than one episode +#define ACTION_CREATE_BOOKMARK 96 //!< Creates a bookmark of the currently playing video file + +#define ACTION_CHAPTER_OR_BIG_STEP_FORWARD 97 //!< Goto the next chapter, if not available perform a big step forward +#define ACTION_CHAPTER_OR_BIG_STEP_BACK 98 //!< Goto the previous chapter, if not available perform a big step back + +#define ACTION_CYCLE_SUBTITLE 99 //!< switch to next subtitle of movie, but will not enable/disable the subtitles. Can be used in videoFullScreen.xml window id=2005 + +#define ACTION_MOUSE_START 100 +#define ACTION_MOUSE_LEFT_CLICK 100 +#define ACTION_MOUSE_RIGHT_CLICK 101 +#define ACTION_MOUSE_MIDDLE_CLICK 102 +#define ACTION_MOUSE_DOUBLE_CLICK 103 +#define ACTION_MOUSE_WHEEL_UP 104 +#define ACTION_MOUSE_WHEEL_DOWN 105 +#define ACTION_MOUSE_DRAG 106 +#define ACTION_MOUSE_MOVE 107 +#define ACTION_MOUSE_LONG_CLICK 108 +#define ACTION_MOUSE_END 109 + +#define ACTION_BACKSPACE 110 +#define ACTION_SCROLL_UP 111 +#define ACTION_SCROLL_DOWN 112 +#define ACTION_ANALOG_FORWARD 113 +#define ACTION_ANALOG_REWIND 114 + +#define ACTION_MOVE_ITEM_UP 115 //!< move item up in playlist +#define ACTION_MOVE_ITEM_DOWN 116 //!< move item down in playlist +#define ACTION_CONTEXT_MENU 117 //!< pops up the context menu + +// stuff for virtual keyboard shortcuts +#define ACTION_SHIFT 118 //!< stuff for virtual keyboard shortcuts +#define ACTION_SYMBOLS 119 //!< stuff for virtual keyboard shortcuts +#define ACTION_CURSOR_LEFT 120 //!< stuff for virtual keyboard shortcuts +#define ACTION_CURSOR_RIGHT 121 //!< stuff for virtual keyboard shortcuts + +#define ACTION_BUILT_IN_FUNCTION 122 + +#define ACTION_SHOW_OSD_TIME 123 //!< displays current time, can be used in videoFullScreen.xml window id=2005 +#define ACTION_ANALOG_SEEK_FORWARD 124 //!< seeks forward, and displays the seek bar. +#define ACTION_ANALOG_SEEK_BACK 125 //!< seeks backward, and displays the seek bar. + +#define ACTION_VIS_PRESET_SHOW 126 +#define ACTION_VIS_PRESET_NEXT 128 +#define ACTION_VIS_PRESET_PREV 129 +#define ACTION_VIS_PRESET_LOCK 130 +#define ACTION_VIS_PRESET_RANDOM 131 +#define ACTION_VIS_RATE_PRESET_PLUS 132 +#define ACTION_VIS_RATE_PRESET_MINUS 133 + +#define ACTION_SHOW_VIDEOMENU 134 +#define ACTION_ENTER 135 + +#define ACTION_INCREASE_RATING 136 +#define ACTION_DECREASE_RATING 137 + +#define ACTION_NEXT_SCENE 138 //!< switch to next scene/cutpoint in movie +#define ACTION_PREV_SCENE 139 //!< switch to previous scene/cutpoint in movie + +#define ACTION_NEXT_LETTER 140 //!< jump through a list or container by letter +#define ACTION_PREV_LETTER 141 + +#define ACTION_JUMP_SMS2 142 //!< jump direct to a particular letter using SMS-style input +#define ACTION_JUMP_SMS3 143 +#define ACTION_JUMP_SMS4 144 +#define ACTION_JUMP_SMS5 145 +#define ACTION_JUMP_SMS6 146 +#define ACTION_JUMP_SMS7 147 +#define ACTION_JUMP_SMS8 148 +#define ACTION_JUMP_SMS9 149 + +#define ACTION_FILTER_CLEAR 150 +#define ACTION_FILTER_SMS2 151 +#define ACTION_FILTER_SMS3 152 +#define ACTION_FILTER_SMS4 153 +#define ACTION_FILTER_SMS5 154 +#define ACTION_FILTER_SMS6 155 +#define ACTION_FILTER_SMS7 156 +#define ACTION_FILTER_SMS8 157 +#define ACTION_FILTER_SMS9 158 + +#define ACTION_FIRST_PAGE 159 +#define ACTION_LAST_PAGE 160 + +#define ACTION_AUDIO_DELAY 161 +#define ACTION_SUBTITLE_DELAY 162 +#define ACTION_MENU 163 + +#define ACTION_SET_RATING 164 + +#define ACTION_RECORD 170 + +#define ACTION_PASTE 180 +#define ACTION_NEXT_CONTROL 181 +#define ACTION_PREV_CONTROL 182 +#define ACTION_CHANNEL_SWITCH 183 +#define ACTION_CHANNEL_UP 184 +#define ACTION_CHANNEL_DOWN 185 +#define ACTION_NEXT_CHANNELGROUP 186 +#define ACTION_PREVIOUS_CHANNELGROUP 187 +#define ACTION_PVR_PLAY 188 +#define ACTION_PVR_PLAY_TV 189 +#define ACTION_PVR_PLAY_RADIO 190 +#define ACTION_PVR_SHOW_TIMER_RULE 191 +#define ACTION_CHANNEL_NUMBER_SEP 192 +#define ACTION_PVR_ANNOUNCE_REMINDERS 193 + +#define ACTION_TOGGLE_FULLSCREEN 199 //!< switch 2 desktop resolution +#define ACTION_TOGGLE_WATCHED 200 //!< Toggle watched status (videos) +#define ACTION_SCAN_ITEM 201 //!< scan item +#define ACTION_TOGGLE_DIGITAL_ANALOG 202 //!< switch digital <-> analog +#define ACTION_RELOAD_KEYMAPS 203 //!< reloads CButtonTranslator's keymaps +#define ACTION_GUIPROFILE_BEGIN 204 //!< start the GUIControlProfiler running + +#define ACTION_TELETEXT_RED 215 //!< Teletext Color button Red to control TopText +#define ACTION_TELETEXT_GREEN 216 //!< Teletext Color button Green to control TopText +#define ACTION_TELETEXT_YELLOW 217 //!< Teletext Color button Yellow to control TopText +#define ACTION_TELETEXT_BLUE 218 //!< Teletext Color button Blue to control TopText + +#define ACTION_INCREASE_PAR 219 +#define ACTION_DECREASE_PAR 220 + +#define ACTION_VSHIFT_UP 227 //!< shift up video image in VideoPlayer +#define ACTION_VSHIFT_DOWN 228 //!< shift down video image in VideoPlayer + +#define ACTION_PLAYER_PLAYPAUSE 229 //!< Play/pause. If playing it pauses, if paused it plays. + +#define ACTION_SUBTITLE_VSHIFT_UP 230 //!< shift up subtitles in VideoPlayer +#define ACTION_SUBTITLE_VSHIFT_DOWN 231 //!< shift down subtitles in VideoPlayer +#define ACTION_SUBTITLE_ALIGN 232 //!< toggle vertical alignment of subtitles + +#define ACTION_FILTER 233 + +#define ACTION_SWITCH_PLAYER 234 + +#define ACTION_STEREOMODE_NEXT 235 +#define ACTION_STEREOMODE_PREVIOUS 236 +#define ACTION_STEREOMODE_TOGGLE 237 //!< turns 3d mode on/off +#define ACTION_STEREOMODE_SELECT 238 +#define ACTION_STEREOMODE_TOMONO 239 +#define ACTION_STEREOMODE_SET 240 + +#define ACTION_SETTINGS_RESET 241 +#define ACTION_SETTINGS_LEVEL_CHANGE 242 + +#define ACTION_TRIGGER_OSD 243 //!< show autoclosing OSD. Can b used in videoFullScreen.xml window id=2005 +#define ACTION_INPUT_TEXT 244 +#define ACTION_VOLUME_SET 245 +#define ACTION_TOGGLE_COMMSKIP 246 + +#define ACTION_PLAYER_RESET 248 //!< Send a reset command to the active game + +#define ACTION_TOGGLE_FONT 249 //!< Toggle font. Used in TextViewer dialog + +#define ACTION_VIDEO_NEXT_STREAM 250 //!< Cycle video streams. Used in videofullscreen. +#define ACTION_QUEUE_ITEM_NEXT 251 //!< used to queue an item to the next position in the playlist + +// Voice actions +#define ACTION_VOICE_RECOGNIZE 300 + +// Touch actions +#define ACTION_TOUCH_TAP 401 //!< touch actions +#define ACTION_TOUCH_TAP_TEN 410 //!< touch actions +#define ACTION_TOUCH_LONGPRESS 411 //!< touch actions +#define ACTION_TOUCH_LONGPRESS_TEN 420 //!< touch actions + +#define ACTION_GESTURE_NOTIFY 500 +#define ACTION_GESTURE_BEGIN 501 +#define ACTION_GESTURE_ZOOM 502 //!< sendaction with point and currentPinchScale (fingers together < 1.0 -> fingers apart > 1.0) +#define ACTION_GESTURE_ROTATE 503 +#define ACTION_GESTURE_PAN 504 +#define ACTION_GESTURE_ABORT 505 //!< gesture was interrupted in unspecified state + +#define ACTION_GESTURE_SWIPE_LEFT 511 +#define ACTION_GESTURE_SWIPE_LEFT_TEN 520 +#define ACTION_GESTURE_SWIPE_RIGHT 521 +#define ACTION_GESTURE_SWIPE_RIGHT_TEN 530 +#define ACTION_GESTURE_SWIPE_UP 531 +#define ACTION_GESTURE_SWIPE_UP_TEN 540 +#define ACTION_GESTURE_SWIPE_DOWN 541 +#define ACTION_GESTURE_SWIPE_DOWN_TEN 550 +// 5xx is reserved for additional gesture actions +#define ACTION_GESTURE_END 599 + +// other, non-gesture actions +#define ACTION_ANALOG_MOVE_X_LEFT 601 //!< analog thumbstick move, horizontal axis, left; see ACTION_ANALOG_MOVE +#define ACTION_ANALOG_MOVE_X_RIGHT 602 //!< analog thumbstick move, horizontal axis, right; see ACTION_ANALOG_MOVE +#define ACTION_ANALOG_MOVE_Y_UP 603 //!< analog thumbstick move, vertical axis, up; see ACTION_ANALOG_MOVE +#define ACTION_ANALOG_MOVE_Y_DOWN 604 //!< analog thumbstick move, vertical axis, down; see ACTION_ANALOG_MOVE +//@} + +// The NOOP action can be specified to disable an input event. This is +// useful in user keyboard.xml etc to disable actions specified in the +// system mappings. ERROR action is used to play an error sound +#define ACTION_ERROR 998 +#define ACTION_NOOP 999 diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt index e32fb7a..a028c7d 100644 --- a/xbmc/interfaces/json-rpc/schema/version.txt +++ b/xbmc/interfaces/json-rpc/schema/version.txt @@ -1 +1 @@ -JSONRPC_VERSION 9.6.1 +JSONRPC_VERSION 10.5.0 -- cgit v1.2.3