diff options
| author | manuel <manuel@mausz.at> | 2021-03-04 23:36:40 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2021-03-04 23:36:40 +0100 |
| commit | 3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f (patch) | |
| tree | 921f4829b32126f80f9113c124f2e14c0ebce8d9 | |
| parent | be933ef2241d79558f91796cc5b3a161f72ebf9c (diff) | |
| download | kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.tar.gz kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.tar.bz2 kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.zip | |
sync with upstreamMatrix
113 files changed, 4178 insertions, 1243 deletions
diff --git a/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt b/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt index db25aa2..a346242 100644 --- a/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt +++ b/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt | |||
| @@ -1 +1 @@ | |||
| pvr.dvbviewer https://github.com/manuelm/pvr.dvbviewer master \ No newline at end of file | pvr.dvbviewer https://github.com/manuelm/pvr.dvbviewer Matrix \ No newline at end of file | ||
diff --git a/cmake/installdata/common/addons.txt b/cmake/installdata/common/addons.txt index 897420f..5a9aef2 100644 --- a/cmake/installdata/common/addons.txt +++ b/cmake/installdata/common/addons.txt | |||
| @@ -42,5 +42,7 @@ addons/metadata.common.themoviedb.org/* | |||
| 42 | addons/metadata.generic.albums/* | 42 | addons/metadata.generic.albums/* |
| 43 | addons/metadata.generic.artists/* | 43 | addons/metadata.generic.artists/* |
| 44 | addons/metadata.themoviedb.org/* | 44 | addons/metadata.themoviedb.org/* |
| 45 | addons/metadata.themoviedb.org.python/* | ||
| 45 | addons/metadata.tvshows.themoviedb.org/* | 46 | addons/metadata.tvshows.themoviedb.org/* |
| 47 | addons/metadata.tvshows.themoviedb.org.python/* | ||
| 46 | addons/kodi.vfs/* | 48 | addons/kodi.vfs/* |
diff --git a/cmake/modules/FindCCache.cmake b/cmake/modules/FindCCache.cmake index a18d4e0..0f6463b 100644 --- a/cmake/modules/FindCCache.cmake +++ b/cmake/modules/FindCCache.cmake | |||
| @@ -16,8 +16,8 @@ if(CCACHE_FOUND) | |||
| 16 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") | 16 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") |
| 17 | set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}") | 17 | set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}") |
| 18 | 18 | ||
| 19 | file(WRITE "${CMAKE_BINARY_DIR}/launch-c" "exec \"${CCACHE_PROGRAM}\" \"${CMAKE_C_COMPILER}\" \"$@\"\n") | 19 | file(WRITE "${CMAKE_BINARY_DIR}/launch-c" "#!/bin/sh\nexec \"${CCACHE_PROGRAM}\" \"${CMAKE_C_COMPILER}\" \"$@\"\n") |
| 20 | file(WRITE "${CMAKE_BINARY_DIR}/launch-cxx" "exec \"${CCACHE_PROGRAM}\" \"${CMAKE_CXX_COMPILER}\" \"$@\"\n") | 20 | file(WRITE "${CMAKE_BINARY_DIR}/launch-cxx" "#!/bin/sh\nexec \"${CCACHE_PROGRAM}\" \"${CMAKE_CXX_COMPILER}\" \"$@\"\n") |
| 21 | execute_process(COMMAND chmod +x "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") | 21 | execute_process(COMMAND chmod +x "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") |
| 22 | 22 | ||
| 23 | set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c" PARENT_SCOPE) | 23 | set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c" PARENT_SCOPE) |
diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake index 465ecc6..3a10b06 100644 --- a/cmake/modules/FindCdio.cmake +++ b/cmake/modules/FindCdio.cmake | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | if(PKG_CONFIG_FOUND) | 12 | if(PKG_CONFIG_FOUND) |
| 13 | pkg_check_modules(PC_CDIO libcdio>=0.80 QUIET) | 13 | pkg_check_modules(PC_CDIO libcdio>=0.80 QUIET) |
| 14 | pkg_check_modules(PC_CDIOPP libcdio++>=2.1.0 QUIET) | ||
| 14 | endif() | 15 | endif() |
| 15 | 16 | ||
| 16 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h | 17 | find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h |
| @@ -19,7 +20,14 @@ find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h | |||
| 19 | find_library(CDIO_LIBRARY NAMES cdio libcdio | 20 | find_library(CDIO_LIBRARY NAMES cdio libcdio |
| 20 | PATHS ${PC_CDIO_LIBDIR}) | 21 | PATHS ${PC_CDIO_LIBDIR}) |
| 21 | 22 | ||
| 22 | set(CDIO_VERSION ${PC_CDIO_VERSION}) | 23 | if(DEFINED PC_CDIO_VERSION AND DEFINED PC_CDIOPP_VERSION AND NOT "${PC_CDIO_VERSION}" VERSION_EQUAL "${PC_CDIOPP_VERSION}") |
| 24 | message(WARNING "Detected libcdio (${PC_CDIO_VERSION}) and libcdio++ (${PC_CDIOPP_VERSION}) version mismatch. libcdio++ will not be used.") | ||
| 25 | else() | ||
| 26 | find_path(CDIOPP_INCLUDE_DIR NAMES cdio++/cdio.hpp | ||
| 27 | PATHS ${PC_CDIOPP_INCLUDEDIR} ${CDIO_INCLUDE_DIR}) | ||
| 28 | |||
| 29 | set(CDIO_VERSION ${PC_CDIO_VERSION}) | ||
| 30 | endif() | ||
| 23 | 31 | ||
| 24 | include(FindPackageHandleStandardArgs) | 32 | include(FindPackageHandleStandardArgs) |
| 25 | find_package_handle_standard_args(Cdio | 33 | find_package_handle_standard_args(Cdio |
| @@ -31,4 +39,4 @@ if(CDIO_FOUND) | |||
| 31 | set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR}) | 39 | set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR}) |
| 32 | endif() | 40 | endif() |
| 33 | 41 | ||
| 34 | mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY) | 42 | mark_as_advanced(CDIO_INCLUDE_DIR CDIOPP_INCLUDE_DIR CDIO_LIBRARY) |
diff --git a/cmake/modules/FindIso9660pp.cmake b/cmake/modules/FindIso9660pp.cmake index 5f84b55..f98273b 100644 --- a/cmake/modules/FindIso9660pp.cmake +++ b/cmake/modules/FindIso9660pp.cmake | |||
| @@ -15,6 +15,8 @@ if(PKG_CONFIG_FOUND) | |||
| 15 | pkg_check_modules(PC_ISO9660 libiso9660>=2.1.0 QUIET) | 15 | pkg_check_modules(PC_ISO9660 libiso9660>=2.1.0 QUIET) |
| 16 | endif() | 16 | endif() |
| 17 | 17 | ||
| 18 | find_package(Cdio) | ||
| 19 | |||
| 18 | find_path(ISO9660PP_INCLUDE_DIR NAMES cdio++/iso9660.hpp | 20 | find_path(ISO9660PP_INCLUDE_DIR NAMES cdio++/iso9660.hpp |
| 19 | PATHS ${PC_ISO9660PP_INCLUDEDIR}) | 21 | PATHS ${PC_ISO9660PP_INCLUDEDIR}) |
| 20 | 22 | ||
| @@ -31,12 +33,12 @@ set(ISO9660PP_VERSION ${PC_ISO9660PP_VERSION}) | |||
| 31 | 33 | ||
| 32 | include(FindPackageHandleStandardArgs) | 34 | include(FindPackageHandleStandardArgs) |
| 33 | find_package_handle_standard_args(Iso9660pp | 35 | find_package_handle_standard_args(Iso9660pp |
| 34 | REQUIRED_VARS ISO9660PP_LIBRARY ISO9660PP_INCLUDE_DIR ISO9660_LIBRARY ISO9660_INCLUDE_DIR | 36 | REQUIRED_VARS ISO9660PP_LIBRARY ISO9660PP_INCLUDE_DIR ISO9660_LIBRARY ISO9660_INCLUDE_DIR CDIO_LIBRARY CDIO_INCLUDE_DIR CDIOPP_INCLUDE_DIR |
| 35 | VERSION_VAR ISO9660PP_VERSION) | 37 | VERSION_VAR ISO9660PP_VERSION) |
| 36 | 38 | ||
| 37 | if(ISO9660PP_FOUND) | 39 | if(ISO9660PP_FOUND) |
| 38 | set(ISO9660PP_LIBRARIES ${ISO9660PP_LIBRARY} ${ISO9660_LIBRARY}) | 40 | set(ISO9660PP_LIBRARIES ${ISO9660PP_LIBRARY} ${ISO9660_LIBRARY} ${CDIO_LIBRARY}) |
| 39 | set(ISO9660PP_INCLUDE_DIRS ${ISO9660PP_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR}) | 41 | set(ISO9660PP_INCLUDE_DIRS ${CDIO_INCLUDE_DIR} ${CDIOPP_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR} ${ISO9660PP_INCLUDE_DIR}) |
| 40 | set(ISO9660PP_DEFINITIONS -DHAS_ISO9660PP=1) | 42 | set(ISO9660PP_DEFINITIONS -DHAS_ISO9660PP=1) |
| 41 | endif() | 43 | endif() |
| 42 | 44 | ||
diff --git a/cmake/modules/FindPulseAudio.cmake b/cmake/modules/FindPulseAudio.cmake index 2ef7910..829a2d8 100644 --- a/cmake/modules/FindPulseAudio.cmake +++ b/cmake/modules/FindPulseAudio.cmake | |||
| @@ -14,14 +14,10 @@ | |||
| 14 | # | 14 | # |
| 15 | # PulseAudio::PulseAudio - The PulseAudio library | 15 | # PulseAudio::PulseAudio - The PulseAudio library |
| 16 | 16 | ||
| 17 | if(NOT PulseAudio_FIND_VERSION) | ||
| 18 | set(PulseAudio_FIND_VERSION 2.0.0) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | if(PKG_CONFIG_FOUND) | 17 | if(PKG_CONFIG_FOUND) |
| 22 | pkg_check_modules(PC_PULSEAUDIO libpulse>=${PulseAudio_FIND_VERSION} QUIET) | 18 | pkg_check_modules(PC_PULSEAUDIO libpulse>=11.0.0 QUIET) |
| 23 | pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib QUIET) | 19 | pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib>=11.0.0 QUIET) |
| 24 | pkg_check_modules(PC_PULSEAUDIO_SIMPLE libpulse-simple QUIET) | 20 | pkg_check_modules(PC_PULSEAUDIO_SIMPLE libpulse-simple>=11.0.0 QUIET) |
| 25 | endif() | 21 | endif() |
| 26 | 22 | ||
| 27 | find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h pulse/simple.h | 23 | find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h pulse/simple.h |
diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake index e39d4e5..7bbda13 100644 --- a/cmake/modules/FindPython.cmake +++ b/cmake/modules/FindPython.cmake | |||
| @@ -10,8 +10,8 @@ if(PKG_CONFIG_FOUND) | |||
| 10 | endif() | 10 | endif() |
| 11 | 11 | ||
| 12 | find_program(PYTHON_EXECUTABLE python3 ONLY_CMAKE_FIND_ROOT_PATH) | 12 | find_program(PYTHON_EXECUTABLE python3 ONLY_CMAKE_FIND_ROOT_PATH) |
| 13 | find_library(PYTHON_LIBRARY NAMES python3.8 python3.7 python3.6 python3.5 PATHS ${PC_PYTHON_LIBDIR}) | 13 | find_library(PYTHON_LIBRARY NAMES python3.9 python3.8 python3.7 python3.6 python3.5 PATHS ${PC_PYTHON_LIBDIR}) |
| 14 | find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} PATH_SUFFIXES python3.8 python3.7 python3.6 python3.5) | 14 | find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} PATH_SUFFIXES python3.9 python3.8 python3.7 python3.6 python3.5) |
| 15 | 15 | ||
| 16 | if(KODI_DEPENDSBUILD) | 16 | if(KODI_DEPENDSBUILD) |
| 17 | find_library(FFI_LIBRARY ffi REQUIRED) | 17 | find_library(FFI_LIBRARY ffi REQUIRED) |
diff --git a/cmake/modules/FindVAAPI.cmake b/cmake/modules/FindVAAPI.cmake index 2111e4f..f0a5d05 100644 --- a/cmake/modules/FindVAAPI.cmake +++ b/cmake/modules/FindVAAPI.cmake | |||
| @@ -24,14 +24,14 @@ find_path(VAAPI_libva-drm_INCLUDE_DIR va/va_drm.h | |||
| 24 | PATHS ${PC_VAAPI_libva-drm_INCLUDEDIR}) | 24 | PATHS ${PC_VAAPI_libva-drm_INCLUDEDIR}) |
| 25 | find_library(VAAPI_libva-drm_LIBRARY NAMES va-drm | 25 | find_library(VAAPI_libva-drm_LIBRARY NAMES va-drm |
| 26 | PATHS ${PC_VAAPI_libva-drm_LIBDIR}) | 26 | PATHS ${PC_VAAPI_libva-drm_LIBDIR}) |
| 27 | if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") | 27 | if("wayland" IN_LIST CORE_PLATFORM_NAME_LC) |
| 28 | find_path(VAAPI_libva-wayland_INCLUDE_DIR va/va_wayland.h | 28 | find_path(VAAPI_libva-wayland_INCLUDE_DIR va/va_wayland.h |
| 29 | PATHS ${PC_VAAPI_libva-wayland_INCLUDEDIR}) | 29 | PATHS ${PC_VAAPI_libva-wayland_INCLUDEDIR}) |
| 30 | find_library(VAAPI_libva-wayland_LIBRARY NAMES va-wayland | 30 | find_library(VAAPI_libva-wayland_LIBRARY NAMES va-wayland |
| 31 | PATHS ${PC_VAAPI_libva-wayland_LIBDIR}) | 31 | PATHS ${PC_VAAPI_libva-wayland_LIBDIR}) |
| 32 | list(APPEND REQUIRED_VARS "VAAPI_libva-wayland_INCLUDE_DIR" "VAAPI_libva-wayland_LIBRARY") | 32 | list(APPEND REQUIRED_VARS "VAAPI_libva-wayland_INCLUDE_DIR" "VAAPI_libva-wayland_LIBRARY") |
| 33 | endif() | 33 | endif() |
| 34 | if(CORE_PLATFORM_NAME_LC STREQUAL "x11") | 34 | if("x11" IN_LIST CORE_PLATFORM_NAME_LC) |
| 35 | find_path(VAAPI_libva-x11_INCLUDE_DIR va/va_x11.h | 35 | find_path(VAAPI_libva-x11_INCLUDE_DIR va/va_x11.h |
| 36 | PATHS ${PC_VAAPI_libva-x11_INCLUDEDIR}) | 36 | PATHS ${PC_VAAPI_libva-x11_INCLUDEDIR}) |
| 37 | find_library(VAAPI_libva-x11_LIBRARY NAMES va-x11 | 37 | find_library(VAAPI_libva-x11_LIBRARY NAMES va-x11 |
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake index 3cfc282..ba229d7 100644 --- a/cmake/modules/FindWaylandpp.cmake +++ b/cmake/modules/FindWaylandpp.cmake | |||
| @@ -11,12 +11,19 @@ | |||
| 11 | # WAYLANDPP_SCANNER - path to wayland-scanner++ | 11 | # WAYLANDPP_SCANNER - path to wayland-scanner++ |
| 12 | 12 | ||
| 13 | pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET) | 13 | pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET) |
| 14 | pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET) | 14 | |
| 15 | if(PC_WAYLANDPP_FOUND) | 15 | if(PC_WAYLANDPP_FOUND) |
| 16 | pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) | 16 | pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) |
| 17 | else() | ||
| 18 | message(SEND_ERROR "wayland-client++ not found via pkg-config") | ||
| 17 | endif() | 19 | endif() |
| 20 | |||
| 21 | pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET) | ||
| 22 | |||
| 18 | if(PC_WAYLANDPP_SCANNER_FOUND) | 23 | if(PC_WAYLANDPP_SCANNER_FOUND) |
| 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) | 24 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) |
| 25 | else() | ||
| 26 | message(SEND_ERROR "wayland-scanner++ not found via pkg-config") | ||
| 20 | endif() | 27 | endif() |
| 21 | 28 | ||
| 22 | find_path(WAYLANDPP_INCLUDE_DIR wayland-client.hpp PATHS ${PC_WAYLANDPP_INCLUDEDIR}) | 29 | find_path(WAYLANDPP_INCLUDE_DIR wayland-client.hpp PATHS ${PC_WAYLANDPP_INCLUDEDIR}) |
diff --git a/cmake/platform/freebsd/x11.cmake b/cmake/platform/freebsd/x11.cmake index 09cebde..307dac3 100644 --- a/cmake/platform/freebsd/x11.cmake +++ b/cmake/platform/freebsd/x11.cmake | |||
| @@ -1,3 +1,2 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) | 1 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) | 2 | list(APPEND PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) |
| 3 | set(APP_RENDER_SYSTEM gl) | ||
diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake index 75b23f3..8f17ef6 100644 --- a/cmake/platform/linux/gbm.cmake +++ b/cmake/platform/linux/gbm.cmake | |||
| @@ -1,17 +1,8 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS EGL GBM LibDRM LibInput Xkbcommon) | 1 | list(APPEND PLATFORM_REQUIRED_DEPS EGL GBM LibDRM LibInput Xkbcommon) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) | 2 | list(APPEND PLATFORM_OPTIONAL_DEPS VAAPI) |
| 3 | 3 | ||
| 4 | set(GBM_RENDER_SYSTEM "" CACHE STRING "Render system to use with GBM: \"gl\" or \"gles\"") | 4 | if(APP_RENDER_SYSTEM STREQUAL "gl") |
| 5 | |||
| 6 | if(GBM_RENDER_SYSTEM STREQUAL "gl") | ||
| 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) | 5 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) |
| 8 | set(APP_RENDER_SYSTEM gl) | 6 | elseif(APP_RENDER_SYSTEM STREQUAL "gles") |
| 9 | elseif(GBM_RENDER_SYSTEM STREQUAL "gles") | ||
| 10 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) | 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) |
| 11 | set(APP_RENDER_SYSTEM gles) | ||
| 12 | else() | ||
| 13 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the GBM windowing system. Please set GBM_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") | ||
| 14 | endif() | 8 | endif() |
| 15 | |||
| 16 | # __GBM__ is needed by eglplatform.h in case it is included before gbm.h | ||
| 17 | list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11 -D__GBM__=1 -DPLATFORM_SETTINGS_FILE=gbm.xml) | ||
diff --git a/cmake/platform/linux/wayland.cmake b/cmake/platform/linux/wayland.cmake index 916b578..1adcd8f 100644 --- a/cmake/platform/linux/wayland.cmake +++ b/cmake/platform/linux/wayland.cmake | |||
| @@ -1,21 +1,14 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS WaylandProtocols>=1.7 Waylandpp>=0.2.2 LibDRM Xkbcommon>=0.4.1) | 1 | list(APPEND PLATFORM_REQUIRED_DEPS WaylandProtocols>=1.7 Waylandpp>=0.2.2 LibDRM Xkbcommon>=0.4.1) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) | 2 | list(APPEND PLATFORM_OPTIONAL_DEPS VAAPI) |
| 3 | 3 | ||
| 4 | set(WAYLAND_RENDER_SYSTEM "" CACHE STRING "Render system to use with Wayland: \"gl\" or \"gles\"") | 4 | if(APP_RENDER_SYSTEM STREQUAL "gl") |
| 5 | |||
| 6 | if(WAYLAND_RENDER_SYSTEM STREQUAL "gl") | ||
| 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl EGL) | 5 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl EGL) |
| 8 | set(APP_RENDER_SYSTEM gl) | 6 | elseif(APP_RENDER_SYSTEM STREQUAL "gles") |
| 9 | elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles") | ||
| 10 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES EGL) | 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES EGL) |
| 11 | set(APP_RENDER_SYSTEM gles) | ||
| 12 | else() | ||
| 13 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") | ||
| 14 | endif() | 8 | endif() |
| 15 | 9 | ||
| 16 | set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols) | 10 | set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols) |
| 17 | set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}") | 11 | set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}") |
| 18 | # WL_EGL_PLATFORM is needed by eglplatform.h in case it is included before wayland-egl.h | 12 | |
| 19 | list(APPEND PLATFORM_DEFINES -DWL_EGL_PLATFORM=1 -DPLATFORM_SETTINGS_FILE=wayland.xml) | ||
| 20 | # for wayland-extra-protocols.hpp | 13 | # for wayland-extra-protocols.hpp |
| 21 | include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}") | 14 | include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}") |
diff --git a/cmake/platform/linux/x11.cmake b/cmake/platform/linux/x11.cmake index 5d7f3d4..5f5b8c2 100644 --- a/cmake/platform/linux/x11.cmake +++ b/cmake/platform/linux/x11.cmake | |||
| @@ -1,17 +1,9 @@ | |||
| 1 | set(PLATFORM_REQUIRED_DEPS EGL X XRandR LibDRM) | 1 | list(APPEND PLATFORM_REQUIRED_DEPS EGL X XRandR LibDRM) |
| 2 | set(PLATFORM_OPTIONAL_DEPS VAAPI) | 2 | list(APPEND PLATFORM_OPTIONAL_DEPS VAAPI) |
| 3 | 3 | ||
| 4 | set(X11_RENDER_SYSTEM "" CACHE STRING "Render system to use with X11: \"gl\" or \"gles\"") | 4 | if(APP_RENDER_SYSTEM STREQUAL "gl") |
| 5 | |||
| 6 | if(X11_RENDER_SYSTEM STREQUAL "gl") | ||
| 7 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) | 5 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) |
| 8 | list(APPEND PLATFORM_OPTIONAL_DEPS GLX VDPAU) | 6 | list(APPEND PLATFORM_OPTIONAL_DEPS GLX VDPAU) |
| 9 | set(APP_RENDER_SYSTEM gl) | 7 | elseif(APP_RENDER_SYSTEM STREQUAL "gles") |
| 10 | elseif(X11_RENDER_SYSTEM STREQUAL "gles") | ||
| 11 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) | 8 | list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) |
| 12 | set(APP_RENDER_SYSTEM gles) | ||
| 13 | else() | ||
| 14 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the X11 windowing system. Please set X11_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") | ||
| 15 | endif() | 9 | endif() |
| 16 | |||
| 17 | list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=x11.xml) \ No newline at end of file | ||
diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake index 5b7b411..1dc33af 100644 --- a/cmake/scripts/android/Install.cmake +++ b/cmake/scripts/android/Install.cmake | |||
| @@ -70,6 +70,7 @@ set(package_files strings.xml | |||
| 70 | src/XBMCProperties.java | 70 | src/XBMCProperties.java |
| 71 | src/XBMCVideoView.java | 71 | src/XBMCVideoView.java |
| 72 | src/XBMCFile.java | 72 | src/XBMCFile.java |
| 73 | src/XBMCURIUtils.java | ||
| 73 | src/channels/SyncChannelJobService.java | 74 | src/channels/SyncChannelJobService.java |
| 74 | src/channels/SyncProgramsJobService.java | 75 | src/channels/SyncProgramsJobService.java |
| 75 | src/channels/model/XBMCDatabase.java | 76 | src/channels/model/XBMCDatabase.java |
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index d896651..757d3ee 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake | |||
| @@ -221,11 +221,19 @@ function(copy_file_to_buildtree file) | |||
| 221 | endif() | 221 | endif() |
| 222 | 222 | ||
| 223 | if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile}) | 223 | if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile}) |
| 224 | if(VERBOSE) | 224 | if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" OR NOT IS_SYMLINK "${file}") |
| 225 | message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | 225 | if(VERBOSE) |
| 226 | message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | ||
| 227 | endif() | ||
| 228 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 229 | "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n" ) | ||
| 230 | else() | ||
| 231 | if(VERBOSE) | ||
| 232 | message(STATUS "copy_file_to_buildtree - copying symlinked file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | ||
| 233 | endif() | ||
| 234 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 235 | "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy_if_different \"${file}\" \"${CMAKE_BINARY_DIR}/${outfile}\")\n") | ||
| 226 | endif() | 236 | endif() |
| 227 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 228 | "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") | ||
| 229 | endif() | 237 | endif() |
| 230 | 238 | ||
| 231 | if(NOT arg_NO_INSTALL) | 239 | if(NOT arg_NO_INSTALL) |
diff --git a/cmake/scripts/common/Platform.cmake b/cmake/scripts/common/Platform.cmake index 5ac233a..397d8d4 100644 --- a/cmake/scripts/common/Platform.cmake +++ b/cmake/scripts/common/Platform.cmake | |||
| @@ -3,10 +3,13 @@ if(NOT CORE_SYSTEM_NAME) | |||
| 3 | endif() | 3 | endif() |
| 4 | 4 | ||
| 5 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) | 5 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) |
| 6 | # Set default CORE_PLATFORM_NAME to X11 | 6 | # Set default CORE_PLATFORM_NAME to X11 WAYLAND GBM |
| 7 | # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> | 7 | # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> |
| 8 | set(_DEFAULT_PLATFORM X11) | 8 | set(_DEFAULT_PLATFORM X11 WAYLAND GBM) |
| 9 | option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) | 9 | |
| 10 | if(NOT APP_RENDER_SYSTEM) | ||
| 11 | message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering. Please set APP_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") | ||
| 12 | endif() | ||
| 10 | else() | 13 | else() |
| 11 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) | 14 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) |
| 12 | endif() | 15 | endif() |
| @@ -18,20 +21,37 @@ set(APP_BINARY_SUFFIX ".bin") | |||
| 18 | # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead | 21 | # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead |
| 19 | # | 22 | # |
| 20 | if(NOT CORE_PLATFORM_NAME) | 23 | if(NOT CORE_PLATFORM_NAME) |
| 21 | set(CORE_PLATFORM_NAME ${_DEFAULT_PLATFORM} CACHE STRING "Platform port to build") | 24 | set(CORE_PLATFORM_NAME ${_DEFAULT_PLATFORM}) |
| 22 | endif() | 25 | endif() |
| 26 | set(CORE_PLATFORM_NAME ${CORE_PLATFORM_NAME} CACHE STRING "Platform port to build" FORCE) | ||
| 23 | unset(_DEFAULT_PLATFORM) | 27 | unset(_DEFAULT_PLATFORM) |
| 24 | string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC) | ||
| 25 | 28 | ||
| 26 | list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") | 29 | string(REPLACE " " ";" CORE_PLATFORM_NAME "${CORE_PLATFORM_NAME}") |
| 27 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 30 | foreach(platform IN LISTS CORE_PLATFORM_NAME) |
| 28 | include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 31 | string(TOLOWER ${platform} platform) |
| 29 | if(ENABLE_APP_AUTONAME) | 32 | list(APPEND CORE_PLATFORM_NAME_LC ${platform}) |
| 30 | set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") | 33 | endforeach() |
| 34 | |||
| 35 | string(REPLACE ";" " " CORE_PLATFORM_STRING "${CORE_PLATFORM_NAME_LC}") | ||
| 36 | list(APPEND final_message "Platforms: ${CORE_PLATFORM_STRING}") | ||
| 37 | |||
| 38 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) | ||
| 39 | list(LENGTH CORE_PLATFORM_NAME_LC PLATFORM_COUNT) | ||
| 40 | if(PLATFORM_COUNT EQUAL 1) | ||
| 41 | option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) | ||
| 42 | if(ENABLE_APP_AUTONAME) | ||
| 43 | set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") | ||
| 44 | endif() | ||
| 31 | endif() | 45 | endif() |
| 32 | else() | ||
| 33 | file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ | ||
| 34 | ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) | ||
| 35 | string(REPLACE ".cmake" " " _platformnames ${_platformnames}) | ||
| 36 | message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") | ||
| 37 | endif() | 46 | endif() |
| 47 | |||
| 48 | foreach(CORE_PLATFORM_LC IN LISTS CORE_PLATFORM_NAME_LC) | ||
| 49 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_LC}.cmake) | ||
| 50 | include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_LC}.cmake) | ||
| 51 | else() | ||
| 52 | file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ | ||
| 53 | ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) | ||
| 54 | string(REPLACE ".cmake" " " _platformnames ${_platformnames}) | ||
| 55 | message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") | ||
| 56 | endif() | ||
| 57 | endforeach() | ||
diff --git a/cmake/scripts/darwin_embedded/Install.cmake b/cmake/scripts/darwin_embedded/Install.cmake index af18277..02464ee 100644 --- a/cmake/scripts/darwin_embedded/Install.cmake +++ b/cmake/scripts/darwin_embedded/Install.cmake | |||
| @@ -122,11 +122,6 @@ endif() | |||
| 122 | set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) | 122 | set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) |
| 123 | configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in | 123 | configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in |
| 124 | ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh @ONLY) | 124 | ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh @ONLY) |
| 125 | |||
| 126 | if(CORE_PLATFORM_NAME_LC STREQUAL ios) | ||
| 127 | configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh.in | ||
| 128 | ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh @ONLY) | ||
| 129 | endif() | ||
| 130 | 125 | ||
| 131 | add_custom_target(deb | 126 | add_custom_target(deb |
| 132 | COMMAND sh ./mkdeb-darwin_embedded.sh ${CORE_BUILD_CONFIG} | 127 | COMMAND sh ./mkdeb-darwin_embedded.sh ${CORE_BUILD_CONFIG} |
diff --git a/cmake/scripts/linux/ExtraTargets.cmake b/cmake/scripts/linux/ExtraTargets.cmake index 37d196a..61c76a8 100644 --- a/cmake/scripts/linux/ExtraTargets.cmake +++ b/cmake/scripts/linux/ExtraTargets.cmake | |||
| @@ -14,7 +14,7 @@ if(ENABLE_EVENTCLIENTS AND BLUETOOTH_FOUND) | |||
| 14 | endif() | 14 | endif() |
| 15 | endif() | 15 | endif() |
| 16 | 16 | ||
| 17 | if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") | 17 | if("wayland" IN_LIST CORE_PLATFORM_NAME_LC) |
| 18 | # This cannot go into wayland.cmake since it requires the Wayland dependencies | 18 | # This cannot go into wayland.cmake since it requires the Wayland dependencies |
| 19 | # to already be resolved | 19 | # to already be resolved |
| 20 | set(PROTOCOL_XMLS "${WAYLANDPP_PROTOCOLS_DIR}/presentation-time.xml" | 20 | set(PROTOCOL_XMLS "${WAYLANDPP_PROTOCOLS_DIR}/presentation-time.xml" |
diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake index 7d8f58b..f723aa2 100644 --- a/cmake/scripts/osx/ArchSetup.cmake +++ b/cmake/scripts/osx/ArchSetup.cmake | |||
| @@ -23,6 +23,8 @@ else() | |||
| 23 | endif() | 23 | endif() |
| 24 | endif() | 24 | endif() |
| 25 | 25 | ||
| 26 | set(CMAKE_OSX_ARCHITECTURES ${CPU}) | ||
| 27 | |||
| 26 | # Additional SYSTEM_DEFINES | 28 | # Additional SYSTEM_DEFINES |
| 27 | list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_OSX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) | 29 | list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_OSX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) |
| 28 | 30 | ||
diff --git a/cmake/scripts/osx/Install.cmake b/cmake/scripts/osx/Install.cmake index 629bc09..2ae41f5 100644 --- a/cmake/scripts/osx/Install.cmake +++ b/cmake/scripts/osx/Install.cmake | |||
| @@ -52,6 +52,7 @@ add_custom_target(dmg | |||
| 52 | "DEV_TEAM=${DEV_TEAM}" | 52 | "DEV_TEAM=${DEV_TEAM}" |
| 53 | "EXPANDED_CODE_SIGN_IDENTITY_NAME=${CODE_SIGN_IDENTITY}" | 53 | "EXPANDED_CODE_SIGN_IDENTITY_NAME=${CODE_SIGN_IDENTITY}" |
| 54 | "PLATFORM_NAME=${PLATFORM}" | 54 | "PLATFORM_NAME=${PLATFORM}" |
| 55 | "XCODE_BUILDTYPE=${CMAKE_CFG_INTDIR}" | ||
| 55 | ./mkdmg-osx.sh ${CORE_BUILD_CONFIG_LOWERCASED} | 56 | ./mkdmg-osx.sh ${CORE_BUILD_CONFIG_LOWERCASED} |
| 56 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) | 57 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) |
| 57 | set_target_properties(dmg PROPERTIES FOLDER "Build Utilities") | 58 | set_target_properties(dmg PROPERTIES FOLDER "Build Utilities") |
diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index f3628f2..9c382da 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake | |||
| @@ -32,9 +32,11 @@ set(DEPS_FOLDER_RELATIVE project/BuildDependencies) | |||
| 32 | set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/${ARCH}) | 32 | set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/${ARCH}) |
| 33 | set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH}) | 33 | set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH}) |
| 34 | 34 | ||
| 35 | # mingw libs | ||
| 35 | list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) | 36 | list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) |
| 36 | list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) | 37 | list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) |
| 37 | list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) | 38 | # dependencies |
| 39 | list(PREPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) | ||
| 38 | 40 | ||
| 39 | # -------- Compiler options --------- | 41 | # -------- Compiler options --------- |
| 40 | 42 | ||
diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake index ad55a01..5a90683 100644 --- a/cmake/scripts/windowsstore/ArchSetup.cmake +++ b/cmake/scripts/windowsstore/ArchSetup.cmake | |||
| @@ -52,7 +52,7 @@ set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/win10-$ | |||
| 52 | list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) | 52 | list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) |
| 53 | list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) | 53 | list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) |
| 54 | # dependencies | 54 | # dependencies |
| 55 | list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) | 55 | list(PREPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) |
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | # -------- Compiler options --------- | 58 | # -------- Compiler options --------- |
diff --git a/cmake/treedata/common/subdirs.txt b/cmake/treedata/common/subdirs.txt index 1988d5b..ac1ee12 100644 --- a/cmake/treedata/common/subdirs.txt +++ b/cmake/treedata/common/subdirs.txt | |||
| @@ -9,10 +9,12 @@ xbmc/addons/interfaces/gui/controls addons_interfaces_gui_controls | |||
| 9 | xbmc/addons/interfaces/gui/dialogs addons_interfaces_gui_dialogs | 9 | xbmc/addons/interfaces/gui/dialogs addons_interfaces_gui_dialogs |
| 10 | xbmc/addons/kodi-dev-kit/include/kodi addons_kodi-dev-kit_include_kodi | 10 | xbmc/addons/kodi-dev-kit/include/kodi addons_kodi-dev-kit_include_kodi |
| 11 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance addons_kodi-dev-kit_include_kodi_addon-instance | 11 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance addons_kodi-dev-kit_include_kodi_addon-instance |
| 12 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream addons_kodi-dev-kit_include_kodi_addon-instance_inputstream | ||
| 12 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/peripheral addons_kodi-dev-kit_include_kodi_addon-instance_peripheral | 13 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/peripheral addons_kodi-dev-kit_include_kodi_addon-instance_peripheral |
| 13 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr addons_kodi-dev-kit_include_kodi_addon-instance_pvr | 14 | xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr addons_kodi-dev-kit_include_kodi_addon-instance_pvr |
| 14 | xbmc/addons/kodi-dev-kit/include/kodi/c-api addons_kodi-dev-kit_include_kodi_c-api | 15 | xbmc/addons/kodi-dev-kit/include/kodi/c-api addons_kodi-dev-kit_include_kodi_c-api |
| 15 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance addons_kodi-dev-kit_include_kodi_c-api_addon-instance | 16 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance addons_kodi-dev-kit_include_kodi_c-api_addon-instance |
| 17 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream addons_kodi-dev-kit_include_kodi_c-api_addon-instance_inputstream | ||
| 16 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr addons_kodi-dev-kit_include_kodi_c-api_addon-instance_pvr | 18 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr addons_kodi-dev-kit_include_kodi_c-api_addon-instance_pvr |
| 17 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui addons_kodi-dev-kit_include_kodi_c-api_gui | 19 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui addons_kodi-dev-kit_include_kodi_c-api_gui |
| 18 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls addons_kodi-dev-kit_include_kodi_c-api_gui_controls | 20 | xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls addons_kodi-dev-kit_include_kodi_c-api_gui_controls |
diff --git a/version.txt b/version.txt index 260b336..4cef763 100644 --- a/version.txt +++ b/version.txt | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | APP_NAME Kodi | 1 | APP_NAME Kodi |
| 2 | COMPANY_NAME XBMC Foundation | 2 | COMPANY_NAME XBMC Foundation |
| 3 | COPYRIGHT_YEARS 2005-2020 | 3 | COPYRIGHT_YEARS 2005-2021 |
| 4 | WEBSITE http://kodi.tv | 4 | WEBSITE http://kodi.tv |
| 5 | VERSION_MAJOR 19 | 5 | VERSION_MAJOR 19 |
| 6 | VERSION_MINOR 0 | 6 | VERSION_MINOR 0 |
| 7 | VERSION_TAG ALPHA2 | 7 | VERSION_TAG |
| 8 | VERSION_CODE 18.9.702 | 8 | VERSION_CODE 19.0.0 |
| 9 | ADDON_API 18.9.702 | 9 | ADDON_API 19.0.0 |
| 10 | ADDON_REPOS repository.xbmc.org|https://mirrors.kodi.tv | 10 | ADDON_REPOS repository.xbmc.org|https://mirrors.kodi.tv |
| 11 | APP_PACKAGE org.xbmc.kodi | 11 | APP_PACKAGE org.xbmc.kodi |
| 12 | PACKAGE_IDENTITY XBMCFoundation.Kodi | 12 | PACKAGE_IDENTITY XBMCFoundation.Kodi |
diff --git a/xbmc/addons/AddonBindings.cmake b/xbmc/addons/AddonBindings.cmake index 11cf190..b89478e 100644 --- a/xbmc/addons/AddonBindings.cmake +++ b/xbmc/addons/AddonBindings.cmake | |||
| @@ -8,5 +8,4 @@ set(CORE_ADDON_BINDINGS_FILES | |||
| 8 | 8 | ||
| 9 | set(CORE_ADDON_BINDINGS_DIRS | 9 | set(CORE_ADDON_BINDINGS_DIRS |
| 10 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-dev-kit/include/kodi/ | 10 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-dev-kit/include/kodi/ |
| 11 | ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/Interface/Addon | ||
| 12 | ) | 11 | ) |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/AddonBase.h b/xbmc/addons/kodi-dev-kit/include/kodi/AddonBase.h index 6ab4159..06b22d5 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/AddonBase.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/AddonBase.h | |||
| @@ -32,7 +32,7 @@ namespace kodi | |||
| 32 | namespace gui | 32 | namespace gui |
| 33 | { | 33 | { |
| 34 | struct IRenderHelper; | 34 | struct IRenderHelper; |
| 35 | } // namespace gui | 35 | } /* namespace gui */ |
| 36 | 36 | ||
| 37 | //============================================================================== | 37 | //============================================================================== |
| 38 | /// @ingroup cpp_kodi_Defs | 38 | /// @ingroup cpp_kodi_Defs |
| @@ -65,7 +65,8 @@ using HardwareContext = ADDON_HARDWARE_CONTEXT; | |||
| 65 | //============================================================================== | 65 | //============================================================================== |
| 66 | /// @ingroup cpp_kodi_addon_addonbase_Defs | 66 | /// @ingroup cpp_kodi_addon_addonbase_Defs |
| 67 | /// @defgroup cpp_kodi_addon_addonbase_Defs_CSettingValue class CSettingValue | 67 | /// @defgroup cpp_kodi_addon_addonbase_Defs_CSettingValue class CSettingValue |
| 68 | /// @brief Inside addon main instance used helper class to give settings value. | 68 | /// @brief **Setting value handler**\n |
| 69 | /// Inside addon main instance used helper class to give settings value. | ||
| 69 | /// | 70 | /// |
| 70 | /// This is used on @ref addon::CAddonBase::SetSetting() to inform addon about | 71 | /// This is used on @ref addon::CAddonBase::SetSetting() to inform addon about |
| 71 | /// settings change by used. This becomes then used to give the related value | 72 | /// settings change by used. This becomes then used to give the related value |
| @@ -311,23 +312,55 @@ private: | |||
| 311 | bool m_owner = false; | 312 | bool m_owner = false; |
| 312 | }; | 313 | }; |
| 313 | 314 | ||
| 314 | /// Add-on main instance class. | 315 | //============================================================================ |
| 316 | /// @addtogroup cpp_kodi_addon_addonbase | ||
| 317 | /// @brief **Add-on main instance class**\n | ||
| 318 | /// This is the addon main class, similar to an <b>`int main()`</b> in executable and | ||
| 319 | /// carries out initial work and later management of it. | ||
| 320 | /// | ||
| 315 | class ATTRIBUTE_HIDDEN CAddonBase | 321 | class ATTRIBUTE_HIDDEN CAddonBase |
| 316 | { | 322 | { |
| 317 | public: | 323 | public: |
| 324 | //============================================================================ | ||
| 325 | /// @ingroup cpp_kodi_addon_addonbase | ||
| 326 | /// @brief Addon base class constructor. | ||
| 327 | /// | ||
| 318 | CAddonBase() | 328 | CAddonBase() |
| 319 | { | 329 | { |
| 320 | m_interface->toAddon->destroy = ADDONBASE_Destroy; | 330 | m_interface->toAddon->destroy = ADDONBASE_Destroy; |
| 321 | m_interface->toAddon->get_status = ADDONBASE_GetStatus; | ||
| 322 | m_interface->toAddon->create_instance = ADDONBASE_CreateInstance; | 331 | m_interface->toAddon->create_instance = ADDONBASE_CreateInstance; |
| 323 | m_interface->toAddon->destroy_instance = ADDONBASE_DestroyInstance; | 332 | m_interface->toAddon->destroy_instance = ADDONBASE_DestroyInstance; |
| 324 | m_interface->toAddon->set_setting = ADDONBASE_SetSetting; | 333 | m_interface->toAddon->set_setting = ADDONBASE_SetSetting; |
| 325 | } | 334 | } |
| 335 | //---------------------------------------------------------------------------- | ||
| 326 | 336 | ||
| 337 | //============================================================================ | ||
| 338 | /// @ingroup cpp_kodi_addon_addonbase | ||
| 339 | /// @brief Destructor. | ||
| 340 | /// | ||
| 327 | virtual ~CAddonBase() = default; | 341 | virtual ~CAddonBase() = default; |
| 342 | //---------------------------------------------------------------------------- | ||
| 328 | 343 | ||
| 344 | //============================================================================ | ||
| 345 | /// @ingroup cpp_kodi_addon_addonbase | ||
| 346 | /// @brief Main addon creation function | ||
| 347 | /// | ||
| 348 | /// With this function addon can carry out necessary work which is required | ||
| 349 | /// at later points or start necessary processes. | ||
| 350 | /// | ||
| 351 | /// This function is optional and necessary work can also be carried out | ||
| 352 | /// using @ref CreateInstance (if it concerns any instance types). | ||
| 353 | /// | ||
| 354 | /// @return @ref ADDON_STATUS_OK if correct, for possible errors see | ||
| 355 | /// @ref ADDON_STATUS | ||
| 356 | /// | ||
| 357 | /// @note Terminating the add-on must be carried out using the class destructor | ||
| 358 | /// given by child. | ||
| 359 | /// | ||
| 329 | virtual ADDON_STATUS Create() { return ADDON_STATUS_OK; } | 360 | virtual ADDON_STATUS Create() { return ADDON_STATUS_OK; } |
| 361 | //---------------------------------------------------------------------------- | ||
| 330 | 362 | ||
| 363 | // obsolete | ||
| 331 | virtual ADDON_STATUS GetStatus() { return ADDON_STATUS_OK; } | 364 | virtual ADDON_STATUS GetStatus() { return ADDON_STATUS_OK; } |
| 332 | 365 | ||
| 333 | //============================================================================ | 366 | //============================================================================ |
| @@ -391,7 +424,7 @@ public: | |||
| 391 | /// @ingroup cpp_kodi_addon_addonbase | 424 | /// @ingroup cpp_kodi_addon_addonbase |
| 392 | /// @brief Instance created | 425 | /// @brief Instance created |
| 393 | /// | 426 | /// |
| 394 | /// @param[in] instanceType The requested type of required instance, see \ref ADDON_TYPE. | 427 | /// @param[in] instanceType The requested type of required instance, see @ref ADDON_TYPE. |
| 395 | /// @param[in] instanceID An individual identification key string given by Kodi. | 428 | /// @param[in] instanceID An individual identification key string given by Kodi. |
| 396 | /// @param[in] instance The instance handler used by Kodi must be passed to | 429 | /// @param[in] instance The instance handler used by Kodi must be passed to |
| 397 | /// the classes created here. See in the example. | 430 | /// the classes created here. See in the example. |
| @@ -401,8 +434,8 @@ public: | |||
| 401 | /// that it can handle differences. | 434 | /// that it can handle differences. |
| 402 | /// @param[out] addonInstance The pointer to instance class created in addon. | 435 | /// @param[out] addonInstance The pointer to instance class created in addon. |
| 403 | /// Needed to be able to identify them on calls. | 436 | /// Needed to be able to identify them on calls. |
| 404 | /// @return \ref ADDON_STATUS_OK if correct, for possible errors | 437 | /// @return @ref ADDON_STATUS_OK if correct, for possible errors |
| 405 | /// see \ref ADDON_STATUS | 438 | /// see @ref ADDON_STATUS |
| 406 | /// | 439 | /// |
| 407 | /// | 440 | /// |
| 408 | /// -------------------------------------------------------------------------- | 441 | /// -------------------------------------------------------------------------- |
| @@ -414,8 +447,8 @@ public: | |||
| 414 | /// | 447 | /// |
| 415 | /// ... | 448 | /// ... |
| 416 | /// | 449 | /// |
| 417 | /// /* If you use only one instance in your add-on, can be instanceType and | 450 | /// // If you use only one instance in your add-on, can be instanceType and |
| 418 | /// * instanceID ignored */ | 451 | /// // instanceID ignored |
| 419 | /// ADDON_STATUS CMyAddon::CreateInstance(int instanceType, | 452 | /// ADDON_STATUS CMyAddon::CreateInstance(int instanceType, |
| 420 | /// const std::string& instanceID, | 453 | /// const std::string& instanceID, |
| 421 | /// KODI_HANDLE instance, | 454 | /// KODI_HANDLE instance, |
| @@ -462,7 +495,7 @@ public: | |||
| 462 | /// This function is optional and intended to notify addon that the instance | 495 | /// This function is optional and intended to notify addon that the instance |
| 463 | /// is terminating. | 496 | /// is terminating. |
| 464 | /// | 497 | /// |
| 465 | /// @param[in] instanceType The requested type of required instance, see \ref ADDON_TYPE. | 498 | /// @param[in] instanceType The requested type of required instance, see @ref ADDON_TYPE. |
| 466 | /// @param[in] instanceID An individual identification key string given by Kodi. | 499 | /// @param[in] instanceID An individual identification key string given by Kodi. |
| 467 | /// @param[in] addonInstance The pointer to instance class created in addon. | 500 | /// @param[in] addonInstance The pointer to instance class created in addon. |
| 468 | /// | 501 | /// |
| @@ -483,25 +516,19 @@ public: | |||
| 483 | static AddonGlobalInterface* | 516 | static AddonGlobalInterface* |
| 484 | m_interface; // Interface function table to hold addresses on add-on and from kodi | 517 | m_interface; // Interface function table to hold addresses on add-on and from kodi |
| 485 | 518 | ||
| 486 | /*private:*/ /* Needed public as long the old call functions becomes used! */ | 519 | private: |
| 487 | static inline void ADDONBASE_Destroy() | 520 | static inline void ADDONBASE_Destroy() |
| 488 | { | 521 | { |
| 489 | delete static_cast<CAddonBase*>(m_interface->addonBase); | 522 | delete static_cast<CAddonBase*>(m_interface->addonBase); |
| 490 | m_interface->addonBase = nullptr; | 523 | m_interface->addonBase = nullptr; |
| 491 | } | 524 | } |
| 492 | 525 | ||
| 493 | static inline ADDON_STATUS ADDONBASE_GetStatus() | ||
| 494 | { | ||
| 495 | return static_cast<CAddonBase*>(m_interface->addonBase)->GetStatus(); | ||
| 496 | } | ||
| 497 | |||
| 498 | static inline ADDON_STATUS ADDONBASE_SetSetting(const char* settingName, const void* settingValue) | 526 | static inline ADDON_STATUS ADDONBASE_SetSetting(const char* settingName, const void* settingValue) |
| 499 | { | 527 | { |
| 500 | return static_cast<CAddonBase*>(m_interface->addonBase) | 528 | return static_cast<CAddonBase*>(m_interface->addonBase) |
| 501 | ->SetSetting(settingName, CSettingValue(settingValue)); | 529 | ->SetSetting(settingName, CSettingValue(settingValue)); |
| 502 | } | 530 | } |
| 503 | 531 | ||
| 504 | private: | ||
| 505 | static inline ADDON_STATUS ADDONBASE_CreateInstance(int instanceType, | 532 | static inline ADDON_STATUS ADDONBASE_CreateInstance(int instanceType, |
| 506 | const char* instanceID, | 533 | const char* instanceID, |
| 507 | KODI_HANDLE instance, | 534 | KODI_HANDLE instance, |
| @@ -591,7 +618,7 @@ private: | |||
| 591 | } /* namespace addon */ | 618 | } /* namespace addon */ |
| 592 | 619 | ||
| 593 | //============================================================================== | 620 | //============================================================================== |
| 594 | /// @ingroup cpp_kodi_addon | 621 | /// @ingroup cpp_kodi |
| 595 | /// @brief To get used version inside Kodi itself about asked type. | 622 | /// @brief To get used version inside Kodi itself about asked type. |
| 596 | /// | 623 | /// |
| 597 | /// This thought to allow a addon a handling of newer addon versions within | 624 | /// This thought to allow a addon a handling of newer addon versions within |
| @@ -613,6 +640,11 @@ inline std::string ATTRIBUTE_HIDDEN GetKodiTypeVersion(int type) | |||
| 613 | //------------------------------------------------------------------------------ | 640 | //------------------------------------------------------------------------------ |
| 614 | 641 | ||
| 615 | //============================================================================== | 642 | //============================================================================== |
| 643 | /// @ingroup cpp_kodi | ||
| 644 | /// @brief To get the addon system installation folder. | ||
| 645 | /// | ||
| 646 | /// @param[in] append [optional] Path to append to given string | ||
| 647 | /// @return Path where addon is installed | ||
| 616 | /// | 648 | /// |
| 617 | inline std::string ATTRIBUTE_HIDDEN GetAddonPath(const std::string& append = "") | 649 | inline std::string ATTRIBUTE_HIDDEN GetAddonPath(const std::string& append = "") |
| 618 | { | 650 | { |
| @@ -637,6 +669,14 @@ inline std::string ATTRIBUTE_HIDDEN GetAddonPath(const std::string& append = "") | |||
| 637 | //------------------------------------------------------------------------------ | 669 | //------------------------------------------------------------------------------ |
| 638 | 670 | ||
| 639 | //============================================================================== | 671 | //============================================================================== |
| 672 | /// @ingroup cpp_kodi | ||
| 673 | /// @brief To get the user-related folder of the addon. | ||
| 674 | /// | ||
| 675 | /// @note This folder is not created automatically and has to be created by the | ||
| 676 | /// addon the first time. | ||
| 677 | /// | ||
| 678 | /// @param[in] append [optional] Path to append to given string | ||
| 679 | /// @return User path of addon | ||
| 640 | /// | 680 | /// |
| 641 | inline std::string ATTRIBUTE_HIDDEN GetBaseUserPath(const std::string& append = "") | 681 | inline std::string ATTRIBUTE_HIDDEN GetBaseUserPath(const std::string& append = "") |
| 642 | { | 682 | { |
| @@ -661,6 +701,19 @@ inline std::string ATTRIBUTE_HIDDEN GetBaseUserPath(const std::string& append = | |||
| 661 | //------------------------------------------------------------------------------ | 701 | //------------------------------------------------------------------------------ |
| 662 | 702 | ||
| 663 | //============================================================================== | 703 | //============================================================================== |
| 704 | /// @ingroup cpp_kodi | ||
| 705 | /// @brief This function gives OS associated executable binary path of the addon. | ||
| 706 | /// | ||
| 707 | /// With some systems this can differ from the addon path at @ref GetAddonPath. | ||
| 708 | /// | ||
| 709 | /// As an example on Linux: | ||
| 710 | /// - Addon path is at `/usr/share/kodi/addons/YOUR_ADDON_ID` | ||
| 711 | /// - Library path is at `/usr/lib/kodi/addons/YOUR_ADDON_ID` | ||
| 712 | /// | ||
| 713 | /// @note In addition, in this function, for a given folder, the add-on path | ||
| 714 | /// itself, but its parent. | ||
| 715 | /// | ||
| 716 | /// @return Kodi's sytem library path where related addons are installed. | ||
| 664 | /// | 717 | /// |
| 665 | inline std::string ATTRIBUTE_HIDDEN GetLibPath() | 718 | inline std::string ATTRIBUTE_HIDDEN GetLibPath() |
| 666 | { | 719 | { |
| @@ -1223,6 +1276,11 @@ inline void ATTRIBUTE_HIDDEN SetSettingEnum(const std::string& settingName, enum | |||
| 1223 | /*!@}*/ | 1276 | /*!@}*/ |
| 1224 | 1277 | ||
| 1225 | //============================================================================ | 1278 | //============================================================================ |
| 1279 | /// @ingroup cpp_kodi | ||
| 1280 | /// @brief Get to related @ref ADDON_STATUS a human readable text. | ||
| 1281 | /// | ||
| 1282 | /// @param[in] status Status value to get name for | ||
| 1283 | /// @return Wanted name, as "Unknown" if status not known | ||
| 1226 | /// | 1284 | /// |
| 1227 | inline std::string ATTRIBUTE_HIDDEN TranslateAddonStatus(ADDON_STATUS status) | 1285 | inline std::string ATTRIBUTE_HIDDEN TranslateAddonStatus(ADDON_STATUS status) |
| 1228 | { | 1286 | { |
| @@ -1279,16 +1337,102 @@ inline void* GetInterface(const std::string& name, const std::string& version) | |||
| 1279 | 1337 | ||
| 1280 | } /* namespace kodi */ | 1338 | } /* namespace kodi */ |
| 1281 | 1339 | ||
| 1282 | /*! addon creation macro | 1340 | //============================================================================== |
| 1283 | * @todo cleanup this stupid big macro | 1341 | /// @ingroup cpp_kodi_addon_addonbase_Defs |
| 1284 | * This macro includes now all for add-on's needed functions. This becomes a bigger | 1342 | /// @defgroup cpp_kodi_addon_addonbase_Defs_ADDONCREATORAddonClass macro ADDONCREATOR(AddonClass) |
| 1285 | * rework after everything is done on Kodi itself, currently is this way needed | 1343 | /// @brief **Addon creation macro**\n |
| 1286 | * to have compatibility with not reworked interfaces. | 1344 | /// This export the three mandatory "C" functions to have available for Kodi. |
| 1287 | * | 1345 | /// |
| 1288 | * Becomes really cleaned up soon :D | 1346 | /// @note Only this macro can be used on a C++ addon, everything else is done |
| 1289 | */ | 1347 | /// automatically. |
| 1348 | /// | ||
| 1349 | /// @param[in] AddonClass Used addon class to be exported with CAddonBase as | ||
| 1350 | /// parent. | ||
| 1351 | /// | ||
| 1352 | /// | ||
| 1353 | /// ---------------------------------------------------------------------------- | ||
| 1354 | /// | ||
| 1355 | /// **Example:** | ||
| 1356 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 1357 | /// | ||
| 1358 | /// #include <kodi/AddonBash.h> | ||
| 1359 | /// | ||
| 1360 | /// class CMyAddon : public kodi::addon::CAddonBase | ||
| 1361 | /// { | ||
| 1362 | /// public: | ||
| 1363 | /// CMyAddon() = default; | ||
| 1364 | /// ADDON_STATUS Create() override; | ||
| 1365 | /// }; | ||
| 1366 | /// | ||
| 1367 | /// ADDON_STATUS CMyAddon::Create() | ||
| 1368 | /// { | ||
| 1369 | /// // Some work | ||
| 1370 | /// | ||
| 1371 | /// return ADDON_STATUS_OK; | ||
| 1372 | /// } | ||
| 1373 | /// | ||
| 1374 | /// ADDONCREATOR(CMyAddon) | ||
| 1375 | /// ~~~~~~~~~~~~~ | ||
| 1376 | /// | ||
| 1377 | /// ---------------------------------------------------------------------------- | ||
| 1378 | /// | ||
| 1379 | /// As information, the following functions are exported using this macro: | ||
| 1380 | /// \table_start | ||
| 1381 | /// \table_h3{ Function, Use, Description } | ||
| 1382 | /// \table_row3{ <b>`ADDON_Create(KODI_HANDLE addonInterface\, const char* globalApiVersion\, void* unused)`</b>, | ||
| 1383 | /// \anchor ADDON_Create | ||
| 1384 | /// _required_, | ||
| 1385 | /// <b>Addon creation call.</b> | ||
| 1386 | /// <br> | ||
| 1387 | /// Like an `int main()` is this the first on addon called place on his start | ||
| 1388 | /// and create within C++ API related class inside addon. | ||
| 1389 | /// <br> | ||
| 1390 | /// @param[in] addonInterface Handle pointer to get Kodi's given table. | ||
| 1391 | /// There have addon needed values and functions | ||
| 1392 | /// to Kodi and addon must set his functions there | ||
| 1393 | /// for Kodi. | ||
| 1394 | /// @param[in] globalApiVersion This give the main version @ref ADDON_GLOBAL_VERSION_MAIN | ||
| 1395 | /// where currently on Kodi's side.<br> | ||
| 1396 | /// This is unsued on addon as there also other | ||
| 1397 | /// special callback functions for.<br> | ||
| 1398 | /// Only thought for future use if needed earlier. | ||
| 1399 | /// @param[in] unused This is a not used value\, only there to have in case of | ||
| 1400 | /// need no Major API version increase where break current. | ||
| 1401 | /// @return @ref ADDON_STATUS_OK if correct\, for possible errors see | ||
| 1402 | /// @ref ADDON_STATUS. | ||
| 1403 | /// <p> | ||
| 1404 | /// } | ||
| 1405 | /// \table_row3{ <b>`const char* ADDON_GetTypeVersion(int type)`</b>, | ||
| 1406 | /// \anchor ADDON_GetTypeVersion | ||
| 1407 | /// _required_, | ||
| 1408 | /// <b>Ask addon about version of given type.</b> | ||
| 1409 | /// <br> | ||
| 1410 | /// This is used to query its associated version in the addon before work | ||
| 1411 | /// is carried out in it and the Kodi can adapt to it. | ||
| 1412 | /// <br> | ||
| 1413 | /// @param[in] type With @ref ADDON_TYPE defined type to ask. | ||
| 1414 | /// @return Version as string of asked type. | ||
| 1415 | /// <p> | ||
| 1416 | /// } | ||
| 1417 | /// \table_row3{ <b>`const char* ADDON_GetTypeMinVersion(int type)`</b>, | ||
| 1418 | /// \anchor ADDON_GetTypeMinVersion | ||
| 1419 | /// _optional_, | ||
| 1420 | /// <b>Ask addon about minimal version of given type.</b> | ||
| 1421 | /// <br> | ||
| 1422 | /// This is used to query its associated min version in the addon before work | ||
| 1423 | /// is carried out in it and the Kodi can adapt to it. | ||
| 1424 | /// <br> | ||
| 1425 | /// @note The minimum version is optional\, if it were not available\, the | ||
| 1426 | /// major version is used instead. | ||
| 1427 | /// <br> | ||
| 1428 | /// @param[in] type With @ref ADDON_TYPE defined type to ask. | ||
| 1429 | /// @return Min version as string of asked type. | ||
| 1430 | /// <p> | ||
| 1431 | /// } | ||
| 1432 | /// \table_end | ||
| 1433 | /// | ||
| 1290 | #define ADDONCREATOR(AddonClass) \ | 1434 | #define ADDONCREATOR(AddonClass) \ |
| 1291 | extern "C" __declspec(dllexport) ADDON_STATUS ADDON_Create( \ | 1435 | extern "C" ATTRIBUTE_DLL_EXPORT ADDON_STATUS ADDON_Create( \ |
| 1292 | KODI_HANDLE addonInterface, const char* /*globalApiVersion*/, void* /*unused*/) \ | 1436 | KODI_HANDLE addonInterface, const char* /*globalApiVersion*/, void* /*unused*/) \ |
| 1293 | { \ | 1437 | { \ |
| 1294 | kodi::addon::CAddonBase::m_interface = static_cast<AddonGlobalInterface*>(addonInterface); \ | 1438 | kodi::addon::CAddonBase::m_interface = static_cast<AddonGlobalInterface*>(addonInterface); \ |
| @@ -1296,27 +1440,15 @@ inline void* GetInterface(const std::string& name, const std::string& version) | |||
| 1296 | return static_cast<kodi::addon::CAddonBase*>(kodi::addon::CAddonBase::m_interface->addonBase) \ | 1440 | return static_cast<kodi::addon::CAddonBase*>(kodi::addon::CAddonBase::m_interface->addonBase) \ |
| 1297 | ->Create(); \ | 1441 | ->Create(); \ |
| 1298 | } \ | 1442 | } \ |
| 1299 | extern "C" __declspec(dllexport) void ADDON_Destroy() \ | 1443 | extern "C" ATTRIBUTE_DLL_EXPORT const char* ADDON_GetTypeVersion(int type) \ |
| 1300 | { \ | ||
| 1301 | kodi::addon::CAddonBase::ADDONBASE_Destroy(); \ | ||
| 1302 | } \ | ||
| 1303 | extern "C" __declspec(dllexport) ADDON_STATUS ADDON_GetStatus() \ | ||
| 1304 | { \ | ||
| 1305 | return kodi::addon::CAddonBase::ADDONBASE_GetStatus(); \ | ||
| 1306 | } \ | ||
| 1307 | extern "C" __declspec(dllexport) ADDON_STATUS ADDON_SetSetting(const char* settingName, \ | ||
| 1308 | const void* settingValue) \ | ||
| 1309 | { \ | ||
| 1310 | return kodi::addon::CAddonBase::ADDONBASE_SetSetting(settingName, settingValue); \ | ||
| 1311 | } \ | ||
| 1312 | extern "C" __declspec(dllexport) const char* ADDON_GetTypeVersion(int type) \ | ||
| 1313 | { \ | 1444 | { \ |
| 1314 | return kodi::addon::GetTypeVersion(type); \ | 1445 | return kodi::addon::GetTypeVersion(type); \ |
| 1315 | } \ | 1446 | } \ |
| 1316 | extern "C" __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) \ | 1447 | extern "C" ATTRIBUTE_DLL_EXPORT const char* ADDON_GetTypeMinVersion(int type) \ |
| 1317 | { \ | 1448 | { \ |
| 1318 | return kodi::addon::GetTypeMinVersion(type); \ | 1449 | return kodi::addon::GetTypeMinVersion(type); \ |
| 1319 | } \ | 1450 | } \ |
| 1320 | AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; | 1451 | AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; |
| 1452 | //------------------------------------------------------------------------------ | ||
| 1321 | 1453 | ||
| 1322 | #endif /* __cplusplus */ | 1454 | #endif /* __cplusplus */ |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/AudioEngine.h b/xbmc/addons/kodi-dev-kit/include/kodi/AudioEngine.h index 36d1dd1..c6f8c4f 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/AudioEngine.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/AudioEngine.h | |||
| @@ -68,7 +68,7 @@ namespace audioengine | |||
| 68 | /// | 68 | /// |
| 69 | /// ------------------------------------------------------------------------ | 69 | /// ------------------------------------------------------------------------ |
| 70 | /// | 70 | /// |
| 71 | /// It has the header \ref AudioEngine.h "#include <kodi/AudioEngine.h>" be included | 71 | /// It has the header @ref AudioEngine.h "#include <kodi/AudioEngine.h>" be included |
| 72 | /// to enjoy it. | 72 | /// to enjoy it. |
| 73 | /// | 73 | /// |
| 74 | //------------------------------------------------------------------------------ | 74 | //------------------------------------------------------------------------------ |
| @@ -262,8 +262,8 @@ public: | |||
| 262 | /// @brief Contructs new class to an Kodi IAEStream in the format specified. | 262 | /// @brief Contructs new class to an Kodi IAEStream in the format specified. |
| 263 | /// | 263 | /// |
| 264 | /// @param[in] format The data format the incoming audio will be in | 264 | /// @param[in] format The data format the incoming audio will be in |
| 265 | /// (e.g. \ref AUDIOENGINE_FMT_S16LE) | 265 | /// (e.g. @ref AUDIOENGINE_FMT_S16LE) |
| 266 | /// @param[in] options [opt] A bit field of stream options (see: enum \ref AudioEngineStreamOptions) | 266 | /// @param[in] options [opt] A bit field of stream options (see: enum @ref AudioEngineStreamOptions) |
| 267 | /// | 267 | /// |
| 268 | /// | 268 | /// |
| 269 | /// ------------------------------------------------------------------------ | 269 | /// ------------------------------------------------------------------------ |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/CMakeLists.txt index d37078a..298b5de 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/CMakeLists.txt +++ b/xbmc/addons/kodi-dev-kit/include/kodi/CMakeLists.txt | |||
| @@ -3,8 +3,6 @@ set(HEADERS AddonBase.h | |||
| 3 | Filesystem.h | 3 | Filesystem.h |
| 4 | General.h | 4 | General.h |
| 5 | Network.h | 5 | Network.h |
| 6 | StreamCodec.h | ||
| 7 | StreamCrypto.h | ||
| 8 | versions.h) | 6 | versions.h) |
| 9 | 7 | ||
| 10 | if(CORE_SYSTEM_NAME STREQUAL android) | 8 | if(CORE_SYSTEM_NAME STREQUAL android) |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/Filesystem.h b/xbmc/addons/kodi-dev-kit/include/kodi/Filesystem.h index 1cf05fe..9e05983 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/Filesystem.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/Filesystem.h | |||
| @@ -91,7 +91,7 @@ namespace vfs | |||
| 91 | /// @brief **File information status**\n | 91 | /// @brief **File information status**\n |
| 92 | /// Used on kodi::vfs::StatFile() to get detailed information about a file. | 92 | /// Used on kodi::vfs::StatFile() to get detailed information about a file. |
| 93 | /// | 93 | /// |
| 94 | //@{ | 94 | ///@{ |
| 95 | class ATTRIBUTE_HIDDEN FileStatus : public kodi::addon::CStructHdl<FileStatus, STAT_STRUCTURE> | 95 | class ATTRIBUTE_HIDDEN FileStatus : public kodi::addon::CStructHdl<FileStatus, STAT_STRUCTURE> |
| 96 | { | 96 | { |
| 97 | public: | 97 | public: |
| @@ -102,7 +102,7 @@ public: | |||
| 102 | FileStatus(STAT_STRUCTURE* channel) : CStructHdl(channel) {} | 102 | FileStatus(STAT_STRUCTURE* channel) : CStructHdl(channel) {} |
| 103 | /*! \endcond */ | 103 | /*! \endcond */ |
| 104 | 104 | ||
| 105 | /// @defgroup cpp_kodi_vfs_Defs_FileStatus_Help *Value Help* | 105 | /// @defgroup cpp_kodi_vfs_Defs_FileStatus_Help Value Help |
| 106 | /// @ingroup cpp_kodi_vfs_Defs_FileStatus | 106 | /// @ingroup cpp_kodi_vfs_Defs_FileStatus |
| 107 | /// ---------------------------------------------------------------------------- | 107 | /// ---------------------------------------------------------------------------- |
| 108 | /// | 108 | /// |
| @@ -126,7 +126,7 @@ public: | |||
| 126 | 126 | ||
| 127 | /// @addtogroup cpp_kodi_vfs_Defs_FileStatus | 127 | /// @addtogroup cpp_kodi_vfs_Defs_FileStatus |
| 128 | /// @copydetails cpp_kodi_vfs_Defs_FileStatus_Help | 128 | /// @copydetails cpp_kodi_vfs_Defs_FileStatus_Help |
| 129 | //@{ | 129 | ///@{ |
| 130 | 130 | ||
| 131 | /// @brief Set ID of device containing file. | 131 | /// @brief Set ID of device containing file. |
| 132 | void SetDeviceId(uint32_t deviceId) { m_cStructure->deviceId = deviceId; } | 132 | void SetDeviceId(uint32_t deviceId) { m_cStructure->deviceId = deviceId; } |
| @@ -208,9 +208,9 @@ public: | |||
| 208 | 208 | ||
| 209 | /// @brief Get stat url is a regular. | 209 | /// @brief Get stat url is a regular. |
| 210 | bool GetIsSocket() const { return m_cStructure->isSocket; } | 210 | bool GetIsSocket() const { return m_cStructure->isSocket; } |
| 211 | //@} | 211 | ///@} |
| 212 | }; | 212 | }; |
| 213 | //@} | 213 | ///@} |
| 214 | //------------------------------------------------------------------------------ | 214 | //------------------------------------------------------------------------------ |
| 215 | 215 | ||
| 216 | //============================================================================== | 216 | //============================================================================== |
| @@ -220,7 +220,7 @@ public: | |||
| 220 | /// Used on kodi::vfs::CFile::IoControlGetCacheStatus() to get running cache | 220 | /// Used on kodi::vfs::CFile::IoControlGetCacheStatus() to get running cache |
| 221 | /// status of proccessed stream. | 221 | /// status of proccessed stream. |
| 222 | /// | 222 | /// |
| 223 | //@{ | 223 | ///@{ |
| 224 | class ATTRIBUTE_HIDDEN CacheStatus | 224 | class ATTRIBUTE_HIDDEN CacheStatus |
| 225 | : public kodi::addon::CStructHdl<CacheStatus, VFS_CACHE_STATUS_DATA> | 225 | : public kodi::addon::CStructHdl<CacheStatus, VFS_CACHE_STATUS_DATA> |
| 226 | { | 226 | { |
| @@ -232,7 +232,7 @@ public: | |||
| 232 | CacheStatus(VFS_CACHE_STATUS_DATA* channel) : CStructHdl(channel) {} | 232 | CacheStatus(VFS_CACHE_STATUS_DATA* channel) : CStructHdl(channel) {} |
| 233 | /*! \endcond */ | 233 | /*! \endcond */ |
| 234 | 234 | ||
| 235 | /// @defgroup cpp_kodi_vfs_Defs_CacheStatus_Help *Value Help* | 235 | /// @defgroup cpp_kodi_vfs_Defs_CacheStatus_Help Value Help |
| 236 | /// @ingroup cpp_kodi_vfs_Defs_CacheStatus | 236 | /// @ingroup cpp_kodi_vfs_Defs_CacheStatus |
| 237 | /// ---------------------------------------------------------------------------- | 237 | /// ---------------------------------------------------------------------------- |
| 238 | /// | 238 | /// |
| @@ -247,7 +247,7 @@ public: | |||
| 247 | 247 | ||
| 248 | /// @addtogroup cpp_kodi_vfs_Defs_CacheStatus | 248 | /// @addtogroup cpp_kodi_vfs_Defs_CacheStatus |
| 249 | /// @copydetails cpp_kodi_vfs_Defs_CacheStatus_Help | 249 | /// @copydetails cpp_kodi_vfs_Defs_CacheStatus_Help |
| 250 | //@{ | 250 | ///@{ |
| 251 | 251 | ||
| 252 | /// @brief Set number of bytes cached forward of current position. | 252 | /// @brief Set number of bytes cached forward of current position. |
| 253 | void SetForward(uint64_t forward) { m_cStructure->forward = forward; } | 253 | void SetForward(uint64_t forward) { m_cStructure->forward = forward; } |
| @@ -273,9 +273,9 @@ public: | |||
| 273 | /// @brief Get cache low speed condition detected. | 273 | /// @brief Get cache low speed condition detected. |
| 274 | bool GetLowspeed() { return m_cStructure->lowspeed; } | 274 | bool GetLowspeed() { return m_cStructure->lowspeed; } |
| 275 | 275 | ||
| 276 | //@} | 276 | ///@} |
| 277 | }; | 277 | }; |
| 278 | //@} | 278 | ///@} |
| 279 | //------------------------------------------------------------------------------ | 279 | //------------------------------------------------------------------------------ |
| 280 | 280 | ||
| 281 | //============================================================================== | 281 | //============================================================================== |
| @@ -318,7 +318,7 @@ public: | |||
| 318 | } | 318 | } |
| 319 | //-------------------------------------------------------------------------- | 319 | //-------------------------------------------------------------------------- |
| 320 | 320 | ||
| 321 | /// @defgroup cpp_kodi_vfs_Defs_HttpHeader_Help *Value Help* | 321 | /// @defgroup cpp_kodi_vfs_Defs_HttpHeader_Help Value Help |
| 322 | /// @ingroup cpp_kodi_vfs_Defs_HttpHeader | 322 | /// @ingroup cpp_kodi_vfs_Defs_HttpHeader |
| 323 | /// | 323 | /// |
| 324 | /// <b>The following table contains values that can be get with @ref cpp_kodi_vfs_Defs_HttpHeader :</b> | 324 | /// <b>The following table contains values that can be get with @ref cpp_kodi_vfs_Defs_HttpHeader :</b> |
| @@ -382,6 +382,7 @@ public: | |||
| 382 | if (res) | 382 | if (res) |
| 383 | { | 383 | { |
| 384 | std::vector<std::string> vecReturn; | 384 | std::vector<std::string> vecReturn; |
| 385 | vecReturn.reserve(numValues); | ||
| 385 | for (int i = 0; i < numValues; ++i) | 386 | for (int i = 0; i < numValues; ++i) |
| 386 | { | 387 | { |
| 387 | vecReturn.emplace_back(res[i]); | 388 | vecReturn.emplace_back(res[i]); |
| @@ -537,7 +538,7 @@ public: | |||
| 537 | /// It has the header @ref Filesystem.h "#include <kodi/Filesystem.h>" be included | 538 | /// It has the header @ref Filesystem.h "#include <kodi/Filesystem.h>" be included |
| 538 | /// to enjoy it. | 539 | /// to enjoy it. |
| 539 | /// | 540 | /// |
| 540 | //@{ | 541 | ///@{ |
| 541 | class ATTRIBUTE_HIDDEN CDirEntry | 542 | class ATTRIBUTE_HIDDEN CDirEntry |
| 542 | { | 543 | { |
| 543 | public: | 544 | public: |
| @@ -580,7 +581,7 @@ public: | |||
| 580 | } | 581 | } |
| 581 | //---------------------------------------------------------------------------- | 582 | //---------------------------------------------------------------------------- |
| 582 | 583 | ||
| 583 | /// @defgroup cpp_kodi_vfs_CDirEntry_Help *Value Help* | 584 | /// @defgroup cpp_kodi_vfs_CDirEntry_Help Value Help |
| 584 | /// @ingroup cpp_kodi_vfs_CDirEntry | 585 | /// @ingroup cpp_kodi_vfs_CDirEntry |
| 585 | /// -------------------------------------------------------------------------- | 586 | /// -------------------------------------------------------------------------- |
| 586 | /// | 587 | /// |
| @@ -598,7 +599,7 @@ public: | |||
| 598 | 599 | ||
| 599 | /// @addtogroup cpp_kodi_vfs_CDirEntry | 600 | /// @addtogroup cpp_kodi_vfs_CDirEntry |
| 600 | /// @copydetails cpp_kodi_vfs_CDirEntry_Help | 601 | /// @copydetails cpp_kodi_vfs_CDirEntry_Help |
| 601 | //@{ | 602 | ///@{ |
| 602 | 603 | ||
| 603 | //============================================================================ | 604 | //============================================================================ |
| 604 | /// @brief Get the directory entry name. | 605 | /// @brief Get the directory entry name. |
| @@ -723,7 +724,7 @@ public: | |||
| 723 | const std::map<std::string, std::string>& GetProperties() const { return m_properties; } | 724 | const std::map<std::string, std::string>& GetProperties() const { return m_properties; } |
| 724 | //---------------------------------------------------------------------------- | 725 | //---------------------------------------------------------------------------- |
| 725 | 726 | ||
| 726 | //@} | 727 | ///@} |
| 727 | 728 | ||
| 728 | private: | 729 | private: |
| 729 | std::string m_label; | 730 | std::string m_label; |
| @@ -734,7 +735,7 @@ private: | |||
| 734 | int64_t m_size; | 735 | int64_t m_size; |
| 735 | time_t m_dateTime; | 736 | time_t m_dateTime; |
| 736 | }; | 737 | }; |
| 737 | //@} | 738 | ///@} |
| 738 | //------------------------------------------------------------------------------ | 739 | //------------------------------------------------------------------------------ |
| 739 | 740 | ||
| 740 | //}}} | 741 | //}}} |
| @@ -1823,7 +1824,7 @@ inline bool ATTRIBUTE_HIDDEN GetCookies(const std::string& url, std::string& coo | |||
| 1823 | /// | 1824 | /// |
| 1824 | /// ~~~~~~~~~~~~~ | 1825 | /// ~~~~~~~~~~~~~ |
| 1825 | /// | 1826 | /// |
| 1826 | //@{ | 1827 | ///@{ |
| 1827 | class ATTRIBUTE_HIDDEN CFile | 1828 | class ATTRIBUTE_HIDDEN CFile |
| 1828 | { | 1829 | { |
| 1829 | public: | 1830 | public: |
| @@ -2324,6 +2325,7 @@ public: | |||
| 2324 | if (res) | 2325 | if (res) |
| 2325 | { | 2326 | { |
| 2326 | std::vector<std::string> vecReturn; | 2327 | std::vector<std::string> vecReturn; |
| 2328 | vecReturn.reserve(numValues); | ||
| 2327 | for (int i = 0; i < numValues; ++i) | 2329 | for (int i = 0; i < numValues; ++i) |
| 2328 | { | 2330 | { |
| 2329 | vecReturn.emplace_back(res[i]); | 2331 | vecReturn.emplace_back(res[i]); |
| @@ -2356,7 +2358,7 @@ public: | |||
| 2356 | private: | 2358 | private: |
| 2357 | void* m_file = nullptr; | 2359 | void* m_file = nullptr; |
| 2358 | }; | 2360 | }; |
| 2359 | //@} | 2361 | ///@} |
| 2360 | //------------------------------------------------------------------------------ | 2362 | //------------------------------------------------------------------------------ |
| 2361 | 2363 | ||
| 2362 | //}}} | 2364 | //}}} |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/General.h b/xbmc/addons/kodi-dev-kit/include/kodi/General.h index 3fad5a0..ab9452b 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/General.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/General.h | |||
| @@ -787,7 +787,7 @@ inline bool ATTRIBUTE_HIDDEN GetKeyboardLayout(int modifierKey, | |||
| 787 | /// @param[out] layout_name new name of used layout (input string not used!) | 787 | /// @param[out] layout_name new name of used layout (input string not used!) |
| 788 | /// @return true if request successed | 788 | /// @return true if request successed |
| 789 | /// | 789 | /// |
| 790 | /// @note \ref GetKeyboardLayout must be called afterwards. | 790 | /// @note @ref GetKeyboardLayout must be called afterwards. |
| 791 | /// | 791 | /// |
| 792 | /// | 792 | /// |
| 793 | /// ------------------------------------------------------------------------ | 793 | /// ------------------------------------------------------------------------ |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/StreamCrypto.h b/xbmc/addons/kodi-dev-kit/include/kodi/StreamCrypto.h deleted file mode 100644 index 8008aa1..0000000 --- a/xbmc/addons/kodi-dev-kit/include/kodi/StreamCrypto.h +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2017-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include <inttypes.h> | ||
| 12 | #include <string.h> | ||
| 13 | |||
| 14 | #define STREAMCRYPTO_VERSION_LEVEL 1 | ||
| 15 | |||
| 16 | #ifdef __cplusplus | ||
| 17 | extern "C" | ||
| 18 | { | ||
| 19 | #endif /* __cplusplus */ | ||
| 20 | |||
| 21 | typedef struct CRYPTO_INFO | ||
| 22 | { | ||
| 23 | enum CRYPTO_KEY_SYSTEM : uint8_t | ||
| 24 | { | ||
| 25 | CRYPTO_KEY_SYSTEM_NONE = 0, | ||
| 26 | CRYPTO_KEY_SYSTEM_WIDEVINE, | ||
| 27 | CRYPTO_KEY_SYSTEM_PLAYREADY, | ||
| 28 | CRYPTO_KEY_SYSTEM_WISEPLAY, | ||
| 29 | CRYPTO_KEY_SYSTEM_COUNT | ||
| 30 | } m_CryptoKeySystem; /*!< @brief keysystem for encrypted media, KEY_SYSTEM_NONE for unencrypted media */ | ||
| 31 | |||
| 32 | static const uint8_t FLAG_SECURE_DECODER = | ||
| 33 | 1; /*!< @brief is set in flags if decoding has to be done in TEE environment */ | ||
| 34 | |||
| 35 | uint8_t flags; | ||
| 36 | uint16_t m_CryptoSessionIdSize; /*!< @brief The size of the crypto session key id */ | ||
| 37 | const char* m_CryptoSessionId; /*!< @brief The crypto session key id */ | ||
| 38 | } CRYPTO_INFO; | ||
| 39 | |||
| 40 | #ifdef __cplusplus | ||
| 41 | } /* extern "C" */ | ||
| 42 | #endif /* __cplusplus */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/AudioDecoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/AudioDecoder.h index a6bea7d..747225f 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/AudioDecoder.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/AudioDecoder.h | |||
| @@ -241,7 +241,7 @@ private: | |||
| 241 | 241 | ||
| 242 | //============================================================================== | 242 | //============================================================================== |
| 243 | /// | 243 | /// |
| 244 | /// \addtogroup cpp_kodi_addon_audiodecoder | 244 | /// @addtogroup cpp_kodi_addon_audiodecoder |
| 245 | /// @brief \cpp_class{ kodi::addon::CInstanceAudioDecoder } | 245 | /// @brief \cpp_class{ kodi::addon::CInstanceAudioDecoder } |
| 246 | /// **Audio decoder add-on instance** | 246 | /// **Audio decoder add-on instance** |
| 247 | /// | 247 | /// |
| @@ -289,9 +289,11 @@ private: | |||
| 289 | /// |:------------------------------|---------------------------------------- | 289 | /// |:------------------------------|---------------------------------------- |
| 290 | /// | <b>`point`</b> | Addon type specification<br>At all addon types and for this kind always <b>"kodi.audiodecoder"</b>. | 290 | /// | <b>`point`</b> | Addon type specification<br>At all addon types and for this kind always <b>"kodi.audiodecoder"</b>. |
| 291 | /// | <b>`library_@PLATFORM@`</b> | Sets the used library name, which is automatically set by cmake at addon build. | 291 | /// | <b>`library_@PLATFORM@`</b> | Sets the used library name, which is automatically set by cmake at addon build. |
| 292 | /// | <b>`name`</b> | The name of the decoder used in Kodi for display. | ||
| 293 | /// | <b>`extension`</b> | The file extensions / styles supported by this addon. | 292 | /// | <b>`extension`</b> | The file extensions / styles supported by this addon. |
| 294 | /// | <b>`tags`</b> | Boolean to point out that addon can bring own information to replayed file, if <b>`false`</b> only the file name is used as info.<br>If <b>`true`</b>, \ref CInstanceAudioDecoder::ReadTag is used and must be implemented. | 293 | /// | <b>`mimetype`</b> | A stream URL mimetype where can be used to force to this addon. |
| 294 | /// | <b>`name`</b> | The name of the decoder used in Kodi for display. | ||
| 295 | /// | <b>`tags`</b> | Boolean to point out that addon can bring own information to replayed file, if <b>`false`</b> only the file name is used as info.<br>If <b>`true`</b>, @ref CInstanceAudioDecoder::ReadTag is used and must be implemented. | ||
| 296 | /// | <b>`tracks`</b> | Boolean to in inform one file can contains several different streams. | ||
| 295 | /// | 297 | /// |
| 296 | /// -------------------------------------------------------------------------- | 298 | /// -------------------------------------------------------------------------- |
| 297 | /// | 299 | /// |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Inputstream.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Inputstream.h index 396b92e..c4c7aca 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Inputstream.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Inputstream.h | |||
| @@ -8,682 +8,1757 @@ | |||
| 8 | 8 | ||
| 9 | #pragma once | 9 | #pragma once |
| 10 | 10 | ||
| 11 | /* | ||
| 12 | * Parts with a comment named "internal" are only used inside header and not | ||
| 13 | * used or accessed direct during add-on development! | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include "../AddonBase.h" | 11 | #include "../AddonBase.h" |
| 17 | #include "../StreamCodec.h" | 12 | #include "../c-api/addon-instance/inputstream.h" |
| 18 | #include "../StreamCrypto.h" | 13 | #include "inputstream/StreamCodec.h" |
| 14 | #include "inputstream/StreamConstants.h" | ||
| 15 | #include "inputstream/StreamCrypto.h" | ||
| 16 | #include "inputstream/TimingConstants.h" | ||
| 19 | 17 | ||
| 20 | #ifdef BUILD_KODI_ADDON | 18 | #ifdef __cplusplus |
| 21 | #include "../DemuxPacket.h" | ||
| 22 | #include "../InputStreamConstants.h" | ||
| 23 | #else | ||
| 24 | #include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" | ||
| 25 | #include "cores/VideoPlayer/Interface/Addon/InputStreamConstants.h" | ||
| 26 | #endif | ||
| 27 | 19 | ||
| 28 | //Increment this level always if you add features which can lead to compile failures in the addon | 20 | #include <map> |
| 29 | #define INPUTSTREAM_VERSION_LEVEL 2 | ||
| 30 | 21 | ||
| 31 | #define INPUTSTREAM_MAX_STREAM_COUNT 256 | 22 | namespace kodi |
| 32 | #define INPUTSTREAM_MAX_STRING_NAME_SIZE 256 | 23 | { |
| 33 | #define INPUTSTREAM_MAX_STRING_CODEC_SIZE 32 | 24 | namespace addon |
| 34 | #define INPUTSTREAM_MAX_STRING_LANGUAGE_SIZE 64 | 25 | { |
| 35 | 26 | ||
| 36 | #ifdef __cplusplus | 27 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |
| 37 | extern "C" | 28 | // "C++" Doxygen group set for the definitions |
| 29 | //{{{ | ||
| 30 | |||
| 31 | //============================================================================== | ||
| 32 | /// @defgroup cpp_kodi_addon_inputstream_Defs Definitions, structures and enumerators | ||
| 33 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 34 | /// @brief **Inputstream add-on instance definition values**\n | ||
| 35 | /// All inputstream functions associated data structures. | ||
| 36 | /// | ||
| 37 | /// Used to exchange the available options between Kodi and addon.\n | ||
| 38 | /// The groups described here correspond to the groups of functions on inputstream | ||
| 39 | /// instance class. | ||
| 40 | /// | ||
| 41 | /// In addition, some of the things described here are also used on the | ||
| 42 | /// @ref cpp_kodi_addon_videocodec "video codec" addon. | ||
| 43 | /// | ||
| 44 | |||
| 45 | //############################################################################## | ||
| 46 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface 1. Interface | ||
| 47 | /// @ingroup cpp_kodi_addon_inputstream_Defs | ||
| 48 | /// @brief **Inputstream add-on general variables**\n | ||
| 49 | /// Used to exchange the available options between Kodi and addon. | ||
| 50 | /// | ||
| 51 | |||
| 52 | //############################################################################## | ||
| 53 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamConstants 2. Stream constants | ||
| 54 | /// @ingroup cpp_kodi_addon_inputstream_Defs | ||
| 55 | /// @brief **Used to exchange any additional data between the caller and processor.**\n | ||
| 56 | /// This includes the standardized values, in addition, an addon can also use | ||
| 57 | /// its own special uses to be exchanged in the same way. | ||
| 58 | /// | ||
| 59 | /// These values can be used by other addons (e.g. video addon) or stream files | ||
| 60 | /// to select the respective inputstream addon and to transfer additional values. | ||
| 61 | /// | ||
| 62 | /// ---------------------------------------------------------------------------- | ||
| 63 | /// | ||
| 64 | /// **Example:** | ||
| 65 | /// | ||
| 66 | /// This example use the @ref STREAM_PROPERTY_INPUTSTREAM on a <b>`*.strm`</b> | ||
| 67 | /// file to select needed addon and a additional value where related to selected | ||
| 68 | /// addon itself. | ||
| 69 | /// | ||
| 70 | /// ~~~~~~~~~~~~ | ||
| 71 | /// #KODIPROP:inputstream=inputstream.adaptive | ||
| 72 | /// #KODIPROP:inputstream.adaptive.manifest_type=mpd | ||
| 73 | /// http://rdmedia.bbc.co.uk/dash/ondemand/testcard/1/client_manifest-events-multilang.mpd | ||
| 74 | /// ~~~~~~~~~~~~ | ||
| 75 | /// | ||
| 76 | /// These are then given to Kodi and the respectively selected addon by means of | ||
| 77 | /// his @ref kodi::addon::CInstanceInputStream::Open "Open" call | ||
| 78 | /// in @ref kodi::addon::InputstreamProperty::GetProperties. | ||
| 79 | /// | ||
| 80 | /// The largest possible amount of these <b>`#KODIPROP`</b> values is defined | ||
| 81 | /// with @ref STREAM_MAX_PROPERTY_COUNT. | ||
| 82 | /// | ||
| 83 | |||
| 84 | //############################################################################## | ||
| 85 | /// @defgroup cpp_kodi_addon_inputstream_Defs_TimingConstants 3. Stream timing | ||
| 86 | /// @ingroup cpp_kodi_addon_inputstream_Defs | ||
| 87 | /// @brief **Timebase and timestamp definitions.**\n | ||
| 88 | /// Used to exchange the available options between Kodi and addon. | ||
| 89 | /// | ||
| 90 | |||
| 91 | //############################################################################## | ||
| 92 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamCodec 4. Stream codec | ||
| 93 | /// @ingroup cpp_kodi_addon_inputstream_Defs | ||
| 94 | /// @brief **Inputstream codec control**\n | ||
| 95 | /// Used to manage stream codec data. | ||
| 96 | /// | ||
| 97 | |||
| 98 | //############################################################################## | ||
| 99 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamEncryption 5. Stream encryption | ||
| 100 | /// @ingroup cpp_kodi_addon_inputstream_Defs | ||
| 101 | /// @brief **Inputstream encryption control**\n | ||
| 102 | /// Used to manage encrypted streams within addon. | ||
| 103 | /// | ||
| 104 | |||
| 105 | //}}} | ||
| 106 | //______________________________________________________________________________ | ||
| 107 | |||
| 108 | class CInstanceInputStream; | ||
| 109 | |||
| 110 | //============================================================================== | ||
| 111 | /// @defgroup cpp_kodi_addon_inputstream_Defs_InputstreamProperty class InputstreamProperty | ||
| 112 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 113 | /// @brief <b>URL and Data of key/value pairs passed to addon on @ref kodi::addon::CInstanceInputStream::Open "Open".</b>\n | ||
| 114 | /// This is used to have the necessary data of the stream to be opened. | ||
| 115 | /// | ||
| 116 | /// ---------------------------------------------------------------------------- | ||
| 117 | /// | ||
| 118 | /// @copydetails cpp_kodi_addon_inputstream_Defs_InputstreamProperty_Help | ||
| 119 | /// | ||
| 120 | /// @warning This data are only given from Kodi to addon and can't be used | ||
| 121 | /// on other places on addon. | ||
| 122 | /// | ||
| 123 | ///@{ | ||
| 124 | class ATTRIBUTE_HIDDEN InputstreamProperty | ||
| 125 | : public CStructHdl<InputstreamProperty, INPUTSTREAM_PROPERTY> | ||
| 38 | { | 126 | { |
| 39 | #endif /* __cplusplus */ | 127 | /*! \cond PRIVATE */ |
| 128 | friend class CInstanceInputStream; | ||
| 129 | /*! \endcond */ | ||
| 40 | 130 | ||
| 41 | /*! | 131 | public: |
| 42 | * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. | 132 | /// @defgroup cpp_kodi_addon_inputstream_Defs_InputstreamProperty_Help Value Help |
| 43 | */ | 133 | /// @ingroup cpp_kodi_addon_inputstream_Defs_InputstreamProperty |
| 44 | struct INPUTSTREAM_CAPABILITIES | 134 | /// |
| 135 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_InputstreamProperty :</b> | ||
| 136 | /// | Name | Type | Get call | ||
| 137 | /// |------|------|---------- | ||
| 138 | /// | **Stream URL** | `std::string` | @ref InputstreamProperty::GetURL "GetURL" | ||
| 139 | /// | **Mime type** | `std::string` | @ref InputstreamProperty::GetMimeType "GetMimeType" | ||
| 140 | /// | **Available amount of properties** | `unsigned int` | @ref InputstreamProperty::GetPropertiesAmount "GetPropertiesAmount" | ||
| 141 | /// | **List of properties** | `std::map<std::string, std::string>` | @ref InputstreamProperty::GetProperties "GetProperties" | ||
| 142 | /// | **Get addon library folder** | `std::string` | @ref InputstreamProperty::GetLibFolder "GetLibFolder" | ||
| 143 | /// | **Get addon profile/user folder** | `std::string` | @ref InputstreamProperty::GetProfileFolder "GetProfileFolder" | ||
| 144 | |||
| 145 | /// @addtogroup cpp_kodi_addon_inputstream_Defs_InputstreamProperty | ||
| 146 | ///@{ | ||
| 147 | |||
| 148 | /// @brief Stream URL to open. | ||
| 149 | std::string GetURL() const { return m_cStructure->m_strURL; } | ||
| 150 | |||
| 151 | /// @brief Stream mime type. | ||
| 152 | std::string GetMimeType() const { return m_cStructure->m_mimeType; } | ||
| 153 | |||
| 154 | /// @brief Amount of available properties. | ||
| 155 | unsigned int GetPropertiesAmount() const | ||
| 45 | { | 156 | { |
| 46 | enum MASKTYPE : uint32_t | 157 | return m_cStructure->m_nCountInfoValues; |
| 158 | } | ||
| 159 | |||
| 160 | /// @brief List of available properties- | ||
| 161 | const std::map<std::string, std::string> GetProperties() const | ||
| 162 | { | ||
| 163 | std::map<std::string, std::string> props; | ||
| 164 | for (unsigned int i = 0; i < m_cStructure->m_nCountInfoValues; ++i) | ||
| 47 | { | 165 | { |
| 48 | /// supports interface IDemux | 166 | props.emplace(m_cStructure->m_ListItemProperties[i].m_strKey, |
| 49 | SUPPORTS_IDEMUX = (1 << 0), | 167 | m_cStructure->m_ListItemProperties[i].m_strValue); |
| 168 | } | ||
| 169 | return props; | ||
| 170 | } | ||
| 171 | |||
| 172 | /// @brief Get addon library folder. | ||
| 173 | /// | ||
| 174 | /// @note As alternative can also @ref kodi::GetAddonPath used. | ||
| 175 | std::string GetLibFolder() const { return m_cStructure->m_libFolder; } | ||
| 176 | |||
| 177 | /// @brief Get addon profile/user folder. | ||
| 178 | /// | ||
| 179 | /// @note As alternative can also @ref kodi::GetBaseUserPath used. | ||
| 180 | std::string GetProfileFolder() const { return m_cStructure->m_profileFolder; } | ||
| 181 | |||
| 182 | ///@} | ||
| 183 | |||
| 184 | private: | ||
| 185 | InputstreamProperty() = delete; | ||
| 186 | InputstreamProperty(const InputstreamProperty& stream) = delete; | ||
| 187 | InputstreamProperty(const INPUTSTREAM_PROPERTY* stream) : CStructHdl(stream) {} | ||
| 188 | InputstreamProperty(INPUTSTREAM_PROPERTY* stream) : CStructHdl(stream) {} | ||
| 189 | }; | ||
| 190 | ///@} | ||
| 191 | //------------------------------------------------------------------------------ | ||
| 192 | |||
| 193 | //============================================================================== | ||
| 194 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities class InputstreamCapabilities | ||
| 195 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 196 | /// @brief **InputStream add-on capabilities. All capabilities are set to "false" as default.**\n | ||
| 197 | /// Asked to addon on @ref kodi::addon::CInstanceInputStream::GetCapabilities "GetCapabilities". | ||
| 198 | /// | ||
| 199 | /// ---------------------------------------------------------------------------- | ||
| 200 | /// | ||
| 201 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities_Help | ||
| 202 | /// | ||
| 203 | ///@{ | ||
| 204 | class ATTRIBUTE_HIDDEN InputstreamCapabilities | ||
| 205 | : public CStructHdl<InputstreamCapabilities, INPUTSTREAM_CAPABILITIES> | ||
| 206 | { | ||
| 207 | /*! \cond PRIVATE */ | ||
| 208 | friend class CInstanceInputStream; | ||
| 209 | /*! \endcond */ | ||
| 50 | 210 | ||
| 51 | /// supports interface IPosTime | 211 | public: |
| 52 | SUPPORTS_IPOSTIME = (1 << 1), | 212 | /*! \cond PRIVATE */ |
| 213 | InputstreamCapabilities() = default; | ||
| 214 | InputstreamCapabilities(const InputstreamCapabilities& stream) : CStructHdl(stream) {} | ||
| 215 | /*! \endcond */ | ||
| 53 | 216 | ||
| 54 | /// supports interface IDisplayTime | 217 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities_Help Value Help |
| 55 | SUPPORTS_IDISPLAYTIME = (1 << 2), | 218 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities |
| 219 | /// | ||
| 220 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities :</b> | ||
| 221 | /// | Name | Type | Set call | Get call | ||
| 222 | /// |------|------|----------|---------- | ||
| 223 | /// | **Capabilities bit mask** | `uint32_t` | @ref InputstreamCapabilities::SetMask "SetMask" | @ref InputstreamCapabilities::GetMask "GetMask" | ||
| 56 | 224 | ||
| 57 | /// supports seek | 225 | /// @addtogroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities |
| 58 | SUPPORTS_SEEK = (1 << 3), | 226 | ///@{ |
| 59 | 227 | ||
| 60 | /// supports pause | 228 | /// @brief Set of supported capabilities. |
| 61 | SUPPORTS_PAUSE = (1 << 4), | 229 | void SetMask(uint32_t mask) const { m_cStructure->m_mask = mask; } |
| 62 | 230 | ||
| 63 | /// supports interface ITime | 231 | /// @brief Get of supported capabilities. |
| 64 | SUPPORTS_ITIME = (1 << 5), | 232 | uint32_t GetMask() const { return m_cStructure->m_mask; } |
| 65 | 233 | ||
| 66 | /// supports interface IChapter | 234 | ///@} |
| 67 | SUPPORTS_ICHAPTER = (1 << 6), | ||
| 68 | }; | ||
| 69 | 235 | ||
| 70 | /// set of supported capabilities | 236 | private: |
| 71 | uint32_t m_mask; | 237 | InputstreamCapabilities(const INPUTSTREAM_CAPABILITIES* stream) : CStructHdl(stream) {} |
| 72 | }; | 238 | InputstreamCapabilities(INPUTSTREAM_CAPABILITIES* stream) : CStructHdl(stream) {} |
| 239 | }; | ||
| 240 | ///@} | ||
| 241 | //------------------------------------------------------------------------------ | ||
| 242 | |||
| 243 | //============================================================================== | ||
| 244 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata class InputstreamMasteringMetadata | ||
| 245 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 246 | /// @brief **Mastering metadata.**\n | ||
| 247 | /// Describes the metadata for [HDR10](https://en.wikipedia.org/wiki/High-dynamic-range_video). | ||
| 248 | /// | ||
| 249 | /// Used when video is compressed using [High Efficiency Video Coding (HEVC)](https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding). | ||
| 250 | /// This is used to describe the capabilities of the display used to master the | ||
| 251 | /// content and the luminance values of the content. | ||
| 252 | /// | ||
| 253 | /// Used on @ref kodi::addon::InputstreamInfo::SetMasteringMetadata and @ref kodi::addon::InputstreamInfo::GetMasteringMetadata. | ||
| 254 | /// | ||
| 255 | /// ---------------------------------------------------------------------------- | ||
| 256 | /// | ||
| 257 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata_Help | ||
| 258 | /// | ||
| 259 | ///@{ | ||
| 260 | class ATTRIBUTE_HIDDEN InputstreamMasteringMetadata | ||
| 261 | : public CStructHdl<InputstreamMasteringMetadata, INPUTSTREAM_MASTERING_METADATA> | ||
| 262 | { | ||
| 263 | /*! \cond PRIVATE */ | ||
| 264 | friend class CInstanceInputStream; | ||
| 265 | friend class InputstreamInfo; | ||
| 266 | /*! \endcond */ | ||
| 73 | 267 | ||
| 74 | /*! | 268 | public: |
| 75 | * @brief structure of key/value pairs passed to addon on Open() | 269 | /*! \cond PRIVATE */ |
| 76 | */ | 270 | InputstreamMasteringMetadata() = default; |
| 77 | struct INPUTSTREAM | 271 | InputstreamMasteringMetadata(const InputstreamMasteringMetadata& stream) : CStructHdl(stream) {} |
| 272 | /*! \endcond */ | ||
| 273 | |||
| 274 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata_Help Value Help | ||
| 275 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata | ||
| 276 | /// | ||
| 277 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata :</b> | ||
| 278 | /// | Name | Type | Set call | Get call | ||
| 279 | /// |------|------|----------|---------- | ||
| 280 | /// | **Chromaticity X coordinates of the red** | `double` | @ref InputstreamMasteringMetadata::SetPrimaryR_ChromaticityX "SetPrimaryR_ChromaticityX" | @ref InputstreamMasteringMetadata::GetPrimaryR_ChromaticityX "GetPrimaryR_ChromaticityX" | ||
| 281 | /// | **Chromaticity Y coordinates of the red** | `double` | @ref InputstreamMasteringMetadata::SetPrimaryR_ChromaticityY "SetPrimaryR_ChromaticityY" | @ref InputstreamMasteringMetadata::GetPrimaryR_ChromaticityY "GetPrimaryR_ChromaticityY" | ||
| 282 | /// | **Chromaticity X coordinates of the green** | `double` | @ref InputstreamMasteringMetadata::SetPrimaryG_ChromaticityX "SetPrimaryG_ChromaticityX" | @ref InputstreamMasteringMetadata::GetPrimaryG_ChromaticityX "GetPrimaryG_ChromaticityX" | ||
| 283 | /// | **Chromaticity Y coordinates of the green** | `double` | @ref InputstreamMasteringMetadata::SetPrimaryG_ChromaticityY "SetPrimaryG_ChromaticityY" | @ref InputstreamMasteringMetadata::GetPrimaryG_ChromaticityY "GetPrimaryG_ChromaticityY" | ||
| 284 | /// | **Chromaticity X coordinates of the blue** | `double` | @ref InputstreamMasteringMetadata::SetPrimaryB_ChromaticityX "SetPrimaryB_ChromaticityX" | @ref InputstreamMasteringMetadata::GetPrimaryB_ChromaticityX "GetPrimaryB_ChromaticityX" | ||
| 285 | /// | **Chromaticity Y coordinates of the blue** | `double` | @ref InputstreamMasteringMetadata::SetPrimaryB_ChromaticityY "SetPrimaryB_ChromaticityY" | @ref InputstreamMasteringMetadata::GetPrimaryB_ChromaticityY "GetPrimaryB_ChromaticityY" | ||
| 286 | /// | **Chromaticity X coordinates of the white point** | `double` | @ref InputstreamMasteringMetadata::SetWhitePoint_ChromaticityX "SetWhitePoint_ChromaticityX" | @ref InputstreamMasteringMetadata::GetWhitePoint_ChromaticityX "GetWhitePoint_ChromaticityX" | ||
| 287 | /// | **Chromaticity Y coordinates of the white point** | `double` | @ref InputstreamMasteringMetadata::SetWhitePoint_ChromaticityY "SetWhitePoint_ChromaticityY" | @ref InputstreamMasteringMetadata::GetWhitePoint_ChromaticityY "GetWhitePoint_ChromaticityY" | ||
| 288 | /// | **Maximum number of bits of the display** | `double` | @ref InputstreamMasteringMetadata::SetLuminanceMax "SetLuminanceMax" | @ref InputstreamMasteringMetadata::GetLuminanceMax "GetLuminanceMax" | ||
| 289 | /// | **Minimum number of bits of the display** | `double` | @ref InputstreamMasteringMetadata::SetLuminanceMin "SetLuminanceMin" | @ref InputstreamMasteringMetadata::GetLuminanceMin "GetLuminanceMin" | ||
| 290 | |||
| 291 | /// @addtogroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata | ||
| 292 | ///@{ | ||
| 293 | |||
| 294 | /// @brief Metadata class compare. | ||
| 295 | /// | ||
| 296 | /// To compare the metadata with another one. | ||
| 297 | /// | ||
| 298 | /// @return true if they equal, false otherwise | ||
| 299 | bool operator==(const kodi::addon::InputstreamMasteringMetadata& right) const | ||
| 78 | { | 300 | { |
| 79 | const char* m_strURL; | 301 | if (memcmp(m_cStructure, right.m_cStructure, sizeof(INPUTSTREAM_MASTERING_METADATA)) == 0) |
| 80 | const char* m_mimeType; | 302 | return true; |
| 303 | return false; | ||
| 304 | } | ||
| 81 | 305 | ||
| 82 | unsigned int m_nCountInfoValues; | 306 | /// @brief Set the chromaticity coordinates of the red value in the |
| 83 | struct LISTITEMPROPERTY | 307 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. |
| 84 | { | 308 | /// |
| 85 | const char* m_strKey; | 309 | /// X coordinate. The values are normalized to 50,000. |
| 86 | const char* m_strValue; | 310 | void SetPrimaryR_ChromaticityX(double value) { m_cStructure->primary_r_chromaticity_x = value; } |
| 87 | } m_ListItemProperties[STREAM_MAX_PROPERTY_COUNT]; | 311 | |
| 88 | 312 | /// @brief Get the chromaticity X coordinates of the red value. | |
| 89 | const char* m_libFolder; | 313 | double GetPrimaryR_ChromaticityX() { return m_cStructure->primary_r_chromaticity_x; } |
| 90 | const char* m_profileFolder; | 314 | |
| 91 | }; | 315 | /// @brief The chromaticity coordinates of the red value in the |
| 92 | 316 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. | |
| 93 | /*! | 317 | /// |
| 94 | * @brief Array of stream IDs | 318 | /// Y coordinate. The values are normalized to 50,000. |
| 95 | */ | 319 | void SetPrimaryR_ChromaticityY(double value) { m_cStructure->primary_r_chromaticity_y = value; } |
| 96 | struct INPUTSTREAM_IDS | 320 | |
| 97 | { | 321 | /// @brief Get the chromaticity Y coordinates of the red value. |
| 98 | unsigned int m_streamCount; | 322 | double GetPrimaryR_ChromaticityY() { return m_cStructure->primary_r_chromaticity_y; } |
| 99 | unsigned int m_streamIds[INPUTSTREAM_MAX_STREAM_COUNT]; | 323 | |
| 100 | }; | 324 | /// @brief Set the chromaticity coordinates of the green value in the |
| 101 | 325 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. | |
| 102 | /*! | 326 | /// |
| 103 | * @brief MASTERING Metadata | 327 | /// X coordinate. The values are normalized to 50,000. |
| 104 | */ | 328 | void SetPrimaryG_ChromaticityX(double value) { m_cStructure->primary_g_chromaticity_x = value; } |
| 105 | struct INPUTSTREAM_MASTERING_METADATA | 329 | |
| 106 | { | 330 | /// @brief Get the chromaticity X coordinates of the green value. |
| 107 | double primary_r_chromaticity_x; | 331 | double GetPrimaryG_ChromaticityX() { return m_cStructure->primary_g_chromaticity_x; } |
| 108 | double primary_r_chromaticity_y; | 332 | |
| 109 | double primary_g_chromaticity_x; | 333 | /// @brief Set the chromaticity coordinates of the green value in the |
| 110 | double primary_g_chromaticity_y; | 334 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. |
| 111 | double primary_b_chromaticity_x; | 335 | /// |
| 112 | double primary_b_chromaticity_y; | 336 | /// Y coordinate. The values are normalized to 50,000. |
| 113 | double white_point_chromaticity_x; | 337 | void SetPrimaryG_ChromaticityY(double value) { m_cStructure->primary_g_chromaticity_y = value; } |
| 114 | double white_point_chromaticity_y; | 338 | |
| 115 | double luminance_max; | 339 | /// @brief Get the chromaticity Y coordinates of the green value. |
| 116 | double luminance_min; | 340 | double GetPrimaryG_ChromaticityY() { return m_cStructure->primary_g_chromaticity_y; } |
| 117 | }; | 341 | |
| 118 | 342 | /// @brief The chromaticity coordinates of the blue value in the | |
| 119 | /*! | 343 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. |
| 120 | * @brief CONTENTLIGHT Metadata | 344 | /// |
| 121 | */ | 345 | /// X coordinate. The values are normalized to 50,000. |
| 122 | struct INPUTSTREAM_CONTENTLIGHT_METADATA | 346 | void SetPrimaryB_ChromaticityX(double value) { m_cStructure->primary_b_chromaticity_x = value; } |
| 123 | { | 347 | |
| 124 | uint64_t max_cll; | 348 | /// @brief Get the chromaticity X coordinates of the blue value. |
| 125 | uint64_t max_fall; | 349 | double GetPrimaryB_ChromaticityX() { return m_cStructure->primary_b_chromaticity_x; } |
| 126 | }; | 350 | |
| 127 | 351 | /// @brief The chromaticity coordinates of the blue value in the | |
| 128 | /*! | 352 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. |
| 129 | * @brief stream properties | 353 | /// |
| 130 | */ | 354 | /// Y coordinate. The values are normalized to 50,000. |
| 131 | struct INPUTSTREAM_INFO | 355 | void SetPrimaryB_ChromaticityY(double value) { m_cStructure->primary_b_chromaticity_y = value; } |
| 132 | { | 356 | |
| 133 | enum STREAM_TYPE | 357 | /// @brief Get the chromaticity Y coordinates of the blue value. |
| 134 | { | 358 | double GetPrimaryB_ChromaticityY() { return m_cStructure->primary_b_chromaticity_y; } |
| 135 | TYPE_NONE = 0, | 359 | |
| 136 | TYPE_VIDEO, | 360 | /// @brief Set the chromaticity coordinates of the white point in the |
| 137 | TYPE_AUDIO, | 361 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. |
| 138 | TYPE_SUBTITLE, | 362 | /// |
| 139 | TYPE_TELETEXT, | 363 | /// X coordinate. The values are normalized to 50,000. |
| 140 | TYPE_RDS, | 364 | void SetWhitePoint_ChromaticityX(double value) |
| 141 | } m_streamType; | 365 | { |
| 142 | 366 | m_cStructure->white_point_chromaticity_x = value; | |
| 143 | enum Codec_FEATURES : uint32_t | 367 | } |
| 144 | { | ||
| 145 | FEATURE_DECODE = 1 | ||
| 146 | }; | ||
| 147 | uint32_t m_features; | ||
| 148 | 368 | ||
| 149 | enum STREAM_FLAGS : uint32_t | 369 | /// @brief Get the chromaticity X coordinates of the white point |
| 150 | { | 370 | double GetWhitePoint_ChromaticityX() { return m_cStructure->white_point_chromaticity_x; } |
| 151 | FLAG_NONE = 0x0000, | 371 | |
| 152 | FLAG_DEFAULT = 0x0001, | 372 | /// @brief Set the chromaticity coordinates of the white point in the |
| 153 | FLAG_DUB = 0x0002, | 373 | /// [CIE1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space. |
| 154 | FLAG_ORIGINAL = 0x0004, | 374 | /// |
| 155 | FLAG_COMMENT = 0x0008, | 375 | /// Y coordinate. The values are normalized to 50,000. |
| 156 | FLAG_LYRICS = 0x0010, | 376 | void SetWhitePoint_ChromaticityY(double value) |
| 157 | FLAG_KARAOKE = 0x0020, | 377 | { |
| 158 | FLAG_FORCED = 0x0040, | 378 | m_cStructure->white_point_chromaticity_y = value; |
| 159 | FLAG_HEARING_IMPAIRED = 0x0080, | 379 | } |
| 160 | FLAG_VISUAL_IMPAIRED = 0x0100, | 380 | |
| 161 | }; | 381 | /// @brief Get the chromaticity Y coordinates of the white point. |
| 162 | 382 | double GetWhitePoint_ChromaticityY() { return m_cStructure->white_point_chromaticity_y; } | |
| 163 | // Keep in sync with AVColorSpace | 383 | |
| 164 | enum COLORSPACE | 384 | /// @brief Set the maximum number of bits of the display used to master the content. |
| 165 | { | 385 | /// |
| 166 | COLORSPACE_RGB = 0, | 386 | /// Values are normalized to 10,000. |
| 167 | COLORSPACE_BT709 = 1, | 387 | void SetLuminanceMax(double value) { m_cStructure->luminance_max = value; } |
| 168 | COLORSPACE_UNSPECIFIED = 2, | 388 | |
| 169 | COLORSPACE_UNKNOWN = COLORSPACE_UNSPECIFIED, // compatibility | 389 | /// @brief Get the maximum number of bits of the display. |
| 170 | COLORSPACE_RESERVED = 3, | 390 | double GetLuminanceMax() { return m_cStructure->luminance_max; } |
| 171 | COLORSPACE_FCC = 4, | 391 | |
| 172 | COLORSPACE_BT470BG = 5, | 392 | /// @brief Set the minimum number of bits of the display used to master the content. |
| 173 | COLORSPACE_SMPTE170M = 6, | 393 | /// |
| 174 | COLORSPACE_SMPTE240M = 7, | 394 | /// Values are normalized to 10,000. |
| 175 | COLORSPACE_YCGCO = 8, | 395 | void SetLuminanceMin(double value) { m_cStructure->luminance_min = value; } |
| 176 | COLORSPACE_YCOCG = COLORSPACE_YCGCO, | 396 | |
| 177 | COLORSPACE_BT2020_NCL = 9, | 397 | /// @brief Get the minimum number of bits of the display. |
| 178 | COLORSPACE_BT2020_CL = 10, | 398 | double GetLuminanceMin() { return m_cStructure->luminance_min; } |
| 179 | COLORSPACE_SMPTE2085 = 11, | 399 | |
| 180 | COLORSPACE_CHROMA_DERIVED_NCL = 12, | 400 | ///@} |
| 181 | COLORSPACE_CHROMA_DERIVED_CL = 13, | 401 | |
| 182 | COLORSPACE_ICTCP = 14, | 402 | private: |
| 183 | COLORSPACE_MAX | 403 | InputstreamMasteringMetadata(const INPUTSTREAM_MASTERING_METADATA* stream) : CStructHdl(stream) {} |
| 184 | }; | 404 | InputstreamMasteringMetadata(INPUTSTREAM_MASTERING_METADATA* stream) : CStructHdl(stream) {} |
| 185 | 405 | }; | |
| 186 | // Keep in sync with AVColorPrimaries | 406 | ///@} |
| 187 | enum COLORPRIMARIES : int32_t | 407 | //------------------------------------------------------------------------------ |
| 188 | { | 408 | |
| 189 | COLORPRIMARY_RESERVED0 = 0, | 409 | //============================================================================== |
| 190 | COLORPRIMARY_BT709 = 1, | 410 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata class InputstreamContentlightMetadata |
| 191 | COLORPRIMARY_UNSPECIFIED = 2, | 411 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface |
| 192 | COLORPRIMARY_RESERVED = 3, | 412 | /// @brief **Contentlight metadata**\n |
| 193 | COLORPRIMARY_BT470M = 4, | 413 | /// Describes the metadata for [HDR10](https://en.wikipedia.org/wiki/High-dynamic-range_video). |
| 194 | COLORPRIMARY_BT470BG = 5, | 414 | /// See also @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata "InputstreamMasteringMetadata". |
| 195 | COLORPRIMARY_SMPTE170M = 6, | 415 | /// |
| 196 | COLORPRIMARY_SMPTE240M = 7, | 416 | /// Used on @ref kodi::addon::InputstreamInfo::SetContentLightMetadata and @ref kodi::addon::InputstreamInfo::GetContentLightMetadata. |
| 197 | COLORPRIMARY_FILM = 8, | 417 | /// |
| 198 | COLORPRIMARY_BT2020 = 9, | 418 | /// ---------------------------------------------------------------------------- |
| 199 | COLORPRIMARY_SMPTE428 = 10, | 419 | /// |
| 200 | COLORPRIMARY_SMPTEST428_1 = COLORPRIMARY_SMPTE428, | 420 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata_Help |
| 201 | COLORPRIMARY_SMPTE431 = 11, | 421 | /// |
| 202 | COLORPRIMARY_SMPTE432 = 12, | 422 | ///@{ |
| 203 | COLORPRIMARY_JEDEC_P22 = 22, | 423 | class ATTRIBUTE_HIDDEN InputstreamContentlightMetadata |
| 204 | COLORPRIMARY_MAX | 424 | : public CStructHdl<InputstreamContentlightMetadata, INPUTSTREAM_CONTENTLIGHT_METADATA> |
| 205 | }; | 425 | { |
| 206 | 426 | /*! \cond PRIVATE */ | |
| 207 | // Keep in sync with AVColorRange | 427 | friend class CInstanceInputStream; |
| 208 | enum COLORRANGE | 428 | friend class InputstreamInfo; |
| 429 | /*! \endcond */ | ||
| 430 | |||
| 431 | public: | ||
| 432 | /*! \cond PRIVATE */ | ||
| 433 | InputstreamContentlightMetadata() = default; | ||
| 434 | InputstreamContentlightMetadata(const InputstreamContentlightMetadata& stream) | ||
| 435 | : CStructHdl(stream) | ||
| 436 | { | ||
| 437 | } | ||
| 438 | /*! \endcond */ | ||
| 439 | |||
| 440 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata_Help Value Help | ||
| 441 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata | ||
| 442 | /// | ||
| 443 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata :</b> | ||
| 444 | /// | Name | Type | Set call | Get call | ||
| 445 | /// |------|------|----------|---------- | ||
| 446 | /// | **Maximum content light level** | `double` | @ref InputstreamContentlightMetadata::SetMaxCll "SetMaxCll" | @ref InputstreamContentlightMetadata::GetMaxCll "GetMaxCll" | ||
| 447 | /// | **Maximum frame average light level** | `double` | @ref InputstreamContentlightMetadata::SetMaxFall "SetMaxFall" | @ref InputstreamContentlightMetadata::GetMaxFall "GetMaxFall" | ||
| 448 | |||
| 449 | /// @addtogroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata | ||
| 450 | ///@{ | ||
| 451 | |||
| 452 | /// @brief Metadata class compare. | ||
| 453 | /// | ||
| 454 | /// To compare the metadata with another one. | ||
| 455 | /// | ||
| 456 | /// @return true if they equal, false otherwise | ||
| 457 | bool operator==(const kodi::addon::InputstreamContentlightMetadata& right) const | ||
| 458 | { | ||
| 459 | if (memcmp(m_cStructure, right.m_cStructure, sizeof(INPUTSTREAM_CONTENTLIGHT_METADATA)) == 0) | ||
| 460 | return true; | ||
| 461 | return false; | ||
| 462 | } | ||
| 463 | |||
| 464 | /// @brief Set the maximum content light level (MaxCLL). | ||
| 465 | /// | ||
| 466 | /// This is the bit value corresponding to the brightest pixel used anywhere | ||
| 467 | /// in the content. | ||
| 468 | void SetMaxCll(uint64_t value) { m_cStructure->max_cll = value; } | ||
| 469 | |||
| 470 | /// @brief Get the maximum content light level (MaxCLL). | ||
| 471 | uint64_t GetMaxCll() { return m_cStructure->max_cll; } | ||
| 472 | |||
| 473 | /// @brief Set the maximum frame average light level (MaxFALL). | ||
| 474 | /// | ||
| 475 | /// This is the bit value corresponding to the average luminance of the frame | ||
| 476 | /// which has the brightest average luminance anywhere in the content. | ||
| 477 | void SetMaxFall(uint64_t value) { m_cStructure->max_fall = value; } | ||
| 478 | |||
| 479 | /// @brief Get the maximum frame average light level (MaxFALL). | ||
| 480 | uint64_t GetMaxFall() { return m_cStructure->max_fall; } | ||
| 481 | |||
| 482 | ///@} | ||
| 483 | |||
| 484 | private: | ||
| 485 | InputstreamContentlightMetadata(const INPUTSTREAM_CONTENTLIGHT_METADATA* stream) | ||
| 486 | : CStructHdl(stream) | ||
| 487 | { | ||
| 488 | } | ||
| 489 | InputstreamContentlightMetadata(INPUTSTREAM_CONTENTLIGHT_METADATA* stream) : CStructHdl(stream) {} | ||
| 490 | }; | ||
| 491 | ///@} | ||
| 492 | //------------------------------------------------------------------------------ | ||
| 493 | |||
| 494 | //============================================================================== | ||
| 495 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo class InputstreamInfo | ||
| 496 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 497 | /// @brief **Inputstream add-on stream info**\n | ||
| 498 | /// This is used to give Kodi the associated and necessary data for an open stream. | ||
| 499 | /// | ||
| 500 | /// Used on @ref kodi::addon::CInstanceInputStream::GetStream(). | ||
| 501 | /// | ||
| 502 | /// ---------------------------------------------------------------------------- | ||
| 503 | /// | ||
| 504 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo_Help | ||
| 505 | /// | ||
| 506 | ///@{ | ||
| 507 | class ATTRIBUTE_HIDDEN InputstreamInfo : public CStructHdl<InputstreamInfo, INPUTSTREAM_INFO> | ||
| 508 | { | ||
| 509 | /*! \cond PRIVATE */ | ||
| 510 | friend class CInstanceInputStream; | ||
| 511 | /*! \endcond */ | ||
| 512 | |||
| 513 | public: | ||
| 514 | /*! \cond PRIVATE */ | ||
| 515 | InputstreamInfo() = default; | ||
| 516 | InputstreamInfo(const InputstreamInfo& stream) : CStructHdl(stream) | ||
| 517 | { | ||
| 518 | SetCryptoSession(stream.GetCryptoSession()); | ||
| 519 | CopyExtraData(); | ||
| 520 | } | ||
| 521 | /*! \endcond */ | ||
| 522 | |||
| 523 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo_Help Value Help | ||
| 524 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo | ||
| 525 | /// | ||
| 526 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo :</b> | ||
| 527 | /// | Name | Type used | Required | Set call | Get call | ||
| 528 | /// |------|-----------|----------|----------|--------- | ||
| 529 | /// | **Stream type** | all | yes | @ref InputstreamInfo::SetStreamType "SetStreamType" | @ref InputstreamInfo::GetStreamType "GetStreamType" | ||
| 530 | /// | **Feature flags** | all | yes | @ref InputstreamInfo::SetFeatures "SetFeatures" | @ref InputstreamInfo::GetFeatures "GetFeatures" | ||
| 531 | /// | **Flags** | all | yes | @ref InputstreamInfo::SetFlags "SetFlags" | @ref InputstreamInfo::GetFlags "GetFlags" | ||
| 532 | /// | **Name** | all | no | @ref InputstreamInfo::SetName "SetName" | @ref InputstreamInfo::GetName "GetName" | ||
| 533 | /// | **Codec name** | all | yes | @ref InputstreamInfo::SetCodecName "SetCodecName" | @ref InputstreamInfo::GetCodecName "GetCodecName" | ||
| 534 | /// | **Codec internal name** | all | no | @ref InputstreamInfo::SetCodecInternalName "SetCodecInternalName" | @ref InputstreamInfo::GetCodecInternalName "GetCodecInternalName" | ||
| 535 | /// | **Codec Profile** | all | no | @ref InputstreamInfo::SetCodecProfile "SetCodecProfile" | @ref InputstreamInfo::GetCodecProfile "GetCodecProfile" | ||
| 536 | /// | **Physical index** | all | yes | @ref InputstreamInfo::SetPhysicalIndex "SetPhysicalIndex" | @ref InputstreamInfo::GetPhysicalIndex "GetPhysicalIndex" | ||
| 537 | /// | **Extra data** | Subtitle / all | Type related required | @ref InputstreamInfo::SetExtraData "SetExtraData" | @ref InputstreamInfo::GetExtraData "GetExtraData" | ||
| 538 | /// | **RFC 5646 language code** | all | no | @ref InputstreamInfo::SetLanguage "SetLanguage" | @ref InputstreamInfo::GetLanguage "GetLanguage" | ||
| 539 | /// | **FPS scale** | Video | Type related required | @ref InputstreamInfo::SetFpsScale "SetFpsScale" | @ref InputstreamInfo::GetFpsScale "GetFpsScale" | ||
| 540 | /// | **FPS rate** | Video | Type related required | @ref InputstreamInfo::SetFpsRate "SetFpsRate" | @ref InputstreamInfo::GetFpsRate "GetFpsRate" | ||
| 541 | /// | **Height** | Video | Type related required | @ref InputstreamInfo::SetHeight "SetHeight" | @ref InputstreamInfo::GetHeight "GetHeight" | ||
| 542 | /// | **Width** | Video | Type related required | @ref InputstreamInfo::SetWidth "SetWidth" | @ref InputstreamInfo::GetWidth "GetWidth" | ||
| 543 | /// | **Aspect** | Video | Type related required | @ref InputstreamInfo::SetAspect "SetAspect" | @ref InputstreamInfo::GetAspect "GetAspect" | ||
| 544 | /// | **Channel quantity** | Audio | Type related required | @ref InputstreamInfo::SetChannels "SetChannels" | @ref InputstreamInfo::GetChannels "GetChannels" | ||
| 545 | /// | **Sample rate** | Audio | Type related required | @ref InputstreamInfo::SetSampleRate "SetSampleRate" | @ref InputstreamInfo::GetSampleRate "GetSampleRate" | ||
| 546 | /// | **Bit rate** | Audio | Type related required | @ref InputstreamInfo::SetBitRate "SetBitRate" | @ref InputstreamInfo::GetBitRate "GetBitRate" | ||
| 547 | /// | **Bits per sample** | Audio | Type related required | @ref InputstreamInfo::SetBitsPerSample "SetBitsPerSample" | @ref InputstreamInfo::GetBitsPerSample "GetBitsPerSample" | ||
| 548 | /// | **Block align** | | no | @ref InputstreamInfo::SetBlockAlign "SetBlockAlign" | @ref InputstreamInfo::GetBlockAlign "GetBlockAlign" | ||
| 549 | /// | **Crypto session info** | | no | @ref InputstreamInfo::SetCryptoSession "SetCryptoSession" | @ref InputstreamInfo::GetCryptoSession "GetCryptoSession" | ||
| 550 | /// | **Four CC code** | | no | @ref InputstreamInfo::SetCodecFourCC "SetCodecFourCC" | @ref InputstreamInfo::GetCodecFourCC "GetCodecFourCC" | ||
| 551 | /// | **Color space** | | no | @ref InputstreamInfo::SetColorSpace "SetColorSpace" | @ref InputstreamInfo::GetColorSpace "GetColorSpace" | ||
| 552 | /// | **Color range** | | no | @ref InputstreamInfo::SetColorRange "SetColorRange" | @ref InputstreamInfo::GetColorRange "GetColorRange" | ||
| 553 | /// | **Color primaries** | | no | @ref InputstreamInfo::SetColorPrimaries "SetColorPrimaries" | @ref InputstreamInfo::GetColorPrimaries "GetColorPrimaries" | ||
| 554 | /// | **Color transfer characteristic** | | no | @ref InputstreamInfo::SetColorTransferCharacteristic "SetColorTransferCharacteristic" | @ref InputstreamInfo::GetColorTransferCharacteristic "GetColorTransferCharacteristic" | ||
| 555 | /// | **Mastering metadata** | | no | @ref InputstreamInfo::SetMasteringMetadata "SetMasteringMetadata" | @ref InputstreamInfo::GetMasteringMetadata "GetMasteringMetadata" | ||
| 556 | /// | **Content light metadata** | | no | @ref InputstreamInfo::SetContentLightMetadata "SetContentLightMetadata" | @ref InputstreamInfo::GetContentLightMetadata "GetContentLightMetadata" | ||
| 557 | /// | ||
| 558 | |||
| 559 | /// @addtogroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo | ||
| 560 | ///@{ | ||
| 561 | |||
| 562 | /// @brief Set the wanted stream type. | ||
| 563 | /// | ||
| 564 | /// @param[in] streamType By @ref INPUTSTREAM_TYPE defined type | ||
| 565 | void SetStreamType(INPUTSTREAM_TYPE streamType) { m_cStructure->m_streamType = streamType; } | ||
| 566 | |||
| 567 | /// @brief To get with @ref SetStreamType changed values. | ||
| 568 | INPUTSTREAM_TYPE GetStreamType() const { return m_cStructure->m_streamType; } | ||
| 569 | |||
| 570 | /// @brief Set special supported feature flags of inputstream. | ||
| 571 | /// | ||
| 572 | /// @param[in] features By @ref INPUTSTREAM_CODEC_FEATURES defined type | ||
| 573 | void SetFeatures(uint32_t features) { m_cStructure->m_features = features; } | ||
| 574 | |||
| 575 | /// @brief To get with @ref SetFeatures changed values. | ||
| 576 | uint32_t GetFeatures() const { return m_cStructure->m_features; } | ||
| 577 | |||
| 578 | /// @brief Set supported flags of inputstream. | ||
| 579 | /// | ||
| 580 | /// @param[in] flags The on @ref INPUTSTREAM_FLAGS defined flags to set | ||
| 581 | void SetFlags(uint32_t flags) { m_cStructure->m_flags = flags; } | ||
| 582 | |||
| 583 | /// @brief To get with @ref SetFeatures changed values. | ||
| 584 | uint32_t GetFlags() const { return m_cStructure->m_flags; } | ||
| 585 | |||
| 586 | /// @brief (optional) Name of the stream, leave empty for default handling. | ||
| 587 | /// | ||
| 588 | /// @param[in] name Stream name | ||
| 589 | void SetName(const std::string& name) | ||
| 590 | { | ||
| 591 | strncpy(m_cStructure->m_name, name.c_str(), INPUTSTREAM_MAX_STRING_NAME_SIZE); | ||
| 592 | } | ||
| 593 | |||
| 594 | /// @brief To get with @ref SetName changed values. | ||
| 595 | std::string GetName() const { return m_cStructure->m_name; } | ||
| 596 | |||
| 597 | /// @brief (required) Name of codec according to ffmpeg. | ||
| 598 | /// | ||
| 599 | /// See https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/codec_desc.c about | ||
| 600 | /// available names. | ||
| 601 | /// | ||
| 602 | /// @remark On @ref INPUTSTREAM_TYPE_TELETEXT and @ref INPUTSTREAM_TYPE_RDS | ||
| 603 | /// this can be ignored and leaved empty. | ||
| 604 | /// | ||
| 605 | /// @param[in] codeName Codec name | ||
| 606 | void SetCodecName(const std::string& codecName) | ||
| 607 | { | ||
| 608 | strncpy(m_cStructure->m_codecName, codecName.c_str(), INPUTSTREAM_MAX_STRING_CODEC_SIZE); | ||
| 609 | } | ||
| 610 | |||
| 611 | /// @brief To get with @ref SetCodecName changed values. | ||
| 612 | std::string GetCodecName() const { return m_cStructure->m_codecName; } | ||
| 613 | |||
| 614 | /// @brief (optional) Internal name of codec (selectionstream info). | ||
| 615 | /// | ||
| 616 | /// @param[in] codecName Internal codec name | ||
| 617 | void SetCodecInternalName(const std::string& codecName) | ||
| 618 | { | ||
| 619 | strncpy(m_cStructure->m_codecInternalName, codecName.c_str(), | ||
| 620 | INPUTSTREAM_MAX_STRING_CODEC_SIZE); | ||
| 621 | } | ||
| 622 | |||
| 623 | /// @brief To get with @ref SetCodecInternalName changed values. | ||
| 624 | std::string GetCodecInternalName() const { return m_cStructure->m_codecInternalName; } | ||
| 625 | |||
| 626 | /// @brief (optional) The profile of the codec. | ||
| 627 | /// | ||
| 628 | /// @param[in] codecProfile Values with @ref STREAMCODEC_PROFILE to use | ||
| 629 | void SetCodecProfile(STREAMCODEC_PROFILE codecProfile) | ||
| 630 | { | ||
| 631 | m_cStructure->m_codecProfile = codecProfile; | ||
| 632 | } | ||
| 633 | |||
| 634 | /// @brief To get with @ref SetCodecProfile changed values. | ||
| 635 | STREAMCODEC_PROFILE GetCodecProfile() const { return m_cStructure->m_codecProfile; } | ||
| 636 | |||
| 637 | /// @brief (required) Physical index. | ||
| 638 | /// | ||
| 639 | /// @param[in] id Index identifier | ||
| 640 | void SetPhysicalIndex(unsigned int id) { m_cStructure->m_pID = id; } | ||
| 641 | |||
| 642 | /// @brief To get with @ref SetPhysicalIndex changed values. | ||
| 643 | unsigned int GetPhysicalIndex() const { return m_cStructure->m_pID; } | ||
| 644 | |||
| 645 | /// @brief Additional data where can needed on streams. | ||
| 646 | /// | ||
| 647 | /// @param[in] extraData List with memory of extra data | ||
| 648 | void SetExtraData(const std::vector<uint8_t>& extraData) | ||
| 649 | { | ||
| 650 | m_extraData = extraData; | ||
| 651 | m_cStructure->m_ExtraData = m_extraData.data(); | ||
| 652 | m_cStructure->m_ExtraSize = m_extraData.size(); | ||
| 653 | } | ||
| 654 | |||
| 655 | /// @brief Additional data where can needed on streams. | ||
| 656 | /// | ||
| 657 | /// @param[in] extraData Pointer with memory of extra data | ||
| 658 | /// @param[in] extraSize Size to store | ||
| 659 | void SetExtraData(const uint8_t* extraData, size_t extraSize) | ||
| 660 | { | ||
| 661 | m_extraData.clear(); | ||
| 662 | if (extraData && extraSize > 0) | ||
| 209 | { | 663 | { |
| 210 | COLORRANGE_UNKNOWN = 0, | 664 | for (size_t i = 0; i < extraSize; ++i) |
| 211 | COLORRANGE_LIMITED, | 665 | m_extraData.emplace_back(extraData[i]); |
| 212 | COLORRANGE_FULLRANGE, | 666 | } |
| 213 | COLORRANGE_MAX | 667 | |
| 214 | }; | 668 | m_cStructure->m_ExtraData = m_extraData.data(); |
| 215 | 669 | m_cStructure->m_ExtraSize = m_extraData.size(); | |
| 216 | // keep in sync with AVColorTransferCharacteristic | 670 | } |
| 217 | enum COLORTRC : int32_t | 671 | |
| 672 | /// @brief To get with @ref SetExtraData changed values. | ||
| 673 | const std::vector<uint8_t>& GetExtraData() { return m_extraData; } | ||
| 674 | |||
| 675 | /// @brief To get size with @ref SetExtraData changed values. | ||
| 676 | size_t GetExtraDataSize() { return m_extraData.size(); } | ||
| 677 | |||
| 678 | /// @brief Compare extra data from outside with class | ||
| 679 | /// | ||
| 680 | /// @param[in] extraData Pointer with memory of extra data for compare | ||
| 681 | /// @param[in] extraSize Size to compare | ||
| 682 | /// @return true if they equal, false otherwise | ||
| 683 | bool CompareExtraData(const uint8_t* extraData, size_t extraSize) const | ||
| 684 | { | ||
| 685 | if (!extraData || m_extraData.size() != extraSize) | ||
| 686 | return false; | ||
| 687 | for (size_t i = 0; i < extraSize; ++i) | ||
| 218 | { | 688 | { |
| 219 | COLORTRC_RESERVED0 = 0, | 689 | if (m_extraData[i] != extraData[i]) |
| 220 | COLORTRC_BT709 = 1, | 690 | return false; |
| 221 | COLORTRC_UNSPECIFIED = 2, | 691 | } |
| 222 | COLORTRC_RESERVED = 3, | 692 | return true; |
| 223 | COLORTRC_GAMMA22 = 4, | 693 | } |
| 224 | COLORTRC_GAMMA28 = 5, | ||
| 225 | COLORTRC_SMPTE170M = 6, | ||
| 226 | COLORTRC_SMPTE240M = 7, | ||
| 227 | COLORTRC_LINEAR = 8, | ||
| 228 | COLORTRC_LOG = 9, | ||
| 229 | COLORTRC_LOG_SQRT = 10, | ||
| 230 | COLORTRC_IEC61966_2_4 = 11, | ||
| 231 | COLORTRC_BT1361_ECG = 12, | ||
| 232 | COLORTRC_IEC61966_2_1 = 13, | ||
| 233 | COLORTRC_BT2020_10 = 14, | ||
| 234 | COLORTRC_BT2020_12 = 15, | ||
| 235 | COLORTRC_SMPTE2084 = 16, | ||
| 236 | COLORTRC_SMPTEST2084 = COLORTRC_SMPTE2084, | ||
| 237 | COLORTRC_SMPTE428 = 17, | ||
| 238 | COLORTRC_SMPTEST428_1 = COLORTRC_SMPTE428, | ||
| 239 | COLORTRC_ARIB_STD_B67 = 18, | ||
| 240 | COLORTRC_MAX | ||
| 241 | }; | ||
| 242 | 694 | ||
| 243 | uint32_t m_flags; | 695 | /// @brief Clear additional data. |
| 696 | void ClearExtraData() | ||
| 697 | { | ||
| 698 | m_extraData.clear(); | ||
| 699 | m_cStructure->m_ExtraData = m_extraData.data(); | ||
| 700 | m_cStructure->m_ExtraSize = m_extraData.size(); | ||
| 701 | } | ||
| 244 | 702 | ||
| 245 | //! @brief (optional) name of the stream, \0 for default handling | 703 | /// @brief RFC 5646 language code (empty string if undefined). |
| 246 | char m_name[INPUTSTREAM_MAX_STRING_NAME_SIZE]; | 704 | /// |
| 705 | /// @param[in] language The language to set | ||
| 706 | void SetLanguage(const std::string& language) | ||
| 707 | { | ||
| 708 | strncpy(m_cStructure->m_language, language.c_str(), INPUTSTREAM_MAX_STRING_LANGUAGE_SIZE); | ||
| 709 | } | ||
| 247 | 710 | ||
| 248 | //! @brief (required) name of codec according to ffmpeg | 711 | /// @brief To get with @ref SetLanguage changed values. |
| 249 | char m_codecName[INPUTSTREAM_MAX_STRING_CODEC_SIZE]; | 712 | std::string GetLanguage() const { return m_cStructure->m_language; } |
| 250 | 713 | ||
| 251 | //! @brief (optional) internal name of codec (selectionstream info) | 714 | /// @brief Scale of 1000 and a rate of 29970 will result in 29.97 fps. |
| 252 | char m_codecInternalName[INPUTSTREAM_MAX_STRING_CODEC_SIZE]; | 715 | /// |
| 716 | /// @param[in] fpsScale Scale rate | ||
| 717 | void SetFpsScale(unsigned int fpsScale) { m_cStructure->m_FpsScale = fpsScale; } | ||
| 253 | 718 | ||
| 254 | //! @brief (optional) the profile of the codec | 719 | /// @brief To get with @ref SetFpsScale changed values. |
| 255 | STREAMCODEC_PROFILE m_codecProfile; | 720 | unsigned int GetFpsScale() const { return m_cStructure->m_FpsScale; } |
| 256 | 721 | ||
| 257 | //! @brief (required) physical index | 722 | /// @brief Rate to use for stream. |
| 258 | unsigned int m_pID; | 723 | /// |
| 724 | /// @param[in] fpsRate Rate to use | ||
| 725 | void SetFpsRate(unsigned int fpsRate) { m_cStructure->m_FpsRate = fpsRate; } | ||
| 259 | 726 | ||
| 260 | const uint8_t* m_ExtraData; | 727 | /// @brief To get with @ref SetFpsRate changed values. |
| 261 | unsigned int m_ExtraSize; | 728 | unsigned int GetFpsRate() const { return m_cStructure->m_FpsRate; } |
| 262 | 729 | ||
| 263 | //! @brief RFC 5646 language code (empty string if undefined) | 730 | /// @brief Height of the stream reported by the demuxer. |
| 264 | char m_language[INPUTSTREAM_MAX_STRING_LANGUAGE_SIZE]; | 731 | /// |
| 732 | /// @param[in] height Height to use | ||
| 733 | void SetHeight(unsigned int height) { m_cStructure->m_Height = height; } | ||
| 265 | 734 | ||
| 266 | //! Video stream related data | 735 | /// @brief To get with @ref SetHeight changed values. |
| 267 | //@{ | 736 | unsigned int GetHeight() const { return m_cStructure->m_Height; } |
| 268 | 737 | ||
| 269 | //! @brief Scale of 1000 and a rate of 29970 will result in 29.97 fps | 738 | /// @brief Width of the stream reported by the demuxer. |
| 270 | unsigned int m_FpsScale; | 739 | /// |
| 740 | /// @param[in] width Width to use | ||
| 741 | void SetWidth(unsigned int width) { m_cStructure->m_Width = width; } | ||
| 271 | 742 | ||
| 272 | unsigned int m_FpsRate; | 743 | /// @brief To get with @ref SetWidth changed values. |
| 744 | unsigned int GetWidth() const { return m_cStructure->m_Width; } | ||
| 273 | 745 | ||
| 274 | //! @brief height of the stream reported by the demuxer | 746 | /// @brief Display aspect of stream. |
| 275 | unsigned int m_Height; | 747 | /// |
| 748 | /// @param[in] aspect Aspect ratio to use | ||
| 749 | void SetAspect(float aspect) { m_cStructure->m_Aspect = aspect; } | ||
| 276 | 750 | ||
| 277 | //! @brief width of the stream reported by the demuxer | 751 | /// @brief To get with @ref SetAspect changed values. |
| 278 | unsigned int m_Width; | 752 | float GetAspect() const { return m_cStructure->m_Aspect; } |
| 279 | 753 | ||
| 280 | //! @brief display aspect of stream | 754 | /// @brief (required) Amount of channels. |
| 281 | float m_Aspect; | 755 | /// |
| 282 | 756 | /// @param[in] sampleRate Channels to use | |
| 283 | //@} | 757 | void SetChannels(unsigned int channels) { m_cStructure->m_Channels = channels; } |
| 284 | |||
| 285 | //! Audio stream related data | ||
| 286 | //@{ | ||
| 287 | |||
| 288 | //! @brief (required) amount of channels | ||
| 289 | unsigned int m_Channels; | ||
| 290 | |||
| 291 | //! @brief (required) sample rate | ||
| 292 | unsigned int m_SampleRate; | ||
| 293 | |||
| 294 | //! @brief (required) bit rate | ||
| 295 | unsigned int m_BitRate; | ||
| 296 | |||
| 297 | //! @brief (required) bits per sample | ||
| 298 | unsigned int m_BitsPerSample; | ||
| 299 | |||
| 300 | unsigned int m_BlockAlign; | ||
| 301 | |||
| 302 | //@} | ||
| 303 | |||
| 304 | CRYPTO_INFO m_cryptoInfo; | ||
| 305 | |||
| 306 | // new in API version 2.0.8 | ||
| 307 | //@{ | ||
| 308 | //! @brief Codec If available, the fourcc code codec | ||
| 309 | unsigned int m_codecFourCC; | ||
| 310 | |||
| 311 | //! @brief definition of colorspace | ||
| 312 | COLORSPACE m_colorSpace; | ||
| 313 | |||
| 314 | //! @brief color range if available | ||
| 315 | COLORRANGE m_colorRange; | ||
| 316 | //@} | ||
| 317 | |||
| 318 | //new in API 2.0.9 / INPUTSTREAM_VERSION_LEVEL 1 | ||
| 319 | //@{ | ||
| 320 | COLORPRIMARIES m_colorPrimaries; | ||
| 321 | COLORTRC m_colorTransferCharacteristic; | ||
| 322 | //@} | ||
| 323 | |||
| 324 | //! @brief mastering static Metadata | ||
| 325 | INPUTSTREAM_MASTERING_METADATA* m_masteringMetadata; | ||
| 326 | |||
| 327 | //! @brief content light static Metadata | ||
| 328 | INPUTSTREAM_CONTENTLIGHT_METADATA* m_contentLightMetadata; | ||
| 329 | }; | ||
| 330 | 758 | ||
| 331 | struct INPUTSTREAM_TIMES | 759 | /// @brief To get with @ref SetChannels changed values. |
| 332 | { | 760 | unsigned int GetChannels() const { return m_cStructure->m_Channels; } |
| 333 | time_t startTime; | ||
| 334 | double ptsStart; | ||
| 335 | double ptsBegin; | ||
| 336 | double ptsEnd; | ||
| 337 | }; | ||
| 338 | 761 | ||
| 339 | /*! | 762 | /// @brief (required) Sample rate. |
| 340 | * @brief "C" ABI Structures to transfer the methods from this to Kodi | 763 | /// |
| 341 | */ | 764 | /// @param[in] sampleRate Rate to use |
| 765 | void SetSampleRate(unsigned int sampleRate) { m_cStructure->m_SampleRate = sampleRate; } | ||
| 342 | 766 | ||
| 343 | // this are properties given to the addon on create | 767 | /// @brief To get with @ref SetSampleRate changed values. |
| 344 | // at this time we have no parameters for the addon | 768 | unsigned int GetSampleRate() const { return m_cStructure->m_SampleRate; } |
| 345 | typedef struct AddonProps_InputStream /* internal */ | 769 | |
| 770 | /// @brief Bit rate. | ||
| 771 | /// | ||
| 772 | /// @param[in] bitRate Rate to use | ||
| 773 | void SetBitRate(unsigned int bitRate) { m_cStructure->m_BitRate = bitRate; } | ||
| 774 | |||
| 775 | /// @brief To get with @ref SetBitRate changed values. | ||
| 776 | unsigned int GetBitRate() const { return m_cStructure->m_BitRate; } | ||
| 777 | |||
| 778 | /// @brief (required) Bits per sample. | ||
| 779 | /// | ||
| 780 | /// @param[in] bitsPerSample Bits per sample to use | ||
| 781 | void SetBitsPerSample(unsigned int bitsPerSample) | ||
| 346 | { | 782 | { |
| 347 | int dummy; | 783 | m_cStructure->m_BitsPerSample = bitsPerSample; |
| 348 | } AddonProps_InputStream; | 784 | } |
| 785 | |||
| 786 | /// @brief To get with @ref SetBitsPerSample changed values. | ||
| 787 | unsigned int GetBitsPerSample() const { return m_cStructure->m_BitsPerSample; } | ||
| 788 | |||
| 789 | /// @brief To set the necessary stream block alignment size. | ||
| 790 | /// | ||
| 791 | /// @param[in] blockAlign Block size in byte | ||
| 792 | void SetBlockAlign(unsigned int blockAlign) { m_cStructure->m_BlockAlign = blockAlign; } | ||
| 793 | |||
| 794 | /// @brief To get with @ref SetBlockAlign changed values. | ||
| 795 | unsigned int GetBlockAlign() const { return m_cStructure->m_BlockAlign; } | ||
| 349 | 796 | ||
| 350 | typedef struct AddonToKodiFuncTable_InputStream /* internal */ | 797 | /// @brief To set stream crypto session informations. |
| 798 | /// | ||
| 799 | /// @param[in] cryptoSession The with @ref cpp_kodi_addon_inputstream_Defs_Interface_StreamCryptoSession setable info | ||
| 800 | /// | ||
| 801 | void SetCryptoSession(const kodi::addon::StreamCryptoSession& cryptoSession) | ||
| 351 | { | 802 | { |
| 352 | KODI_HANDLE kodiInstance; | 803 | m_cryptoSession = cryptoSession; |
| 353 | DemuxPacket* (*allocate_demux_packet)(void* kodiInstance, int data_size); | 804 | memcpy(&m_cStructure->m_cryptoSession, m_cryptoSession.GetCStructure(), |
| 354 | DemuxPacket* (*allocate_encrypted_demux_packet)(void* kodiInstance, | 805 | sizeof(STREAM_CRYPTO_SESSION)); |
| 355 | unsigned int data_size, | 806 | } |
| 356 | unsigned int encrypted_subsample_count); | 807 | |
| 357 | void (*free_demux_packet)(void* kodiInstance, DemuxPacket* packet); | 808 | /// @brief To get with @ref GetCryptoSession changed values. |
| 358 | } AddonToKodiFuncTable_InputStream; | 809 | const kodi::addon::StreamCryptoSession& GetCryptoSession() const { return m_cryptoSession; } |
| 810 | |||
| 811 | /// @brief Codec If available, the fourcc code codec. | ||
| 812 | /// | ||
| 813 | /// @param[in] codecFourCC Codec four CC code | ||
| 814 | void SetCodecFourCC(unsigned int codecFourCC) { m_cStructure->m_codecFourCC = codecFourCC; } | ||
| 815 | |||
| 816 | /// @brief To get with @ref SetCodecFourCC changed values | ||
| 817 | unsigned int GetCodecFourCC() const { return m_cStructure->m_codecFourCC; } | ||
| 818 | |||
| 819 | /// @brief Definition of colorspace. | ||
| 820 | /// | ||
| 821 | /// @param[in] colorSpace The with @ref INPUTSTREAM_COLORSPACE setable color space | ||
| 822 | void SetColorSpace(INPUTSTREAM_COLORSPACE colorSpace) { m_cStructure->m_colorSpace = colorSpace; } | ||
| 823 | |||
| 824 | /// @brief To get with @ref SetColorSpace changed values. | ||
| 825 | INPUTSTREAM_COLORSPACE GetColorSpace() const { return m_cStructure->m_colorSpace; } | ||
| 826 | |||
| 827 | /// @brief Color range if available. | ||
| 828 | /// | ||
| 829 | /// @param[in] colorRange The with @ref INPUTSTREAM_COLORRANGE setable color space | ||
| 830 | void SetColorRange(INPUTSTREAM_COLORRANGE colorRange) { m_cStructure->m_colorRange = colorRange; } | ||
| 359 | 831 | ||
| 360 | struct AddonInstance_InputStream; | 832 | /// @brief To get with @ref SetColorRange changed values. |
| 361 | typedef struct KodiToAddonFuncTable_InputStream /* internal */ | 833 | INPUTSTREAM_COLORRANGE GetColorRange() const { return m_cStructure->m_colorRange; } |
| 834 | |||
| 835 | /// @brief Chromaticity coordinates of the source primaries. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.1. | ||
| 836 | /// | ||
| 837 | /// @param[in] colorPrimaries The with @ref INPUTSTREAM_COLORPRIMARIES setable values | ||
| 838 | void SetColorPrimaries(INPUTSTREAM_COLORPRIMARIES colorPrimaries) | ||
| 362 | { | 839 | { |
| 363 | KODI_HANDLE addonInstance; | 840 | m_cStructure->m_colorPrimaries = colorPrimaries; |
| 841 | } | ||
| 364 | 842 | ||
| 365 | bool(__cdecl* open)(const AddonInstance_InputStream* instance, INPUTSTREAM* props); | 843 | /// @brief To get with @ref SetColorPrimaries changed values. |
| 366 | void(__cdecl* close)(const AddonInstance_InputStream* instance); | 844 | INPUTSTREAM_COLORPRIMARIES GetColorPrimaries() const { return m_cStructure->m_colorPrimaries; } |
| 367 | const char*(__cdecl* get_path_list)(const AddonInstance_InputStream* instance); | ||
| 368 | void(__cdecl* get_capabilities)(const AddonInstance_InputStream* instance, | ||
| 369 | INPUTSTREAM_CAPABILITIES* capabilities); | ||
| 370 | 845 | ||
| 371 | // IDemux | 846 | /// @brief Color Transfer Characteristic. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.2. |
| 372 | struct INPUTSTREAM_IDS(__cdecl* get_stream_ids)(const AddonInstance_InputStream* instance); | 847 | /// |
| 373 | struct INPUTSTREAM_INFO(__cdecl* get_stream)(const AddonInstance_InputStream* instance, | 848 | /// @param[in] colorTransferCharacteristic The with @ref INPUTSTREAM_COLORTRC setable characteristic |
| 374 | int streamid); | 849 | void SetColorTransferCharacteristic(INPUTSTREAM_COLORTRC colorTransferCharacteristic) |
| 375 | void(__cdecl* enable_stream)(const AddonInstance_InputStream* instance, | 850 | { |
| 376 | int streamid, | 851 | m_cStructure->m_colorTransferCharacteristic = colorTransferCharacteristic; |
| 377 | bool enable); | 852 | } |
| 378 | bool(__cdecl* open_stream)(const AddonInstance_InputStream* instance, int streamid); | ||
| 379 | void(__cdecl* demux_reset)(const AddonInstance_InputStream* instance); | ||
| 380 | void(__cdecl* demux_abort)(const AddonInstance_InputStream* instance); | ||
| 381 | void(__cdecl* demux_flush)(const AddonInstance_InputStream* instance); | ||
| 382 | DemuxPacket*(__cdecl* demux_read)(const AddonInstance_InputStream* instance); | ||
| 383 | bool(__cdecl* demux_seek_time)(const AddonInstance_InputStream* instance, | ||
| 384 | double time, | ||
| 385 | bool backwards, | ||
| 386 | double* startpts); | ||
| 387 | void(__cdecl* demux_set_speed)(const AddonInstance_InputStream* instance, int speed); | ||
| 388 | void(__cdecl* set_video_resolution)(const AddonInstance_InputStream* instance, | ||
| 389 | int width, | ||
| 390 | int height); | ||
| 391 | |||
| 392 | // IDisplayTime | ||
| 393 | int(__cdecl* get_total_time)(const AddonInstance_InputStream* instance); | ||
| 394 | int(__cdecl* get_time)(const AddonInstance_InputStream* instance); | ||
| 395 | |||
| 396 | // ITime | ||
| 397 | bool(__cdecl* get_times)(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES* times); | ||
| 398 | |||
| 399 | // IPosTime | ||
| 400 | bool(__cdecl* pos_time)(const AddonInstance_InputStream* instance, int ms); | ||
| 401 | |||
| 402 | int(__cdecl* read_stream)(const AddonInstance_InputStream* instance, | ||
| 403 | uint8_t* buffer, | ||
| 404 | unsigned int bufferSize); | ||
| 405 | int64_t(__cdecl* seek_stream)(const AddonInstance_InputStream* instance, | ||
| 406 | int64_t position, | ||
| 407 | int whence); | ||
| 408 | int64_t(__cdecl* position_stream)(const AddonInstance_InputStream* instance); | ||
| 409 | int64_t(__cdecl* length_stream)(const AddonInstance_InputStream* instance); | ||
| 410 | bool(__cdecl* is_real_time_stream)(const AddonInstance_InputStream* instance); | ||
| 411 | |||
| 412 | // IChapter | ||
| 413 | int(__cdecl* get_chapter)(const AddonInstance_InputStream* instance); | ||
| 414 | int(__cdecl* get_chapter_count)(const AddonInstance_InputStream* instance); | ||
| 415 | const char*(__cdecl* get_chapter_name)(const AddonInstance_InputStream* instance, int ch); | ||
| 416 | int64_t(__cdecl* get_chapter_pos)(const AddonInstance_InputStream* instance, int ch); | ||
| 417 | bool(__cdecl* seek_chapter)(const AddonInstance_InputStream* instance, int ch); | ||
| 418 | |||
| 419 | int(__cdecl* block_size_stream)(const AddonInstance_InputStream* instance); | ||
| 420 | } KodiToAddonFuncTable_InputStream; | ||
| 421 | |||
| 422 | typedef struct AddonInstance_InputStream /* internal */ | ||
| 423 | { | ||
| 424 | AddonProps_InputStream* props; | ||
| 425 | AddonToKodiFuncTable_InputStream* toKodi; | ||
| 426 | KodiToAddonFuncTable_InputStream* toAddon; | ||
| 427 | } AddonInstance_InputStream; | ||
| 428 | 853 | ||
| 429 | #ifdef __cplusplus | 854 | /// @brief To get with @ref SetColorTransferCharacteristic changed values. |
| 430 | } /* extern "C" */ | 855 | INPUTSTREAM_COLORTRC GetColorTransferCharacteristic() const |
| 856 | { | ||
| 857 | return m_cStructure->m_colorTransferCharacteristic; | ||
| 858 | } | ||
| 431 | 859 | ||
| 432 | namespace kodi | 860 | /// @brief Mastering static Metadata. |
| 433 | { | 861 | /// |
| 434 | namespace addon | 862 | /// Describes the metadata for HDR10, used when video is compressed using High |
| 435 | { | 863 | /// Efficiency Video Coding (HEVC). This is used to describe the capabilities |
| 864 | /// of the display used to master the content and the luminance values of the | ||
| 865 | /// content. | ||
| 866 | /// | ||
| 867 | /// @param[in] masteringMetadata The with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamMasteringMetadata setable metadata | ||
| 868 | void SetMasteringMetadata(const kodi::addon::InputstreamMasteringMetadata& masteringMetadata) | ||
| 869 | { | ||
| 870 | m_masteringMetadata = masteringMetadata; | ||
| 871 | m_cStructure->m_masteringMetadata = m_masteringMetadata; | ||
| 872 | } | ||
| 436 | 873 | ||
| 437 | class ATTRIBUTE_HIDDEN CInstanceInputStream : public IAddonInstance | 874 | /// @brief To get with @ref SetMasteringMetadata changed values. |
| 438 | { | 875 | const kodi::addon::InputstreamMasteringMetadata& GetMasteringMetadata() const |
| 439 | public: | ||
| 440 | explicit CInstanceInputStream(KODI_HANDLE instance, const std::string& kodiVersion = "") | ||
| 441 | : IAddonInstance(ADDON_INSTANCE_INPUTSTREAM, | ||
| 442 | !kodiVersion.empty() ? kodiVersion | ||
| 443 | : GetKodiTypeVersion(ADDON_INSTANCE_INPUTSTREAM)) | ||
| 444 | { | 876 | { |
| 445 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 877 | return m_masteringMetadata; |
| 446 | throw std::logic_error("kodi::addon::CInstanceInputStream: Creation of multiple together " | 878 | } |
| 447 | "with single instance way is not allowed!"); | ||
| 448 | 879 | ||
| 449 | SetAddonStruct(instance, m_kodiVersion); | 880 | /// @brief Clear mastering static Metadata. |
| 881 | void ClearMasteringMetadata() { m_cStructure->m_masteringMetadata = nullptr; } | ||
| 882 | |||
| 883 | /// @brief Content light static Metadata. | ||
| 884 | /// | ||
| 885 | /// The maximum content light level (MaxCLL) and frame average light level | ||
| 886 | /// (MaxFALL) for the metadata for HDR10. | ||
| 887 | /// | ||
| 888 | /// @param[in] contentLightMetadata The with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamContentlightMetadata setable metadata | ||
| 889 | void SetContentLightMetadata( | ||
| 890 | const kodi::addon::InputstreamContentlightMetadata& contentLightMetadata) | ||
| 891 | { | ||
| 892 | m_contentLightMetadata = contentLightMetadata; | ||
| 893 | m_cStructure->m_contentLightMetadata = m_contentLightMetadata; | ||
| 450 | } | 894 | } |
| 451 | 895 | ||
| 452 | ~CInstanceInputStream() override = default; | 896 | /// @brief To get with @ref SetContentLightMetadata changed values. |
| 897 | const kodi::addon::InputstreamContentlightMetadata& GetContentLightMetadata() const | ||
| 898 | { | ||
| 899 | return m_contentLightMetadata; | ||
| 900 | } | ||
| 453 | 901 | ||
| 454 | /*! | 902 | /// @brief Clear content light static Metadata. |
| 455 | * Open a stream. | 903 | void ClearContentLightMetadata() { m_cStructure->m_contentLightMetadata = nullptr; } |
| 456 | * @param props | ||
| 457 | * @return True if the stream has been opened successfully, false otherwise. | ||
| 458 | * @remarks | ||
| 459 | */ | ||
| 460 | virtual bool Open(INPUTSTREAM& props) = 0; | ||
| 461 | |||
| 462 | /*! | ||
| 463 | * Close an open stream. | ||
| 464 | * @remarks | ||
| 465 | */ | ||
| 466 | virtual void Close() = 0; | ||
| 467 | 904 | ||
| 468 | /*! | 905 | ///@} |
| 469 | * Get Capabilities of this addon. | ||
| 470 | * @param capabilities The add-on's capabilities. | ||
| 471 | * @remarks | ||
| 472 | */ | ||
| 473 | virtual void GetCapabilities(INPUTSTREAM_CAPABILITIES& capabilities) = 0; | ||
| 474 | |||
| 475 | /*! | ||
| 476 | * Get IDs of available streams | ||
| 477 | * @remarks | ||
| 478 | */ | ||
| 479 | virtual INPUTSTREAM_IDS GetStreamIds() = 0; | ||
| 480 | |||
| 481 | /*! | ||
| 482 | * Get stream properties of a stream. | ||
| 483 | * @param streamid unique id of stream | ||
| 484 | * @return struc of stream properties | ||
| 485 | * @remarks | ||
| 486 | */ | ||
| 487 | virtual INPUTSTREAM_INFO GetStream(int streamid) = 0; | ||
| 488 | |||
| 489 | /*! | ||
| 490 | * Enable or disable a stream. | ||
| 491 | * A disabled stream does not send demux packets | ||
| 492 | * @param streamid unique id of stream | ||
| 493 | * @param enable true for enable, false for disable | ||
| 494 | * @remarks | ||
| 495 | */ | ||
| 496 | virtual void EnableStream(int streamid, bool enable) = 0; | ||
| 497 | |||
| 498 | /*! | ||
| 499 | * Opens a stream for playback. | ||
| 500 | * @param streamid unique id of stream | ||
| 501 | * @remarks | ||
| 502 | */ | ||
| 503 | virtual bool OpenStream(int streamid) = 0; | ||
| 504 | 906 | ||
| 505 | /*! | 907 | private: |
| 506 | * Reset the demultiplexer in the add-on. | 908 | InputstreamInfo(const INPUTSTREAM_INFO* stream) : CStructHdl(stream) |
| 507 | * @remarks Required if bHandlesDemuxing is set to true. | 909 | { |
| 508 | */ | 910 | SetCryptoSession(StreamCryptoSession(&stream->m_cryptoSession)); |
| 509 | virtual void DemuxReset() {} | 911 | CopyExtraData(); |
| 912 | } | ||
| 913 | InputstreamInfo(INPUTSTREAM_INFO* stream) : CStructHdl(stream) | ||
| 914 | { | ||
| 915 | SetCryptoSession(StreamCryptoSession(&stream->m_cryptoSession)); | ||
| 916 | CopyExtraData(); | ||
| 917 | } | ||
| 510 | 918 | ||
| 511 | /*! | 919 | void CopyExtraData() |
| 512 | * Abort the demultiplexer thread in the add-on. | 920 | { |
| 513 | * @remarks Required if bHandlesDemuxing is set to true. | 921 | if (m_cStructure->m_ExtraData && m_cStructure->m_ExtraSize > 0) |
| 514 | */ | 922 | { |
| 515 | virtual void DemuxAbort() {} | 923 | for (unsigned int i = 0; i < m_cStructure->m_ExtraSize; ++i) |
| 924 | m_extraData.emplace_back(m_cStructure->m_ExtraData[i]); | ||
| 925 | } | ||
| 926 | if (m_cStructure->m_masteringMetadata) | ||
| 927 | m_masteringMetadata = m_cStructure->m_masteringMetadata; | ||
| 928 | if (m_cStructure->m_contentLightMetadata) | ||
| 929 | m_contentLightMetadata = m_cStructure->m_contentLightMetadata; | ||
| 930 | } | ||
| 931 | std::vector<uint8_t> m_extraData; | ||
| 932 | StreamCryptoSession m_cryptoSession; | ||
| 933 | InputstreamMasteringMetadata m_masteringMetadata; | ||
| 934 | InputstreamContentlightMetadata m_contentLightMetadata; | ||
| 935 | }; | ||
| 936 | ///@} | ||
| 937 | //------------------------------------------------------------------------------ | ||
| 938 | |||
| 939 | //============================================================================== | ||
| 940 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamTimes class InputstreamTimes | ||
| 941 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 942 | /// @brief **Inputstream add-on times**\n | ||
| 943 | /// Used on @ref kodi::addon::CInstanceInputStream::GetTimes(). | ||
| 944 | /// | ||
| 945 | /// ---------------------------------------------------------------------------- | ||
| 946 | /// | ||
| 947 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamTimes_Help | ||
| 948 | /// | ||
| 949 | ///@{ | ||
| 950 | class ATTRIBUTE_HIDDEN InputstreamTimes : public CStructHdl<InputstreamTimes, INPUTSTREAM_TIMES> | ||
| 951 | { | ||
| 952 | /*! \cond PRIVATE */ | ||
| 953 | friend class CInstanceInputStream; | ||
| 954 | /*! \endcond */ | ||
| 516 | 955 | ||
| 517 | /*! | 956 | public: |
| 518 | * Flush all data that's currently in the demultiplexer buffer in the add-on. | 957 | /*! \cond PRIVATE */ |
| 519 | * @remarks Required if bHandlesDemuxing is set to true. | 958 | InputstreamTimes() = default; |
| 520 | */ | 959 | InputstreamTimes(const InputstreamTimes& stream) : CStructHdl(stream) {} |
| 521 | virtual void DemuxFlush() {} | 960 | /*! \endcond */ |
| 522 | 961 | ||
| 523 | /*! | 962 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamTimes_Help Value Help |
| 524 | * Read the next packet from the demultiplexer, if there is one. | 963 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamTimes |
| 525 | * @return The next packet. | 964 | /// |
| 526 | * If there is no next packet, then the add-on should return the | 965 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamTimes :</b> |
| 527 | * packet created by calling AllocateDemuxPacket(0) on the callback. | 966 | /// | Name | Type | Set call | Get call |
| 528 | * If the stream changed and Kodi's player needs to be reinitialised, | 967 | /// |------|------|----------|-------------------- |
| 529 | * then, the add-on should call AllocateDemuxPacket(0) on the | 968 | /// | **Start time** | `time_t` | @ref InputstreamTimes::SetStartTime "SetStartTime" | @ref InputstreamTimes::GetStartTime "GetStartTime" |
| 530 | * callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and | 969 | /// | **PTS start** | `double` | @ref InputstreamTimes::SetPtsStart "SetPtsStart" | @ref InputstreamTimes::GetPtsStart "GetPtsStart" |
| 531 | * return the value. | 970 | /// | **PTS begin** | `double` | @ref InputstreamTimes::SetPtsBegin "SetPtsBegin" | @ref InputstreamTimes::GetPtsBegin "GetPtsBegin" |
| 532 | * The add-on should return NULL if an error occurred. | 971 | /// | **PTS end** | `double` | @ref InputstreamTimes::SetPtsEnd "SetPtsEnd" | @ref InputstreamTimes::GetPtsEnd "GetPtsEnd" |
| 533 | * @remarks Return NULL if this add-on won't provide this function. | 972 | /// |
| 534 | */ | ||
| 535 | virtual DemuxPacket* DemuxRead() { return nullptr; } | ||
| 536 | |||
| 537 | /*! | ||
| 538 | * Notify the InputStream addon/demuxer that Kodi wishes to seek the stream by time | ||
| 539 | * Demuxer is required to set stream to an IDR frame | ||
| 540 | * @param time The absolute time since stream start | ||
| 541 | * @param backwards True to seek to keyframe BEFORE time, else AFTER | ||
| 542 | * @param startpts can be updated to point to where display should start | ||
| 543 | * @return True if the seek operation was possible | ||
| 544 | * @remarks Optional, and only used if addon has its own demuxer. | ||
| 545 | */ | ||
| 546 | virtual bool DemuxSeekTime(double time, bool backwards, double& startpts) { return false; } | ||
| 547 | 973 | ||
| 548 | /*! | 974 | /// @addtogroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamTimes |
| 549 | * Notify the InputStream addon/demuxer that Kodi wishes to change playback speed | 975 | ///@{ |
| 550 | * @param speed The requested playback speed | ||
| 551 | * @remarks Optional, and only used if addon has its own demuxer. | ||
| 552 | */ | ||
| 553 | virtual void DemuxSetSpeed(int speed) {} | ||
| 554 | 976 | ||
| 555 | /*! | 977 | /// @brief Start time in milliseconds |
| 556 | * Sets desired width / height | 978 | void SetStartTime(time_t startTime) const { m_cStructure->startTime = startTime; } |
| 557 | * @param width / hight | ||
| 558 | */ | ||
| 559 | virtual void SetVideoResolution(int width, int height) {} | ||
| 560 | 979 | ||
| 561 | /*! | 980 | /// @brief To get with @ref SetStartTime changed values |
| 562 | * Totel time in ms | 981 | time_t GetStartTime() const { return m_cStructure->startTime; } |
| 563 | * @remarks | ||
| 564 | */ | ||
| 565 | virtual int GetTotalTime() { return -1; } | ||
| 566 | 982 | ||
| 567 | /*! | 983 | /// @brief Start PTS |
| 568 | * Playing time in ms | 984 | void SetPtsStart(double ptsStart) const { m_cStructure->ptsStart = ptsStart; } |
| 569 | * @remarks | ||
| 570 | */ | ||
| 571 | virtual int GetTime() { return -1; } | ||
| 572 | 985 | ||
| 573 | /*! | 986 | /// @brief To get with @ref SetPtsStart changed values |
| 574 | * Get current timing values in PTS scale | 987 | double GetPtsStart() const { return m_cStructure->ptsStart; } |
| 575 | * @remarks | ||
| 576 | */ | ||
| 577 | virtual bool GetTimes(INPUTSTREAM_TIMES& times) { return false; } | ||
| 578 | 988 | ||
| 579 | /*! | 989 | /// @brief Begin PTS |
| 580 | * Positions inputstream to playing time given in ms | 990 | void SetPtsBegin(double ptsBegin) const { m_cStructure->ptsBegin = ptsBegin; } |
| 581 | * @remarks | ||
| 582 | */ | ||
| 583 | virtual bool PosTime(int ms) { return false; } | ||
| 584 | 991 | ||
| 585 | /*! | 992 | /// @brief To get with @ref SetPtsBegin changed values |
| 586 | * Return currently selected chapter | 993 | double GetPtsBegin() const { return m_cStructure->ptsBegin; } |
| 587 | * @remarks | ||
| 588 | */ | ||
| 589 | virtual int GetChapter() { return -1; }; | ||
| 590 | 994 | ||
| 591 | /*! | 995 | /// @brief End PTS |
| 592 | * Return number of available chapters | 996 | void SetPtsEnd(double ptsEnd) const { m_cStructure->ptsEnd = ptsEnd; } |
| 593 | * @remarks | ||
| 594 | */ | ||
| 595 | virtual int GetChapterCount() { return 0; }; | ||
| 596 | 997 | ||
| 597 | /*! | 998 | /// @brief To get with @ref SetPtsEnd changed values |
| 598 | * Return name of chapter # ch | 999 | double GetPtsEnd() const { return m_cStructure->ptsEnd; } |
| 599 | * @remarks | ||
| 600 | */ | ||
| 601 | virtual const char* GetChapterName(int ch) { return nullptr; }; | ||
| 602 | 1000 | ||
| 603 | /*! | 1001 | ///@} |
| 604 | * Return position if chapter # ch in milliseconds | ||
| 605 | * @remarks | ||
| 606 | */ | ||
| 607 | virtual int64_t GetChapterPos(int ch) { return 0; }; | ||
| 608 | 1002 | ||
| 609 | /*! | 1003 | private: |
| 610 | * Seek to the beginning of chapter # ch | 1004 | InputstreamTimes(const INPUTSTREAM_TIMES* stream) : CStructHdl(stream) {} |
| 611 | * @remarks | 1005 | InputstreamTimes(INPUTSTREAM_TIMES* stream) : CStructHdl(stream) {} |
| 612 | */ | 1006 | }; |
| 613 | virtual bool SeekChapter(int ch) { return false; }; | 1007 | ///@} |
| 1008 | //------------------------------------------------------------------------------ | ||
| 1009 | |||
| 1010 | //============================================================================ | ||
| 1011 | /// | ||
| 1012 | /// @addtogroup cpp_kodi_addon_inputstream | ||
| 1013 | /// @brief \cpp_class{ kodi::addon::CInstanceInputStream } | ||
| 1014 | /// **Inputstream add-on instance** | ||
| 1015 | /// | ||
| 1016 | /// This instance type is for using input streams to video and audio, to process | ||
| 1017 | /// and then give them to Kodi. | ||
| 1018 | /// | ||
| 1019 | /// This usage can be requested under various conditions, for example explicitly | ||
| 1020 | /// by another addon, by a Mimetype protocol defined in `addon.xml` or supported | ||
| 1021 | /// file extensions. | ||
| 1022 | /// | ||
| 1023 | /// In addition, stream files (* .strm) can be linked to an inputstream addon | ||
| 1024 | /// using <b>`#KODIPROP:inputstream=<ADDON_NAME>`</b>. | ||
| 1025 | /// | ||
| 1026 | /// Include the header @ref Inputstream.h "#include <kodi/addon-instance/Inputstream.h>" | ||
| 1027 | /// to use this class. | ||
| 1028 | /// | ||
| 1029 | /// ---------------------------------------------------------------------------- | ||
| 1030 | /// | ||
| 1031 | /// Here is an example of what the <b>`addon.xml.in`</b> would look like for an inputstream addon: | ||
| 1032 | /// | ||
| 1033 | /// ~~~~~~~~~~~~~{.xml} | ||
| 1034 | /// <?xml version="1.0" encoding="UTF-8"?> | ||
| 1035 | /// <addon | ||
| 1036 | /// id="inputstream.myspecialnamefor" | ||
| 1037 | /// version="1.0.0" | ||
| 1038 | /// name="My InputStream addon" | ||
| 1039 | /// provider-name="Your Name"> | ||
| 1040 | /// <requires>@ADDON_DEPENDS@</requires> | ||
| 1041 | /// <extension | ||
| 1042 | /// point="kodi.inputstream" | ||
| 1043 | /// extension=".xyz|.zyx" | ||
| 1044 | /// listitemprops="license_type|license_key|license_data|license_flags" | ||
| 1045 | /// protocols="myspecialnamefor|myspecialnamefors" | ||
| 1046 | /// library_@PLATFORM@="@LIBRARY_FILENAME@"/> | ||
| 1047 | /// <extension point="xbmc.addon.metadata"> | ||
| 1048 | /// <summary lang="en_GB">My InputStream addon</summary> | ||
| 1049 | /// <description lang="en_GB">My InputStream description</description> | ||
| 1050 | /// <platform>@PLATFORM@</platform> | ||
| 1051 | /// </extension> | ||
| 1052 | /// </addon> | ||
| 1053 | /// ~~~~~~~~~~~~~ | ||
| 1054 | /// | ||
| 1055 | /// | ||
| 1056 | /// At <b>`<extension point="kodi.inputstream" ...>`</b> the basic instance definition is declared, this is intended to identify the addon as an input stream and to see its supported types: | ||
| 1057 | /// | Name | Description | ||
| 1058 | /// |------|---------------------- | ||
| 1059 | /// | <b>`point`</b> | The identification of the addon instance to inputstream is mandatory <b>`kodi.inputstream`</b>. In addition, the instance declared in the first <b>`<extension ... />`</b> is also | ||
| 1060 | /// | <b>`extension`</b> | A filename extension is an identifier specified as a suffix to the name of a computer file where supported by addon. | ||
| 1061 | /// | <b>`listitemprops`</b> | Values that are available to the addon at @ref InputstreamProperty::GetProperties() and that can be passed to @ref CInstanceInputStream::Open() ith the respective values. | ||
| 1062 | /// | <b>`protocols`</b> | The streaming protocol is a special protocol supported by the addon for the transmission of streaming media data over a network. | ||
| 1063 | /// | <b>`library_@PLATFORM@`</b> | The runtime library used for the addon. This is usually declared by cmake and correctly displayed in the translated `addon.xml`. | ||
| 1064 | /// | ||
| 1065 | /// | ||
| 1066 | /// @remark For more detailed description of the <b>`addon.xml`</b>, see also https://kodi.wiki/view/Addon.xml. | ||
| 1067 | /// | ||
| 1068 | /// | ||
| 1069 | /// -------------------------------------------------------------------------- | ||
| 1070 | /// | ||
| 1071 | /// | ||
| 1072 | /// **Example:** | ||
| 1073 | /// | ||
| 1074 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 1075 | /// #include <kodi/addon-instance/Inputstream.h> | ||
| 1076 | /// | ||
| 1077 | /// class CMyInputstream : public kodi::addon::CInstanceInputStream | ||
| 1078 | /// { | ||
| 1079 | /// public: | ||
| 1080 | /// CMyInputstream(KODI_HANDLE instance, const std::string& kodiVersion); | ||
| 1081 | /// | ||
| 1082 | /// void GetCapabilities(kodi::addon::InputstreamCapabilities& capabilities) override; | ||
| 1083 | /// bool Open(const kodi::addon::InputstreamProperty& props) override; | ||
| 1084 | /// void Close() override; | ||
| 1085 | /// ... | ||
| 1086 | /// }; | ||
| 1087 | /// | ||
| 1088 | /// CMyInputstream::CMyInputstream(KODI_HANDLE instance, const std::string& kodiVersion) | ||
| 1089 | /// : kodi::addon::CInstanceInputStream(instance, kodiVersion) | ||
| 1090 | /// { | ||
| 1091 | /// ... | ||
| 1092 | /// } | ||
| 1093 | /// | ||
| 1094 | /// void CMyInputstream::GetCapabilities(kodi::addon::InputstreamCapabilities& capabilities) | ||
| 1095 | /// { | ||
| 1096 | /// capabilities.SetMask(INPUTSTREAM_SUPPORTS_IDEMUX | INPUTSTREAM_SUPPORTS_PAUSE); | ||
| 1097 | /// } | ||
| 1098 | /// | ||
| 1099 | /// void CMyInputstream::Open(const kodi::addon::InputstreamProperty& props) | ||
| 1100 | /// { | ||
| 1101 | /// std::string url = props.GetURL(); | ||
| 1102 | /// ... | ||
| 1103 | /// } | ||
| 1104 | /// | ||
| 1105 | /// void CMyInputstream::Close() | ||
| 1106 | /// { | ||
| 1107 | /// ... | ||
| 1108 | /// } | ||
| 1109 | /// | ||
| 1110 | /// ... | ||
| 1111 | /// | ||
| 1112 | /// //---------------------------------------------------------------------- | ||
| 1113 | /// | ||
| 1114 | /// class CMyAddon : public kodi::addon::CAddonBase | ||
| 1115 | /// { | ||
| 1116 | /// public: | ||
| 1117 | /// CMyAddon() = default; | ||
| 1118 | /// ADDON_STATUS CreateInstance(int instanceType, | ||
| 1119 | /// std::string instanceID, | ||
| 1120 | /// KODI_HANDLE instance, | ||
| 1121 | /// const std::string& version, | ||
| 1122 | /// KODI_HANDLE& addonInstance) override; | ||
| 1123 | /// }; | ||
| 1124 | /// | ||
| 1125 | /// // If you use only one instance in your add-on, can be instanceType and | ||
| 1126 | /// // instanceID ignored | ||
| 1127 | /// ADDON_STATUS CMyAddon::CreateInstance(int instanceType, | ||
| 1128 | /// std::string instanceID, | ||
| 1129 | /// KODI_HANDLE instance, | ||
| 1130 | /// const std::string& version, | ||
| 1131 | /// KODI_HANDLE& addonInstance) | ||
| 1132 | /// { | ||
| 1133 | /// if (instanceType == ADDON_INSTANCE_INPUTSTREAM) | ||
| 1134 | /// { | ||
| 1135 | /// kodi::Log(ADDON_LOG_NOTICE, "Creating my Inputstream"); | ||
| 1136 | /// addonInstance = new CMyInputstream(instance, version); | ||
| 1137 | /// return ADDON_STATUS_OK; | ||
| 1138 | /// } | ||
| 1139 | /// else if (...) | ||
| 1140 | /// { | ||
| 1141 | /// ... | ||
| 1142 | /// } | ||
| 1143 | /// return ADDON_STATUS_UNKNOWN; | ||
| 1144 | /// } | ||
| 1145 | /// | ||
| 1146 | /// ADDONCREATOR(CMyAddon) | ||
| 1147 | /// ~~~~~~~~~~~~~ | ||
| 1148 | /// | ||
| 1149 | /// The destruction of the example class `CMyInputstream` is called from | ||
| 1150 | /// Kodi's header. Manually deleting the add-on instance is not required. | ||
| 1151 | /// | ||
| 1152 | //------------------------------------------------------------------------------ | ||
| 1153 | class ATTRIBUTE_HIDDEN CInstanceInputStream : public IAddonInstance | ||
| 1154 | { | ||
| 1155 | public: | ||
| 1156 | //============================================================================ | ||
| 1157 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1158 | /// @brief Inputstream class constructor used to support multiple instance | ||
| 1159 | /// types | ||
| 1160 | /// | ||
| 1161 | /// @param[in] instance The instance value given to <b>`kodi::addon::CAddonBase::CreateInstance(...)`</b> | ||
| 1162 | /// @param[in] kodiVersion [opt] Version used in Kodi for this instance, to | ||
| 1163 | /// allow compatibility to older Kodi versions. | ||
| 1164 | /// | ||
| 1165 | /// @warning Only use `instance` from the @ref CAddonBase::CreateInstance call. | ||
| 1166 | /// | ||
| 1167 | explicit CInstanceInputStream(KODI_HANDLE instance, const std::string& kodiVersion = "") | ||
| 1168 | : IAddonInstance(ADDON_INSTANCE_INPUTSTREAM, | ||
| 1169 | !kodiVersion.empty() ? kodiVersion | ||
| 1170 | : GetKodiTypeVersion(ADDON_INSTANCE_INPUTSTREAM)) | ||
| 1171 | { | ||
| 1172 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | ||
| 1173 | throw std::logic_error("kodi::addon::CInstanceInputStream: Creation of multiple together " | ||
| 1174 | "with single instance way is not allowed!"); | ||
| 614 | 1175 | ||
| 615 | /*! | 1176 | SetAddonStruct(instance, m_kodiVersion); |
| 616 | * Read from an open stream. | 1177 | } |
| 617 | * @param buffer The buffer to store the data in. | 1178 | //---------------------------------------------------------------------------- |
| 618 | * @param bufferSize The amount of bytes to read. | ||
| 619 | * @return The amount of bytes that were actually read from the stream. | ||
| 620 | * @remarks Return -1 if this add-on won't provide this function. | ||
| 621 | */ | ||
| 622 | virtual int ReadStream(uint8_t* buffer, unsigned int bufferSize) { return -1; } | ||
| 623 | 1179 | ||
| 624 | /*! | 1180 | //============================================================================ |
| 625 | * Seek in a stream. | 1181 | /// @ingroup cpp_kodi_addon_inputstream |
| 626 | * @param position The position to seek to. | 1182 | /// @brief Destructor |
| 627 | * @param whence ? | 1183 | /// |
| 628 | * @return The new position. | 1184 | ~CInstanceInputStream() override = default; |
| 629 | * @remarks Return -1 if this add-on won't provide this function. | 1185 | //---------------------------------------------------------------------------- |
| 630 | */ | 1186 | |
| 1187 | //============================================================================ | ||
| 1188 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1189 | /// @brief Get the list of features that this add-on provides. | ||
| 1190 | /// | ||
| 1191 | /// Called by Kodi to query the add-on's capabilities. | ||
| 1192 | /// Used to check which options should be presented in the UI, which methods to call, etc. | ||
| 1193 | /// All capabilities that the add-on supports should be set to true. | ||
| 1194 | /// | ||
| 1195 | /// @param[out] capabilities The with @ref cpp_kodi_addon_inputstream_Defs_Capabilities defined add-on's capabilities. | ||
| 1196 | /// | ||
| 1197 | /// | ||
| 1198 | /// -------------------------------------------------------------------------- | ||
| 1199 | /// | ||
| 1200 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities_Help | ||
| 1201 | /// | ||
| 1202 | /// -------------------------------------------------------------------------- | ||
| 1203 | /// @note Valid implementation required. | ||
| 1204 | /// | ||
| 1205 | /// | ||
| 1206 | /// -------------------------------------------------------------------------- | ||
| 1207 | /// | ||
| 1208 | /// **Example:** | ||
| 1209 | /// | ||
| 1210 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 1211 | /// void CMyInputstream::GetCapabilities(kodi::addon::InputstreamCapabilities& capabilities) | ||
| 1212 | /// { | ||
| 1213 | /// capabilities.SetMask(INPUTSTREAM_SUPPORTS_IDEMUX | INPUTSTREAM_SUPPORTS_PAUSE); | ||
| 1214 | /// } | ||
| 1215 | /// ~~~~~~~~~~~~~ | ||
| 1216 | /// | ||
| 1217 | virtual void GetCapabilities(kodi::addon::InputstreamCapabilities& capabilities) = 0; | ||
| 1218 | //---------------------------------------------------------------------------- | ||
| 1219 | |||
| 1220 | //============================================================================ | ||
| 1221 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1222 | /// @brief Open a stream. | ||
| 1223 | /// | ||
| 1224 | /// @param[in] props The used properties about the stream | ||
| 1225 | /// @return True if the stream has been opened successfully, false otherwise. | ||
| 1226 | /// | ||
| 1227 | /// | ||
| 1228 | /// -------------------------------------------------------------------------- | ||
| 1229 | /// | ||
| 1230 | /// @copydetails cpp_kodi_addon_inputstream_Defs_InputstreamProperty_Help | ||
| 1231 | /// | ||
| 1232 | /// -------------------------------------------------------------------------- | ||
| 1233 | /// @note Valid implementation required. | ||
| 1234 | /// | ||
| 1235 | /// | ||
| 1236 | /// -------------------------------------------------------------------------- | ||
| 1237 | /// | ||
| 1238 | /// **Example:** | ||
| 1239 | /// | ||
| 1240 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 1241 | /// void CMyInputstream::Open(const kodi::addon::InputstreamProperty& props) | ||
| 1242 | /// { | ||
| 1243 | /// std::string url = props.GetURL(); | ||
| 1244 | /// std::string license_key = props.GetProperties()["inputstream.myspecialnamefor.license_key"]; | ||
| 1245 | /// ... | ||
| 1246 | /// } | ||
| 1247 | /// ~~~~~~~~~~~~~ | ||
| 1248 | /// | ||
| 1249 | virtual bool Open(const kodi::addon::InputstreamProperty& props) = 0; | ||
| 1250 | //---------------------------------------------------------------------------- | ||
| 1251 | |||
| 1252 | //============================================================================ | ||
| 1253 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1254 | /// @brief Close an open stream. | ||
| 1255 | /// | ||
| 1256 | /// @remarks | ||
| 1257 | /// | ||
| 1258 | /// | ||
| 1259 | /// -------------------------------------------------------------------------- | ||
| 1260 | /// @note Valid implementation required. | ||
| 1261 | /// | ||
| 1262 | virtual void Close() = 0; | ||
| 1263 | //---------------------------------------------------------------------------- | ||
| 1264 | |||
| 1265 | //============================================================================ | ||
| 1266 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1267 | /// @brief Check for real-time streaming | ||
| 1268 | /// | ||
| 1269 | /// @return true if current stream is real-time | ||
| 1270 | /// | ||
| 1271 | virtual bool IsRealTimeStream() { return true; } | ||
| 1272 | //---------------------------------------------------------------------------- | ||
| 1273 | |||
| 1274 | //############################################################################ | ||
| 1275 | /// @defgroup cpp_kodi_addon_inputstream_Read 1. Stream read | ||
| 1276 | /// @brief **Functions required to read streams direct and demux inside Kodi.** | ||
| 1277 | /// | ||
| 1278 | /// This part contains at least the functions necessary for addon that have to | ||
| 1279 | /// be supported. This can only be ignored if you use your own demux. | ||
| 1280 | /// | ||
| 1281 | /// The data loaded by Kodi is then processed in it itself. The source does not | ||
| 1282 | /// matter, only Kodi must be able to process this stream data itself and is | ||
| 1283 | /// therefore limited in some things. | ||
| 1284 | /// | ||
| 1285 | /// For more complex things, the addon must integrate its own demuxer and, | ||
| 1286 | /// if necessary, even its own codec processing (see @ref cpp_kodi_addon_codec "Codec"). | ||
| 1287 | /// | ||
| 1288 | /// @note These are used and must be set by the addon if the @ref INPUTSTREAM_SUPPORTS_IDEMUX | ||
| 1289 | /// is <em><b>undefined</b></em> in the capabilities (see @ref GetCapabilities()). | ||
| 1290 | /// Otherwise becomes @ref cpp_kodi_addon_inputstream_Demux "demuxing" used. | ||
| 1291 | /// | ||
| 1292 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1293 | ///@{ | ||
| 1294 | |||
| 1295 | //============================================================================ | ||
| 1296 | /// @brief Read from an open stream. | ||
| 1297 | /// | ||
| 1298 | /// @param[in] buffer The buffer to store the data in. | ||
| 1299 | /// @param[in] bufferSize The amount of bytes to read. | ||
| 1300 | /// @return The amount of bytes that were actually read from the stream. | ||
| 1301 | /// | ||
| 1302 | virtual int ReadStream(uint8_t* buffer, unsigned int bufferSize) { return -1; } | ||
| 1303 | //---------------------------------------------------------------------------- | ||
| 1304 | |||
| 1305 | //============================================================================ | ||
| 1306 | /// @brief Seek in a stream. | ||
| 1307 | /// | ||
| 1308 | /// @param[in] position The position to seek to | ||
| 1309 | /// @param[in] whence offset relative to<br> | ||
| 1310 | /// You can set the value of whence to one of three things: | ||
| 1311 | /// | Value | int | Description | | ||
| 1312 | /// |:------------:|:-----:|:----------------------------------------------------| | ||
| 1313 | /// | **SEEK_SET** | `0` | position is relative to the beginning of the file. This is probably what you had in mind anyway, and is the most commonly used value for whence. | ||
| 1314 | /// | **SEEK_CUR** | `1` | position is relative to the current file pointer position. So, in effect, you can say, "Move to my current position plus 30 bytes," or, "move to my current position minus 20 bytes." | ||
| 1315 | /// | **SEEK_END** | `2` | position is relative to the end of the file. Just like SEEK_SET except from the other end of the file. Be sure to use negative values for offset if you want to back up from the end of the file, instead of going past the end into oblivion. | ||
| 1316 | /// | ||
| 1317 | /// @return Returns the resulting offset location as measured in bytes from | ||
| 1318 | /// the beginning of the file. On error, the value -1 is returned. | ||
| 1319 | /// | ||
| 1320 | /// @remarks Optional and can leaved away or return -1 if this add-on won't | ||
| 1321 | /// provide this function. | ||
| 1322 | /// | ||
| 631 | virtual int64_t SeekStream(int64_t position, int whence = SEEK_SET) { return -1; } | 1323 | virtual int64_t SeekStream(int64_t position, int whence = SEEK_SET) { return -1; } |
| 632 | 1324 | //---------------------------------------------------------------------------- | |
| 633 | /*! | 1325 | |
| 634 | * @return The position in the stream that's currently being read. | 1326 | //============================================================================ |
| 635 | * @remarks Return -1 if this add-on won't provide this function. | 1327 | /// @brief The position in the stream that's currently being read. |
| 636 | */ | 1328 | /// |
| 1329 | /// @return Stream position | ||
| 1330 | /// | ||
| 1331 | /// @remarks Optional and can leaved away or return -1 if this add-on won't | ||
| 1332 | /// provide this function. | ||
| 1333 | /// | ||
| 637 | virtual int64_t PositionStream() { return -1; } | 1334 | virtual int64_t PositionStream() { return -1; } |
| 638 | 1335 | //---------------------------------------------------------------------------- | |
| 639 | /*! | 1336 | |
| 640 | * @return The total length of the stream that's currently being read. | 1337 | //============================================================================ |
| 641 | * @remarks Return -1 if this add-on won't provide this function. | 1338 | /// @brief The Total length of the stream that's currently being read. |
| 642 | */ | 1339 | /// |
| 1340 | /// @return Length of the stream | ||
| 1341 | /// | ||
| 1342 | /// @remarks Optional and can leaved away or return -1 if this add-on won't | ||
| 1343 | /// provide this function. | ||
| 1344 | /// | ||
| 643 | virtual int64_t LengthStream() { return -1; } | 1345 | virtual int64_t LengthStream() { return -1; } |
| 644 | 1346 | //-------------------------------------------------------------------------- | |
| 645 | /*! | 1347 | |
| 646 | * @return Obtain the chunk size to use when reading streams. | 1348 | //========================================================================== |
| 647 | * @remarks Return 0 if this add-on won't provide this function. | 1349 | /// @brief Obtain the chunk size to use when reading streams. |
| 648 | */ | 1350 | /// |
| 1351 | /// @return Block chunk size | ||
| 1352 | /// | ||
| 1353 | /// @remarks Optional and can leaved away or return 0 if this add-on won't | ||
| 1354 | /// provide this function. | ||
| 1355 | /// | ||
| 649 | virtual int GetBlockSize() { return 0; } | 1356 | virtual int GetBlockSize() { return 0; } |
| 1357 | //-------------------------------------------------------------------------- | ||
| 1358 | |||
| 1359 | ///@} | ||
| 1360 | |||
| 1361 | //############################################################################ | ||
| 1362 | /// @defgroup cpp_kodi_addon_inputstream_Demux 2. Stream demuxing (optional) | ||
| 1363 | /// @brief **Read demux streams.** | ||
| 1364 | /// | ||
| 1365 | /// @note These are used and must be set by the addon if the @ref INPUTSTREAM_SUPPORTS_IDEMUX is set in the capabilities (see @ref GetCapabilities()). | ||
| 1366 | /// | ||
| 1367 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1368 | ///@{ | ||
| 1369 | |||
| 1370 | //============================================================================ | ||
| 1371 | /// @brief Get IDs of available streams | ||
| 1372 | /// | ||
| 1373 | /// @param[in] ids list of used identifications | ||
| 1374 | /// @return true if successfully done, otherwise false | ||
| 1375 | /// | ||
| 1376 | /// @remarks This id's are used to identify wanted data on @ref GetStream call. | ||
| 1377 | /// | ||
| 1378 | /// | ||
| 1379 | /// -------------------------------------------------------------------------- | ||
| 1380 | /// | ||
| 1381 | /// **Example:** | ||
| 1382 | /// | ||
| 1383 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 1384 | /// | ||
| 1385 | /// bool CMyInputstream::GetStreamIds(std::vector<unsigned int>& ids) | ||
| 1386 | /// { | ||
| 1387 | /// kodi::Log(ADDON_LOG_DEBUG, "GetStreamIds(...)"); | ||
| 1388 | /// | ||
| 1389 | /// if (m_opened) | ||
| 1390 | /// { | ||
| 1391 | /// // This check not needed to have, the ABI checks also about, but make | ||
| 1392 | /// // sure you not give more as 32 streams. | ||
| 1393 | /// if (m_myStreams.size() > MAX_STREAM_COUNT) | ||
| 1394 | /// { | ||
| 1395 | /// kodi::Log(ADDON_LOG_ERROR, "Too many streams, only %u supported", MAX_STREAM_COUNT); | ||
| 1396 | /// return false; | ||
| 1397 | /// } | ||
| 1398 | /// | ||
| 1399 | /// ids.emplace_back(m_myAudioStreamId); | ||
| 1400 | /// | ||
| 1401 | /// for (const auto& streamPair : m_myOtherStreams) | ||
| 1402 | /// { | ||
| 1403 | /// ids.emplace_back(streamPair.second->uniqueId); | ||
| 1404 | /// } | ||
| 1405 | /// } | ||
| 1406 | /// | ||
| 1407 | /// return !ids.empty(); | ||
| 1408 | /// } | ||
| 1409 | /// ~~~~~~~~~~~~~ | ||
| 1410 | /// | ||
| 1411 | virtual bool GetStreamIds(std::vector<unsigned int>& ids) { return false; } | ||
| 1412 | //---------------------------------------------------------------------------- | ||
| 1413 | |||
| 1414 | //============================================================================ | ||
| 1415 | /// @brief Function for giving detailed stream information | ||
| 1416 | /// | ||
| 1417 | /// The associated information is set here for IDs previously given with | ||
| 1418 | /// @ref GetStreamIds. | ||
| 1419 | /// | ||
| 1420 | /// This data is required to identify the associated codec and, if necessary, | ||
| 1421 | /// to refer to your own codec (if available in the addon). | ||
| 1422 | /// | ||
| 1423 | /// @param[in] streamid unique id of stream | ||
| 1424 | /// @param[out] stream Information data of wanted stream | ||
| 1425 | /// @return true if successfully done, otherwise false | ||
| 1426 | /// | ||
| 1427 | /// @remarks Available stream id's previously asked by @ref GetStreamIds | ||
| 1428 | /// | ||
| 1429 | /// | ||
| 1430 | /// -------------------------------------------------------------------------- | ||
| 1431 | /// | ||
| 1432 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo_Help | ||
| 1433 | /// | ||
| 1434 | /// -------------------------------------------------------------------------- | ||
| 1435 | /// | ||
| 1436 | /// **Example:** | ||
| 1437 | /// | ||
| 1438 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 1439 | /// bool CMyInputstream::GetStream(int streamid, kodi::addon::InputstreamInfo& stream) | ||
| 1440 | /// { | ||
| 1441 | /// // This is just a small example, this type will be significantly larger | ||
| 1442 | /// // for larger and more complex streams. | ||
| 1443 | /// if (streamid == m_myAudioStreamId) | ||
| 1444 | /// { | ||
| 1445 | /// // This only a minimal exampl | ||
| 1446 | /// stream.SetStreamType(INPUTSTREAM_TYPE_AUDIO); | ||
| 1447 | /// stream.SetFeatures(INPUTSTREAM_FEATURE_NONE); // Only added to example, INPUTSTREAM_FEATURE_NONE is default and no need to call | ||
| 1448 | /// stream.SetFlags(INPUTSTREAM_FLAG_NONE); // Only added to example, INPUTSTREAM_FLAG_NONE is default and no need to call | ||
| 1449 | /// stream.SetCodecName("mp2"); // Codec name, string must by equal with FFmpeg, see https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/codec_desc.c | ||
| 1450 | /// stream.SetPhysicalIndex(1); // Identifier required to set | ||
| 1451 | /// stream.SetLanguage("en"); | ||
| 1452 | /// stream.SetChannels(2); | ||
| 1453 | /// stream.SetSampleRate(48000); | ||
| 1454 | /// stream.SetBitRate(0); | ||
| 1455 | /// stream.SetBitsPerSample(16); | ||
| 1456 | /// } | ||
| 1457 | /// else ... | ||
| 1458 | /// ... | ||
| 1459 | /// return true; | ||
| 1460 | /// } | ||
| 1461 | /// ~~~~~~~~~~~~~ | ||
| 1462 | /// | ||
| 1463 | virtual bool GetStream(int streamid, kodi::addon::InputstreamInfo& stream) { return false; } | ||
| 1464 | //---------------------------------------------------------------------------- | ||
| 1465 | |||
| 1466 | //============================================================================ | ||
| 1467 | /// @brief Enable or disable a stream. | ||
| 1468 | /// | ||
| 1469 | /// A disabled stream does not send demux packets | ||
| 1470 | /// | ||
| 1471 | /// @param[in] streamid unique id of stream | ||
| 1472 | /// @param[in] enable true for enable, false for disable | ||
| 1473 | /// | ||
| 1474 | /// @remarks Available stream id's previously asked by @ref GetStreamIds | ||
| 1475 | /// | ||
| 1476 | /// | ||
| 1477 | /// -------------------------------------------------------------------------- | ||
| 1478 | /// @note Valid implementation required. | ||
| 1479 | /// | ||
| 1480 | virtual void EnableStream(int streamid, bool enable) {} | ||
| 1481 | //---------------------------------------------------------------------------- | ||
| 1482 | |||
| 1483 | //============================================================================ | ||
| 1484 | /// @brief Opens a stream for playback. | ||
| 1485 | /// | ||
| 1486 | /// @param[in] streamid unique id of stream | ||
| 1487 | /// | ||
| 1488 | /// @remarks Available stream id's previously asked by @ref GetStreamIds | ||
| 1489 | /// | ||
| 1490 | /// | ||
| 1491 | /// -------------------------------------------------------------------------- | ||
| 1492 | /// @note Valid implementation required. | ||
| 1493 | /// | ||
| 1494 | virtual bool OpenStream(int streamid) { return false; } | ||
| 1495 | //---------------------------------------------------------------------------- | ||
| 1496 | |||
| 1497 | //============================================================================ | ||
| 1498 | /// @brief Reset the demultiplexer in the add-on. | ||
| 1499 | /// | ||
| 1500 | /// @remarks Optional, and only used if addon has its own demuxer. | ||
| 1501 | /// | ||
| 1502 | virtual void DemuxReset() {} | ||
| 1503 | //---------------------------------------------------------------------------- | ||
| 650 | 1504 | ||
| 651 | /*! | 1505 | //============================================================================ |
| 652 | * Check for real-time streaming | 1506 | /// @brief Abort the demultiplexer thread in the add-on. |
| 653 | * @return true if current stream is real-time | 1507 | /// |
| 654 | */ | 1508 | /// @remarks Optional, and only used if addon has its own demuxer. |
| 655 | virtual bool IsRealTimeStream() { return true; } | 1509 | /// |
| 1510 | virtual void DemuxAbort() {} | ||
| 1511 | //---------------------------------------------------------------------------- | ||
| 656 | 1512 | ||
| 657 | /*! | 1513 | //============================================================================ |
| 658 | * @brief Allocate a demux packet. Free with FreeDemuxPacket | 1514 | /// @brief Flush all data that's currently in the demultiplexer buffer in the add-on. |
| 659 | * @param dataSize The size of the data that will go into the packet | 1515 | /// |
| 660 | * @return The allocated packet | 1516 | /// @remarks Optional, and only used if addon has its own demuxer. |
| 661 | */ | 1517 | /// |
| 662 | DemuxPacket* AllocateDemuxPacket(int dataSize) | 1518 | virtual void DemuxFlush() {} |
| 1519 | //---------------------------------------------------------------------------- | ||
| 1520 | |||
| 1521 | //============================================================================ | ||
| 1522 | /// @brief Read the next packet from the demultiplexer, if there is one. | ||
| 1523 | /// | ||
| 1524 | /// @return The next packet. | ||
| 1525 | /// If there is no next packet, then the add-on should return the | ||
| 1526 | /// packet created by calling @ref AllocateDemuxPacket "AllocateDemuxPacket(0)" on the callback. | ||
| 1527 | /// If the stream changed and Kodi's player needs to be reinitialised, | ||
| 1528 | /// then, the add-on should call @ref AllocateDemuxPacket "AllocateDemuxPacket(0)" on the | ||
| 1529 | /// callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and | ||
| 1530 | /// return the value. | ||
| 1531 | /// The add-on should return <b>`nullptr`</b> if an error occured. | ||
| 1532 | /// | ||
| 1533 | /// @remarks Return <b>`nullptr`</b> if this add-on won't provide this function. | ||
| 1534 | /// | ||
| 1535 | virtual DEMUX_PACKET* DemuxRead() { return nullptr; } | ||
| 1536 | //---------------------------------------------------------------------------- | ||
| 1537 | |||
| 1538 | //============================================================================ | ||
| 1539 | /// @brief Notify the InputStream addon/demuxer that Kodi wishes to seek the stream by time | ||
| 1540 | /// | ||
| 1541 | /// Demuxer is required to set stream to an IDR frame | ||
| 1542 | /// | ||
| 1543 | /// @param[in] time The absolute time since stream start | ||
| 1544 | /// @param[in] backwards True to seek to keyframe BEFORE time, else AFTER | ||
| 1545 | /// @param[in] startpts can be updated to point to where display should start | ||
| 1546 | /// @return True if the seek operation was possible | ||
| 1547 | /// | ||
| 1548 | /// @remarks Optional, and only used if addon has its own demuxer. | ||
| 1549 | /// | ||
| 1550 | virtual bool DemuxSeekTime(double time, bool backwards, double& startpts) { return false; } | ||
| 1551 | //---------------------------------------------------------------------------- | ||
| 1552 | |||
| 1553 | //============================================================================ | ||
| 1554 | /// @brief Notify the InputStream addon/demuxer that Kodi wishes to change playback speed | ||
| 1555 | /// | ||
| 1556 | /// @param[in] speed The requested playback speed | ||
| 1557 | /// | ||
| 1558 | /// @remarks Optional, and only used if addon has its own demuxer. | ||
| 1559 | /// | ||
| 1560 | virtual void DemuxSetSpeed(int speed) {} | ||
| 1561 | //---------------------------------------------------------------------------- | ||
| 1562 | |||
| 1563 | //============================================================================ | ||
| 1564 | /// @brief Sets desired width / height | ||
| 1565 | /// | ||
| 1566 | /// @param[in] width Width to set | ||
| 1567 | /// @param[in] height Height to set | ||
| 1568 | /// | ||
| 1569 | virtual void SetVideoResolution(int width, int height) {} | ||
| 1570 | //---------------------------------------------------------------------------- | ||
| 1571 | |||
| 1572 | //============================================================================= | ||
| 1573 | /// @brief Allocate a demux packet. Free with @ref FreeDemuxPacket | ||
| 1574 | /// | ||
| 1575 | /// @param[in] dataSize The size of the data that will go into the packet | ||
| 1576 | /// @return The allocated packet | ||
| 1577 | /// | ||
| 1578 | /// @remarks Only called from addon itself | ||
| 1579 | /// | ||
| 1580 | DEMUX_PACKET* AllocateDemuxPacket(int dataSize) | ||
| 663 | { | 1581 | { |
| 664 | return m_instanceData->toKodi->allocate_demux_packet(m_instanceData->toKodi->kodiInstance, | 1582 | return m_instanceData->toKodi->allocate_demux_packet(m_instanceData->toKodi->kodiInstance, |
| 665 | dataSize); | 1583 | dataSize); |
| 666 | } | 1584 | } |
| 667 | 1585 | //---------------------------------------------------------------------------- | |
| 668 | /*! | 1586 | |
| 669 | * @brief Allocate a demux packet. Free with FreeDemuxPacket | 1587 | //============================================================================ |
| 670 | * @param dataSize The size of the data that will go into the packet | 1588 | /// @brief Allocate a encrypted demux packet. Free with @ref FreeDemuxPacket |
| 671 | * @return The allocated packet | 1589 | /// |
| 672 | */ | 1590 | /// @param[in] dataSize The size of the data that will go into the packet |
| 673 | DemuxPacket* AllocateEncryptedDemuxPacket(int dataSize, unsigned int encryptedSubsampleCount) | 1591 | /// @param[in] encryptedSubsampleCount The encrypted subsample count |
| 1592 | /// @return The allocated packet | ||
| 1593 | /// | ||
| 1594 | /// @remarks Only called from addon itself | ||
| 1595 | /// | ||
| 1596 | DEMUX_PACKET* AllocateEncryptedDemuxPacket(int dataSize, unsigned int encryptedSubsampleCount) | ||
| 674 | { | 1597 | { |
| 675 | return m_instanceData->toKodi->allocate_encrypted_demux_packet( | 1598 | return m_instanceData->toKodi->allocate_encrypted_demux_packet( |
| 676 | m_instanceData->toKodi->kodiInstance, dataSize, encryptedSubsampleCount); | 1599 | m_instanceData->toKodi->kodiInstance, dataSize, encryptedSubsampleCount); |
| 677 | } | 1600 | } |
| 678 | 1601 | //---------------------------------------------------------------------------- | |
| 679 | /*! | 1602 | |
| 680 | * @brief Free a packet that was allocated with AllocateDemuxPacket | 1603 | //============================================================================ |
| 681 | * @param packet The packet to free | 1604 | /// @brief Free a packet that was allocated with AllocateDemuxPacket |
| 682 | */ | 1605 | /// |
| 683 | void FreeDemuxPacket(DemuxPacket* packet) | 1606 | /// @param[in] packet The packet to free |
| 1607 | /// | ||
| 1608 | /// @remarks Only called from addon itself | ||
| 1609 | /// | ||
| 1610 | void FreeDemuxPacket(DEMUX_PACKET* packet) | ||
| 684 | { | 1611 | { |
| 685 | return m_instanceData->toKodi->free_demux_packet(m_instanceData->toKodi->kodiInstance, packet); | 1612 | return m_instanceData->toKodi->free_demux_packet(m_instanceData->toKodi->kodiInstance, packet); |
| 686 | } | 1613 | } |
| 1614 | //---------------------------------------------------------------------------- | ||
| 1615 | |||
| 1616 | ///@} | ||
| 1617 | |||
| 1618 | //############################################################################ | ||
| 1619 | /// @defgroup cpp_kodi_addon_inputstream_Time 3. Time (optional) | ||
| 1620 | /// @brief **To get stream position time.** | ||
| 1621 | /// | ||
| 1622 | /// @note These are used and must be set by the addon if the @ref INPUTSTREAM_SUPPORTS_IDISPLAYTIME is set in the capabilities (see @ref GetCapabilities()). | ||
| 1623 | /// | ||
| 1624 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1625 | ///@{ | ||
| 1626 | |||
| 1627 | //========================================================================== | ||
| 1628 | /// @brief Totel time in ms | ||
| 1629 | /// | ||
| 1630 | /// @return Total time in milliseconds | ||
| 1631 | /// | ||
| 1632 | /// @remarks | ||
| 1633 | /// | ||
| 1634 | virtual int GetTotalTime() { return -1; } | ||
| 1635 | //-------------------------------------------------------------------------- | ||
| 1636 | |||
| 1637 | //========================================================================== | ||
| 1638 | /// @brief Playing time in ms | ||
| 1639 | /// | ||
| 1640 | /// @return Playing time in milliseconds | ||
| 1641 | /// | ||
| 1642 | /// @remarks | ||
| 1643 | /// | ||
| 1644 | virtual int GetTime() { return -1; } | ||
| 1645 | //-------------------------------------------------------------------------- | ||
| 1646 | |||
| 1647 | ///@} | ||
| 1648 | |||
| 1649 | //############################################################################ | ||
| 1650 | /// @defgroup cpp_kodi_addon_inputstream_Times 4. Times (optional) | ||
| 1651 | /// @brief **Another way to get stream position time.** | ||
| 1652 | /// | ||
| 1653 | /// @note These are used and must be set by the addon if the @ref INPUTSTREAM_SUPPORTS_ITIME is set in the capabilities (see @ref GetCapabilities()). | ||
| 1654 | /// | ||
| 1655 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1656 | ///@{ | ||
| 1657 | |||
| 1658 | //============================================================================ | ||
| 1659 | /// @brief Get current timing values in PTS scale | ||
| 1660 | /// | ||
| 1661 | /// @param[out] times The with @ref InputstreamTimes to given times | ||
| 1662 | /// @return true if successfully done, false if not | ||
| 1663 | /// | ||
| 1664 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Times_Help | ||
| 1665 | /// | ||
| 1666 | /// @remarks | ||
| 1667 | /// | ||
| 1668 | virtual bool GetTimes(InputstreamTimes& times) { return false; } | ||
| 1669 | //---------------------------------------------------------------------------- | ||
| 1670 | |||
| 1671 | ///@} | ||
| 1672 | |||
| 1673 | //############################################################################ | ||
| 1674 | /// @defgroup cpp_kodi_addon_inputstream_PosTime 5. Position time (optional) | ||
| 1675 | /// @brief **Third way get stream position time.** | ||
| 1676 | /// | ||
| 1677 | /// @note These are used and must be set by the addon if the @ref INPUTSTREAM_SUPPORTS_IPOSTIME is set in the capabilities (see @ref GetCapabilities()). | ||
| 1678 | /// | ||
| 1679 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1680 | ///@{ | ||
| 1681 | |||
| 1682 | //============================================================================ | ||
| 1683 | /// @brief Positions inputstream to playing time given in ms | ||
| 1684 | /// | ||
| 1685 | /// @param[in] ms Position time in milliseconds | ||
| 1686 | /// | ||
| 1687 | /// @remarks | ||
| 1688 | /// | ||
| 1689 | virtual bool PosTime(int ms) { return false; } | ||
| 1690 | //---------------------------------------------------------------------------- | ||
| 1691 | |||
| 1692 | ///@} | ||
| 1693 | |||
| 1694 | //############################################################################ | ||
| 1695 | /// @defgroup cpp_kodi_addon_inputstream_Chapter 6. Chapter (optional) | ||
| 1696 | /// @brief **Used to get available chapters.** | ||
| 1697 | /// | ||
| 1698 | /// @note These are used and must be set by the addon if the @ref INPUTSTREAM_SUPPORTS_ICHAPTER is set in the capabilities (see @ref GetCapabilities()). | ||
| 1699 | /// | ||
| 1700 | /// @ingroup cpp_kodi_addon_inputstream | ||
| 1701 | ///@{ | ||
| 1702 | |||
| 1703 | //========================================================================== | ||
| 1704 | /// | ||
| 1705 | /// @brief Return currently selected chapter | ||
| 1706 | /// | ||
| 1707 | /// @return Chapter number | ||
| 1708 | /// | ||
| 1709 | /// @remarks | ||
| 1710 | /// | ||
| 1711 | virtual int GetChapter() { return -1; }; | ||
| 1712 | //-------------------------------------------------------------------------- | ||
| 1713 | |||
| 1714 | //========================================================================== | ||
| 1715 | /// | ||
| 1716 | /// @brief Return number of available chapters | ||
| 1717 | /// | ||
| 1718 | /// @return Chapter count | ||
| 1719 | /// | ||
| 1720 | /// @remarks | ||
| 1721 | /// | ||
| 1722 | virtual int GetChapterCount() { return 0; }; | ||
| 1723 | //-------------------------------------------------------------------------- | ||
| 1724 | |||
| 1725 | //========================================================================== | ||
| 1726 | /// | ||
| 1727 | /// @brief Return name of chapter | ||
| 1728 | /// | ||
| 1729 | /// @param[in] ch Chapter identifier | ||
| 1730 | /// @return Chapter name | ||
| 1731 | /// | ||
| 1732 | /// @remarks | ||
| 1733 | /// | ||
| 1734 | virtual const char* GetChapterName(int ch) { return nullptr; }; | ||
| 1735 | //-------------------------------------------------------------------------- | ||
| 1736 | |||
| 1737 | //========================================================================== | ||
| 1738 | /// | ||
| 1739 | /// @brief Return position if chapter # ch in milliseconds | ||
| 1740 | /// | ||
| 1741 | /// @param[in] ch Chapter to get position from | ||
| 1742 | /// @return Position in milliseconds | ||
| 1743 | /// | ||
| 1744 | /// @remarks | ||
| 1745 | /// | ||
| 1746 | virtual int64_t GetChapterPos(int ch) { return 0; }; | ||
| 1747 | //-------------------------------------------------------------------------- | ||
| 1748 | |||
| 1749 | //========================================================================== | ||
| 1750 | /// | ||
| 1751 | /// @brief Seek to the beginning of chapter # ch | ||
| 1752 | /// | ||
| 1753 | /// @param[in] ch Chapter to seek | ||
| 1754 | /// @return True if successfully done, false if not | ||
| 1755 | /// | ||
| 1756 | /// @remarks | ||
| 1757 | /// | ||
| 1758 | virtual bool SeekChapter(int ch) { return false; }; | ||
| 1759 | //-------------------------------------------------------------------------- | ||
| 1760 | |||
| 1761 | ///@} | ||
| 687 | 1762 | ||
| 688 | private: | 1763 | private: |
| 689 | static int compareVersion(const int v1[3], const int v2[3]) | 1764 | static int compareVersion(const int v1[3], const int v2[3]) |
| @@ -752,9 +1827,10 @@ private: | |||
| 752 | */ | 1827 | */ |
| 753 | } | 1828 | } |
| 754 | 1829 | ||
| 755 | inline static bool ADDON_Open(const AddonInstance_InputStream* instance, INPUTSTREAM* props) | 1830 | inline static bool ADDON_Open(const AddonInstance_InputStream* instance, |
| 1831 | INPUTSTREAM_PROPERTY* props) | ||
| 756 | { | 1832 | { |
| 757 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->Open(*props); | 1833 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->Open(props); |
| 758 | } | 1834 | } |
| 759 | 1835 | ||
| 760 | inline static void ADDON_Close(const AddonInstance_InputStream* instance) | 1836 | inline static void ADDON_Close(const AddonInstance_InputStream* instance) |
| @@ -765,22 +1841,48 @@ private: | |||
| 765 | inline static void ADDON_GetCapabilities(const AddonInstance_InputStream* instance, | 1841 | inline static void ADDON_GetCapabilities(const AddonInstance_InputStream* instance, |
| 766 | INPUTSTREAM_CAPABILITIES* capabilities) | 1842 | INPUTSTREAM_CAPABILITIES* capabilities) |
| 767 | { | 1843 | { |
| 768 | static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance) | 1844 | InputstreamCapabilities caps(capabilities); |
| 769 | ->GetCapabilities(*capabilities); | 1845 | static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->GetCapabilities(caps); |
| 770 | } | 1846 | } |
| 771 | 1847 | ||
| 772 | 1848 | ||
| 773 | // IDemux | 1849 | // IDemux |
| 774 | inline static struct INPUTSTREAM_IDS ADDON_GetStreamIds(const AddonInstance_InputStream* instance) | 1850 | inline static bool ADDON_GetStreamIds(const AddonInstance_InputStream* instance, |
| 1851 | struct INPUTSTREAM_IDS* ids) | ||
| 775 | { | 1852 | { |
| 776 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->GetStreamIds(); | 1853 | std::vector<unsigned int> idList; |
| 1854 | bool ret = | ||
| 1855 | static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->GetStreamIds(idList); | ||
| 1856 | if (ret) | ||
| 1857 | { | ||
| 1858 | for (size_t i = 0; i < idList.size() && i < INPUTSTREAM_MAX_STREAM_COUNT; ++i) | ||
| 1859 | { | ||
| 1860 | ids->m_streamCount++; | ||
| 1861 | ids->m_streamIds[i] = idList[i]; | ||
| 1862 | } | ||
| 1863 | } | ||
| 1864 | return ret; | ||
| 777 | } | 1865 | } |
| 778 | 1866 | ||
| 779 | inline static struct INPUTSTREAM_INFO ADDON_GetStream(const AddonInstance_InputStream* instance, | 1867 | inline static bool ADDON_GetStream( |
| 780 | int streamid) | 1868 | const AddonInstance_InputStream* instance, |
| 1869 | int streamid, | ||
| 1870 | struct INPUTSTREAM_INFO* info, | ||
| 1871 | KODI_HANDLE* demuxStream, | ||
| 1872 | KODI_HANDLE (*transfer_stream)(KODI_HANDLE handle, | ||
| 1873 | int streamId, | ||
| 1874 | struct INPUTSTREAM_INFO* stream)) | ||
| 781 | { | 1875 | { |
| 782 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance) | 1876 | InputstreamInfo infoData(info); |
| 783 | ->GetStream(streamid); | 1877 | bool ret = static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance) |
| 1878 | ->GetStream(streamid, infoData); | ||
| 1879 | if (ret && transfer_stream) | ||
| 1880 | { | ||
| 1881 | // Do this with given callback to prevent memory problems and leaks. This | ||
| 1882 | // then create on Kodi the needed class where then given back on demuxStream. | ||
| 1883 | *demuxStream = transfer_stream(instance->toKodi->kodiInstance, streamid, info); | ||
| 1884 | } | ||
| 1885 | return ret; | ||
| 784 | } | 1886 | } |
| 785 | 1887 | ||
| 786 | inline static void ADDON_EnableStream(const AddonInstance_InputStream* instance, | 1888 | inline static void ADDON_EnableStream(const AddonInstance_InputStream* instance, |
| @@ -812,7 +1914,7 @@ private: | |||
| 812 | static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->DemuxFlush(); | 1914 | static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->DemuxFlush(); |
| 813 | } | 1915 | } |
| 814 | 1916 | ||
| 815 | inline static DemuxPacket* ADDON_DemuxRead(const AddonInstance_InputStream* instance) | 1917 | inline static DEMUX_PACKET* ADDON_DemuxRead(const AddonInstance_InputStream* instance) |
| 816 | { | 1918 | { |
| 817 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->DemuxRead(); | 1919 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->DemuxRead(); |
| 818 | } | 1920 | } |
| @@ -855,7 +1957,8 @@ private: | |||
| 855 | inline static bool ADDON_GetTimes(const AddonInstance_InputStream* instance, | 1957 | inline static bool ADDON_GetTimes(const AddonInstance_InputStream* instance, |
| 856 | INPUTSTREAM_TIMES* times) | 1958 | INPUTSTREAM_TIMES* times) |
| 857 | { | 1959 | { |
| 858 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->GetTimes(*times); | 1960 | InputstreamTimes cppTimes(times); |
| 1961 | return static_cast<CInstanceInputStream*>(instance->toAddon->addonInstance)->GetTimes(cppTimes); | ||
| 859 | } | 1962 | } |
| 860 | 1963 | ||
| 861 | // IPosTime | 1964 | // IPosTime |
| @@ -927,6 +2030,7 @@ private: | |||
| 927 | 2030 | ||
| 928 | AddonInstance_InputStream* m_instanceData; | 2031 | AddonInstance_InputStream* m_instanceData; |
| 929 | }; | 2032 | }; |
| 2033 | //------------------------------------------------------------------------------ | ||
| 930 | 2034 | ||
| 931 | } /* namespace addon */ | 2035 | } /* namespace addon */ |
| 932 | } /* namespace kodi */ | 2036 | } /* namespace kodi */ |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/PVR.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/PVR.h index d5977a7..61e294f 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/PVR.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/PVR.h | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | * Only must be min version increased if a new compile of addon breaks after | 36 | * Only must be min version increased if a new compile of addon breaks after |
| 37 | * changes here. | 37 | * changes here. |
| 38 | * | 38 | * |
| 39 | * Have by add of new parts a look about **Doxygen** `\\ingroup`, so that | 39 | * Have by add of new parts a look about **Doxygen** `\@ingroup`, so that |
| 40 | * added parts included in documentation. | 40 | * added parts included in documentation. |
| 41 | * | 41 | * |
| 42 | * If you add addon side related documentation, where his dev need know, use `///`. | 42 | * If you add addon side related documentation, where his dev need know, use `///`. |
| @@ -1477,22 +1477,39 @@ public: | |||
| 1477 | //---------------------------------------------------------------------------- | 1477 | //---------------------------------------------------------------------------- |
| 1478 | 1478 | ||
| 1479 | //============================================================================ | 1479 | //============================================================================ |
| 1480 | /// @brief Tell the client the time frame to use when notifying epg events back to Kodi | 1480 | /// @brief Tell the client the past time frame to use when notifying epg events back to Kodi |
| 1481 | /// | 1481 | /// |
| 1482 | /// The client might push epg events asynchronously to Kodi using the callback function | 1482 | /// The client might push epg events asynchronously to Kodi using the callback function |
| 1483 | /// @ref EpgEventStateChange. To be able to only push events that are actually of | 1483 | /// @ref EpgEventStateChange. To be able to only push events that are actually of |
| 1484 | /// interest for Kodi, client needs to know about the epg time frame Kodi uses. Kodi | 1484 | /// interest for Kodi, client needs to know about the epg time frame Kodi uses. Kodi supplies |
| 1485 | /// supplies the current epg time frame value in @ref EpgMaxDays() when creating the | 1485 | /// the current epg max past time frame value @ref EpgMaxPastDays() when creating the addon |
| 1486 | /// addon and calls @ref SetEPGTimeFrame later whenever Kodi's epg time frame value | 1486 | /// and calls @ref SetEPGMaxPastDays later whenever Kodi's epg time frame value changes. |
| 1487 | /// changes. | ||
| 1488 | /// | 1487 | /// |
| 1489 | /// @param[in] days number of days from "now". @ref EPG_TIMEFRAME_UNLIMITED means that Kodi | 1488 | /// @param[in] pastDays number of days before "now". @ref EPG_TIMEFRAME_UNLIMITED means that Kodi |
| 1490 | /// is interested in all epg events, regardless of event times. | 1489 | /// is interested in all epg events, regardless of event times. |
| 1491 | /// @return @ref PVR_ERROR_NO_ERROR if new value was successfully set. | 1490 | /// @return @ref PVR_ERROR_NO_ERROR if new value was successfully set. |
| 1492 | /// | 1491 | /// |
| 1493 | /// @remarks Required if @ref PVRCapabilities::SetSupportsEPG "supportsEPG" is set to true. | 1492 | /// @remarks Required if @ref PVRCapabilities::SetSupportsEPG "supportsEPG" is set to true. |
| 1494 | /// | 1493 | /// |
| 1495 | virtual PVR_ERROR SetEPGTimeFrame(int days) { return PVR_ERROR_NOT_IMPLEMENTED; } | 1494 | virtual PVR_ERROR SetEPGMaxPastDays(int pastDays) { return PVR_ERROR_NOT_IMPLEMENTED; } |
| 1495 | //---------------------------------------------------------------------------- | ||
| 1496 | |||
| 1497 | //============================================================================ | ||
| 1498 | /// @brief Tell the client the future time frame to use when notifying epg events back to Kodi | ||
| 1499 | /// | ||
| 1500 | /// The client might push epg events asynchronously to Kodi using the callback function | ||
| 1501 | /// @ref EpgEventStateChange. To be able to only push events that are actually of | ||
| 1502 | /// interest for Kodi, client needs to know about the epg time frame Kodi uses. Kodi supplies | ||
| 1503 | /// the current epg max future time frame value @ref EpgMaxFutureDays() when creating the addon | ||
| 1504 | /// and calls @ref SetEPGMaxFutureDays later whenever Kodi's epg time frame value changes. | ||
| 1505 | /// | ||
| 1506 | /// @param[in] futureDays number of days from "now". @ref EPG_TIMEFRAME_UNLIMITED means that Kodi | ||
| 1507 | /// is interested in all epg events, regardless of event times. | ||
| 1508 | /// @return @ref PVR_ERROR_NO_ERROR if new value was successfully set. | ||
| 1509 | /// | ||
| 1510 | /// @remarks Required if @ref PVRCapabilities::SetSupportsEPG "supportsEPG" is set to true. | ||
| 1511 | /// | ||
| 1512 | virtual PVR_ERROR SetEPGMaxFutureDays(int futureDays) { return PVR_ERROR_NOT_IMPLEMENTED; } | ||
| 1496 | //---------------------------------------------------------------------------- | 1513 | //---------------------------------------------------------------------------- |
| 1497 | 1514 | ||
| 1498 | //========================================================================== | 1515 | //========================================================================== |
| @@ -1518,15 +1535,28 @@ public: | |||
| 1518 | 1535 | ||
| 1519 | //========================================================================== | 1536 | //========================================================================== |
| 1520 | /// @brief **Callback to Kodi Function**\n | 1537 | /// @brief **Callback to Kodi Function**\n |
| 1521 | /// Get the Max days handled by Kodi. | 1538 | /// Get the Max past days handled by Kodi. |
| 1522 | /// | 1539 | /// |
| 1523 | /// If > @ref EPG_TIMEFRAME_UNLIMITED, in async epg mode, deliver only events | 1540 | /// If > @ref EPG_TIMEFRAME_UNLIMITED, in async epg mode, deliver only events in the |
| 1524 | /// in the range from 'end time > now' to 'start time < now + EpgMaxDays(). | 1541 | /// range from 'end time > now - EpgMaxPastDays()' to 'start time < now + EpgMaxFutureDays(). |
| 1525 | /// @ref EPG_TIMEFRAME_UNLIMITED, notify all events. | 1542 | /// @ref EPG_TIMEFRAME_UNLIMITED, notify all events. |
| 1526 | /// | 1543 | /// |
| 1527 | /// @return The Max days handled by Kodi | 1544 | /// @return The Max past days handled by Kodi |
| 1528 | /// | 1545 | /// |
| 1529 | inline int EpgMaxDays() const { return m_instanceData->props->iEpgMaxDays; } | 1546 | inline int EpgMaxPastDays() const { return m_instanceData->props->iEpgMaxPastDays; } |
| 1547 | //---------------------------------------------------------------------------- | ||
| 1548 | |||
| 1549 | //========================================================================== | ||
| 1550 | /// @brief **Callback to Kodi Function**\n | ||
| 1551 | /// Get the Max future days handled by Kodi. | ||
| 1552 | /// | ||
| 1553 | /// If > @ref EPG_TIMEFRAME_UNLIMITED, in async epg mode, deliver only events in the | ||
| 1554 | /// range from 'end time > now - EpgMaxPastDays()' to 'start time < now + EpgMaxFutureDays(). | ||
| 1555 | /// @ref EPG_TIMEFRAME_UNLIMITED, notify all events. | ||
| 1556 | /// | ||
| 1557 | /// @return The Max future days handled by Kodi | ||
| 1558 | /// | ||
| 1559 | inline int EpgMaxFutureDays() const { return m_instanceData->props->iEpgMaxFutureDays; } | ||
| 1530 | //---------------------------------------------------------------------------- | 1560 | //---------------------------------------------------------------------------- |
| 1531 | 1561 | ||
| 1532 | //========================================================================== | 1562 | //========================================================================== |
| @@ -2324,7 +2354,7 @@ public: | |||
| 2324 | /// @remarks Required, and only used if addon has its own demuxer. | 2354 | /// @remarks Required, and only used if addon has its own demuxer. |
| 2325 | /// Return `nullptr` if this add-on won't provide this function. | 2355 | /// Return `nullptr` if this add-on won't provide this function. |
| 2326 | /// | 2356 | /// |
| 2327 | virtual DemuxPacket* DemuxRead() { return nullptr; } | 2357 | virtual DEMUX_PACKET* DemuxRead() { return nullptr; } |
| 2328 | //---------------------------------------------------------------------------- | 2358 | //---------------------------------------------------------------------------- |
| 2329 | 2359 | ||
| 2330 | //============================================================================ | 2360 | //============================================================================ |
| @@ -2413,7 +2443,7 @@ public: | |||
| 2413 | /// | 2443 | /// |
| 2414 | /// @remarks Only called from addon itself | 2444 | /// @remarks Only called from addon itself |
| 2415 | /// | 2445 | /// |
| 2416 | inline DemuxPacket* AllocateDemuxPacket(int iDataSize) | 2446 | inline DEMUX_PACKET* AllocateDemuxPacket(int iDataSize) |
| 2417 | { | 2447 | { |
| 2418 | return m_instanceData->toKodi->AllocateDemuxPacket(m_instanceData->toKodi->kodiInstance, | 2448 | return m_instanceData->toKodi->AllocateDemuxPacket(m_instanceData->toKodi->kodiInstance, |
| 2419 | iDataSize); | 2449 | iDataSize); |
| @@ -2428,7 +2458,7 @@ public: | |||
| 2428 | /// | 2458 | /// |
| 2429 | /// @remarks Only called from addon itself. | 2459 | /// @remarks Only called from addon itself. |
| 2430 | /// | 2460 | /// |
| 2431 | inline void FreeDemuxPacket(DemuxPacket* pPacket) | 2461 | inline void FreeDemuxPacket(DEMUX_PACKET* pPacket) |
| 2432 | { | 2462 | { |
| 2433 | m_instanceData->toKodi->FreeDemuxPacket(m_instanceData->toKodi->kodiInstance, pPacket); | 2463 | m_instanceData->toKodi->FreeDemuxPacket(m_instanceData->toKodi->kodiInstance, pPacket); |
| 2434 | } | 2464 | } |
| @@ -2662,7 +2692,8 @@ private: | |||
| 2662 | m_instanceData->toAddon->IsEPGTagPlayable = ADDON_IsEPGTagPlayable; | 2692 | m_instanceData->toAddon->IsEPGTagPlayable = ADDON_IsEPGTagPlayable; |
| 2663 | m_instanceData->toAddon->GetEPGTagEdl = ADDON_GetEPGTagEdl; | 2693 | m_instanceData->toAddon->GetEPGTagEdl = ADDON_GetEPGTagEdl; |
| 2664 | m_instanceData->toAddon->GetEPGTagStreamProperties = ADDON_GetEPGTagStreamProperties; | 2694 | m_instanceData->toAddon->GetEPGTagStreamProperties = ADDON_GetEPGTagStreamProperties; |
| 2665 | m_instanceData->toAddon->SetEPGTimeFrame = ADDON_SetEPGTimeFrame; | 2695 | m_instanceData->toAddon->SetEPGMaxPastDays = ADDON_SetEPGMaxPastDays; |
| 2696 | m_instanceData->toAddon->SetEPGMaxFutureDays = ADDON_SetEPGMaxFutureDays; | ||
| 2666 | m_instanceData->toAddon->CallEPGMenuHook = ADDON_CallEPGMenuHook; | 2697 | m_instanceData->toAddon->CallEPGMenuHook = ADDON_CallEPGMenuHook; |
| 2667 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | 2698 | //--==----==----==----==----==----==----==----==----==----==----==----==----== |
| 2668 | m_instanceData->toAddon->GetRecordingsAmount = ADDON_GetRecordingsAmount; | 2699 | m_instanceData->toAddon->GetRecordingsAmount = ADDON_GetRecordingsAmount; |
| @@ -2998,10 +3029,17 @@ private: | |||
| 2998 | return error; | 3029 | return error; |
| 2999 | } | 3030 | } |
| 3000 | 3031 | ||
| 3001 | inline static PVR_ERROR ADDON_SetEPGTimeFrame(const AddonInstance_PVR* instance, int days) | 3032 | inline static PVR_ERROR ADDON_SetEPGMaxPastDays(const AddonInstance_PVR* instance, int pastDays) |
| 3033 | { | ||
| 3034 | return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance) | ||
| 3035 | ->SetEPGMaxPastDays(pastDays); | ||
| 3036 | } | ||
| 3037 | |||
| 3038 | inline static PVR_ERROR ADDON_SetEPGMaxFutureDays(const AddonInstance_PVR* instance, | ||
| 3039 | int futureDays) | ||
| 3002 | { | 3040 | { |
| 3003 | return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance) | 3041 | return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance) |
| 3004 | ->SetEPGTimeFrame(days); | 3042 | ->SetEPGMaxFutureDays(futureDays); |
| 3005 | } | 3043 | } |
| 3006 | 3044 | ||
| 3007 | inline static PVR_ERROR ADDON_CallEPGMenuHook(const AddonInstance_PVR* instance, | 3045 | inline static PVR_ERROR ADDON_CallEPGMenuHook(const AddonInstance_PVR* instance, |
| @@ -3364,7 +3402,7 @@ private: | |||
| 3364 | static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxFlush(); | 3402 | static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxFlush(); |
| 3365 | } | 3403 | } |
| 3366 | 3404 | ||
| 3367 | inline static DemuxPacket* ADDON_DemuxRead(const AddonInstance_PVR* instance) | 3405 | inline static DEMUX_PACKET* ADDON_DemuxRead(const AddonInstance_PVR* instance) |
| 3368 | { | 3406 | { |
| 3369 | return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxRead(); | 3407 | return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxRead(); |
| 3370 | } | 3408 | } |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Screensaver.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Screensaver.h index 4902fcb..d4ac1aa 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Screensaver.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Screensaver.h | |||
| @@ -41,7 +41,7 @@ namespace addon | |||
| 41 | /// * <b><c>Render()</c></b> - Called at render time | 41 | /// * <b><c>Render()</c></b> - Called at render time |
| 42 | /// * <b><c>Stop()</c></b> - Called when the screensaver has no work | 42 | /// * <b><c>Stop()</c></b> - Called when the screensaver has no work |
| 43 | /// | 43 | /// |
| 44 | /// Additionally, there are several \ref cpp_kodi_addon_screensaver_CB "other functions" | 44 | /// Additionally, there are several @ref cpp_kodi_addon_screensaver_CB "other functions" |
| 45 | /// available in which the child class can ask about the current hardware, | 45 | /// available in which the child class can ask about the current hardware, |
| 46 | /// including the device, display and several other parts. | 46 | /// including the device, display and several other parts. |
| 47 | /// | 47 | /// |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VFS.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VFS.h index 177bf72..dbfb833 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VFS.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VFS.h | |||
| @@ -152,7 +152,7 @@ private: | |||
| 152 | 152 | ||
| 153 | //############################################################################## | 153 | //############################################################################## |
| 154 | /// @defgroup cpp_kodi_addon_vfs_Defs Definitions, structures and enumerators | 154 | /// @defgroup cpp_kodi_addon_vfs_Defs Definitions, structures and enumerators |
| 155 | /// \ingroup cpp_kodi_addon_vfs | 155 | /// @ingroup cpp_kodi_addon_vfs |
| 156 | /// @brief **VFS add-on general variables** | 156 | /// @brief **VFS add-on general variables** |
| 157 | /// | 157 | /// |
| 158 | /// Used to exchange the available options between Kodi and addon. | 158 | /// Used to exchange the available options between Kodi and addon. |
| @@ -161,7 +161,7 @@ private: | |||
| 161 | 161 | ||
| 162 | //============================================================================== | 162 | //============================================================================== |
| 163 | /// | 163 | /// |
| 164 | /// \addtogroup cpp_kodi_addon_vfs | 164 | /// @addtogroup cpp_kodi_addon_vfs |
| 165 | /// @brief \cpp_class{ kodi::addon::CInstanceVFS } | 165 | /// @brief \cpp_class{ kodi::addon::CInstanceVFS } |
| 166 | /// **Virtual Filesystem (VFS) add-on instance** | 166 | /// **Virtual Filesystem (VFS) add-on instance** |
| 167 | /// | 167 | /// |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VideoCodec.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VideoCodec.h index 12893db..7cf58a0 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VideoCodec.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/VideoCodec.h | |||
| @@ -9,241 +9,456 @@ | |||
| 9 | #pragma once | 9 | #pragma once |
| 10 | 10 | ||
| 11 | #include "../AddonBase.h" | 11 | #include "../AddonBase.h" |
| 12 | #include "../StreamCrypto.h" | 12 | #include "../c-api/addon-instance/video_codec.h" |
| 13 | #include "../StreamCodec.h" | 13 | #include "inputstream/DemuxPacket.h" |
| 14 | #include "inputstream/StreamCodec.h" | ||
| 15 | #include "inputstream/StreamCrypto.h" | ||
| 14 | 16 | ||
| 15 | #ifdef BUILD_KODI_ADDON | 17 | #ifdef __cplusplus |
| 16 | #include "../DemuxPacket.h" | ||
| 17 | #else | ||
| 18 | #include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" | ||
| 19 | #endif | ||
| 20 | 18 | ||
| 21 | extern "C" | 19 | namespace kodi |
| 20 | { | ||
| 21 | namespace addon | ||
| 22 | { | 22 | { |
| 23 | enum VIDEOCODEC_FORMAT | ||
| 24 | { | ||
| 25 | UnknownVideoFormat = 0, | ||
| 26 | VideoFormatYV12, | ||
| 27 | VideoFormatI420, | ||
| 28 | MaxVideoFormats | ||
| 29 | }; | ||
| 30 | |||
| 31 | 23 | ||
| 32 | struct VIDEOCODEC_INITDATA | 24 | class CInstanceVideoCodec; |
| 25 | |||
| 26 | //============================================================================== | ||
| 27 | /// @defgroup cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata class VideoCodecInitdata | ||
| 28 | /// @ingroup cpp_kodi_addon_videocodec_Defs | ||
| 29 | /// @brief Initialization data to open a video codec stream. | ||
| 30 | /// | ||
| 31 | /// ---------------------------------------------------------------------------- | ||
| 32 | /// | ||
| 33 | /// @copydetails cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata_Help | ||
| 34 | /// | ||
| 35 | ///@{ | ||
| 36 | class ATTRIBUTE_HIDDEN VideoCodecInitdata | ||
| 37 | : public CStructHdl<VideoCodecInitdata, VIDEOCODEC_INITDATA> | ||
| 38 | { | ||
| 39 | /*! \cond PRIVATE */ | ||
| 40 | friend class CInstanceVideoCodec; | ||
| 41 | /*! \endcond */ | ||
| 42 | |||
| 43 | public: | ||
| 44 | /// @defgroup cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata_Help Value Help | ||
| 45 | /// @ingroup cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata | ||
| 46 | /// | ||
| 47 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata :</b> | ||
| 48 | /// | Name | Type | Get call | ||
| 49 | /// |------|------|---------- | ||
| 50 | /// | **Codec type** | `VIDEOCODEC_TYPE` | @ref VideoCodecInitdata::GetCodecType "GetCodecType" | ||
| 51 | /// | **Codec profile** | `STREAMCODEC_PROFILE` | @ref VideoCodecInitdata::GetCodecProfile "GetCodecProfile" | ||
| 52 | /// | **Video formats** | `std::vector<VIDEOCODEC_FORMAT>` | @ref VideoCodecInitdata::GetVideoFormats "GetVideoFormats" | ||
| 53 | /// | **Width** | `uint32_t` | @ref VideoCodecInitdata::GetWidth "GetWidth" | ||
| 54 | /// | **Height** | `uint32_t` | @ref VideoCodecInitdata::GetHeight "GetHeight" | ||
| 55 | /// | **Extra data** | `const uint8_t*` | @ref VideoCodecInitdata::GetExtraData "GetExtraData" | ||
| 56 | /// | **Extra data size** | `unsigned int` | @ref VideoCodecInitdata::GetExtraDataSize "GetExtraDataSize" | ||
| 57 | /// | **Crypto session** | `kodi::addon::StreamCryptoSession` | @ref VideoCodecInitdata::GetCryptoSession "GetCryptoSession" | ||
| 58 | /// | ||
| 59 | |||
| 60 | /// @addtogroup cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata | ||
| 61 | ///@{ | ||
| 62 | |||
| 63 | /// @brief The codec type required by Kodi to process the stream. | ||
| 64 | /// | ||
| 65 | /// See @ref VIDEOCODEC_TYPE for possible values. | ||
| 66 | VIDEOCODEC_TYPE GetCodecType() const { return m_cStructure->codec; } | ||
| 67 | |||
| 68 | /// @brief Used profiles for non-scalable 2D video | ||
| 69 | STREAMCODEC_PROFILE GetCodecProfile() const { return m_cStructure->codecProfile; } | ||
| 70 | |||
| 71 | /// @brief The video stream representations requested by Kodi | ||
| 72 | /// | ||
| 73 | /// This contains a list of the required video formats. One of them has to | ||
| 74 | /// select the addon to return the created image. | ||
| 75 | /// | ||
| 76 | std::vector<VIDEOCODEC_FORMAT> GetVideoFormats() const | ||
| 33 | { | 77 | { |
| 34 | enum Codec { | 78 | std::vector<VIDEOCODEC_FORMAT> formats; |
| 35 | CodecUnknown = 0, | 79 | unsigned int i = 0; |
| 36 | CodecVp8, | 80 | while (i < VIDEOCODEC_FORMAT_MAXFORMATS && |
| 37 | CodecH264, | 81 | m_cStructure->videoFormats[i] != VIDEOCODEC_FORMAT_UNKNOWN) |
| 38 | CodecVp9 | 82 | formats.emplace_back(m_cStructure->videoFormats[i++]); |
| 39 | } codec; | 83 | if (formats.empty()) |
| 40 | 84 | formats.emplace_back(VIDEOCODEC_FORMAT_UNKNOWN); | |
| 41 | STREAMCODEC_PROFILE codecProfile; | 85 | return formats; |
| 42 | 86 | } | |
| 43 | //UnknownVideoFormat is terminator | 87 | |
| 44 | VIDEOCODEC_FORMAT *videoFormats; | 88 | /// @brief Picture width. |
| 45 | 89 | uint32_t GetWidth() const { return m_cStructure->width; } | |
| 46 | uint32_t width, height; | 90 | |
| 47 | 91 | /// @brief Picture height. | |
| 48 | const uint8_t *extraData; | 92 | uint32_t GetHeight() const { return m_cStructure->height; } |
| 49 | unsigned int extraDataSize; | 93 | |
| 50 | 94 | /// @brief Depending on the required decoding, additional data given by the stream. | |
| 51 | CRYPTO_INFO cryptoInfo; | 95 | const uint8_t* GetExtraData() const { return m_cStructure->extraData; } |
| 52 | }; | 96 | |
| 53 | 97 | /// @brief Size of the data given with @ref extraData. | |
| 54 | struct VIDEOCODEC_PICTURE | 98 | unsigned int GetExtraDataSize() const { return m_cStructure->extraDataSize; } |
| 99 | |||
| 100 | /// @brief **Data to manage stream cryptography**\n | ||
| 101 | /// To get class structure manages any encryption values required in order to have | ||
| 102 | /// them available in their stream processing. | ||
| 103 | /// | ||
| 104 | /// ---------------------------------------------------------------------------- | ||
| 105 | /// | ||
| 106 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Info_StreamCryptoSession_Help | ||
| 107 | /// | ||
| 108 | kodi::addon::StreamCryptoSession GetCryptoSession() const { return &m_cStructure->cryptoSession; } | ||
| 109 | |||
| 110 | ///@} | ||
| 111 | |||
| 112 | private: | ||
| 113 | VideoCodecInitdata() = delete; | ||
| 114 | VideoCodecInitdata(const VideoCodecInitdata& session) : CStructHdl(session) {} | ||
| 115 | VideoCodecInitdata(const VIDEOCODEC_INITDATA* session) : CStructHdl(session) {} | ||
| 116 | VideoCodecInitdata(VIDEOCODEC_INITDATA* session) : CStructHdl(session) {} | ||
| 117 | }; | ||
| 118 | ///@} | ||
| 119 | //------------------------------------------------------------------------------ | ||
| 120 | |||
| 121 | //############################################################################## | ||
| 122 | /// @defgroup cpp_kodi_addon_videocodec_Defs Definitions, structures and enumerators | ||
| 123 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 124 | /// @brief **Video codec add-on general variables** | ||
| 125 | /// | ||
| 126 | /// Used to exchange the available options between Kodi and addon. | ||
| 127 | /// | ||
| 128 | /// | ||
| 129 | |||
| 130 | //============================================================================ | ||
| 131 | /// | ||
| 132 | /// @addtogroup cpp_kodi_addon_videocodec | ||
| 133 | /// @brief \cpp_class{ kodi::addon::CInstanceVideoCodec } | ||
| 134 | /// **Video codec add-on instance** | ||
| 135 | /// | ||
| 136 | /// This is an addon instance class to add an additional video decoder to Kodi | ||
| 137 | /// using addon. | ||
| 138 | /// | ||
| 139 | /// This means that either a new type of decoding can be introduced to an input | ||
| 140 | /// stream add-on that requires special types of decoding. | ||
| 141 | /// | ||
| 142 | /// When using the inputstream addon, @ref cpp_kodi_addon_inputstream_Defs_Interface_InputstreamInfo | ||
| 143 | /// to @ref cpp_kodi_addon_inputstream_Defs_Info is used to declare that the | ||
| 144 | /// decoder stored in the addon is used. | ||
| 145 | /// | ||
| 146 | /// @note At the moment this can only be used together with input stream addons, | ||
| 147 | /// independent use as a codec addon is not yet possible. | ||
| 148 | /// | ||
| 149 | /// Include the header @ref VideoCodec.h "#include <kodi/addon-instance/VideoCodec.h>" | ||
| 150 | /// to use this class. | ||
| 151 | /// | ||
| 152 | /// -------------------------------------------------------------------------- | ||
| 153 | /// | ||
| 154 | /// **Example:** | ||
| 155 | /// This as an example when used together with @ref cpp_kodi_addon_inputstream "kodi::addon::CInstanceInputStream". | ||
| 156 | /// | ||
| 157 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 158 | /// #include <kodi/addon-instance/Inputstream.h> | ||
| 159 | /// #include <kodi/addon-instance/VideoCodec.h> | ||
| 160 | /// | ||
| 161 | /// class CMyVideoCodec : public kodi::addon::CInstanceVideoCodec | ||
| 162 | /// { | ||
| 163 | /// public: | ||
| 164 | /// CMyVideoCodec(KODI_HANDLE instance, CMyInputstream* inputstream); | ||
| 165 | /// ... | ||
| 166 | /// | ||
| 167 | /// private: | ||
| 168 | /// CMyInputstream* m_inputstream; | ||
| 169 | /// }; | ||
| 170 | /// | ||
| 171 | /// CMyVideoCodec::CMyVideoCodec(KODI_HANDLE instance, | ||
| 172 | /// const std::string& version, | ||
| 173 | /// CMyInputstream* inputstream) | ||
| 174 | /// : kodi::addon::CInstanceVideoCodec(instance, version), | ||
| 175 | /// m_inputstream(inputstream) | ||
| 176 | /// { | ||
| 177 | /// ... | ||
| 178 | /// } | ||
| 179 | /// ... | ||
| 180 | /// | ||
| 181 | /// //---------------------------------------------------------------------- | ||
| 182 | /// | ||
| 183 | /// class CMyInputstream : public kodi::addon::CInstanceInputStream | ||
| 184 | /// { | ||
| 185 | /// public: | ||
| 186 | /// CMyInputstream(KODI_HANDLE instance, const std::string& kodiVersion); | ||
| 187 | /// | ||
| 188 | /// ADDON_STATUS CreateInstance(int instanceType, | ||
| 189 | /// std::string instanceID, | ||
| 190 | /// KODI_HANDLE instance, | ||
| 191 | /// const std::string& version, | ||
| 192 | /// KODI_HANDLE& addonInstance) override; | ||
| 193 | /// ... | ||
| 194 | /// }; | ||
| 195 | /// | ||
| 196 | /// CMyInputstream::CMyInputstream(KODI_HANDLE instance, const std::string& kodiVersion) | ||
| 197 | /// : kodi::addon::CInstanceInputStream(instance, kodiVersion) | ||
| 198 | /// { | ||
| 199 | /// ... | ||
| 200 | /// } | ||
| 201 | /// | ||
| 202 | /// ADDON_STATUS CMyInputstream::CreateInstance(int instanceType, | ||
| 203 | /// std::string instanceID, | ||
| 204 | /// KODI_HANDLE instance, | ||
| 205 | /// const std::string& version, | ||
| 206 | /// KODI_HANDLE& addonInstance) | ||
| 207 | /// { | ||
| 208 | /// if (instanceType == ADDON_INSTANCE_VIDEOCODEC) | ||
| 209 | /// { | ||
| 210 | /// addonInstance = new CMyVideoCodec(instance, version, this); | ||
| 211 | /// return ADDON_STATUS_OK; | ||
| 212 | /// } | ||
| 213 | /// return ADDON_STATUS_NOT_IMPLEMENTED; | ||
| 214 | /// } | ||
| 215 | /// | ||
| 216 | /// ... | ||
| 217 | /// | ||
| 218 | /// //---------------------------------------------------------------------- | ||
| 219 | /// | ||
| 220 | /// class CMyAddon : public kodi::addon::CAddonBase | ||
| 221 | /// { | ||
| 222 | /// public: | ||
| 223 | /// CMyAddon() { } | ||
| 224 | /// ADDON_STATUS CreateInstance(int instanceType, | ||
| 225 | /// std::string instanceID, | ||
| 226 | /// KODI_HANDLE instance, | ||
| 227 | /// const std::string& version, | ||
| 228 | /// KODI_HANDLE& addonInstance) override; | ||
| 229 | /// }; | ||
| 230 | /// | ||
| 231 | /// // If you use only one instance in your add-on, can be instanceType and | ||
| 232 | /// // instanceID ignored | ||
| 233 | /// ADDON_STATUS CMyAddon::CreateInstance(int instanceType, | ||
| 234 | /// std::string instanceID, | ||
| 235 | /// KODI_HANDLE instance, | ||
| 236 | /// const std::string& version, | ||
| 237 | /// KODI_HANDLE& addonInstance) | ||
| 238 | /// { | ||
| 239 | /// if (instanceType == ADDON_INSTANCE_INPUTSTREAM) | ||
| 240 | /// { | ||
| 241 | /// kodi::Log(ADDON_LOG_NOTICE, "Creating my Inputstream"); | ||
| 242 | /// addonInstance = new CMyInputstream(instance, version); | ||
| 243 | /// return ADDON_STATUS_OK; | ||
| 244 | /// } | ||
| 245 | /// else if (...) | ||
| 246 | /// { | ||
| 247 | /// ... | ||
| 248 | /// } | ||
| 249 | /// return ADDON_STATUS_UNKNOWN; | ||
| 250 | /// } | ||
| 251 | /// | ||
| 252 | /// ADDONCREATOR(CMyAddon) | ||
| 253 | /// ~~~~~~~~~~~~~ | ||
| 254 | /// | ||
| 255 | /// The destruction of the example class `CMyInputstream` is called from | ||
| 256 | /// Kodi's header. Manually deleting the add-on instance is not required. | ||
| 257 | /// | ||
| 258 | /// | ||
| 259 | class ATTRIBUTE_HIDDEN CInstanceVideoCodec : public IAddonInstance | ||
| 260 | { | ||
| 261 | public: | ||
| 262 | //============================================================================ | ||
| 263 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 264 | /// @brief Video codec class constructor used to support multiple instance | ||
| 265 | /// types | ||
| 266 | /// | ||
| 267 | /// @param[in] instance The instance value given to <b>`kodi::addon::CAddonBase::CreateInstance(...)`</b>, | ||
| 268 | /// or by a inputstream instance if them declared as parent. | ||
| 269 | /// @param[in] kodiVersion [opt] Version used in Kodi for this instance, to | ||
| 270 | /// allow compatibility to older Kodi versions. | ||
| 271 | /// | ||
| 272 | explicit CInstanceVideoCodec(KODI_HANDLE instance, const std::string& kodiVersion = "") | ||
| 273 | : IAddonInstance(ADDON_INSTANCE_VIDEOCODEC, | ||
| 274 | !kodiVersion.empty() ? kodiVersion | ||
| 275 | : GetKodiTypeVersion(ADDON_INSTANCE_VIDEOCODEC)) | ||
| 55 | { | 276 | { |
| 56 | enum VideoPlane { | 277 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
| 57 | YPlane = 0, | 278 | throw std::logic_error("kodi::addon::CInstanceVideoCodec: Creation of multiple together with " |
| 58 | UPlane, | 279 | "single instance way is not allowed!"); |
| 59 | VPlane, | 280 | |
| 60 | MaxPlanes = 3, | 281 | SetAddonStruct(instance); |
| 61 | }; | 282 | } |
| 62 | 283 | //---------------------------------------------------------------------------- | |
| 63 | enum Flags : uint32_t { | 284 | |
| 64 | FLAG_DROP, | 285 | //============================================================================ |
| 65 | FLAG_DRAIN | 286 | /// @ingroup cpp_kodi_addon_videocodec |
| 66 | }; | 287 | /// @brief Destructor |
| 67 | 288 | /// | |
| 68 | VIDEOCODEC_FORMAT videoFormat; | 289 | ~CInstanceVideoCodec() override = default; |
| 69 | uint32_t flags; | 290 | //---------------------------------------------------------------------------- |
| 70 | 291 | ||
| 71 | uint32_t width, height; | 292 | //============================================================================ |
| 72 | 293 | /// @ingroup cpp_kodi_addon_videocodec | |
| 73 | uint8_t *decodedData; | 294 | /// @brief Open the decoder, returns true on success |
| 74 | size_t decodedDataSize; | 295 | /// |
| 75 | 296 | /// Decoders not capable of running multiple instances should return false in case | |
| 76 | uint32_t planeOffsets[VideoPlane::MaxPlanes]; | 297 | /// there is already a instance open. |
| 77 | uint32_t stride[VideoPlane::MaxPlanes]; | 298 | /// |
| 78 | 299 | /// @param[in] initData Video codec init data | |
| 79 | int64_t pts; | 300 | /// @return true if successfully done |
| 80 | 301 | /// | |
| 81 | KODI_HANDLE videoBufferHandle; //< will be passed in release_frame_buffer | 302 | /// |
| 82 | }; | 303 | /// ---------------------------------------------------------------------------- |
| 83 | 304 | /// | |
| 84 | enum VIDEOCODEC_RETVAL | 305 | /// @copydetails cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata_Help |
| 306 | /// | ||
| 307 | virtual bool Open(const kodi::addon::VideoCodecInitdata& initData) { return false; } | ||
| 308 | //---------------------------------------------------------------------------- | ||
| 309 | |||
| 310 | //============================================================================ | ||
| 311 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 312 | /// @brief Reconfigure the decoder, returns true on success | ||
| 313 | /// | ||
| 314 | /// Decoders not capable of runnung multiple instances may be capable of reconfiguring | ||
| 315 | /// the running instance. If Reconfigure returns false, player will close / open | ||
| 316 | /// the decoder | ||
| 317 | /// | ||
| 318 | /// @param[in] initData Video codec reconfigure data | ||
| 319 | /// @return true if successfully done | ||
| 320 | /// | ||
| 321 | virtual bool Reconfigure(const kodi::addon::VideoCodecInitdata& initData) { return false; } | ||
| 322 | //---------------------------------------------------------------------------- | ||
| 323 | |||
| 324 | //============================================================================ | ||
| 325 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 326 | /// @brief add data, decoder has to consume the entire packet | ||
| 327 | /// | ||
| 328 | /// @param[in] packet Data to process for decode | ||
| 329 | /// @return true if the packet was consumed or if resubmitting it is useless | ||
| 330 | /// | ||
| 331 | virtual bool AddData(const DEMUX_PACKET& packet) { return false; } | ||
| 332 | //---------------------------------------------------------------------------- | ||
| 333 | |||
| 334 | //============================================================================ | ||
| 335 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 336 | /// @brief GetPicture controls decoding. | ||
| 337 | /// | ||
| 338 | /// Player calls it on every cycle it can signal a picture, request a buffer, | ||
| 339 | /// or return none, if nothing applies the data is valid until the next | ||
| 340 | /// GetPicture return @ref VC_PICTURE | ||
| 341 | /// | ||
| 342 | /// @param[in,out] Structure which contains the necessary data | ||
| 343 | /// @return The with @ref VIDEOCODEC_RETVAL return values | ||
| 344 | /// | ||
| 345 | virtual VIDEOCODEC_RETVAL GetPicture(VIDEOCODEC_PICTURE& picture) { return VC_ERROR; } | ||
| 346 | //---------------------------------------------------------------------------- | ||
| 347 | |||
| 348 | //============================================================================ | ||
| 349 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 350 | /// @brief should return codecs name | ||
| 351 | /// | ||
| 352 | /// @return Codec name | ||
| 353 | /// | ||
| 354 | virtual const char* GetName() { return nullptr; } | ||
| 355 | //---------------------------------------------------------------------------- | ||
| 356 | |||
| 357 | //============================================================================ | ||
| 358 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 359 | /// @brief Reset the decoder | ||
| 360 | /// | ||
| 361 | virtual void Reset() {} | ||
| 362 | //---------------------------------------------------------------------------- | ||
| 363 | |||
| 364 | /*! | ||
| 365 | * @brief AddonToKodi interface | ||
| 366 | */ | ||
| 367 | |||
| 368 | //============================================================================ | ||
| 369 | /// @ingroup cpp_kodi_addon_videocodec | ||
| 370 | /// @brief All picture members can be expected to be set correctly except | ||
| 371 | /// decodedData and pts. | ||
| 372 | /// | ||
| 373 | /// GetFrameBuffer has to set decodedData to a valid memory address and return true. | ||
| 374 | /// | ||
| 375 | /// @param[out] picture The buffer, or unmodified if false is returned | ||
| 376 | /// @return In case buffer allocation fails, it return false. | ||
| 377 | /// | ||
| 378 | /// @note If this returns true, buffer must be freed using @ref ReleaseFrameBuffer(). | ||
| 379 | /// | ||
| 380 | /// @remarks Only called from addon itself | ||
| 381 | /// | ||
| 382 | bool GetFrameBuffer(VIDEOCODEC_PICTURE& picture) | ||
| 85 | { | 383 | { |
| 86 | VC_NONE = 0, //< noop | 384 | return m_instanceData->toKodi->get_frame_buffer(m_instanceData->toKodi->kodiInstance, &picture); |
| 87 | VC_ERROR, //< an error occurred, no other messages will be returned | 385 | } |
| 88 | VC_BUFFER, //< the decoder needs more data | 386 | //---------------------------------------------------------------------------- |
| 89 | VC_PICTURE, //< the decoder got a picture | 387 | |
| 90 | VC_EOF, //< the decoder signals EOF | 388 | //============================================================================ |
| 91 | }; | 389 | /// |
| 92 | 390 | /// @ingroup cpp_kodi_addon_videocodec | |
| 93 | // this are properties given to the addon on create | 391 | /// @brief Release the with @ref GetFrameBuffer() given framebuffer. |
| 94 | // at this time we have no parameters for the addon | 392 | /// |
| 95 | typedef struct AddonProps_VideoCodec | 393 | /// @param[in] handle the on @ref VIDEOCODEC_PICTURE.videoBufferHandle defined buffer handle |
| 394 | /// | ||
| 395 | /// @remarks Only called from addon itself | ||
| 396 | /// | ||
| 397 | void ReleaseFrameBuffer(void* buffer) | ||
| 96 | { | 398 | { |
| 97 | int dummy; | 399 | return m_instanceData->toKodi->release_frame_buffer(m_instanceData->toKodi->kodiInstance, |
| 98 | } AddonProps_VideoCodec; | 400 | buffer); |
| 401 | } | ||
| 402 | //---------------------------------------------------------------------------- | ||
| 99 | 403 | ||
| 100 | struct AddonInstance_VideoCodec; | 404 | private: |
| 101 | typedef struct KodiToAddonFuncTable_VideoCodec | 405 | void SetAddonStruct(KODI_HANDLE instance) |
| 102 | { | 406 | { |
| 103 | KODI_HANDLE addonInstance; | 407 | if (instance == nullptr) |
| 104 | 408 | throw std::logic_error("kodi::addon::CInstanceVideoCodec: Creation with empty addon " | |
| 105 | //! \brief Opens a codec | 409 | "structure not allowed, table must be given from Kodi!"); |
| 106 | bool (__cdecl* open) (const AddonInstance_VideoCodec* instance, VIDEOCODEC_INITDATA *initData); | 410 | |
| 107 | 411 | m_instanceData = static_cast<AddonInstance_VideoCodec*>(instance); | |
| 108 | //! \brief Reconfigures a codec | 412 | |
| 109 | bool (__cdecl* reconfigure) (const AddonInstance_VideoCodec* instance, VIDEOCODEC_INITDATA *initData); | 413 | m_instanceData->toAddon->addonInstance = this; |
| 110 | 414 | m_instanceData->toAddon->open = ADDON_Open; | |
| 111 | //! \brief Feed codec if requested from GetPicture() (return VC_BUFFER) | 415 | m_instanceData->toAddon->reconfigure = ADDON_Reconfigure; |
| 112 | bool (__cdecl* add_data) (const AddonInstance_VideoCodec* instance, const DemuxPacket *packet); | 416 | m_instanceData->toAddon->add_data = ADDON_AddData; |
| 113 | 417 | m_instanceData->toAddon->get_picture = ADDON_GetPicture; | |
| 114 | //! \brief Get a decoded picture / request new data | 418 | m_instanceData->toAddon->get_name = ADDON_GetName; |
| 115 | VIDEOCODEC_RETVAL (__cdecl* get_picture) (const AddonInstance_VideoCodec* instance, VIDEOCODEC_PICTURE *picture); | 419 | m_instanceData->toAddon->reset = ADDON_Reset; |
| 420 | } | ||
| 421 | |||
| 422 | inline static bool ADDON_Open(const AddonInstance_VideoCodec* instance, | ||
| 423 | VIDEOCODEC_INITDATA* initData) | ||
| 424 | { | ||
| 425 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->Open(initData); | ||
| 426 | } | ||
| 116 | 427 | ||
| 117 | //! \brief Get the name of this video decoder | 428 | inline static bool ADDON_Reconfigure(const AddonInstance_VideoCodec* instance, |
| 118 | const char *(__cdecl* get_name) (const AddonInstance_VideoCodec* instance); | 429 | VIDEOCODEC_INITDATA* initData) |
| 430 | { | ||
| 431 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance) | ||
| 432 | ->Reconfigure(initData); | ||
| 433 | } | ||
| 119 | 434 | ||
| 120 | //! \brief Reset the codec | 435 | inline static bool ADDON_AddData(const AddonInstance_VideoCodec* instance, |
| 121 | void (__cdecl* reset)(const AddonInstance_VideoCodec* instance); | 436 | const DEMUX_PACKET* packet) |
| 122 | } KodiToAddonFuncTable_VideoCodec; | 437 | { |
| 438 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->AddData(*packet); | ||
| 439 | } | ||
| 123 | 440 | ||
| 124 | typedef struct AddonToKodiFuncTable_VideoCodec | 441 | inline static VIDEOCODEC_RETVAL ADDON_GetPicture(const AddonInstance_VideoCodec* instance, |
| 442 | VIDEOCODEC_PICTURE* picture) | ||
| 125 | { | 443 | { |
| 126 | KODI_HANDLE kodiInstance; | 444 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance) |
| 127 | bool(*get_frame_buffer)(void* kodiInstance, VIDEOCODEC_PICTURE *picture); | 445 | ->GetPicture(*picture); |
| 128 | void(*release_frame_buffer)(void* kodiInstance, void *buffer); | 446 | } |
| 129 | } AddonToKodiFuncTable_VideoCodec; | ||
| 130 | 447 | ||
| 131 | typedef struct AddonInstance_VideoCodec | 448 | inline static const char* ADDON_GetName(const AddonInstance_VideoCodec* instance) |
| 132 | { | 449 | { |
| 133 | AddonProps_VideoCodec* props; | 450 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->GetName(); |
| 134 | AddonToKodiFuncTable_VideoCodec* toKodi; | 451 | } |
| 135 | KodiToAddonFuncTable_VideoCodec* toAddon; | ||
| 136 | } AddonInstance_VideoCodec; | ||
| 137 | } | ||
| 138 | 452 | ||
| 139 | namespace kodi | 453 | inline static void ADDON_Reset(const AddonInstance_VideoCodec* instance) |
| 140 | { | ||
| 141 | namespace addon | ||
| 142 | { | 454 | { |
| 455 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->Reset(); | ||
| 456 | } | ||
| 457 | |||
| 458 | AddonInstance_VideoCodec* m_instanceData; | ||
| 459 | }; | ||
| 143 | 460 | ||
| 144 | class ATTRIBUTE_HIDDEN CInstanceVideoCodec : public IAddonInstance | 461 | } // namespace addon |
| 145 | { | ||
| 146 | public: | ||
| 147 | explicit CInstanceVideoCodec(KODI_HANDLE instance, const std::string& kodiVersion = "") | ||
| 148 | : IAddonInstance(ADDON_INSTANCE_VIDEOCODEC, | ||
| 149 | !kodiVersion.empty() ? kodiVersion | ||
| 150 | : GetKodiTypeVersion(ADDON_INSTANCE_VIDEOCODEC)) | ||
| 151 | { | ||
| 152 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | ||
| 153 | throw std::logic_error("kodi::addon::CInstanceVideoCodec: Creation of multiple together with single instance way is not allowed!"); | ||
| 154 | |||
| 155 | SetAddonStruct(instance); | ||
| 156 | } | ||
| 157 | |||
| 158 | ~CInstanceVideoCodec() override = default; | ||
| 159 | |||
| 160 | //! \copydoc CInstanceVideoCodec::Open | ||
| 161 | virtual bool Open(VIDEOCODEC_INITDATA &initData) { return false; }; | ||
| 162 | |||
| 163 | //! \copydoc CInstanceVideoCodec::Reconfigure | ||
| 164 | virtual bool Reconfigure(VIDEOCODEC_INITDATA &initData) { return false; }; | ||
| 165 | |||
| 166 | //! \copydoc CInstanceVideoCodec::AddData | ||
| 167 | virtual bool AddData(const DemuxPacket &packet) { return false; }; | ||
| 168 | |||
| 169 | //! \copydoc CInstanceVideoCodec::GetPicture | ||
| 170 | virtual VIDEOCODEC_RETVAL GetPicture(VIDEOCODEC_PICTURE &picture) { return VC_ERROR; }; | ||
| 171 | |||
| 172 | //! \copydoc CInstanceVideoCodec::GetName | ||
| 173 | virtual const char *GetName() { return nullptr; }; | ||
| 174 | |||
| 175 | //! \copydoc CInstanceVideoCodec::Reset | ||
| 176 | virtual void Reset() {}; | ||
| 177 | |||
| 178 | /*! | ||
| 179 | * @brief AddonToKodi interface | ||
| 180 | */ | ||
| 181 | |||
| 182 | //! \copydoc CInstanceVideoCodec::GetFrameBuffer | ||
| 183 | bool GetFrameBuffer(VIDEOCODEC_PICTURE &picture) | ||
| 184 | { | ||
| 185 | return m_instanceData->toKodi->get_frame_buffer(m_instanceData->toKodi->kodiInstance, | ||
| 186 | &picture); | ||
| 187 | } | ||
| 188 | |||
| 189 | //! \copydoc CInstanceVideoCodec::ReleaseFrameBuffer | ||
| 190 | void ReleaseFrameBuffer(void *buffer) | ||
| 191 | { | ||
| 192 | return m_instanceData->toKodi->release_frame_buffer(m_instanceData->toKodi->kodiInstance, | ||
| 193 | buffer); | ||
| 194 | } | ||
| 195 | |||
| 196 | private: | ||
| 197 | void SetAddonStruct(KODI_HANDLE instance) | ||
| 198 | { | ||
| 199 | if (instance == nullptr) | ||
| 200 | throw std::logic_error("kodi::addon::CInstanceVideoCodec: Creation with empty addon structure not allowed, table must be given from Kodi!"); | ||
| 201 | |||
| 202 | m_instanceData = static_cast<AddonInstance_VideoCodec*>(instance); | ||
| 203 | |||
| 204 | m_instanceData->toAddon->addonInstance = this; | ||
| 205 | m_instanceData->toAddon->open = ADDON_Open; | ||
| 206 | m_instanceData->toAddon->reconfigure = ADDON_Reconfigure; | ||
| 207 | m_instanceData->toAddon->add_data = ADDON_AddData; | ||
| 208 | m_instanceData->toAddon->get_picture = ADDON_GetPicture; | ||
| 209 | m_instanceData->toAddon->get_name = ADDON_GetName; | ||
| 210 | m_instanceData->toAddon->reset = ADDON_Reset; | ||
| 211 | } | ||
| 212 | |||
| 213 | inline static bool ADDON_Open(const AddonInstance_VideoCodec* instance, VIDEOCODEC_INITDATA *initData) | ||
| 214 | { | ||
| 215 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->Open(*initData); | ||
| 216 | } | ||
| 217 | |||
| 218 | inline static bool ADDON_Reconfigure(const AddonInstance_VideoCodec* instance, VIDEOCODEC_INITDATA *initData) | ||
| 219 | { | ||
| 220 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance) | ||
| 221 | ->Reconfigure(*initData); | ||
| 222 | } | ||
| 223 | |||
| 224 | inline static bool ADDON_AddData(const AddonInstance_VideoCodec* instance, const DemuxPacket *packet) | ||
| 225 | { | ||
| 226 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance) | ||
| 227 | ->AddData(*packet); | ||
| 228 | } | ||
| 229 | |||
| 230 | inline static VIDEOCODEC_RETVAL ADDON_GetPicture(const AddonInstance_VideoCodec* instance, VIDEOCODEC_PICTURE *picture) | ||
| 231 | { | ||
| 232 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance) | ||
| 233 | ->GetPicture(*picture); | ||
| 234 | } | ||
| 235 | |||
| 236 | inline static const char *ADDON_GetName(const AddonInstance_VideoCodec* instance) | ||
| 237 | { | ||
| 238 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->GetName(); | ||
| 239 | } | ||
| 240 | |||
| 241 | inline static void ADDON_Reset(const AddonInstance_VideoCodec* instance) | ||
| 242 | { | ||
| 243 | return static_cast<CInstanceVideoCodec*>(instance->toAddon->addonInstance)->Reset(); | ||
| 244 | } | ||
| 245 | |||
| 246 | AddonInstance_VideoCodec* m_instanceData; | ||
| 247 | }; | ||
| 248 | } // namespace addon | ||
| 249 | } // namespace kodi | 462 | } // namespace kodi |
| 463 | |||
| 464 | #endif /* __cplusplus */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Visualization.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Visualization.h index 7b1db65..1dddea2 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Visualization.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/Visualization.h | |||
| @@ -721,7 +721,7 @@ public: | |||
| 721 | inline void TransferPresets(const std::vector<std::string>& presets) | 721 | inline void TransferPresets(const std::vector<std::string>& presets) |
| 722 | { | 722 | { |
| 723 | m_instanceData->toKodi->clear_presets(m_instanceData->toKodi->kodiInstance); | 723 | m_instanceData->toKodi->clear_presets(m_instanceData->toKodi->kodiInstance); |
| 724 | for (auto it : presets) | 724 | for (const auto& it : presets) |
| 725 | m_instanceData->toKodi->transfer_preset(m_instanceData->toKodi->kodiInstance, it.c_str()); | 725 | m_instanceData->toKodi->transfer_preset(m_instanceData->toKodi->kodiInstance, it.c_str()); |
| 726 | } | 726 | } |
| 727 | //---------------------------------------------------------------------------- | 727 | //---------------------------------------------------------------------------- |
| @@ -915,7 +915,7 @@ private: | |||
| 915 | std::vector<std::string> presets; | 915 | std::vector<std::string> presets; |
| 916 | if (thisClass->GetPresets(presets)) | 916 | if (thisClass->GetPresets(presets)) |
| 917 | { | 917 | { |
| 918 | for (auto it : presets) | 918 | for (const auto& it : presets) |
| 919 | thisClass->m_instanceData->toKodi->transfer_preset(addon->toKodi->kodiInstance, it.c_str()); | 919 | thisClass->m_instanceData->toKodi->transfer_preset(addon->toKodi->kodiInstance, it.c_str()); |
| 920 | } | 920 | } |
| 921 | 921 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/CMakeLists.txt new file mode 100644 index 0000000..a551b4b --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/CMakeLists.txt | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | set(HEADERS DemuxPacket.h | ||
| 2 | StreamCodec.h | ||
| 3 | StreamConstants.h | ||
| 4 | TimingConstants.h) | ||
| 5 | |||
| 6 | if(NOT ENABLE_STATIC_LIBS) | ||
| 7 | core_add_library(addons_kodi-dev-kit_include_kodi_addon-instance_inputstream) | ||
| 8 | endif() | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/DemuxPacket.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/DemuxPacket.h new file mode 100644 index 0000000..f965b9f --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/DemuxPacket.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "TimingConstants.h" | ||
| 12 | #include "../../c-api/addon-instance/inputstream/demux_packet.h" | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamCodec.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamCodec.h new file mode 100644 index 0000000..e80e2ca --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamCodec.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../c-api/addon-instance/inputstream/stream_codec.h" | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamConstants.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamConstants.h new file mode 100644 index 0000000..200631b --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamConstants.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../c-api/addon-instance/inputstream/stream_constants.h" | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamCrypto.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamCrypto.h new file mode 100644 index 0000000..8a85121 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/StreamCrypto.h | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../c-api/addon-instance/inputstream/stream_crypto.h" | ||
| 12 | #include "../../AddonBase.h" | ||
| 13 | |||
| 14 | #ifdef __cplusplus | ||
| 15 | |||
| 16 | namespace kodi | ||
| 17 | { | ||
| 18 | namespace addon | ||
| 19 | { | ||
| 20 | |||
| 21 | class CInstanceInputStream; | ||
| 22 | class InputstreamInfo; | ||
| 23 | class VideoCodecInitdata; | ||
| 24 | |||
| 25 | //============================================================================== | ||
| 26 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamEncryption_StreamCryptoSession class StreamCryptoSession | ||
| 27 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamEncryption | ||
| 28 | /// @brief **Data to manage stream cryptography**\n | ||
| 29 | /// This class structure manages any encryption values required in order to have | ||
| 30 | /// them available in their stream processing. | ||
| 31 | /// | ||
| 32 | /// Used on inputstream by @ref kodi::addon::InputstreamInfo::SetCryptoSession / | ||
| 33 | /// @ref kodi::addon::InputstreamInfo::GetCryptoSession and are given to the | ||
| 34 | /// used video codec to decrypt related data. | ||
| 35 | /// | ||
| 36 | /// ---------------------------------------------------------------------------- | ||
| 37 | /// | ||
| 38 | /// @copydetails cpp_kodi_addon_inputstream_Defs_Info_StreamCryptoSession_Help | ||
| 39 | /// | ||
| 40 | ///@{ | ||
| 41 | class ATTRIBUTE_HIDDEN StreamCryptoSession | ||
| 42 | : public CStructHdl<StreamCryptoSession, STREAM_CRYPTO_SESSION> | ||
| 43 | { | ||
| 44 | /*! \cond PRIVATE */ | ||
| 45 | friend class CInstanceInputStream; | ||
| 46 | friend class InputstreamInfo; | ||
| 47 | friend class VideoCodecInitdata; | ||
| 48 | /*! \endcond */ | ||
| 49 | |||
| 50 | public: | ||
| 51 | /*! \cond PRIVATE */ | ||
| 52 | StreamCryptoSession() { memset(m_cStructure, 0, sizeof(STREAM_CRYPTO_SESSION)); } | ||
| 53 | StreamCryptoSession(const StreamCryptoSession& session) : CStructHdl(session) {} | ||
| 54 | /*! \endcond */ | ||
| 55 | |||
| 56 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Info_StreamCryptoSession_Help Value Help | ||
| 57 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Info_StreamCryptoSession | ||
| 58 | /// | ||
| 59 | /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_inputstream_Defs_Info_StreamCryptoSession :</b> | ||
| 60 | /// | Name | Type | Set call | Get call | ||
| 61 | /// |------|------|----------|---------- | ||
| 62 | /// | **Keysystem for encrypted media** | @ref STREAM_CRYPTO_KEY_SYSTEM | @ref StreamCryptoSession::SetKeySystem "SetKeySystem" | @ref StreamCryptoSession::GetKeySystem "GetKeySystem" | ||
| 63 | /// | **Flags for special conditions** | `uint8_t` | @ref StreamCryptoSession::SetFlags "SetFlags" | @ref StreamCryptoSession::GetFlags "GetFlags" | ||
| 64 | /// | **Crypto session key id** | `std::string` | @ref StreamCryptoSession::SetSessionId "SetSessionId" | @ref StreamCryptoSession::GetSessionId "GetSessionId" | ||
| 65 | |||
| 66 | /// @brief To set keysystem for encrypted media, @ref STREAM_CRYPTO_KEY_SYSTEM_NONE for | ||
| 67 | /// unencrypted media. | ||
| 68 | /// | ||
| 69 | /// See @ref STREAM_CRYPTO_KEY_SYSTEM for available options. | ||
| 70 | void SetKeySystem(STREAM_CRYPTO_KEY_SYSTEM keySystem) { m_cStructure->keySystem = keySystem; } | ||
| 71 | |||
| 72 | /// @brief Get keysystem for encrypted media. | ||
| 73 | STREAM_CRYPTO_KEY_SYSTEM GetKeySystem() const { return m_cStructure->keySystem; } | ||
| 74 | |||
| 75 | /// @brief Set bit flags to use special conditions, see @ref STREAM_CRYPTO_FLAGS | ||
| 76 | /// for available flags. | ||
| 77 | void SetFlags(uint8_t flags) { m_cStructure->flags = flags; } | ||
| 78 | |||
| 79 | /// @brief Get flags for special conditions. | ||
| 80 | uint8_t GetFlags() const { return m_cStructure->flags; } | ||
| 81 | |||
| 82 | /// @brief To set the crypto session key identifier. | ||
| 83 | void SetSessionId(const std::string& sessionId) | ||
| 84 | { | ||
| 85 | strncpy(m_cStructure->sessionId, sessionId.c_str(), sizeof(m_cStructure->sessionId) - 1); | ||
| 86 | } | ||
| 87 | |||
| 88 | /// @brief To get the crypto session key identifier. | ||
| 89 | std::string GetSessionId() const { return m_cStructure->sessionId; } | ||
| 90 | |||
| 91 | private: | ||
| 92 | StreamCryptoSession(const STREAM_CRYPTO_SESSION* session) : CStructHdl(session) {} | ||
| 93 | StreamCryptoSession(STREAM_CRYPTO_SESSION* session) : CStructHdl(session) {} | ||
| 94 | }; | ||
| 95 | |||
| 96 | } /* namespace addon */ | ||
| 97 | } /* namespace kodi */ | ||
| 98 | |||
| 99 | #endif /* __cplusplus */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/TimingConstants.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/TimingConstants.h new file mode 100644 index 0000000..22f8952 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/inputstream/TimingConstants.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../c-api/addon-instance/inputstream/timing_constants.h" | ||
| 12 | |||
| 13 | #ifdef __cplusplus | ||
| 14 | |||
| 15 | // Unset the on timing_constants.h given defines | ||
| 16 | #undef STREAM_TIME_TO_MSEC | ||
| 17 | #undef STREAM_SEC_TO_TIME | ||
| 18 | #undef STREAM_MSEC_TO_TIME | ||
| 19 | |||
| 20 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 21 | /// @brief Converts a stream time to milliseconds as an integer value. | ||
| 22 | /// | ||
| 23 | /// @param[in] x Stream time | ||
| 24 | /// @return Milliseconds | ||
| 25 | /// | ||
| 26 | /// @note Within "C" code this is used as `#define`. | ||
| 27 | /// | ||
| 28 | constexpr int STREAM_TIME_TO_MSEC(double x) | ||
| 29 | { | ||
| 30 | return static_cast<int>(x * 1000 / STREAM_TIME_BASE); | ||
| 31 | } | ||
| 32 | |||
| 33 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 34 | /// @brief Converts a time in seconds to the used stream time format. | ||
| 35 | /// | ||
| 36 | /// @param[in] x Seconds | ||
| 37 | /// @return Stream time | ||
| 38 | /// | ||
| 39 | /// @note Within "C" code this is used as `#define`. | ||
| 40 | /// | ||
| 41 | constexpr double STREAM_SEC_TO_TIME(double x) | ||
| 42 | { | ||
| 43 | return x * STREAM_TIME_BASE; | ||
| 44 | } | ||
| 45 | |||
| 46 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 47 | /// @brief Converts a time in milliseconds to the used stream time format. | ||
| 48 | /// | ||
| 49 | /// @param[in] x Milliseconds | ||
| 50 | /// @return Stream time | ||
| 51 | /// | ||
| 52 | /// @note Within "C" code this is used as `#define`. | ||
| 53 | /// | ||
| 54 | constexpr double STREAM_MSEC_TO_TIME(double x) | ||
| 55 | { | ||
| 56 | return x * STREAM_TIME_BASE / 1000; | ||
| 57 | } | ||
| 58 | |||
| 59 | #endif /* __cplusplus */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/peripheral/PeripheralUtils.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/peripheral/PeripheralUtils.h index febaeb9..1a6cc63 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/peripheral/PeripheralUtils.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/peripheral/PeripheralUtils.h | |||
| @@ -806,7 +806,7 @@ struct DriverPrimitive | |||
| 806 | { | 806 | { |
| 807 | protected: | 807 | protected: |
| 808 | /*! | 808 | /*! |
| 809 | * \brief Construct a driver primitive of the specified type | 809 | * @brief Construct a driver primitive of the specified type |
| 810 | */ | 810 | */ |
| 811 | DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE type, unsigned int driverIndex) | 811 | DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE type, unsigned int driverIndex) |
| 812 | : m_type(type), m_driverIndex(driverIndex) | 812 | : m_type(type), m_driverIndex(driverIndex) |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr/Stream.h b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr/Stream.h index 5613947..4241c23 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr/Stream.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/pvr/Stream.h | |||
| @@ -166,7 +166,7 @@ public: | |||
| 166 | m_cStructure->strLanguage[0] = language[0]; | 166 | m_cStructure->strLanguage[0] = language[0]; |
| 167 | m_cStructure->strLanguage[1] = language[1]; | 167 | m_cStructure->strLanguage[1] = language[1]; |
| 168 | m_cStructure->strLanguage[2] = language[2]; | 168 | m_cStructure->strLanguage[2] = language[2]; |
| 169 | m_cStructure->strLanguage[2] = 0; | 169 | m_cStructure->strLanguage[3] = 0; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | /// @brief To get with @ref SetLanguage() changed values. | 172 | /// @brief To get with @ref SetLanguage() changed values. |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt index 4edd034..b5d0382 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/CMakeLists.txt | |||
| @@ -2,10 +2,12 @@ set(HEADERS audio_decoder.h | |||
| 2 | audio_encoder.h | 2 | audio_encoder.h |
| 3 | game.h | 3 | game.h |
| 4 | image_decoder.h | 4 | image_decoder.h |
| 5 | inputstream.h | ||
| 5 | peripheral.h | 6 | peripheral.h |
| 6 | pvr.h | 7 | pvr.h |
| 7 | screensaver.h | 8 | screensaver.h |
| 8 | vfs.h | 9 | vfs.h |
| 10 | video_codec.h | ||
| 9 | visualization.h) | 11 | visualization.h) |
| 10 | 12 | ||
| 11 | if(NOT ENABLE_STATIC_LIBS) | 13 | if(NOT ENABLE_STATIC_LIBS) |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h index 8b75ddb..be6ad16 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_decoder.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_AUDIO_DECODER_H | 9 | #ifndef C_API_ADDONINSTANCE_AUDIO_DECODER_H |
| 12 | #define C_API_ADDONINSTANCE_AUDIO_DECODER_H | 10 | #define C_API_ADDONINSTANCE_AUDIO_DECODER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h index 6f24d1c..b9f2ab5 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/audio_encoder.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_AUDIO_ENCODER_H | 9 | #ifndef C_API_ADDONINSTANCE_AUDIO_ENCODER_H |
| 12 | #define C_API_ADDONINSTANCE_AUDIO_ENCODER_H | 10 | #define C_API_ADDONINSTANCE_AUDIO_ENCODER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h index c97fa5d..b1de817 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/game.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_GAME_H | 9 | #ifndef C_API_ADDONINSTANCE_GAME_H |
| 12 | #define C_API_ADDONINSTANCE_GAME_H | 10 | #define C_API_ADDONINSTANCE_GAME_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h index 6455b38..7093212 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/image_decoder.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_IMAGE_DECODER_H | 9 | #ifndef C_API_ADDONINSTANCE_IMAGE_DECODER_H |
| 12 | #define C_API_ADDONINSTANCE_IMAGE_DECODER_H | 10 | #define C_API_ADDONINSTANCE_IMAGE_DECODER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream.h new file mode 100644 index 0000000..1b3a735 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream.h | |||
| @@ -0,0 +1,703 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_H | ||
| 10 | #define C_API_ADDONINSTANCE_INPUTSTREAM_H | ||
| 11 | |||
| 12 | #include "../addon_base.h" | ||
| 13 | #include "inputstream/demux_packet.h" | ||
| 14 | #include "inputstream/stream_codec.h" | ||
| 15 | #include "inputstream/stream_constants.h" | ||
| 16 | #include "inputstream/stream_crypto.h" | ||
| 17 | #include "inputstream/timing_constants.h" | ||
| 18 | |||
| 19 | #include <time.h> | ||
| 20 | |||
| 21 | // Increment this level always if you add features which can lead to compile failures in the addon | ||
| 22 | #define INPUTSTREAM_VERSION_LEVEL 4 | ||
| 23 | |||
| 24 | #define INPUTSTREAM_MAX_INFO_COUNT 8 | ||
| 25 | #define INPUTSTREAM_MAX_STREAM_COUNT 256 | ||
| 26 | #define INPUTSTREAM_MAX_STRING_NAME_SIZE 256 | ||
| 27 | #define INPUTSTREAM_MAX_STRING_CODEC_SIZE 32 | ||
| 28 | #define INPUTSTREAM_MAX_STRING_LANGUAGE_SIZE 64 | ||
| 29 | |||
| 30 | #ifdef __cplusplus | ||
| 31 | extern "C" | ||
| 32 | { | ||
| 33 | #endif /* __cplusplus */ | ||
| 34 | |||
| 35 | //============================================================================== | ||
| 36 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface_InputstreamCapabilities | ||
| 37 | /// @brief **Capability types of inputstream addon.**\n | ||
| 38 | /// This values are needed to tell Kodi which options are supported on the addon. | ||
| 39 | /// | ||
| 40 | /// If one of this is defined, then the corresponding methods from | ||
| 41 | /// @ref cpp_kodi_addon_inputstream "kodi::addon::CInstanceInputStream" need | ||
| 42 | /// to be implemented. | ||
| 43 | /// | ||
| 44 | /// Used on @ref kodi::addon::CInstanceInputStream::GetCapabilities(). | ||
| 45 | /// | ||
| 46 | ///@{ | ||
| 47 | enum INPUTSTREAM_MASKTYPE | ||
| 48 | { | ||
| 49 | /// @brief **0000 0000 0000 0001 :** Supports interface demuxing. | ||
| 50 | /// | ||
| 51 | /// If set must be @ref cpp_kodi_addon_inputstream_Demux "Demux support" included. | ||
| 52 | INPUTSTREAM_SUPPORTS_IDEMUX = (1 << 0), | ||
| 53 | |||
| 54 | /// @brief **0000 0000 0000 0010 :** Supports interface position time. | ||
| 55 | /// | ||
| 56 | /// This means that the start time and the current stream time are used. | ||
| 57 | /// | ||
| 58 | /// If set must be @ref cpp_kodi_addon_inputstream_Time "Time support" included. | ||
| 59 | INPUTSTREAM_SUPPORTS_IPOSTIME = (1 << 1), | ||
| 60 | |||
| 61 | /// @brief **0000 0000 0000 0100 :** Supports interface for display time. | ||
| 62 | /// | ||
| 63 | /// This will call up the complete stream time information. The start time | ||
| 64 | /// and the individual PTS times are then given using @ref cpp_kodi_addon_inputstream_Defs_Times. | ||
| 65 | /// | ||
| 66 | /// If set must be @ref cpp_kodi_addon_inputstream_Times "Times support" included. | ||
| 67 | INPUTSTREAM_SUPPORTS_IDISPLAYTIME = (1 << 2), | ||
| 68 | |||
| 69 | /// @brief **0000 0000 0000 1000 :** Supports seek | ||
| 70 | INPUTSTREAM_SUPPORTS_SEEK = (1 << 3), | ||
| 71 | |||
| 72 | /// @brief **0000 0000 0001 0000 :** Supports pause | ||
| 73 | INPUTSTREAM_SUPPORTS_PAUSE = (1 << 4), | ||
| 74 | |||
| 75 | /// @brief **0000 0000 0010 0000 :** Supports interface to give position time. | ||
| 76 | /// | ||
| 77 | /// This will only ask for the current time of the stream, not for length or | ||
| 78 | /// start. | ||
| 79 | /// | ||
| 80 | /// If set must be @ref cpp_kodi_addon_inputstream_PosTime "Position time support" included. | ||
| 81 | INPUTSTREAM_SUPPORTS_ITIME = (1 << 5), | ||
| 82 | |||
| 83 | /// @brief **0000 0000 0100 0000 :** Supports interface for chapter selection. | ||
| 84 | /// | ||
| 85 | /// If set must be @ref cpp_kodi_addon_inputstream_Chapter "Chapter support" included. | ||
| 86 | INPUTSTREAM_SUPPORTS_ICHAPTER = (1 << 6), | ||
| 87 | }; | ||
| 88 | ///@} | ||
| 89 | //---------------------------------------------------------------------------- | ||
| 90 | |||
| 91 | /*! | ||
| 92 | * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. | ||
| 93 | */ | ||
| 94 | struct INPUTSTREAM_CAPABILITIES | ||
| 95 | { | ||
| 96 | /// set of supported capabilities | ||
| 97 | uint32_t m_mask; | ||
| 98 | }; | ||
| 99 | |||
| 100 | /*! | ||
| 101 | * @brief structure of key/value pairs passed to addon on Open() | ||
| 102 | */ | ||
| 103 | struct INPUTSTREAM_PROPERTY | ||
| 104 | { | ||
| 105 | const char* m_strURL; | ||
| 106 | const char* m_mimeType; | ||
| 107 | |||
| 108 | unsigned int m_nCountInfoValues; | ||
| 109 | struct LISTITEMPROPERTY | ||
| 110 | { | ||
| 111 | const char* m_strKey; | ||
| 112 | const char* m_strValue; | ||
| 113 | } m_ListItemProperties[STREAM_MAX_PROPERTY_COUNT]; | ||
| 114 | |||
| 115 | const char* m_libFolder; | ||
| 116 | const char* m_profileFolder; | ||
| 117 | }; | ||
| 118 | |||
| 119 | /*! | ||
| 120 | * @brief Array of stream IDs | ||
| 121 | */ | ||
| 122 | struct INPUTSTREAM_IDS | ||
| 123 | { | ||
| 124 | unsigned int m_streamCount; | ||
| 125 | unsigned int m_streamIds[INPUTSTREAM_MAX_STREAM_COUNT]; | ||
| 126 | }; | ||
| 127 | |||
| 128 | /*! | ||
| 129 | * @brief MASTERING Metadata | ||
| 130 | */ | ||
| 131 | struct INPUTSTREAM_MASTERING_METADATA | ||
| 132 | { | ||
| 133 | double primary_r_chromaticity_x; | ||
| 134 | double primary_r_chromaticity_y; | ||
| 135 | double primary_g_chromaticity_x; | ||
| 136 | double primary_g_chromaticity_y; | ||
| 137 | double primary_b_chromaticity_x; | ||
| 138 | double primary_b_chromaticity_y; | ||
| 139 | double white_point_chromaticity_x; | ||
| 140 | double white_point_chromaticity_y; | ||
| 141 | double luminance_max; | ||
| 142 | double luminance_min; | ||
| 143 | }; | ||
| 144 | |||
| 145 | /*! | ||
| 146 | * @brief CONTENTLIGHT Metadata | ||
| 147 | */ | ||
| 148 | struct INPUTSTREAM_CONTENTLIGHT_METADATA | ||
| 149 | { | ||
| 150 | uint64_t max_cll; | ||
| 151 | uint64_t max_fall; | ||
| 152 | }; | ||
| 153 | |||
| 154 | //============================================================================== | ||
| 155 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_TYPE enum INPUTSTREAM_TYPE | ||
| 156 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 157 | /// @brief **Inputstream types**\n | ||
| 158 | /// To identify type on stream. | ||
| 159 | /// | ||
| 160 | /// Used on @ref kodi::addon::InputstreamInfo::SetStreamType and @ref kodi::addon::InputstreamInfo::GetStreamType. | ||
| 161 | /// | ||
| 162 | ///@{ | ||
| 163 | enum INPUTSTREAM_TYPE | ||
| 164 | { | ||
| 165 | /// @brief **0 :** To set nothing defined | ||
| 166 | INPUTSTREAM_TYPE_NONE = 0, | ||
| 167 | |||
| 168 | /// @brief **1 :** To identify @ref cpp_kodi_addon_inputstream_Defs_Info as Video | ||
| 169 | INPUTSTREAM_TYPE_VIDEO, | ||
| 170 | |||
| 171 | /// @brief **2 :** To identify @ref cpp_kodi_addon_inputstream_Defs_Info as Audio | ||
| 172 | INPUTSTREAM_TYPE_AUDIO, | ||
| 173 | |||
| 174 | /// @brief **3 :** To identify @ref cpp_kodi_addon_inputstream_Defs_Info as Subtitle | ||
| 175 | INPUTSTREAM_TYPE_SUBTITLE, | ||
| 176 | |||
| 177 | /// @brief **4 :** To identify @ref cpp_kodi_addon_inputstream_Defs_Info as Teletext | ||
| 178 | INPUTSTREAM_TYPE_TELETEXT, | ||
| 179 | |||
| 180 | /// @brief **5 :** To identify @ref cpp_kodi_addon_inputstream_Defs_Info as Radio RDS | ||
| 181 | INPUTSTREAM_TYPE_RDS, | ||
| 182 | }; | ||
| 183 | ///@} | ||
| 184 | //------------------------------------------------------------------------------ | ||
| 185 | |||
| 186 | //============================================================================== | ||
| 187 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_CODEC_FEATURES enum INPUTSTREAM_CODEC_FEATURES | ||
| 188 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 189 | /// @brief **Inputstream codec features**\n | ||
| 190 | /// To identify special extra features used for optional codec on inputstream. | ||
| 191 | /// | ||
| 192 | /// Used on @ref kodi::addon::InputstreamInfo::SetFeatures and @ref kodi::addon::InputstreamInfo::GetFeatures. | ||
| 193 | /// | ||
| 194 | /// @note These variables are bit flags which are created using "|" can be used together. | ||
| 195 | /// | ||
| 196 | ///@{ | ||
| 197 | enum INPUTSTREAM_CODEC_FEATURES | ||
| 198 | { | ||
| 199 | /// @brief **0000 0000 0000 0000 :** Empty to set if nothing is used | ||
| 200 | INPUTSTREAM_FEATURE_NONE = 0, | ||
| 201 | |||
| 202 | /// @brief **0000 0000 0000 0001 :** To set addon decode should used with @ref cpp_kodi_addon_videocodec. | ||
| 203 | INPUTSTREAM_FEATURE_DECODE = (1 << 0) | ||
| 204 | }; | ||
| 205 | ///@} | ||
| 206 | //---------------------------------------------------------------------------- | ||
| 207 | |||
| 208 | //============================================================================ | ||
| 209 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_FLAGS enum INPUTSTREAM_FLAGS | ||
| 210 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 211 | /// @brief **Inputstream flags**\n | ||
| 212 | /// To identify extra stream flags used on inputstream. | ||
| 213 | /// | ||
| 214 | /// Used on @ref kodi::addon::InputstreamInfo::SetFlags and @ref kodi::addon::InputstreamInfo::GetFlags. | ||
| 215 | /// | ||
| 216 | /// @note These variables are bit flags which are created using "|" can be used together. | ||
| 217 | /// | ||
| 218 | ///@{ | ||
| 219 | enum INPUTSTREAM_FLAGS | ||
| 220 | { | ||
| 221 | /// @brief **0000 0000 0000 0000 :** Empty to set if nothing is used | ||
| 222 | INPUTSTREAM_FLAG_NONE = 0, | ||
| 223 | |||
| 224 | /// @brief **0000 0000 0000 0001 :** Default | ||
| 225 | INPUTSTREAM_FLAG_DEFAULT = (1 << 0), | ||
| 226 | |||
| 227 | /// @brief **0000 0000 0000 0010 :** Dub | ||
| 228 | INPUTSTREAM_FLAG_DUB = (1 << 1), | ||
| 229 | |||
| 230 | /// @brief **0000 0000 0000 0100 :** Original | ||
| 231 | INPUTSTREAM_FLAG_ORIGINAL = (1 << 2), | ||
| 232 | |||
| 233 | /// @brief **0000 0000 0000 1000 :** Comment | ||
| 234 | INPUTSTREAM_FLAG_COMMENT = (1 << 3), | ||
| 235 | |||
| 236 | /// @brief **0000 0000 0001 0000 :** Lyrics | ||
| 237 | INPUTSTREAM_FLAG_LYRICS = (1 << 4), | ||
| 238 | |||
| 239 | /// @brief **0000 0000 0010 0000 :** Karaoke | ||
| 240 | INPUTSTREAM_FLAG_KARAOKE = (1 << 5), | ||
| 241 | |||
| 242 | /// @brief **0000 0000 0100 0000 :** Forced | ||
| 243 | INPUTSTREAM_FLAG_FORCED = (1 << 6), | ||
| 244 | |||
| 245 | /// @brief **0000 0000 1000 0000 :** Hearing impaired | ||
| 246 | INPUTSTREAM_FLAG_HEARING_IMPAIRED = (1 << 7), | ||
| 247 | |||
| 248 | /// @brief **0000 0001 0000 0000 :** Visual impaired | ||
| 249 | INPUTSTREAM_FLAG_VISUAL_IMPAIRED = (1 << 8), | ||
| 250 | }; | ||
| 251 | ///@} | ||
| 252 | //---------------------------------------------------------------------------- | ||
| 253 | |||
| 254 | // Keep in sync with AVColorSpace | ||
| 255 | //============================================================================ | ||
| 256 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_COLORSPACE enum INPUTSTREAM_COLORSPACE | ||
| 257 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 258 | /// @brief **Inputstream color space flags**\n | ||
| 259 | /// YUV colorspace type. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.3. | ||
| 260 | /// | ||
| 261 | /// Used on @ref kodi::addon::InputstreamInfo::SetColorSpace and @ref kodi::addon::InputstreamInfo::GetColorSpace. | ||
| 262 | /// | ||
| 263 | ///@{ | ||
| 264 | enum INPUTSTREAM_COLORSPACE | ||
| 265 | { | ||
| 266 | /// @brief **0 :** Order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) | ||
| 267 | INPUTSTREAM_COLORSPACE_RGB = 0, | ||
| 268 | |||
| 269 | /// @brief **1 :** Also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B | ||
| 270 | INPUTSTREAM_COLORSPACE_BT709 = 1, | ||
| 271 | |||
| 272 | /// @brief **2 :** To set stream is unspecified | ||
| 273 | INPUTSTREAM_COLORSPACE_UNSPECIFIED = 2, | ||
| 274 | |||
| 275 | /// @brief **2 :** To set stream is unkown | ||
| 276 | /// @note Same as @ref INPUTSTREAM_COLORSPACE_UNSPECIFIED | ||
| 277 | INPUTSTREAM_COLORSPACE_UNKNOWN = INPUTSTREAM_COLORSPACE_UNSPECIFIED, // compatibility | ||
| 278 | |||
| 279 | /// @brief **3 :** To set colorspace reserved | ||
| 280 | INPUTSTREAM_COLORSPACE_RESERVED = 3, | ||
| 281 | |||
| 282 | /// @brief **4 :** FCC Title 47 Code of Federal Regulations 73.682 (a)(20) | ||
| 283 | INPUTSTREAM_COLORSPACE_FCC = 4, | ||
| 284 | |||
| 285 | /// @brief **5 :** Also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 | ||
| 286 | INPUTSTREAM_COLORSPACE_BT470BG = 5, | ||
| 287 | |||
| 288 | /// @brief **6 :** Also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC | ||
| 289 | INPUTSTREAM_COLORSPACE_SMPTE170M = 6, | ||
| 290 | |||
| 291 | /// @brief **7 :** Functionally identical to above @ref INPUTSTREAM_COLORSPACE_SMPTE170M | ||
| 292 | INPUTSTREAM_COLORSPACE_SMPTE240M = 7, | ||
| 293 | |||
| 294 | /// @brief **8 :** Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 | ||
| 295 | INPUTSTREAM_COLORSPACE_YCGCO = 8, | ||
| 296 | |||
| 297 | /// @brief **8 :** To set colorspace as YCOCG | ||
| 298 | /// @note Same as @ref INPUTSTREAM_COLORSPACE_YCGCO | ||
| 299 | INPUTSTREAM_COLORSPACE_YCOCG = INPUTSTREAM_COLORSPACE_YCGCO, | ||
| 300 | |||
| 301 | /// @brief **9 :** ITU-R BT2020 non-constant luminance system | ||
| 302 | INPUTSTREAM_COLORSPACE_BT2020_NCL = 9, | ||
| 303 | |||
| 304 | /// @brief **10 :** ITU-R BT2020 constant luminance system | ||
| 305 | INPUTSTREAM_COLORSPACE_BT2020_CL = 10, | ||
| 306 | |||
| 307 | /// @brief **11 :** SMPTE 2085, Y'D'zD'x | ||
| 308 | INPUTSTREAM_COLORSPACE_SMPTE2085 = 11, | ||
| 309 | |||
| 310 | /// @brief **12 :** Chromaticity-derived non-constant luminance system | ||
| 311 | INPUTSTREAM_COLORSPACE_CHROMA_DERIVED_NCL = 12, | ||
| 312 | |||
| 313 | /// @brief **13 :** Chromaticity-derived constant luminance system | ||
| 314 | INPUTSTREAM_COLORSPACE_CHROMA_DERIVED_CL = 13, | ||
| 315 | |||
| 316 | /// @brief **14 :** ITU-R BT.2100-0, ICtCp | ||
| 317 | INPUTSTREAM_COLORSPACE_ICTCP = 14, | ||
| 318 | |||
| 319 | /// @brief The maximum value to use in a list. | ||
| 320 | INPUTSTREAM_COLORSPACE_MAX | ||
| 321 | }; | ||
| 322 | ///@} | ||
| 323 | //------------------------------------------------------------------------------ | ||
| 324 | |||
| 325 | // Keep in sync with AVColorPrimaries | ||
| 326 | //============================================================================== | ||
| 327 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_COLORPRIMARIES enum INPUTSTREAM_COLORPRIMARIES | ||
| 328 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 329 | /// @brief **Inputstream color primaries flags**\n | ||
| 330 | /// Chromaticity coordinates of the source primaries. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.1. | ||
| 331 | /// | ||
| 332 | /// Used on @ref kodi::addon::InputstreamInfo::SetColorPrimaries and @ref kodi::addon::InputstreamInfo::GetColorPrimaries. | ||
| 333 | /// | ||
| 334 | ///@{ | ||
| 335 | enum INPUTSTREAM_COLORPRIMARIES | ||
| 336 | { | ||
| 337 | /// @brief **0 :** Reserved | ||
| 338 | INPUTSTREAM_COLORPRIMARY_RESERVED0 = 0, | ||
| 339 | |||
| 340 | /// @brief **1 :** Also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B | ||
| 341 | INPUTSTREAM_COLORPRIMARY_BT709 = 1, | ||
| 342 | |||
| 343 | /// @brief **2 :** Unspecified | ||
| 344 | INPUTSTREAM_COLORPRIMARY_UNSPECIFIED = 2, | ||
| 345 | |||
| 346 | /// @brief **3 :** Reserved | ||
| 347 | INPUTSTREAM_COLORPRIMARY_RESERVED = 3, | ||
| 348 | |||
| 349 | /// @brief **4 :** Also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) | ||
| 350 | INPUTSTREAM_COLORPRIMARY_BT470M = 4, | ||
| 351 | |||
| 352 | /// @brief **5 :** Also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM | ||
| 353 | INPUTSTREAM_COLORPRIMARY_BT470BG = 5, | ||
| 354 | |||
| 355 | /// @brief **6 :** Also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC | ||
| 356 | INPUTSTREAM_COLORPRIMARY_SMPTE170M = 6, | ||
| 357 | |||
| 358 | /// @brief **7 :** Functionally identical to above | ||
| 359 | INPUTSTREAM_COLORPRIMARY_SMPTE240M = 7, | ||
| 360 | |||
| 361 | /// @brief **8 :** Colour filters using Illuminant C | ||
| 362 | INPUTSTREAM_COLORPRIMARY_FILM = 8, | ||
| 363 | |||
| 364 | /// @brief **9 :** ITU-R BT2020 | ||
| 365 | INPUTSTREAM_COLORPRIMARY_BT2020 = 9, | ||
| 366 | |||
| 367 | /// @brief **10 :** SMPTE ST 428-1 (CIE 1931 XYZ) | ||
| 368 | INPUTSTREAM_COLORPRIMARY_SMPTE428 = 10, | ||
| 369 | |||
| 370 | /// @brief **10 :** | ||
| 371 | /// @note Same as @ref INPUTSTREAM_COLORPRIMARY_SMPTE428 | ||
| 372 | INPUTSTREAM_COLORPRIMARY_SMPTEST428_1 = INPUTSTREAM_COLORPRIMARY_SMPTE428, | ||
| 373 | |||
| 374 | /// @brief **11 :** SMPTE ST 431-2 (2011) / DCI P3 | ||
| 375 | INPUTSTREAM_COLORPRIMARY_SMPTE431 = 11, | ||
| 376 | |||
| 377 | /// @brief **12 :** SMPTE ST 432-1 (2010) / P3 D65 / Display P3 | ||
| 378 | INPUTSTREAM_COLORPRIMARY_SMPTE432 = 12, | ||
| 379 | |||
| 380 | /// @brief **22 :** JEDEC P22 phosphors | ||
| 381 | INPUTSTREAM_COLORPRIMARY_JEDEC_P22 = 22, | ||
| 382 | |||
| 383 | /// @brief The maximum value to use in a list. | ||
| 384 | INPUTSTREAM_COLORPRIMARY_MAX | ||
| 385 | }; | ||
| 386 | ///@} | ||
| 387 | //------------------------------------------------------------------------------ | ||
| 388 | |||
| 389 | // Keep in sync with AVColorRange | ||
| 390 | //============================================================================== | ||
| 391 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_COLORRANGE enum INPUTSTREAM_COLORRANGE | ||
| 392 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 393 | /// @brief **Inputstream color range flags**\n | ||
| 394 | /// MPEG vs JPEG YUV range. | ||
| 395 | /// | ||
| 396 | /// Used on @ref kodi::addon::InputstreamInfo::SetColorRange and @ref kodi::addon::InputstreamInfo::GetColorRange. | ||
| 397 | /// | ||
| 398 | ///@{ | ||
| 399 | enum INPUTSTREAM_COLORRANGE | ||
| 400 | { | ||
| 401 | /// @brief **0 :** To define as unkown | ||
| 402 | INPUTSTREAM_COLORRANGE_UNKNOWN = 0, | ||
| 403 | |||
| 404 | /// @brief **1 :** The normal 219*2^(n-8) "MPEG" YUV ranges | ||
| 405 | INPUTSTREAM_COLORRANGE_LIMITED, | ||
| 406 | |||
| 407 | /// @brief **2 :** The normal 2^n-1 "JPEG" YUV ranges | ||
| 408 | INPUTSTREAM_COLORRANGE_FULLRANGE, | ||
| 409 | |||
| 410 | /// @brief The maximum value to use in a list. | ||
| 411 | INPUTSTREAM_COLORRANGE_MAX | ||
| 412 | }; | ||
| 413 | ///@} | ||
| 414 | //------------------------------------------------------------------------------ | ||
| 415 | |||
| 416 | // keep in sync with AVColorTransferCharacteristic | ||
| 417 | //============================================================================== | ||
| 418 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_INPUTSTREAM_COLORTRC enum INPUTSTREAM_COLORTRC | ||
| 419 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 420 | /// @brief **Inputstream color TRC flags**\n | ||
| 421 | /// Color Transfer Characteristic. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.2. | ||
| 422 | /// | ||
| 423 | /// Used on @ref kodi::addon::InputstreamInfo::SetColorTransferCharacteristic and @ref kodi::addon::InputstreamInfo::GetColorTransferCharacteristic. | ||
| 424 | /// | ||
| 425 | ///@{ | ||
| 426 | enum INPUTSTREAM_COLORTRC | ||
| 427 | { | ||
| 428 | /// @brief **0 :** Reserved | ||
| 429 | INPUTSTREAM_COLORTRC_RESERVED0 = 0, | ||
| 430 | |||
| 431 | /// @brief **1 :** Also ITU-R BT1361 | ||
| 432 | INPUTSTREAM_COLORTRC_BT709 = 1, | ||
| 433 | |||
| 434 | /// @brief **2 :** Unspecified | ||
| 435 | INPUTSTREAM_COLORTRC_UNSPECIFIED = 2, | ||
| 436 | |||
| 437 | /// @brief **3 :** Reserved | ||
| 438 | INPUTSTREAM_COLORTRC_RESERVED = 3, | ||
| 439 | |||
| 440 | /// @brief **4 :** Also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM | ||
| 441 | INPUTSTREAM_COLORTRC_GAMMA22 = 4, | ||
| 442 | |||
| 443 | /// @brief **5 :** Also ITU-R BT470BG | ||
| 444 | INPUTSTREAM_COLORTRC_GAMMA28 = 5, | ||
| 445 | |||
| 446 | /// @brief **6 :** Also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC | ||
| 447 | INPUTSTREAM_COLORTRC_SMPTE170M = 6, | ||
| 448 | |||
| 449 | /// @brief **7 :** Functionally identical to above @ref INPUTSTREAM_COLORTRC_SMPTE170M | ||
| 450 | INPUTSTREAM_COLORTRC_SMPTE240M = 7, | ||
| 451 | |||
| 452 | /// @brief **8 :** Linear transfer characteristics | ||
| 453 | INPUTSTREAM_COLORTRC_LINEAR = 8, | ||
| 454 | |||
| 455 | /// @brief **9 :** Logarithmic transfer characteristic (100:1 range) | ||
| 456 | INPUTSTREAM_COLORTRC_LOG = 9, | ||
| 457 | |||
| 458 | /// @brief **10 :** Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range) | ||
| 459 | INPUTSTREAM_COLORTRC_LOG_SQRT = 10, | ||
| 460 | |||
| 461 | /// @brief **11 :** IEC 61966-2-4 | ||
| 462 | INPUTSTREAM_COLORTRC_IEC61966_2_4 = 11, | ||
| 463 | |||
| 464 | /// @brief **12 :** ITU-R BT1361 Extended Colour Gamut | ||
| 465 | INPUTSTREAM_COLORTRC_BT1361_ECG = 12, | ||
| 466 | |||
| 467 | /// @brief **13 :** IEC 61966-2-1 (sRGB or sYCC) | ||
| 468 | INPUTSTREAM_COLORTRC_IEC61966_2_1 = 13, | ||
| 469 | |||
| 470 | /// @brief **14 :** ITU-R BT2020 for 10-bit system | ||
| 471 | INPUTSTREAM_COLORTRC_BT2020_10 = 14, | ||
| 472 | |||
| 473 | /// @brief **15 :** ITU-R BT2020 for 12-bit system | ||
| 474 | INPUTSTREAM_COLORTRC_BT2020_12 = 15, | ||
| 475 | |||
| 476 | /// @brief **16 :** SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems | ||
| 477 | INPUTSTREAM_COLORTRC_SMPTE2084 = 16, | ||
| 478 | |||
| 479 | /// @brief **16 :** Same as @ref INPUTSTREAM_COLORTRC_SMPTE2084 | ||
| 480 | INPUTSTREAM_COLORTRC_SMPTEST2084 = INPUTSTREAM_COLORTRC_SMPTE2084, | ||
| 481 | |||
| 482 | /// @brief **17 :** SMPTE ST 428-1 | ||
| 483 | INPUTSTREAM_COLORTRC_SMPTE428 = 17, | ||
| 484 | |||
| 485 | /// @brief **17 :** Same as @ref INPUTSTREAM_COLORTRC_SMPTE428 | ||
| 486 | INPUTSTREAM_COLORTRC_SMPTEST428_1 = INPUTSTREAM_COLORTRC_SMPTE428, | ||
| 487 | |||
| 488 | /// @brief **18 :** ARIB STD-B67, known as "Hybrid log-gamma" | ||
| 489 | INPUTSTREAM_COLORTRC_ARIB_STD_B67 = 18, | ||
| 490 | |||
| 491 | /// @brief The maximum value to use in a list. | ||
| 492 | INPUTSTREAM_COLORTRC_MAX | ||
| 493 | }; | ||
| 494 | ///@} | ||
| 495 | //------------------------------------------------------------------------------ | ||
| 496 | |||
| 497 | /*! | ||
| 498 | * @brief stream properties | ||
| 499 | */ | ||
| 500 | struct INPUTSTREAM_INFO | ||
| 501 | { | ||
| 502 | enum INPUTSTREAM_TYPE m_streamType; | ||
| 503 | uint32_t m_features; | ||
| 504 | uint32_t m_flags; | ||
| 505 | |||
| 506 | //! @brief (optional) name of the stream, \0 for default handling | ||
| 507 | char m_name[INPUTSTREAM_MAX_STRING_NAME_SIZE]; | ||
| 508 | |||
| 509 | //! @brief (required) name of codec according to ffmpeg | ||
| 510 | char m_codecName[INPUTSTREAM_MAX_STRING_CODEC_SIZE]; | ||
| 511 | |||
| 512 | //! @brief (optional) internal name of codec (selectionstream info) | ||
| 513 | char m_codecInternalName[INPUTSTREAM_MAX_STRING_CODEC_SIZE]; | ||
| 514 | |||
| 515 | //! @brief (optional) the profile of the codec | ||
| 516 | enum STREAMCODEC_PROFILE m_codecProfile; | ||
| 517 | |||
| 518 | //! @brief (required) physical index | ||
| 519 | unsigned int m_pID; | ||
| 520 | |||
| 521 | const uint8_t* m_ExtraData; | ||
| 522 | unsigned int m_ExtraSize; | ||
| 523 | |||
| 524 | //! @brief RFC 5646 language code (empty string if undefined) | ||
| 525 | char m_language[INPUTSTREAM_MAX_STRING_LANGUAGE_SIZE]; | ||
| 526 | |||
| 527 | //! Video stream related data | ||
| 528 | //@{ | ||
| 529 | |||
| 530 | //! @brief Scale of 1000 and a rate of 29970 will result in 29.97 fps | ||
| 531 | unsigned int m_FpsScale; | ||
| 532 | |||
| 533 | unsigned int m_FpsRate; | ||
| 534 | |||
| 535 | //! @brief height of the stream reported by the demuxer | ||
| 536 | unsigned int m_Height; | ||
| 537 | |||
| 538 | //! @brief width of the stream reported by the demuxer | ||
| 539 | unsigned int m_Width; | ||
| 540 | |||
| 541 | //! @brief display aspect of stream | ||
| 542 | float m_Aspect; | ||
| 543 | |||
| 544 | //@} | ||
| 545 | |||
| 546 | //! Audio stream related data | ||
| 547 | //@{ | ||
| 548 | |||
| 549 | //! @brief (required) amount of channels | ||
| 550 | unsigned int m_Channels; | ||
| 551 | |||
| 552 | //! @brief (required) sample rate | ||
| 553 | unsigned int m_SampleRate; | ||
| 554 | |||
| 555 | //! @brief (required) bit rate | ||
| 556 | unsigned int m_BitRate; | ||
| 557 | |||
| 558 | //! @brief (required) bits per sample | ||
| 559 | unsigned int m_BitsPerSample; | ||
| 560 | |||
| 561 | unsigned int m_BlockAlign; | ||
| 562 | |||
| 563 | //@} | ||
| 564 | |||
| 565 | struct STREAM_CRYPTO_SESSION m_cryptoSession; | ||
| 566 | |||
| 567 | // new in API version 2.0.8 | ||
| 568 | //@{ | ||
| 569 | //! @brief Codec If available, the fourcc code codec | ||
| 570 | unsigned int m_codecFourCC; | ||
| 571 | |||
| 572 | //! @brief definition of colorspace | ||
| 573 | enum INPUTSTREAM_COLORSPACE m_colorSpace; | ||
| 574 | |||
| 575 | //! @brief color range if available | ||
| 576 | enum INPUTSTREAM_COLORRANGE m_colorRange; | ||
| 577 | //@} | ||
| 578 | |||
| 579 | //new in API 2.0.9 / INPUTSTREAM_VERSION_LEVEL 1 | ||
| 580 | //@{ | ||
| 581 | enum INPUTSTREAM_COLORPRIMARIES m_colorPrimaries; | ||
| 582 | enum INPUTSTREAM_COLORTRC m_colorTransferCharacteristic; | ||
| 583 | //@} | ||
| 584 | |||
| 585 | //! @brief mastering static Metadata | ||
| 586 | struct INPUTSTREAM_MASTERING_METADATA* m_masteringMetadata; | ||
| 587 | |||
| 588 | //! @brief content light static Metadata | ||
| 589 | struct INPUTSTREAM_CONTENTLIGHT_METADATA* m_contentLightMetadata; | ||
| 590 | }; | ||
| 591 | |||
| 592 | struct INPUTSTREAM_TIMES | ||
| 593 | { | ||
| 594 | time_t startTime; | ||
| 595 | double ptsStart; | ||
| 596 | double ptsBegin; | ||
| 597 | double ptsEnd; | ||
| 598 | }; | ||
| 599 | |||
| 600 | /*! | ||
| 601 | * @brief "C" ABI Structures to transfer the methods from this to Kodi | ||
| 602 | */ | ||
| 603 | |||
| 604 | // this are properties given to the addon on create | ||
| 605 | // at this time we have no parameters for the addon | ||
| 606 | typedef struct AddonProps_InputStream /* internal */ | ||
| 607 | { | ||
| 608 | int dummy; | ||
| 609 | } AddonProps_InputStream; | ||
| 610 | |||
| 611 | typedef struct AddonToKodiFuncTable_InputStream /* internal */ | ||
| 612 | { | ||
| 613 | KODI_HANDLE kodiInstance; | ||
| 614 | struct DEMUX_PACKET* (*allocate_demux_packet)(void* kodiInstance, int data_size); | ||
| 615 | struct DEMUX_PACKET* (*allocate_encrypted_demux_packet)(void* kodiInstance, | ||
| 616 | unsigned int data_size, | ||
| 617 | unsigned int encrypted_subsample_count); | ||
| 618 | void (*free_demux_packet)(void* kodiInstance, struct DEMUX_PACKET* packet); | ||
| 619 | } AddonToKodiFuncTable_InputStream; | ||
| 620 | |||
| 621 | struct AddonInstance_InputStream; | ||
| 622 | typedef struct KodiToAddonFuncTable_InputStream /* internal */ | ||
| 623 | { | ||
| 624 | KODI_HANDLE addonInstance; | ||
| 625 | |||
| 626 | bool(__cdecl* open)(const struct AddonInstance_InputStream* instance, | ||
| 627 | struct INPUTSTREAM_PROPERTY* props); | ||
| 628 | void(__cdecl* close)(const struct AddonInstance_InputStream* instance); | ||
| 629 | const char*(__cdecl* get_path_list)(const struct AddonInstance_InputStream* instance); | ||
| 630 | void(__cdecl* get_capabilities)(const struct AddonInstance_InputStream* instance, | ||
| 631 | struct INPUTSTREAM_CAPABILITIES* capabilities); | ||
| 632 | |||
| 633 | // IDemux | ||
| 634 | bool(__cdecl* get_stream_ids)(const struct AddonInstance_InputStream* instance, | ||
| 635 | struct INPUTSTREAM_IDS* ids); | ||
| 636 | bool(__cdecl* get_stream)(const struct AddonInstance_InputStream* instance, | ||
| 637 | int streamid, | ||
| 638 | struct INPUTSTREAM_INFO* info, | ||
| 639 | KODI_HANDLE* demuxStream, | ||
| 640 | KODI_HANDLE (*transfer_stream)(KODI_HANDLE handle, | ||
| 641 | int streamId, | ||
| 642 | struct INPUTSTREAM_INFO* stream)); | ||
| 643 | void(__cdecl* enable_stream)(const struct AddonInstance_InputStream* instance, | ||
| 644 | int streamid, | ||
| 645 | bool enable); | ||
| 646 | bool(__cdecl* open_stream)(const struct AddonInstance_InputStream* instance, int streamid); | ||
| 647 | void(__cdecl* demux_reset)(const struct AddonInstance_InputStream* instance); | ||
| 648 | void(__cdecl* demux_abort)(const struct AddonInstance_InputStream* instance); | ||
| 649 | void(__cdecl* demux_flush)(const struct AddonInstance_InputStream* instance); | ||
| 650 | struct DEMUX_PACKET*(__cdecl* demux_read)(const struct AddonInstance_InputStream* instance); | ||
| 651 | bool(__cdecl* demux_seek_time)(const struct AddonInstance_InputStream* instance, | ||
| 652 | double time, | ||
| 653 | bool backwards, | ||
| 654 | double* startpts); | ||
| 655 | void(__cdecl* demux_set_speed)(const struct AddonInstance_InputStream* instance, int speed); | ||
| 656 | void(__cdecl* set_video_resolution)(const struct AddonInstance_InputStream* instance, | ||
| 657 | int width, | ||
| 658 | int height); | ||
| 659 | |||
| 660 | // IDisplayTime | ||
| 661 | int(__cdecl* get_total_time)(const struct AddonInstance_InputStream* instance); | ||
| 662 | int(__cdecl* get_time)(const struct AddonInstance_InputStream* instance); | ||
| 663 | |||
| 664 | // ITime | ||
| 665 | bool(__cdecl* get_times)(const struct AddonInstance_InputStream* instance, | ||
| 666 | struct INPUTSTREAM_TIMES* times); | ||
| 667 | |||
| 668 | // IPosTime | ||
| 669 | bool(__cdecl* pos_time)(const struct AddonInstance_InputStream* instance, int ms); | ||
| 670 | |||
| 671 | int(__cdecl* read_stream)(const struct AddonInstance_InputStream* instance, | ||
| 672 | uint8_t* buffer, | ||
| 673 | unsigned int bufferSize); | ||
| 674 | int64_t(__cdecl* seek_stream)(const struct AddonInstance_InputStream* instance, | ||
| 675 | int64_t position, | ||
| 676 | int whence); | ||
| 677 | int64_t(__cdecl* position_stream)(const struct AddonInstance_InputStream* instance); | ||
| 678 | int64_t(__cdecl* length_stream)(const struct AddonInstance_InputStream* instance); | ||
| 679 | bool(__cdecl* is_real_time_stream)(const struct AddonInstance_InputStream* instance); | ||
| 680 | |||
| 681 | // IChapter | ||
| 682 | int(__cdecl* get_chapter)(const struct AddonInstance_InputStream* instance); | ||
| 683 | int(__cdecl* get_chapter_count)(const struct AddonInstance_InputStream* instance); | ||
| 684 | const char*(__cdecl* get_chapter_name)(const struct AddonInstance_InputStream* instance, | ||
| 685 | int ch); | ||
| 686 | int64_t(__cdecl* get_chapter_pos)(const struct AddonInstance_InputStream* instance, int ch); | ||
| 687 | bool(__cdecl* seek_chapter)(const struct AddonInstance_InputStream* instance, int ch); | ||
| 688 | |||
| 689 | int(__cdecl* block_size_stream)(const struct AddonInstance_InputStream* instance); | ||
| 690 | } KodiToAddonFuncTable_InputStream; | ||
| 691 | |||
| 692 | typedef struct AddonInstance_InputStream /* internal */ | ||
| 693 | { | ||
| 694 | struct AddonProps_InputStream* props; | ||
| 695 | struct AddonToKodiFuncTable_InputStream* toKodi; | ||
| 696 | struct KodiToAddonFuncTable_InputStream* toAddon; | ||
| 697 | } AddonInstance_InputStream; | ||
| 698 | |||
| 699 | #ifdef __cplusplus | ||
| 700 | } /* extern "C" */ | ||
| 701 | #endif /* __cplusplus */ | ||
| 702 | |||
| 703 | #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/CMakeLists.txt b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/CMakeLists.txt new file mode 100644 index 0000000..9a22c44 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/CMakeLists.txt | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | set(HEADERS demux_packet.h | ||
| 2 | stream_codec.h | ||
| 3 | stream_constants.h | ||
| 4 | stream_crypto.h | ||
| 5 | timing_constants.h) | ||
| 6 | |||
| 7 | if(NOT ENABLE_STATIC_LIBS) | ||
| 8 | core_add_library(addons_kodi-dev-kit_include_kodi_c-api_addon-instance_inputstream) | ||
| 9 | endif() | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/demux_packet.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/demux_packet.h new file mode 100644 index 0000000..79686ab --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/demux_packet.h | |||
| @@ -0,0 +1,117 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_DEMUXPACKET_H | ||
| 10 | #define C_API_ADDONINSTANCE_INPUTSTREAM_DEMUXPACKET_H | ||
| 11 | |||
| 12 | #include "timing_constants.h" | ||
| 13 | |||
| 14 | #include <stdbool.h> | ||
| 15 | #include <stdint.h> | ||
| 16 | |||
| 17 | #define DEMUX_SPECIALID_STREAMINFO -10 | ||
| 18 | #define DEMUX_SPECIALID_STREAMCHANGE -11 | ||
| 19 | |||
| 20 | #ifdef __cplusplus | ||
| 21 | extern "C" | ||
| 22 | { | ||
| 23 | #endif /* __cplusplus */ | ||
| 24 | |||
| 25 | struct DEMUX_CRYPTO_INFO; | ||
| 26 | |||
| 27 | //============================================================================ | ||
| 28 | /// @defgroup cpp_kodi_addon_inputstream_Defs_Interface_DEMUX_PACKET struct DEMUX_PACKET | ||
| 29 | /// @ingroup cpp_kodi_addon_inputstream_Defs_Interface | ||
| 30 | /// @brief **Demux packet**\n | ||
| 31 | /// To processed codec and demux inputstream stream. | ||
| 32 | /// | ||
| 33 | /// This part is in the "C" style in order to have better performance and | ||
| 34 | /// possibly to be used in "C" libraries. | ||
| 35 | /// | ||
| 36 | /// The structure should be created with @ref kodi::addon::CInstanceInputStream::AllocateDemuxPacket() | ||
| 37 | /// or @ref kodi::addon::CInstanceInputStream::AllocateEncryptedDemuxPacket() | ||
| 38 | /// and if not added to Kodi with @ref kodi::addon::CInstanceInputStream::FreeDemuxPacket() | ||
| 39 | /// be deleted again. | ||
| 40 | /// | ||
| 41 | /// Packages that have been given to Kodi and processed will then be deleted | ||
| 42 | /// by him. | ||
| 43 | /// | ||
| 44 | ///@{ | ||
| 45 | struct DEMUX_PACKET | ||
| 46 | { | ||
| 47 | /// @brief Stream package which is given for decoding. | ||
| 48 | /// | ||
| 49 | /// @note Associated storage from here is created using | ||
| 50 | /// @ref kodi::addon::CInstanceInputStream::AllocateDemuxPacket() | ||
| 51 | /// or @ref kodi::addon::CInstanceInputStream::AllocateEncryptedDemuxPacket(). | ||
| 52 | uint8_t* pData; | ||
| 53 | |||
| 54 | /// @brief Size of the package given at @ref pData. | ||
| 55 | int iSize; | ||
| 56 | |||
| 57 | /// @brief Identification of the stream. | ||
| 58 | int iStreamId; | ||
| 59 | |||
| 60 | /// @brief Identification of the associated demuxer, this can be identical | ||
| 61 | /// on several streams. | ||
| 62 | int64_t demuxerId; | ||
| 63 | |||
| 64 | /// @brief The group this data belongs to, used to group data from different | ||
| 65 | /// streams together. | ||
| 66 | int iGroupId; | ||
| 67 | |||
| 68 | //------------------------------------------ | ||
| 69 | |||
| 70 | /// @brief Additional packet data that can be provided by the container. | ||
| 71 | /// | ||
| 72 | /// Packet can contain several types of side information. | ||
| 73 | /// | ||
| 74 | /// This is usually based on that of ffmpeg, see | ||
| 75 | /// [AVPacketSideData](https://ffmpeg.org/doxygen/trunk/structAVPacketSideData.html). | ||
| 76 | void* pSideData; | ||
| 77 | |||
| 78 | /// @brief Data elements stored at @ref pSideData. | ||
| 79 | int iSideDataElems; | ||
| 80 | |||
| 81 | //------------------------------------------ | ||
| 82 | |||
| 83 | /// @brief Presentation time stamp (PTS). | ||
| 84 | double pts; | ||
| 85 | |||
| 86 | /// @brief Decoding time stamp (DTS). | ||
| 87 | double dts; | ||
| 88 | |||
| 89 | /// @brief Duration in @ref STREAM_TIME_BASE if available | ||
| 90 | double duration; | ||
| 91 | |||
| 92 | /// @brief Display time from input stream | ||
| 93 | int dispTime; | ||
| 94 | |||
| 95 | /// @brief To show that this package allows recreating the presentation by | ||
| 96 | /// mistake. | ||
| 97 | bool recoveryPoint; | ||
| 98 | |||
| 99 | //------------------------------------------ | ||
| 100 | |||
| 101 | /// @brief Optional data to allow decryption at processing site if | ||
| 102 | /// necessary. | ||
| 103 | /// | ||
| 104 | /// This can be created using @ref kodi::addon::CInstanceInputStream::AllocateEncryptedDemuxPacket(), | ||
| 105 | /// otherwise this is declared as <b>`nullptr`</b>. | ||
| 106 | /// | ||
| 107 | /// See @ref DEMUX_CRYPTO_INFO for their style. | ||
| 108 | struct DEMUX_CRYPTO_INFO* cryptoInfo; | ||
| 109 | }; | ||
| 110 | ///@} | ||
| 111 | //---------------------------------------------------------------------------- | ||
| 112 | |||
| 113 | #ifdef __cplusplus | ||
| 114 | } /* extern "C" */ | ||
| 115 | #endif /* __cplusplus */ | ||
| 116 | |||
| 117 | #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_DEMUXPACKET_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/StreamCodec.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_codec.h index e030371..b489cb9 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/StreamCodec.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_codec.h | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | 9 | #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCODEC_H |
| 10 | #define C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCODEC_H | ||
| 10 | 11 | ||
| 11 | #ifdef __cplusplus | 12 | #ifdef __cplusplus |
| 12 | extern "C" | 13 | extern "C" |
| @@ -14,10 +15,12 @@ extern "C" | |||
| 14 | #endif /* __cplusplus */ | 15 | #endif /* __cplusplus */ |
| 15 | 16 | ||
| 16 | //============================================================================== | 17 | //============================================================================== |
| 17 | /// @ingroup cpp_kodi_addon_videocodec_Defs_VIDEOCODEC_INITDATA | 18 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamEncryption_STREAMCODEC_PROFILE enum STREAMCODEC_PROFILE |
| 18 | /// @brief The standard defines several sets of capabilities, which are referred | 19 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamCodec |
| 19 | /// to as profiles, targeting specific classes of applications. | 20 | /// @brief **The standard defines several sets of capabilities.**\n |
| 20 | //@{ | 21 | /// Which are referred to as profiles, targeting specific classes of applications. |
| 22 | /// | ||
| 23 | ///@{ | ||
| 21 | enum STREAMCODEC_PROFILE | 24 | enum STREAMCODEC_PROFILE |
| 22 | { | 25 | { |
| 23 | /// @brief Unknown codec profile | 26 | /// @brief Unknown codec profile |
| @@ -26,8 +29,8 @@ extern "C" | |||
| 26 | /// @brief If a codec profile is not required | 29 | /// @brief If a codec profile is not required |
| 27 | CodecProfileNotNeeded, | 30 | CodecProfileNotNeeded, |
| 28 | 31 | ||
| 29 | /// @brief **H264** Baseline Profile (BP, 66) | 32 | /// @brief **H264** Baseline Profile (BP, 66)\n |
| 30 | /// | 33 | /// \n |
| 31 | /// Primarily for low-cost applications that require additional data loss | 34 | /// Primarily for low-cost applications that require additional data loss |
| 32 | /// robustness, this profile is used in some videoconferencing and mobile | 35 | /// robustness, this profile is used in some videoconferencing and mobile |
| 33 | /// applications. This profile includes all features that are supported | 36 | /// applications. This profile includes all features that are supported |
| @@ -40,8 +43,8 @@ extern "C" | |||
| 40 | /// profiles share the same profile identifier code value. | 43 | /// profiles share the same profile identifier code value. |
| 41 | H264CodecProfileBaseline, | 44 | H264CodecProfileBaseline, |
| 42 | 45 | ||
| 43 | /// @brief **H264** Main Profile (MP, 77) | 46 | /// @brief **H264** Main Profile (MP, 77)\n |
| 44 | /// | 47 | /// \n |
| 45 | /// This profile is used for standard-definition digital TV broadcasts that | 48 | /// This profile is used for standard-definition digital TV broadcasts that |
| 46 | /// use the MPEG-4 format as defined in the | 49 | /// use the MPEG-4 format as defined in the |
| 47 | /// [DVB standard](http://www.etsi.org/deliver/etsi_ts/101100_101199/101154/01.09.01_60/ts_101154v010901p.pdf). | 50 | /// [DVB standard](http://www.etsi.org/deliver/etsi_ts/101100_101199/101154/01.09.01_60/ts_101154v010901p.pdf). |
| @@ -50,15 +53,15 @@ extern "C" | |||
| 50 | /// in 2004 for that application. | 53 | /// in 2004 for that application. |
| 51 | H264CodecProfileMain, | 54 | H264CodecProfileMain, |
| 52 | 55 | ||
| 53 | /// @brief **H264** Extended Profile (XP, 88) | 56 | /// @brief **H264** Extended Profile (XP, 88)\n |
| 54 | /// | 57 | /// \n |
| 55 | /// Intended as the streaming video profile, this profile has relatively high | 58 | /// Intended as the streaming video profile, this profile has relatively high |
| 56 | /// compression capability and some extra tricks for robustness to data losses | 59 | /// compression capability and some extra tricks for robustness to data losses |
| 57 | /// and server stream switching. | 60 | /// and server stream switching. |
| 58 | H264CodecProfileExtended, | 61 | H264CodecProfileExtended, |
| 59 | 62 | ||
| 60 | /// @brief **H264** High Profile (HiP, 100) | 63 | /// @brief **H264** High Profile (HiP, 100)\n |
| 61 | /// | 64 | /// \n |
| 62 | /// The primary profile for broadcast and disc storage applications, | 65 | /// The primary profile for broadcast and disc storage applications, |
| 63 | /// particularly for high-definition television applications (for example, | 66 | /// particularly for high-definition television applications (for example, |
| 64 | /// this is the profile adopted by the [Blu-ray Disc](https://en.wikipedia.org/wiki/Blu-ray_Disc) | 67 | /// this is the profile adopted by the [Blu-ray Disc](https://en.wikipedia.org/wiki/Blu-ray_Disc) |
| @@ -66,31 +69,31 @@ extern "C" | |||
| 66 | /// HDTV broadcast service). | 69 | /// HDTV broadcast service). |
| 67 | H264CodecProfileHigh, | 70 | H264CodecProfileHigh, |
| 68 | 71 | ||
| 69 | /// @brief **H264** High 10 Profile (Hi10P, 110) | 72 | /// @brief **H264** High 10 Profile (Hi10P, 110)\n |
| 70 | /// | 73 | /// \n |
| 71 | /// Going beyond typical mainstream consumer product capabilities, this | 74 | /// Going beyond typical mainstream consumer product capabilities, this |
| 72 | /// profile builds on top of the High Profile, adding support for up to 10 | 75 | /// profile builds on top of the High Profile, adding support for up to 10 |
| 73 | /// bits per sample of decoded picture precision. | 76 | /// bits per sample of decoded picture precision. |
| 74 | H264CodecProfileHigh10, | 77 | H264CodecProfileHigh10, |
| 75 | 78 | ||
| 76 | /// @brief **H264** High 4:2:2 Profile (Hi422P, 122) | 79 | /// @brief **H264** High 4:2:2 Profile (Hi422P, 122)\n |
| 77 | /// | 80 | /// \n |
| 78 | /// Primarily targeting professional applications that use interlaced video, | 81 | /// Primarily targeting professional applications that use interlaced video, |
| 79 | /// this profile builds on top of the High 10 Profile, adding support for the | 82 | /// this profile builds on top of the High 10 Profile, adding support for the |
| 80 | /// 4:2:2 chroma sampling format while using up to 10 bits per sample of | 83 | /// 4:2:2 chroma sampling format while using up to 10 bits per sample of |
| 81 | /// decoded picture precision. | 84 | /// decoded picture precision. |
| 82 | H264CodecProfileHigh422, | 85 | H264CodecProfileHigh422, |
| 83 | 86 | ||
| 84 | /// @brief **H264** High 4:4:4 Predictive Profile (Hi444PP, 244) | 87 | /// @brief **H264** High 4:4:4 Predictive Profile (Hi444PP, 244)\n |
| 85 | /// | 88 | /// \n |
| 86 | /// This profile builds on top of the High 4:2:2 Profile, supporting up to | 89 | /// This profile builds on top of the High 4:2:2 Profile, supporting up to |
| 87 | /// 4:4:4 chroma sampling, up to 14 bits per sample, and additionally | 90 | /// 4:4:4 chroma sampling, up to 14 bits per sample, and additionally |
| 88 | /// supporting efficient lossless region coding and the coding of each | 91 | /// supporting efficient lossless region coding and the coding of each |
| 89 | /// picture as three separate color planes. | 92 | /// picture as three separate color planes. |
| 90 | H264CodecProfileHigh444Predictive, | 93 | H264CodecProfileHigh444Predictive, |
| 91 | 94 | ||
| 92 | /// @brief **VP9** profile 0 | 95 | /// @brief **VP9** profile 0\n |
| 93 | /// | 96 | /// \n |
| 94 | /// There are several variants of the VP9 format (known as "coding profiles"), | 97 | /// There are several variants of the VP9 format (known as "coding profiles"), |
| 95 | /// which successively allow more features; profile 0 is the basic variant, | 98 | /// which successively allow more features; profile 0 is the basic variant, |
| 96 | /// requiring the least from a hardware implementation. | 99 | /// requiring the least from a hardware implementation. |
| @@ -99,28 +102,30 @@ extern "C" | |||
| 99 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0 | 102 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0 |
| 100 | VP9CodecProfile0 = 20, | 103 | VP9CodecProfile0 = 20, |
| 101 | 104 | ||
| 102 | /// @brief **VP9** profile 1 | 105 | /// @brief **VP9** profile 1\n |
| 103 | /// | 106 | /// \n |
| 104 | /// [Color depth](https://en.wikipedia.org/wiki/Color_depth): 8 bit, | 107 | /// [Color depth](https://en.wikipedia.org/wiki/Color_depth): 8 bit, |
| 105 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0, 4:2:2, 4:4:4 | 108 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0, 4:2:2, 4:4:4 |
| 106 | VP9CodecProfile1, | 109 | VP9CodecProfile1, |
| 107 | 110 | ||
| 108 | /// @brief **VP9** profile 2 | 111 | /// @brief **VP9** profile 2\n |
| 109 | /// | 112 | /// \n |
| 110 | /// [Color depth](https://en.wikipedia.org/wiki/Color_depth): 10–12 bit, | 113 | /// [Color depth](https://en.wikipedia.org/wiki/Color_depth): 10–12 bit, |
| 111 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0 | 114 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0 |
| 112 | VP9CodecProfile2, | 115 | VP9CodecProfile2, |
| 113 | 116 | ||
| 114 | /// @brief **VP9** profile 3 | 117 | /// @brief **VP9** profile 3\n |
| 115 | /// | 118 | /// \n |
| 116 | /// [Color depth](https://en.wikipedia.org/wiki/Color_depth): 10–12 bit, | 119 | /// [Color depth](https://en.wikipedia.org/wiki/Color_depth): 10–12 bit, |
| 117 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0, 4:2:2, 4:4:4, | 120 | /// [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling): 4:2:0, 4:2:2, 4:4:4, |
| 118 | /// see [VP9 Bitstream & Decoding Process Specification](https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf) | 121 | /// see [VP9 Bitstream & Decoding Process Specification](https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf) |
| 119 | VP9CodecProfile3, | 122 | VP9CodecProfile3, |
| 120 | }; | 123 | }; |
| 121 | //@} | 124 | ///@} |
| 122 | //------------------------------------------------------------------------------ | 125 | //------------------------------------------------------------------------------ |
| 123 | 126 | ||
| 124 | #ifdef __cplusplus | 127 | #ifdef __cplusplus |
| 125 | } /* extern "C" */ | 128 | } /* extern "C" */ |
| 126 | #endif /* __cplusplus */ | 129 | #endif /* __cplusplus */ |
| 130 | |||
| 131 | #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCODEC_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_constants.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_constants.h new file mode 100644 index 0000000..f442d64 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_constants.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2017-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCONSTANTS_H | ||
| 10 | #define C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCONSTANTS_H | ||
| 11 | |||
| 12 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamConstants | ||
| 13 | /// @brief The name of the inputstream add-on that should be used by Kodi to | ||
| 14 | /// play the stream. | ||
| 15 | /// | ||
| 16 | /// Leave blank to use Kodi's built-in playing capabilities or to allow | ||
| 17 | /// ffmpeg to handle directly set to @ref STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG. | ||
| 18 | #define STREAM_PROPERTY_INPUTSTREAM "inputstream" | ||
| 19 | |||
| 20 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamConstants | ||
| 21 | /// @brief Identification string for an input stream. | ||
| 22 | /// | ||
| 23 | /// This value can be used in addition to @ref STREAM_PROPERTY_INPUTSTREAM. It is | ||
| 24 | /// used to provide the respective inpustream addon with additional | ||
| 25 | /// identification. | ||
| 26 | /// | ||
| 27 | /// The difference between this and other stream properties is that it is also | ||
| 28 | /// passed in the associated @ref kodi::addon::CAddonBase::CreateInstance call. | ||
| 29 | /// | ||
| 30 | /// This makes it possible to select different processing classes within the | ||
| 31 | /// associated add-on. | ||
| 32 | #define STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID "inputstream-instance-id" | ||
| 33 | |||
| 34 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamConstants | ||
| 35 | /// @brief "true" to denote that the stream that should be played is a | ||
| 36 | /// realtime stream. Any other value indicates that this is not a realtime | ||
| 37 | /// stream. | ||
| 38 | #define STREAM_PROPERTY_ISREALTIMESTREAM "isrealtimestream" | ||
| 39 | |||
| 40 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamConstants | ||
| 41 | /// @brief Special value for @ref STREAM_PROPERTY_INPUTSTREAM to use | ||
| 42 | /// ffmpeg to directly play a stream URL. | ||
| 43 | #define STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG "inputstream.ffmpeg" | ||
| 44 | |||
| 45 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamConstants | ||
| 46 | /// @brief Max number of properties that can be sent to an Inputstream addon | ||
| 47 | #define STREAM_MAX_PROPERTY_COUNT 30 | ||
| 48 | |||
| 49 | #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCONSTANTS_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h new file mode 100644 index 0000000..4b60306 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h | |||
| @@ -0,0 +1,129 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2017-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H | ||
| 10 | #define C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H | ||
| 11 | |||
| 12 | #include <stdint.h> | ||
| 13 | #include <string.h> | ||
| 14 | |||
| 15 | #define STREAMCRYPTO_VERSION_LEVEL 2 | ||
| 16 | |||
| 17 | #ifdef __cplusplus | ||
| 18 | extern "C" | ||
| 19 | { | ||
| 20 | #endif /* __cplusplus */ | ||
| 21 | |||
| 22 | //============================================================================ | ||
| 23 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamEncryption_STREAM_CRYPTO_KEY_SYSTEM enum STREAM_CRYPTO_KEY_SYSTEM | ||
| 24 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamEncryption | ||
| 25 | /// @brief **Available ways to process stream cryptography**\n | ||
| 26 | /// For @ref cpp_kodi_addon_inputstream_Defs_StreamEncryption_StreamCryptoSession, | ||
| 27 | /// this defines the used and required auxiliary modules which are required to | ||
| 28 | /// process the encryption stream. | ||
| 29 | /// | ||
| 30 | /// Used to set wanted [digital rights management](https://en.wikipedia.org/wiki/Digital_rights_management) | ||
| 31 | /// (DRM) technology provider for stream. | ||
| 32 | ///@{ | ||
| 33 | enum STREAM_CRYPTO_KEY_SYSTEM | ||
| 34 | { | ||
| 35 | /// @brief **0** - If no path is to be used, this is the default | ||
| 36 | STREAM_CRYPTO_KEY_SYSTEM_NONE = 0, | ||
| 37 | |||
| 38 | /// @brief **1** - To use [Widevine](https://en.wikipedia.org/wiki/Widevine) for processing | ||
| 39 | STREAM_CRYPTO_KEY_SYSTEM_WIDEVINE, | ||
| 40 | |||
| 41 | /// @brief **2** - To use [Playready](https://en.wikipedia.org/wiki/PlayReady) for processing | ||
| 42 | STREAM_CRYPTO_KEY_SYSTEM_PLAYREADY, | ||
| 43 | |||
| 44 | /// @brief **3** - To use Wiseplay for processing | ||
| 45 | STREAM_CRYPTO_KEY_SYSTEM_WISEPLAY, | ||
| 46 | |||
| 47 | /// @brief **4** - The maximum value to use in a list. | ||
| 48 | STREAM_CRYPTO_KEY_SYSTEM_COUNT | ||
| 49 | }; | ||
| 50 | ///@} | ||
| 51 | //---------------------------------------------------------------------------- | ||
| 52 | |||
| 53 | //============================================================================ | ||
| 54 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamEncryption_STREAM_CRYPTO_FLAGS enum STREAM_CRYPTO_FLAGS | ||
| 55 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamEncryption | ||
| 56 | /// @brief **Cryptography flags to use special conditions**\n | ||
| 57 | /// To identify special extra conditions. | ||
| 58 | /// | ||
| 59 | /// @note These variables are bit flags which are created using "|" can be used | ||
| 60 | /// together. | ||
| 61 | /// | ||
| 62 | ///@{ | ||
| 63 | enum STREAM_CRYPTO_FLAGS | ||
| 64 | { | ||
| 65 | /// @brief **0000 0000** - Empty to set if nothing is used. | ||
| 66 | STREAM_CRYPTO_FLAG_NONE = 0, | ||
| 67 | |||
| 68 | /// @brief **0000 0001** - Is set in flags if decoding has to be done in | ||
| 69 | /// [trusted execution environment (TEE)](https://en.wikipedia.org/wiki/Trusted_execution_environment). | ||
| 70 | STREAM_CRYPTO_FLAG_SECURE_DECODER = (1 << 0) | ||
| 71 | }; | ||
| 72 | ///@} | ||
| 73 | //---------------------------------------------------------------------------- | ||
| 74 | |||
| 75 | //============================================================================ | ||
| 76 | /// @defgroup cpp_kodi_addon_inputstream_Defs_StreamEncryption_DEMUX_CRYPTO_INFO struct DEMUX_CRYPTO_INFO | ||
| 77 | /// @ingroup cpp_kodi_addon_inputstream_Defs_StreamEncryption | ||
| 78 | /// @brief **C data structure for processing encrypted streams.**\n | ||
| 79 | /// If required, this structure is used for every DEMUX_PACKET to be processed. | ||
| 80 | /// | ||
| 81 | ///@{ | ||
| 82 | struct DEMUX_CRYPTO_INFO | ||
| 83 | { | ||
| 84 | /// @brief Number of subsamples. | ||
| 85 | uint16_t numSubSamples; | ||
| 86 | |||
| 87 | /// @brief Flags for later use. | ||
| 88 | uint16_t flags; | ||
| 89 | |||
| 90 | /// @brief @ref numSubSamples uint16_t's wich define the size of clear size | ||
| 91 | /// of a subsample. | ||
| 92 | uint16_t* clearBytes; | ||
| 93 | |||
| 94 | /// @brief @ref numSubSamples uint32_t's wich define the size of cipher size | ||
| 95 | /// of a subsample. | ||
| 96 | uint32_t* cipherBytes; | ||
| 97 | |||
| 98 | /// @brief Initialization vector | ||
| 99 | uint8_t iv[16]; | ||
| 100 | |||
| 101 | /// @brief Key id | ||
| 102 | uint8_t kid[16]; | ||
| 103 | }; | ||
| 104 | ///@} | ||
| 105 | //---------------------------------------------------------------------------- | ||
| 106 | |||
| 107 | // Data to manage stream cryptography | ||
| 108 | struct STREAM_CRYPTO_SESSION | ||
| 109 | { | ||
| 110 | // keysystem for encrypted media, STREAM_CRYPTO_KEY_SYSTEM_NONE for unencrypted | ||
| 111 | // media. | ||
| 112 | // | ||
| 113 | // See STREAM_CRYPTO_KEY_SYSTEM for available options. | ||
| 114 | enum STREAM_CRYPTO_KEY_SYSTEM keySystem; | ||
| 115 | |||
| 116 | // Flags to use special conditions, see STREAM_CRYPTO_FLAGS for available flags. | ||
| 117 | uint8_t flags; | ||
| 118 | |||
| 119 | // The crypto session key id. | ||
| 120 | char sessionId[256]; | ||
| 121 | }; | ||
| 122 | ///@} | ||
| 123 | //---------------------------------------------------------------------------- | ||
| 124 | |||
| 125 | #ifdef __cplusplus | ||
| 126 | } /* extern "C" */ | ||
| 127 | #endif /* __cplusplus */ | ||
| 128 | |||
| 129 | #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/timing_constants.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/timing_constants.h new file mode 100644 index 0000000..a226a0d --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/timing_constants.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2015-2020 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_TIMINGCONSTANTS_H | ||
| 10 | #define C_API_ADDONINSTANCE_INPUTSTREAM_TIMINGCONSTANTS_H | ||
| 11 | |||
| 12 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 13 | /// @brief Speed value to pause stream in playback. | ||
| 14 | /// | ||
| 15 | #define STREAM_PLAYSPEED_PAUSE 0 // frame stepping | ||
| 16 | |||
| 17 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 18 | /// @brief Speed value to perform stream playback at normal speed. | ||
| 19 | /// | ||
| 20 | /// See @ref STREAM_PLAYSPEED_PAUSE for pause of stream. | ||
| 21 | /// | ||
| 22 | #define STREAM_PLAYSPEED_NORMAL 1000 | ||
| 23 | |||
| 24 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 25 | /// @brief Time base represented as integer. | ||
| 26 | /// | ||
| 27 | #define STREAM_TIME_BASE 1000000 | ||
| 28 | |||
| 29 | /// @ingroup cpp_kodi_addon_inputstream_Defs_TimingConstants | ||
| 30 | /// @brief Undefined timestamp value. | ||
| 31 | /// | ||
| 32 | /// Usually reported by demuxer that work on containers that do not provide | ||
| 33 | /// either pts or dts. | ||
| 34 | /// | ||
| 35 | #define STREAM_NOPTS_VALUE 0xFFF0000000000000 | ||
| 36 | |||
| 37 | // "C" defines to translate stream times | ||
| 38 | #define STREAM_TIME_TO_MSEC(x) ((int)((double)(x)*1000 / STREAM_TIME_BASE)) | ||
| 39 | #define STREAM_SEC_TO_TIME(x) ((double)(x)*STREAM_TIME_BASE) | ||
| 40 | #define STREAM_MSEC_TO_TIME(x) ((double)(x)*STREAM_TIME_BASE / 1000) | ||
| 41 | |||
| 42 | #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_TIMINGCONSTANTS_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h index 393f34a..df168bc 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/peripheral.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PERIPHERAL_H | 9 | #ifndef C_API_ADDONINSTANCE_PERIPHERAL_H |
| 12 | #define C_API_ADDONINSTANCE_PERIPHERAL_H | 10 | #define C_API_ADDONINSTANCE_PERIPHERAL_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h index a50ea2b..cc24e5d 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_H | 10 | #define C_API_ADDONINSTANCE_PVR_H |
| 13 | 11 | ||
| @@ -67,7 +65,8 @@ extern "C" | |||
| 67 | { | 65 | { |
| 68 | const char* strUserPath; | 66 | const char* strUserPath; |
| 69 | const char* strClientPath; | 67 | const char* strClientPath; |
| 70 | int iEpgMaxDays; | 68 | int iEpgMaxFutureDays; |
| 69 | int iEpgMaxPastDays; | ||
| 71 | } AddonProperties_PVR; | 70 | } AddonProperties_PVR; |
| 72 | 71 | ||
| 73 | /*! | 72 | /*! |
| @@ -124,8 +123,8 @@ extern "C" | |||
| 124 | 123 | ||
| 125 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | 124 | //--==----==----==----==----==----==----==----==----==----==----==----==----== |
| 126 | // Stream demux interface functions | 125 | // Stream demux interface functions |
| 127 | void (*FreeDemuxPacket)(void* kodiInstance, struct DemuxPacket* pPacket); | 126 | void (*FreeDemuxPacket)(void* kodiInstance, struct DEMUX_PACKET* pPacket); |
| 128 | struct DemuxPacket* (*AllocateDemuxPacket)(void* kodiInstance, int iDataSize); | 127 | struct DEMUX_PACKET* (*AllocateDemuxPacket)(void* kodiInstance, int iDataSize); |
| 129 | struct PVR_CODEC (*GetCodecByName)(const void* kodiInstance, const char* strCodecName); | 128 | struct PVR_CODEC (*GetCodecByName)(const void* kodiInstance, const char* strCodecName); |
| 130 | 129 | ||
| 131 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | 130 | //--==----==----==----==----==----==----==----==----==----==----==----==----== |
| @@ -210,7 +209,8 @@ extern "C" | |||
| 210 | const struct EPG_TAG*, | 209 | const struct EPG_TAG*, |
| 211 | struct PVR_NAMED_VALUE*, | 210 | struct PVR_NAMED_VALUE*, |
| 212 | unsigned int*); | 211 | unsigned int*); |
| 213 | enum PVR_ERROR(__cdecl* SetEPGTimeFrame)(const struct AddonInstance_PVR*, int); | 212 | enum PVR_ERROR(__cdecl* SetEPGMaxPastDays)(const struct AddonInstance_PVR*, int); |
| 213 | enum PVR_ERROR(__cdecl* SetEPGMaxFutureDays)(const struct AddonInstance_PVR*, int); | ||
| 214 | enum PVR_ERROR(__cdecl* CallEPGMenuHook)(const struct AddonInstance_PVR*, | 214 | enum PVR_ERROR(__cdecl* CallEPGMenuHook)(const struct AddonInstance_PVR*, |
| 215 | const struct PVR_MENUHOOK*, | 215 | const struct PVR_MENUHOOK*, |
| 216 | const struct EPG_TAG*); | 216 | const struct EPG_TAG*); |
| @@ -295,7 +295,7 @@ extern "C" | |||
| 295 | // Stream demux interface functions | 295 | // Stream demux interface functions |
| 296 | enum PVR_ERROR(__cdecl* GetStreamProperties)(const struct AddonInstance_PVR*, | 296 | enum PVR_ERROR(__cdecl* GetStreamProperties)(const struct AddonInstance_PVR*, |
| 297 | struct PVR_STREAM_PROPERTIES*); | 297 | struct PVR_STREAM_PROPERTIES*); |
| 298 | struct DemuxPacket*(__cdecl* DemuxRead)(const struct AddonInstance_PVR*); | 298 | struct DEMUX_PACKET*(__cdecl* DemuxRead)(const struct AddonInstance_PVR*); |
| 299 | void(__cdecl* DemuxReset)(const struct AddonInstance_PVR*); | 299 | void(__cdecl* DemuxReset)(const struct AddonInstance_PVR*); |
| 300 | void(__cdecl* DemuxAbort)(const struct AddonInstance_PVR*); | 300 | void(__cdecl* DemuxAbort)(const struct AddonInstance_PVR*); |
| 301 | void(__cdecl* DemuxFlush)(const struct AddonInstance_PVR*); | 301 | void(__cdecl* DemuxFlush)(const struct AddonInstance_PVR*); |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h index a24d27f..f8213fb 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channel_groups.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H | 10 | #define C_API_ADDONINSTANCE_PVR_CHANNEL_GROUPS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h index 00daffa..a19fba1 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_CHANNELS_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_CHANNELS_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_CHANNELS_H | 10 | #define C_API_ADDONINSTANCE_PVR_CHANNELS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h index 449000f..a765121 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_defines.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_DEFINES_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_DEFINES_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_DEFINES_H | 10 | #define C_API_ADDONINSTANCE_PVR_DEFINES_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h index e7cdf06..c74a113 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_EDL_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_EDL_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_EDL_H | 10 | #define C_API_ADDONINSTANCE_PVR_EDL_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h index d7512dc..2ed23cd 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_EPG_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_EPG_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_EPG_H | 10 | #define C_API_ADDONINSTANCE_PVR_EPG_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h index e2136f6..b4470bb 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h | |||
| @@ -6,19 +6,12 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_GENERAL_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_GENERAL_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_GENERAL_H | 10 | #define C_API_ADDONINSTANCE_PVR_GENERAL_H |
| 13 | 11 | ||
| 12 | #include "../inputstream/stream_constants.h" | ||
| 14 | #include "pvr_defines.h" | 13 | #include "pvr_defines.h" |
| 15 | 14 | ||
| 16 | #ifdef BUILD_KODI_ADDON | ||
| 17 | #include "../../../InputStreamConstants.h" | ||
| 18 | #else | ||
| 19 | #include "cores/VideoPlayer/Interface/Addon/InputStreamConstants.h" | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #include <stdbool.h> | 15 | #include <stdbool.h> |
| 23 | 16 | ||
| 24 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ | 17 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h index 2ead263..e204311 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_menu_hook.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_MENUHOOK_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_MENUHOOK_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_MENUHOOK_H | 10 | #define C_API_ADDONINSTANCE_PVR_MENUHOOK_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h index 2e2c081..0bbfe57 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_RECORDINGS_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_RECORDINGS_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_RECORDINGS_H | 10 | #define C_API_ADDONINSTANCE_PVR_RECORDINGS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h index 1206c67..aaca30e 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h | |||
| @@ -6,19 +6,12 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_STREAM_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_STREAM_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_STREAM_H | 10 | #define C_API_ADDONINSTANCE_PVR_STREAM_H |
| 13 | 11 | ||
| 12 | #include "../inputstream/demux_packet.h" | ||
| 14 | #include "pvr_defines.h" | 13 | #include "pvr_defines.h" |
| 15 | 14 | ||
| 16 | #ifdef BUILD_KODI_ADDON | ||
| 17 | #include "../../../DemuxPacket.h" | ||
| 18 | #else | ||
| 19 | #include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #include <stdint.h> | 15 | #include <stdint.h> |
| 23 | #include <time.h> | 16 | #include <time.h> |
| 24 | 17 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h index 209726d..a4b53d6 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_timers.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_TIMERS_H | 9 | #ifndef C_API_ADDONINSTANCE_PVR_TIMERS_H |
| 12 | #define C_API_ADDONINSTANCE_PVR_TIMERS_H | 10 | #define C_API_ADDONINSTANCE_PVR_TIMERS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h index 32cf6e1..90f971a 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/screensaver.h | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | 9 | #ifndef C_API_ADDONINSTANCE_SCREENSAVER_H |
| 10 | #define C_API_ADDONINSTANCE_SCREENSAVER_H | ||
| 10 | 11 | ||
| 11 | #include "../addon_base.h" | 12 | #include "../addon_base.h" |
| 12 | 13 | ||
| @@ -73,3 +74,5 @@ extern "C" | |||
| 73 | #ifdef __cplusplus | 74 | #ifdef __cplusplus |
| 74 | } /* extern "C" */ | 75 | } /* extern "C" */ |
| 75 | #endif /* __cplusplus */ | 76 | #endif /* __cplusplus */ |
| 77 | |||
| 78 | #endif /* !C_API_ADDONINSTANCE_SCREENSAVER_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h index a6c3f44..7021c0f 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/vfs.h | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | * See LICENSES/README.md for more information. | 5 | * See LICENSES/README.md for more information. |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #pragma once | ||
| 9 | |||
| 10 | #ifndef C_API_ADDONINSTANCE_VFS_H | 8 | #ifndef C_API_ADDONINSTANCE_VFS_H |
| 11 | #define C_API_ADDONINSTANCE_VFS_H | 9 | #define C_API_ADDONINSTANCE_VFS_H |
| 12 | 10 | ||
| @@ -94,7 +92,7 @@ extern "C" | |||
| 94 | VFS_FILE_HANDLE context); | 92 | VFS_FILE_HANDLE context); |
| 95 | bool(__cdecl* io_control_get_cache_status)(const struct AddonInstance_VFSEntry* instance, | 93 | bool(__cdecl* io_control_get_cache_status)(const struct AddonInstance_VFSEntry* instance, |
| 96 | VFS_FILE_HANDLE context, | 94 | VFS_FILE_HANDLE context, |
| 97 | VFS_CACHE_STATUS_DATA* status); | 95 | struct VFS_CACHE_STATUS_DATA* status); |
| 98 | bool(__cdecl* io_control_set_cache_rate)(const struct AddonInstance_VFSEntry* instance, | 96 | bool(__cdecl* io_control_set_cache_rate)(const struct AddonInstance_VFSEntry* instance, |
| 99 | VFS_FILE_HANDLE context, | 97 | VFS_FILE_HANDLE context, |
| 100 | unsigned int rate); | 98 | unsigned int rate); |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/video_codec.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/video_codec.h new file mode 100644 index 0000000..02d8b06 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/video_codec.h | |||
| @@ -0,0 +1,261 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2017-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef C_API_ADDONINSTANCE_VIDEOCODEC_H | ||
| 10 | #define C_API_ADDONINSTANCE_VIDEOCODEC_H | ||
| 11 | |||
| 12 | #include "../addon_base.h" | ||
| 13 | #include "inputstream/demux_packet.h" | ||
| 14 | #include "inputstream/stream_codec.h" | ||
| 15 | #include "inputstream/stream_crypto.h" | ||
| 16 | |||
| 17 | #ifdef __cplusplus | ||
| 18 | extern "C" | ||
| 19 | { | ||
| 20 | #endif /* __cplusplus */ | ||
| 21 | |||
| 22 | //============================================================================ | ||
| 23 | /// @ingroup cpp_kodi_addon_videocodec_Defs | ||
| 24 | /// @brief Return values used by video decoder interface | ||
| 25 | enum VIDEOCODEC_RETVAL | ||
| 26 | { | ||
| 27 | /// @brief Noop | ||
| 28 | VC_NONE = 0, | ||
| 29 | |||
| 30 | /// @brief An error occured, no other messages will be returned | ||
| 31 | VC_ERROR, | ||
| 32 | |||
| 33 | /// @brief The decoder needs more data | ||
| 34 | VC_BUFFER, | ||
| 35 | |||
| 36 | /// @brief The decoder got a picture | ||
| 37 | VC_PICTURE, | ||
| 38 | |||
| 39 | /// @brief The decoder signals EOF | ||
| 40 | VC_EOF, | ||
| 41 | }; | ||
| 42 | //---------------------------------------------------------------------------- | ||
| 43 | |||
| 44 | //============================================================================ | ||
| 45 | /// @ingroup cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata | ||
| 46 | /// @brief The video stream representations requested by Kodi | ||
| 47 | /// | ||
| 48 | enum VIDEOCODEC_FORMAT | ||
| 49 | { | ||
| 50 | /// @brief Unknown types, this is used to declare the end of a list of | ||
| 51 | /// requested types | ||
| 52 | VIDEOCODEC_FORMAT_UNKNOWN = 0, | ||
| 53 | |||
| 54 | /// @brief YV12 4:2:0 YCrCb planar format | ||
| 55 | VIDEOCODEC_FORMAT_YV12, | ||
| 56 | |||
| 57 | /// @brief These formats are identical to YV12 except that the U and V plane | ||
| 58 | /// order is reversed. | ||
| 59 | VIDEOCODEC_FORMAT_I420, | ||
| 60 | |||
| 61 | /// @brief The maximum value to use in a list. | ||
| 62 | VIDEOCODEC_FORMAT_MAXFORMATS | ||
| 63 | }; | ||
| 64 | //---------------------------------------------------------------------------- | ||
| 65 | |||
| 66 | //============================================================================ | ||
| 67 | /// @ingroup cpp_kodi_addon_videocodec_Defs_VideoCodecInitdata | ||
| 68 | /// @brief Video codec types that can be requested from Kodi | ||
| 69 | /// | ||
| 70 | enum VIDEOCODEC_TYPE | ||
| 71 | { | ||
| 72 | /// @brief Unknown or other type requested | ||
| 73 | /// | ||
| 74 | VIDEOCODEC_UNKNOWN = 0, | ||
| 75 | |||
| 76 | /// @brief [VP8](https://en.wikipedia.org/wiki/VP8) video coding format | ||
| 77 | /// | ||
| 78 | VIDEOCODEC_VP8, | ||
| 79 | |||
| 80 | /// @brief [Advanced Video Coding (AVC)](https://en.wikipedia.org/wiki/Advanced_Video_Coding), | ||
| 81 | /// also referred to as H.264 or [MPEG-4](https://en.wikipedia.org/wiki/MPEG-4) | ||
| 82 | /// Part 10, Advanced Video Coding (MPEG-4 AVC). | ||
| 83 | VIDEOCODEC_H264, | ||
| 84 | |||
| 85 | /// @brief [VP9](https://en.wikipedia.org/wiki/VP9) video coding format\n | ||
| 86 | /// \n | ||
| 87 | /// VP9 is the successor to VP8 and competes mainly with MPEG's | ||
| 88 | /// [High Efficiency Video Coding](https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding) | ||
| 89 | /// (HEVC/H.265). | ||
| 90 | VIDEOCODEC_VP9 | ||
| 91 | }; | ||
| 92 | //---------------------------------------------------------------------------- | ||
| 93 | |||
| 94 | //============================================================================ | ||
| 95 | /// @ingroup cpp_kodi_addon_videocodec_Defs_VIDEOCODEC_PICTURE | ||
| 96 | /// @brief YUV Plane identification pointers | ||
| 97 | /// | ||
| 98 | /// YUV is a color encoding system typically used as part of a color image pipeline. | ||
| 99 | /// | ||
| 100 | /// These are used to access stored data in @ref VIDEOCODEC_PICTURE::planeOffsets | ||
| 101 | /// and @ref VIDEOCODEC_PICTURE::stride. | ||
| 102 | /// | ||
| 103 | enum VIDEOCODEC_PLANE | ||
| 104 | { | ||
| 105 | /// @brief "luminance" component Y (equivalent to grey scale) | ||
| 106 | VIDEOCODEC_PICTURE_Y_PLANE = 0, | ||
| 107 | |||
| 108 | /// @brief "chrominance" component U (blue projection) | ||
| 109 | VIDEOCODEC_PICTURE_U_PLANE, | ||
| 110 | |||
| 111 | /// @brief "chrominance" component V (red projection) | ||
| 112 | VIDEOCODEC_PICTURE_V_PLANE, | ||
| 113 | |||
| 114 | /// @brief The maximum value to use in a list. | ||
| 115 | VIDEOCODEC_PICTURE_MAXPLANES = 3, | ||
| 116 | }; | ||
| 117 | //---------------------------------------------------------------------------- | ||
| 118 | |||
| 119 | //============================================================================ | ||
| 120 | /// @ingroup cpp_kodi_addon_videocodec_Defs_VIDEOCODEC_PICTURE | ||
| 121 | /// @brief Video coded process flags, used to perform special operations in | ||
| 122 | /// stream calls. | ||
| 123 | /// | ||
| 124 | /// These are used to access stored data in @ref VIDEOCODEC_PICTURE::flags. | ||
| 125 | /// | ||
| 126 | /// @note These variables are bit flags which are created using "|" can be used together. | ||
| 127 | /// | ||
| 128 | enum VIDEOCODEC_PICTURE_FLAG | ||
| 129 | { | ||
| 130 | /// @brief Empty and nothing defined | ||
| 131 | VIDEOCODEC_PICTURE_FLAG_NONE = 0, | ||
| 132 | |||
| 133 | /// @brief Drop in decoder | ||
| 134 | VIDEOCODEC_PICTURE_FLAG_DROP = (1 << 0), | ||
| 135 | |||
| 136 | /// @brief Squeeze out pictured without feeding new packets | ||
| 137 | VIDEOCODEC_PICTURE_FLAG_DRAIN = (1 << 1), | ||
| 138 | }; | ||
| 139 | //---------------------------------------------------------------------------- | ||
| 140 | |||
| 141 | //============================================================================ | ||
| 142 | /// @defgroup cpp_kodi_addon_videocodec_Defs_VIDEOCODEC_PICTURE struct VIDEOCODEC_PICTURE | ||
| 143 | /// @ingroup cpp_kodi_addon_videocodec_Defs | ||
| 144 | /// @brief Data structure which is given to the addon when a decoding call is made. | ||
| 145 | /// | ||
| 146 | ///@{ | ||
| 147 | struct VIDEOCODEC_PICTURE | ||
| 148 | { | ||
| 149 | /// @brief The video format declared with @ref VIDEOCODEC_FORMAT and to be | ||
| 150 | /// used on the addon. | ||
| 151 | enum VIDEOCODEC_FORMAT videoFormat; | ||
| 152 | |||
| 153 | /// @brief Video coded process flags, used to perform special operations in | ||
| 154 | /// stream calls. | ||
| 155 | /// | ||
| 156 | /// Possible flags are declared here @ref VIDEOCODEC_PICTURE_FLAGS. | ||
| 157 | uint32_t flags; | ||
| 158 | |||
| 159 | /// @brief Picture width. | ||
| 160 | uint32_t width; | ||
| 161 | |||
| 162 | /// @brief Picture height. | ||
| 163 | uint32_t height; | ||
| 164 | |||
| 165 | /// @brief Data to be decoded in the addon. | ||
| 166 | uint8_t* decodedData; | ||
| 167 | |||
| 168 | /// @brief Size of the data given with @ref decodedData | ||
| 169 | size_t decodedDataSize; | ||
| 170 | |||
| 171 | /// @brief YUV color plane calculation array. | ||
| 172 | /// | ||
| 173 | /// This includes the three values of the YUV and can be identified using | ||
| 174 | /// @ref VIDEOCODEC_PLANE. | ||
| 175 | uint32_t planeOffsets[VIDEOCODEC_PICTURE_MAXPLANES]; | ||
| 176 | |||
| 177 | /// @brief YUV color stride calculation array | ||
| 178 | /// | ||
| 179 | /// This includes the three values of the YUV and can be identified using | ||
| 180 | /// @ref VIDEOCODEC_PLANE. | ||
| 181 | uint32_t stride[VIDEOCODEC_PICTURE_MAXPLANES]; | ||
| 182 | |||
| 183 | /// @brief Picture presentation time stamp (PTS). | ||
| 184 | int64_t pts; | ||
| 185 | |||
| 186 | /// @brief This is used to save the related handle from Kodi. | ||
| 187 | /// | ||
| 188 | /// To handle the input stream buffer, this is given by Kodi using | ||
| 189 | /// @ref kodi::addon::CInstanceVideoCodec::GetFrameBuffer and must be | ||
| 190 | /// released again using @ref kodi::addon::CInstanceVideoCodec::ReleaseFrameBuffer. | ||
| 191 | KODI_HANDLE videoBufferHandle; | ||
| 192 | }; | ||
| 193 | ///@} | ||
| 194 | //---------------------------------------------------------------------------- | ||
| 195 | |||
| 196 | struct VIDEOCODEC_INITDATA | ||
| 197 | { | ||
| 198 | enum VIDEOCODEC_TYPE codec; | ||
| 199 | enum STREAMCODEC_PROFILE codecProfile; | ||
| 200 | enum VIDEOCODEC_FORMAT* videoFormats; | ||
| 201 | uint32_t width; | ||
| 202 | uint32_t height; | ||
| 203 | const uint8_t* extraData; | ||
| 204 | unsigned int extraDataSize; | ||
| 205 | struct STREAM_CRYPTO_SESSION cryptoSession; | ||
| 206 | }; | ||
| 207 | |||
| 208 | // this are properties given to the addon on create | ||
| 209 | // at this time we have no parameters for the addon | ||
| 210 | typedef struct AddonProps_VideoCodec | ||
| 211 | { | ||
| 212 | int dummy; | ||
| 213 | } AddonProps_VideoCodec; | ||
| 214 | |||
| 215 | struct AddonInstance_VideoCodec; | ||
| 216 | typedef struct KodiToAddonFuncTable_VideoCodec | ||
| 217 | { | ||
| 218 | KODI_HANDLE addonInstance; | ||
| 219 | |||
| 220 | //! @brief Opens a codec | ||
| 221 | bool(__cdecl* open)(const struct AddonInstance_VideoCodec* instance, | ||
| 222 | struct VIDEOCODEC_INITDATA* initData); | ||
| 223 | |||
| 224 | //! @brief Reconfigures a codec | ||
| 225 | bool(__cdecl* reconfigure)(const struct AddonInstance_VideoCodec* instance, | ||
| 226 | struct VIDEOCODEC_INITDATA* initData); | ||
| 227 | |||
| 228 | //! @brief Feed codec if requested from GetPicture() (return VC_BUFFER) | ||
| 229 | bool(__cdecl* add_data)(const struct AddonInstance_VideoCodec* instance, | ||
| 230 | const struct DEMUX_PACKET* packet); | ||
| 231 | |||
| 232 | //! @brief Get a decoded picture / request new data | ||
| 233 | enum VIDEOCODEC_RETVAL(__cdecl* get_picture)(const struct AddonInstance_VideoCodec* instance, | ||
| 234 | struct VIDEOCODEC_PICTURE* picture); | ||
| 235 | |||
| 236 | //! @brief Get the name of this video decoder | ||
| 237 | const char*(__cdecl* get_name)(const struct AddonInstance_VideoCodec* instance); | ||
| 238 | |||
| 239 | //! @brief Reset the codec | ||
| 240 | void(__cdecl* reset)(const struct AddonInstance_VideoCodec* instance); | ||
| 241 | } KodiToAddonFuncTable_VideoCodec; | ||
| 242 | |||
| 243 | typedef struct AddonToKodiFuncTable_VideoCodec | ||
| 244 | { | ||
| 245 | KODI_HANDLE kodiInstance; | ||
| 246 | bool (*get_frame_buffer)(void* kodiInstance, struct VIDEOCODEC_PICTURE* picture); | ||
| 247 | void (*release_frame_buffer)(void* kodiInstance, void* buffer); | ||
| 248 | } AddonToKodiFuncTable_VideoCodec; | ||
| 249 | |||
| 250 | typedef struct AddonInstance_VideoCodec | ||
| 251 | { | ||
| 252 | struct AddonProps_VideoCodec* props; | ||
| 253 | struct AddonToKodiFuncTable_VideoCodec* toKodi; | ||
| 254 | struct KodiToAddonFuncTable_VideoCodec* toAddon; | ||
| 255 | } AddonInstance_VideoCodec; | ||
| 256 | |||
| 257 | #ifdef __cplusplus | ||
| 258 | } /* extern "C" */ | ||
| 259 | #endif /* __cplusplus */ | ||
| 260 | |||
| 261 | #endif /* !C_API_ADDONINSTANCE_VIDEOCODEC_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h index 913aad8..616e0a8 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/visualization.h | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | 9 | #ifndef C_API_ADDONINSTANCE_VISUALIZATION_H |
| 10 | #define C_API_ADDONINSTANCE_VISUALIZATION_H | ||
| 10 | 11 | ||
| 11 | #include "../addon_base.h" | 12 | #include "../addon_base.h" |
| 12 | 13 | ||
| @@ -115,3 +116,5 @@ extern "C" | |||
| 115 | #ifdef __cplusplus | 116 | #ifdef __cplusplus |
| 116 | } /* extern "C" */ | 117 | } /* extern "C" */ |
| 117 | #endif /* __cplusplus */ | 118 | #endif /* __cplusplus */ |
| 119 | |||
| 120 | #endif /* !C_API_ADDONINSTANCE_VISUALIZATION_H */ | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h index faa99fa..1153eca 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon_base.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDON_BASE_H | 9 | #ifndef C_API_ADDON_BASE_H |
| 12 | #define C_API_ADDON_BASE_H | 10 | #define C_API_ADDON_BASE_H |
| 13 | 11 | ||
| @@ -27,6 +25,8 @@ | |||
| 27 | #endif | 25 | #endif |
| 28 | #endif | 26 | #endif |
| 29 | 27 | ||
| 28 | // Generic helper definitions for smallest possible alignment | ||
| 29 | //@{ | ||
| 30 | #undef ATTRIBUTE_PACKED | 30 | #undef ATTRIBUTE_PACKED |
| 31 | #undef PRAGMA_PACK_BEGIN | 31 | #undef PRAGMA_PACK_BEGIN |
| 32 | #undef PRAGMA_PACK_END | 32 | #undef PRAGMA_PACK_END |
| @@ -34,18 +34,16 @@ | |||
| 34 | #if defined(__GNUC__) | 34 | #if defined(__GNUC__) |
| 35 | #define ATTRIBUTE_PACKED __attribute__((packed)) | 35 | #define ATTRIBUTE_PACKED __attribute__((packed)) |
| 36 | #define PRAGMA_PACK 0 | 36 | #define PRAGMA_PACK 0 |
| 37 | #define ATTRIBUTE_HIDDEN __attribute__((visibility("hidden"))) | ||
| 38 | #endif | 37 | #endif |
| 39 | 38 | ||
| 40 | #if !defined(ATTRIBUTE_PACKED) | 39 | #if !defined(ATTRIBUTE_PACKED) |
| 41 | #define ATTRIBUTE_PACKED | 40 | #define ATTRIBUTE_PACKED |
| 42 | #define PRAGMA_PACK 1 | 41 | #define PRAGMA_PACK 1 |
| 43 | #endif | 42 | #endif |
| 43 | //@} | ||
| 44 | 44 | ||
| 45 | #if !defined(ATTRIBUTE_HIDDEN) | 45 | // Generic helper definitions for inline function support |
| 46 | #define ATTRIBUTE_HIDDEN | 46 | //@{ |
| 47 | #endif | ||
| 48 | |||
| 49 | #ifdef _MSC_VER | 47 | #ifdef _MSC_VER |
| 50 | #define ATTRIBUTE_FORCEINLINE __forceinline | 48 | #define ATTRIBUTE_FORCEINLINE __forceinline |
| 51 | #elif defined(__GNUC__) | 49 | #elif defined(__GNUC__) |
| @@ -59,6 +57,27 @@ | |||
| 59 | #else | 57 | #else |
| 60 | #define ATTRIBUTE_FORCEINLINE inline | 58 | #define ATTRIBUTE_FORCEINLINE inline |
| 61 | #endif | 59 | #endif |
| 60 | //@} | ||
| 61 | |||
| 62 | // Generic helper definitions for shared library support | ||
| 63 | //@{ | ||
| 64 | #if defined _WIN32 || defined __CYGWIN__ | ||
| 65 | #define ATTRIBUTE_DLL_IMPORT __declspec(dllimport) | ||
| 66 | #define ATTRIBUTE_DLL_EXPORT __declspec(dllexport) | ||
| 67 | #define ATTRIBUTE_DLL_LOCAL | ||
| 68 | #else | ||
| 69 | #if __GNUC__ >= 4 | ||
| 70 | #define ATTRIBUTE_DLL_IMPORT __attribute__ ((visibility ("default"))) | ||
| 71 | #define ATTRIBUTE_DLL_EXPORT __attribute__ ((visibility ("default"))) | ||
| 72 | #define ATTRIBUTE_DLL_LOCAL __attribute__ ((visibility ("hidden"))) | ||
| 73 | #else | ||
| 74 | #define ATTRIBUTE_DLL_IMPORT | ||
| 75 | #define ATTRIBUTE_DLL_EXPORT | ||
| 76 | #define ATTRIBUTE_DLL_LOCAL | ||
| 77 | #endif | ||
| 78 | #endif | ||
| 79 | #define ATTRIBUTE_HIDDEN ATTRIBUTE_DLL_LOCAL // Fallback to old | ||
| 80 | //@} | ||
| 62 | 81 | ||
| 63 | // Hardware specific device context interface | 82 | // Hardware specific device context interface |
| 64 | #define ADDON_HARDWARE_CONTEXT void* | 83 | #define ADDON_HARDWARE_CONTEXT void* |
| @@ -75,9 +94,11 @@ extern "C" | |||
| 75 | #endif /* __cplusplus */ | 94 | #endif /* __cplusplus */ |
| 76 | 95 | ||
| 77 | //============================================================================ | 96 | //============================================================================ |
| 78 | /// @ingroup cpp_kodi_addon_addonbase | 97 | /// @ingroup cpp_kodi_addon_addonbase_Defs |
| 79 | /// @brief Return value of functions in @ref cpp_kodi_addon_addonbase "kodi::addon::CAddonBase" | 98 | /// @defgroup cpp_kodi_addon_addonbase_Defs_ADDON_STATUS enum ADDON_STATUS |
| 80 | /// and associated classes. | 99 | /// @brief <b>Return value of functions in @ref cpp_kodi_addon_addonbase "kodi::addon::CAddonBase" |
| 100 | /// and associated classes</b>\n | ||
| 101 | /// With this Kodi can do any follow-up work or add-on e.g. declare it as defective. | ||
| 81 | /// | 102 | /// |
| 82 | ///@{ | 103 | ///@{ |
| 83 | typedef enum ADDON_STATUS | 104 | typedef enum ADDON_STATUS |
| @@ -211,7 +232,7 @@ extern "C" | |||
| 211 | typedef struct KodiToAddonFuncTable_Addon | 232 | typedef struct KodiToAddonFuncTable_Addon |
| 212 | { | 233 | { |
| 213 | void (*destroy)(); | 234 | void (*destroy)(); |
| 214 | ADDON_STATUS (*get_status)(); | 235 | ADDON_STATUS (*get_status)(); // TODO unused remove by next min version increase |
| 215 | ADDON_STATUS(*create_instance) | 236 | ADDON_STATUS(*create_instance) |
| 216 | (int instanceType, | 237 | (int instanceType, |
| 217 | const char* instanceID, | 238 | const char* instanceID, |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h index 97510f7..dcb004c 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/audio_engine.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_AUDIO_ENGINE_H | 9 | #ifndef C_API_AUDIO_ENGINE_H |
| 12 | #define C_API_AUDIO_ENGINE_H | 10 | #define C_API_AUDIO_ENGINE_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h index 70f9400..4290cb9 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_FILESYSTEM_H | 9 | #ifndef C_API_FILESYSTEM_H |
| 12 | #define C_API_FILESYSTEM_H | 10 | #define C_API_FILESYSTEM_H |
| 13 | 11 | ||
| @@ -106,16 +104,15 @@ extern "C" | |||
| 106 | /// @brief **CURL message types**\n | 104 | /// @brief **CURL message types**\n |
| 107 | /// Used on kodi::vfs::CFile::CURLAddOption(). | 105 | /// Used on kodi::vfs::CFile::CURLAddOption(). |
| 108 | /// | 106 | /// |
| 109 | //@{ | 107 | ///@{ |
| 110 | typedef enum CURLOptiontype | 108 | typedef enum CURLOptiontype |
| 111 | { | 109 | { |
| 112 | /// @brief Set a general option. | 110 | /// @brief Set a general option. |
| 113 | ADDON_CURL_OPTION_OPTION, | 111 | ADDON_CURL_OPTION_OPTION, |
| 114 | 112 | ||
| 115 | /// @brief Set a protocol option. | 113 | /// @brief Set a protocol option.\n |
| 116 | /// | 114 | ///\n |
| 117 | /// The following names for *ADDON_CURL_OPTION_PROTOCOL* are possible: | 115 | /// The following names for *ADDON_CURL_OPTION_PROTOCOL* are possible: |
| 118 | /// | ||
| 119 | /// | Option name | Description | 116 | /// | Option name | Description |
| 120 | /// |------------------------------------:|:-------------------------------- | 117 | /// |------------------------------------:|:-------------------------------- |
| 121 | /// | <b>`accept-charset`</b> | Set the "accept-charset" header | 118 | /// | <b>`accept-charset`</b> | Set the "accept-charset" header |
| @@ -140,7 +137,7 @@ extern "C" | |||
| 140 | /// @brief Add a Header | 137 | /// @brief Add a Header |
| 141 | ADDON_CURL_OPTION_HEADER | 138 | ADDON_CURL_OPTION_HEADER |
| 142 | } CURLOptiontype; | 139 | } CURLOptiontype; |
| 143 | //@} | 140 | ///@} |
| 144 | //---------------------------------------------------------------------------- | 141 | //---------------------------------------------------------------------------- |
| 145 | 142 | ||
| 146 | //============================================================================ | 143 | //============================================================================ |
| @@ -151,7 +148,7 @@ extern "C" | |||
| 151 | /// | 148 | /// |
| 152 | /// Used on kodi::vfs::CFile::GetPropertyValue() and kodi::vfs::CFile::GetPropertyValues(). | 149 | /// Used on kodi::vfs::CFile::GetPropertyValue() and kodi::vfs::CFile::GetPropertyValues(). |
| 153 | /// | 150 | /// |
| 154 | //@{ | 151 | ///@{ |
| 155 | typedef enum FilePropertyTypes | 152 | typedef enum FilePropertyTypes |
| 156 | { | 153 | { |
| 157 | /// @brief Get protocol response line. | 154 | /// @brief Get protocol response line. |
| @@ -167,7 +164,7 @@ extern "C" | |||
| 167 | /// @brief Get file effective URL (last one if redirected). | 164 | /// @brief Get file effective URL (last one if redirected). |
| 168 | ADDON_FILE_PROPERTY_EFFECTIVE_URL | 165 | ADDON_FILE_PROPERTY_EFFECTIVE_URL |
| 169 | } FilePropertyTypes; | 166 | } FilePropertyTypes; |
| 170 | //@} | 167 | ///@} |
| 171 | //---------------------------------------------------------------------------- | 168 | //---------------------------------------------------------------------------- |
| 172 | 169 | ||
| 173 | //}}} | 170 | //}}} |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h index 12afd02..8518a96 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/general.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GENERAL_H | 9 | #ifndef C_API_GENERAL_H |
| 12 | #define C_API_GENERAL_H | 10 | #define C_API_GENERAL_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h index 84fd822..46de262 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/button.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_BUTTON_H | 9 | #ifndef C_API_GUI_CONTROLS_BUTTON_H |
| 12 | #define C_API_GUI_CONTROLS_BUTTON_H | 10 | #define C_API_GUI_CONTROLS_BUTTON_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h index ca38b27..571c7ce 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/edit.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_EDIT_H | 9 | #ifndef C_API_GUI_CONTROLS_EDIT_H |
| 12 | #define C_API_GUI_CONTROLS_EDIT_H | 10 | #define C_API_GUI_CONTROLS_EDIT_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h index fea014b..dab4574 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/fade_label.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_FADE_LABEL_H | 9 | #ifndef C_API_GUI_CONTROLS_FADE_LABEL_H |
| 12 | #define C_API_GUI_CONTROLS_FADE_LABEL_H | 10 | #define C_API_GUI_CONTROLS_FADE_LABEL_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h index 4a46e6d..257dd67 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/image.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_IMAGE_H | 9 | #ifndef C_API_GUI_CONTROLS_IMAGE_H |
| 12 | #define C_API_GUI_CONTROLS_IMAGE_H | 10 | #define C_API_GUI_CONTROLS_IMAGE_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h index d8a9fe4..92af25c 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/label.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_LABEL_H | 9 | #ifndef C_API_GUI_CONTROLS_LABEL_H |
| 12 | #define C_API_GUI_CONTROLS_LABEL_H | 10 | #define C_API_GUI_CONTROLS_LABEL_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h index 88638e0..4f211fd 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/progress.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_PROGRESS_H | 9 | #ifndef C_API_GUI_CONTROLS_PROGRESS_H |
| 12 | #define C_API_GUI_CONTROLS_PROGRESS_H | 10 | #define C_API_GUI_CONTROLS_PROGRESS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h index a672d95..d652e67 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/radio_button.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_RADIO_BUTTON_H | 9 | #ifndef C_API_GUI_CONTROLS_RADIO_BUTTON_H |
| 12 | #define C_API_GUI_CONTROLS_RADIO_BUTTON_H | 10 | #define C_API_GUI_CONTROLS_RADIO_BUTTON_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h index d4053a6..792a8d6 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_RENDERING_H | 9 | #ifndef C_API_GUI_CONTROLS_RENDERING_H |
| 12 | #define C_API_GUI_CONTROLS_RENDERING_H | 10 | #define C_API_GUI_CONTROLS_RENDERING_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h index 2cbc972..4299252 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/settings_slider.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_SETTINGS_SLIDER_H | 9 | #ifndef C_API_GUI_CONTROLS_SETTINGS_SLIDER_H |
| 12 | #define C_API_GUI_CONTROLS_SETTINGS_SLIDER_H | 10 | #define C_API_GUI_CONTROLS_SETTINGS_SLIDER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h index 0a67208..67c6c2f 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/slider.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_SLIDER_H | 9 | #ifndef C_API_GUI_CONTROLS_SLIDER_H |
| 12 | #define C_API_GUI_CONTROLS_SLIDER_H | 10 | #define C_API_GUI_CONTROLS_SLIDER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h index d5e5c86..0373636 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/spin.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_SPIN_H | 9 | #ifndef C_API_GUI_CONTROLS_SPIN_H |
| 12 | #define C_API_GUI_CONTROLS_SPIN_H | 10 | #define C_API_GUI_CONTROLS_SPIN_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h index 276d04c..333689e 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/controls/text_box.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_CONTROLS_TEXT_BOX_H | 9 | #ifndef C_API_GUI_CONTROLS_TEXT_BOX_H |
| 12 | #define C_API_GUI_CONTROLS_TEXT_BOX_H | 10 | #define C_API_GUI_CONTROLS_TEXT_BOX_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h index ec60bc2..f0ea9a2 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/definitions.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DEFINITIONS_H | 9 | #ifndef C_API_GUI_DEFINITIONS_H |
| 12 | #define C_API_GUI_DEFINITIONS_H | 10 | #define C_API_GUI_DEFINITIONS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h index 8bb5370..130d831 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/context_menu.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_CONTEXT_MENU_H | 9 | #ifndef C_API_GUI_DIALOGS_CONTEXT_MENU_H |
| 12 | #define C_API_GUI_DIALOGS_CONTEXT_MENU_H | 10 | #define C_API_GUI_DIALOGS_CONTEXT_MENU_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h index e53588f..0992d5c 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/extended_progress.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H | 9 | #ifndef C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H |
| 12 | #define C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H | 10 | #define C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h index 7ae4fac..ef3945b 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_FILEBROWSER_H | 9 | #ifndef C_API_GUI_DIALOGS_FILEBROWSER_H |
| 12 | #define C_API_GUI_DIALOGS_FILEBROWSER_H | 10 | #define C_API_GUI_DIALOGS_FILEBROWSER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h index fc3c34c..f84dc20 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/keyboard.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_KEYBOARD_H | 9 | #ifndef C_API_GUI_DIALOGS_KEYBOARD_H |
| 12 | #define C_API_GUI_DIALOGS_KEYBOARD_H | 10 | #define C_API_GUI_DIALOGS_KEYBOARD_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h index df23cd7..08aaf25 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/numeric.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_NUMERIC_H | 9 | #ifndef C_API_GUI_DIALOGS_NUMERIC_H |
| 12 | #define C_API_GUI_DIALOGS_NUMERIC_H | 10 | #define C_API_GUI_DIALOGS_NUMERIC_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h index 9f37051..45fe0fc 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/ok.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_OK_H | 9 | #ifndef C_API_GUI_DIALOGS_OK_H |
| 12 | #define C_API_GUI_DIALOGS_OK_H | 10 | #define C_API_GUI_DIALOGS_OK_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h index f1c8972..60a003a 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/progress.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_PROGRESS_H | 9 | #ifndef C_API_GUI_DIALOGS_PROGRESS_H |
| 12 | #define C_API_GUI_DIALOGS_PROGRESS_H | 10 | #define C_API_GUI_DIALOGS_PROGRESS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h index 41ab82f..79635d7 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/select.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_SELECT_H | 9 | #ifndef C_API_GUI_DIALOGS_SELECT_H |
| 12 | #define C_API_GUI_DIALOGS_SELECT_H | 10 | #define C_API_GUI_DIALOGS_SELECT_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h index eb38b0b..4a1cfe6 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/text_viewer.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_TEXT_VIEWER_H | 9 | #ifndef C_API_GUI_DIALOGS_TEXT_VIEWER_H |
| 12 | #define C_API_GUI_DIALOGS_TEXT_VIEWER_H | 10 | #define C_API_GUI_DIALOGS_TEXT_VIEWER_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h index 01ed806..8558acb 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/yes_no.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_DIALOGS_YES_NO_H | 9 | #ifndef C_API_GUI_DIALOGS_YES_NO_H |
| 12 | #define C_API_GUI_DIALOGS_YES_NO_H | 10 | #define C_API_GUI_DIALOGS_YES_NO_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h index d0d256c..6769867 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/general.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_GENERAL_H | 9 | #ifndef C_API_GUI_GENERAL_H |
| 12 | #define C_API_GUI_GENERAL_H | 10 | #define C_API_GUI_GENERAL_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h index 274f3d9..5d62587 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_ACTION_IDS_H | 9 | #ifndef C_API_GUI_ACTION_IDS_H |
| 12 | #define C_API_GUI_ACTION_IDS_H | 10 | #define C_API_GUI_ACTION_IDS_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h index f0c4dc7..d2120ac 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/list_item.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_LIST_ITEM_H | 9 | #ifndef C_API_GUI_LIST_ITEM_H |
| 12 | #define C_API_GUI_LIST_ITEM_H | 10 | #define C_API_GUI_LIST_ITEM_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h index 0f844f5..d7181c0 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/window.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_GUI_WINDOW_H | 9 | #ifndef C_API_GUI_WINDOW_H |
| 12 | #define C_API_GUI_WINDOW_H | 10 | #define C_API_GUI_WINDOW_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h index 88d5231..8bd987b 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_NETWORK_H | 9 | #ifndef C_API_NETWORK_H |
| 12 | #define C_API_NETWORK_H | 10 | #define C_API_NETWORK_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h index 568a2fd..09d8c8c 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/platform/android/system.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * See LICENSES/README.md for more information. | 6 | * See LICENSES/README.md for more information. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_PLATFORM_ANDROID_H | 9 | #ifndef C_API_PLATFORM_ANDROID_H |
| 12 | #define C_API_PLATFORM_ANDROID_H | 10 | #define C_API_PLATFORM_ANDROID_H |
| 13 | 11 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h index 3066b3c..10fa6ef 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h | |||
| @@ -451,7 +451,7 @@ public: | |||
| 451 | /// @param[in] item List item to add | 451 | /// @param[in] item List item to add |
| 452 | /// @param[in] itemPosition [opt] The position for item, default is on end | 452 | /// @param[in] itemPosition [opt] The position for item, default is on end |
| 453 | /// | 453 | /// |
| 454 | void AddListItem(std::shared_ptr<CListItem> item, int itemPosition = -1) | 454 | void AddListItem(const std::shared_ptr<CListItem>& item, int itemPosition = -1) |
| 455 | { | 455 | { |
| 456 | m_interface->kodi_gui->window->add_list_item(m_interface->kodiBase, m_controlHandle, | 456 | m_interface->kodi_gui->window->add_list_item(m_interface->kodiBase, m_controlHandle, |
| 457 | item->m_controlHandle, itemPosition); | 457 | item->m_controlHandle, itemPosition); |
| @@ -465,7 +465,7 @@ public: | |||
| 465 | /// @param[in] item List item to add | 465 | /// @param[in] item List item to add |
| 466 | /// @param[in] itemPosition [opt] The position for item, default is on end | 466 | /// @param[in] itemPosition [opt] The position for item, default is on end |
| 467 | /// | 467 | /// |
| 468 | void AddListItem(const std::string item, int itemPosition = -1) | 468 | void AddListItem(const std::string& item, int itemPosition = -1) |
| 469 | { | 469 | { |
| 470 | m_interface->kodi_gui->window->add_list_item( | 470 | m_interface->kodi_gui->window->add_list_item( |
| 471 | m_interface->kodiBase, m_controlHandle, | 471 | m_interface->kodiBase, m_controlHandle, |
| @@ -492,7 +492,7 @@ public: | |||
| 492 | /// | 492 | /// |
| 493 | /// @param[in] item List item control class to remove | 493 | /// @param[in] item List item control class to remove |
| 494 | /// | 494 | /// |
| 495 | void RemoveListItem(std::shared_ptr<CListItem> item) | 495 | void RemoveListItem(const std::shared_ptr<CListItem>& item) |
| 496 | { | 496 | { |
| 497 | m_interface->kodi_gui->window->remove_list_item(m_interface->kodiBase, m_controlHandle, | 497 | m_interface->kodi_gui->window->remove_list_item(m_interface->kodiBase, m_controlHandle, |
| 498 | item->m_controlHandle); | 498 | item->m_controlHandle); |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/TextViewer.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/TextViewer.h index 42a86f3..dc89740 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/TextViewer.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/TextViewer.h | |||
| @@ -33,7 +33,7 @@ namespace dialogs | |||
| 33 | /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em> | 33 | /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em> |
| 34 | /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>. | 34 | /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>. |
| 35 | /// | 35 | /// |
| 36 | /// It has the header \ref TextViewer.h "#include <kodi/gui/dialogs/TextViewer.h>" | 36 | /// It has the header @ref TextViewer.h "#include <kodi/gui/dialogs/TextViewer.h>" |
| 37 | /// be included to enjoy it. | 37 | /// be included to enjoy it. |
| 38 | /// | 38 | /// |
| 39 | namespace TextViewer | 39 | namespace TextViewer |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h index 4dd97af..5d4e384 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | #ifdef __cplusplus | 11 | #ifdef __cplusplus |
| 12 | 12 | ||
| 13 | #if defined(WIN32) && defined(HAS_ANGLE) | ||
| 14 | |||
| 13 | #include <EGL/egl.h> | 15 | #include <EGL/egl.h> |
| 14 | #include <EGL/eglext.h> | 16 | #include <EGL/eglext.h> |
| 15 | #include <angle_gl.h> | 17 | #include <angle_gl.h> |
| @@ -386,4 +388,8 @@ using CRenderHelper = gl::CGLonDX; | |||
| 386 | } /* namespace gui */ | 388 | } /* namespace gui */ |
| 387 | } /* namespace kodi */ | 389 | } /* namespace kodi */ |
| 388 | 390 | ||
| 391 | #else /* defined(WIN32) && defined(HAS_ANGLE) */ | ||
| 392 | #pragma message ( "WARNING: GLonDX.h only be available on Windows by use of Angle as depend!" ) | ||
| 393 | #endif /* defined(WIN32) && defined(HAS_ANGLE) */ | ||
| 394 | |||
| 389 | #endif /* __cplusplus */ | 395 | #endif /* __cplusplus */ |
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/renderHelper.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/renderHelper.h index dabe101..b08f898 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/gui/renderHelper.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/renderHelper.h | |||
| @@ -67,7 +67,7 @@ inline std::shared_ptr<IRenderHelper> ATTRIBUTE_HIDDEN GetRenderHelper() | |||
| 67 | if (static_cast<CAddonBase*>(CAddonBase::m_interface->addonBase)->m_renderHelper) | 67 | if (static_cast<CAddonBase*>(CAddonBase::m_interface->addonBase)->m_renderHelper) |
| 68 | return static_cast<CAddonBase*>(CAddonBase::m_interface->addonBase)->m_renderHelper; | 68 | return static_cast<CAddonBase*>(CAddonBase::m_interface->addonBase)->m_renderHelper; |
| 69 | 69 | ||
| 70 | const std::shared_ptr<kodi::gui::IRenderHelper> renderHelper(new CRenderHelper()); | 70 | std::shared_ptr<kodi::gui::IRenderHelper> renderHelper(new CRenderHelper()); |
| 71 | if (!renderHelper->Init()) | 71 | if (!renderHelper->Init()) |
| 72 | return nullptr; | 72 | return nullptr; |
| 73 | 73 | ||
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-dev-kit/include/kodi/versions.h index e632f5a..e3431eb 100644 --- a/xbmc/addons/kodi-dev-kit/include/kodi/versions.h +++ b/xbmc/addons/kodi-dev-kit/include/kodi/versions.h | |||
| @@ -8,6 +8,9 @@ | |||
| 8 | 8 | ||
| 9 | #pragma once | 9 | #pragma once |
| 10 | 10 | ||
| 11 | #ifndef KODI_VERSIONS_H | ||
| 12 | #define KODI_VERSIONS_H | ||
| 13 | |||
| 11 | #include <string.h> | 14 | #include <string.h> |
| 12 | 15 | ||
| 13 | #define STR_HELPER(x) #x | 16 | #define STR_HELPER(x) #x |
| @@ -34,7 +37,7 @@ | |||
| 34 | // because cmake uses this area in this form to perform its addon dependency | 37 | // because cmake uses this area in this form to perform its addon dependency |
| 35 | // check. | 38 | // check. |
| 36 | // clang-format off | 39 | // clang-format off |
| 37 | #define ADDON_GLOBAL_VERSION_MAIN "1.2.4" | 40 | #define ADDON_GLOBAL_VERSION_MAIN "1.3.0" |
| 38 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.2.0" | 41 | #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.2.0" |
| 39 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" | 42 | #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" |
| 40 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ | 43 | #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ |
| @@ -104,10 +107,21 @@ | |||
| 104 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_XML_ID "kodi.binary.instance.imagedecoder" | 107 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_XML_ID "kodi.binary.instance.imagedecoder" |
| 105 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_DEPENDS "addon-instance/ImageDecoder.h" | 108 | #define ADDON_INSTANCE_VERSION_IMAGEDECODER_DEPENDS "addon-instance/ImageDecoder.h" |
| 106 | 109 | ||
| 107 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM "2.3.4" | 110 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM "3.0.1" |
| 108 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_MIN "2.3.4" | 111 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_MIN "3.0.1" |
| 109 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream" | 112 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream" |
| 110 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "addon-instance/Inputstream.h" | 113 | #define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "c-api/addon-instance/inputstream.h" \ |
| 114 | "c-api/addon-instance/inputstream/demux_packet.h" \ | ||
| 115 | "c-api/addon-instance/inputstream/stream_codec.h" \ | ||
| 116 | "c-api/addon-instance/inputstream/stream_constants.h" \ | ||
| 117 | "c-api/addon-instance/inputstream/stream_crypto.h" \ | ||
| 118 | "c-api/addon-instance/inputstream/timing_constants.h" \ | ||
| 119 | "addon-instance/Inputstream.h" \ | ||
| 120 | "addon-instance/inputstream/DemuxPacket.h" \ | ||
| 121 | "addon-instance/inputstream/StreamCodec.h" \ | ||
| 122 | "addon-instance/inputstream/StreamConstants.h" \ | ||
| 123 | "addon-instance/inputstream/StreamCrypto.h" \ | ||
| 124 | "addon-instance/inputstream/TimingConstants.h" | ||
| 111 | 125 | ||
| 112 | #define ADDON_INSTANCE_VERSION_PERIPHERAL "2.0.0" | 126 | #define ADDON_INSTANCE_VERSION_PERIPHERAL "2.0.0" |
| 113 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "2.0.0" | 127 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "2.0.0" |
| @@ -115,8 +129,8 @@ | |||
| 115 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ | 129 | #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ |
| 116 | "addon-instance/PeripheralUtils.h" | 130 | "addon-instance/PeripheralUtils.h" |
| 117 | 131 | ||
| 118 | #define ADDON_INSTANCE_VERSION_PVR "7.0.1" | 132 | #define ADDON_INSTANCE_VERSION_PVR "7.1.0" |
| 119 | #define ADDON_INSTANCE_VERSION_PVR_MIN "7.0.0" | 133 | #define ADDON_INSTANCE_VERSION_PVR_MIN "7.1.0" |
| 120 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" | 134 | #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" |
| 121 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "c-api/addon-instance/pvr.h" \ | 135 | #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "c-api/addon-instance/pvr.h" \ |
| 122 | "c-api/addon-instance/pvr/pvr_channel_groups.h" \ | 136 | "c-api/addon-instance/pvr/pvr_channel_groups.h" \ |
| @@ -158,24 +172,30 @@ | |||
| 158 | #define ADDON_INSTANCE_VERSION_VISUALIZATION_DEPENDS "addon-instance/Visualization.h" \ | 172 | #define ADDON_INSTANCE_VERSION_VISUALIZATION_DEPENDS "addon-instance/Visualization.h" \ |
| 159 | "c-api/addon-instance/visualization.h" | 173 | "c-api/addon-instance/visualization.h" |
| 160 | 174 | ||
| 161 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC "1.0.4" | 175 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC "2.0.2" |
| 162 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_MIN "1.0.4" | 176 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_MIN "2.0.1" |
| 163 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_XML_ID "kodi.binary.instance.videocodec" | 177 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_XML_ID "kodi.binary.instance.videocodec" |
| 164 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_DEPENDS "addon-instance/VideoCodec.h" \ | 178 | #define ADDON_INSTANCE_VERSION_VIDEOCODEC_DEPENDS "c-api/addon-instance/video_codec.h" \ |
| 165 | "StreamCodec.h" \ | 179 | "c-api/addon-instance/inputstream/stream_codec.h" \ |
| 166 | "StreamCrypto.h" | 180 | "c-api/addon-instance/inputstream/stream_crypto.h" \ |
| 181 | "addon-instance/VideoCodec.h" \ | ||
| 182 | "addon-instance/inputstream/StreamCodec.h" \ | ||
| 183 | "addon-instance/inputstream/StreamCrypto.h" \ | ||
| 167 | // clang-format on | 184 | // clang-format on |
| 168 | 185 | ||
| 169 | //============================================================================== | 186 | //============================================================================== |
| 170 | /// | 187 | /// @ingroup cpp_kodi_addon_addonbase_Defs |
| 171 | /// @ingroup cpp_kodi_addon_addonbase | 188 | /// @defgroup cpp_kodi_addon_addonbase_Defs_ADDON_TYPE enum ADDON_TYPE |
| 172 | /// The currently available instance types for Kodi add-ons | 189 | /// **The currently available instance types for Kodi add-ons**\n |
| 190 | /// This identifies the associated API part on the interface in Kodi and in the | ||
| 191 | /// addon. | ||
| 173 | /// | 192 | /// |
| 174 | /// \internal | 193 | /// \internal |
| 175 | /// @note For add of new types take a new number on end. To change | 194 | /// @note For add of new types take a new number on end. To change |
| 176 | /// existing numbers can be make problems on already compiled add-ons. | 195 | /// existing numbers can be make problems on already compiled add-ons. |
| 177 | /// \endinternal | 196 | /// \endinternal |
| 178 | /// | 197 | /// |
| 198 | ///@{ | ||
| 179 | typedef enum ADDON_TYPE | 199 | typedef enum ADDON_TYPE |
| 180 | { | 200 | { |
| 181 | /* addon global parts */ | 201 | /* addon global parts */ |
| @@ -192,39 +212,40 @@ typedef enum ADDON_TYPE | |||
| 192 | 212 | ||
| 193 | /* addon type instances */ | 213 | /* addon type instances */ |
| 194 | 214 | ||
| 195 | /// Audio decoder instance, see \ref cpp_kodi_addon_audiodecoder "kodi::addon::CInstanceAudioDecoder" | 215 | /// Audio decoder instance, see @ref cpp_kodi_addon_audiodecoder "kodi::addon::CInstanceAudioDecoder" |
| 196 | ADDON_INSTANCE_AUDIODECODER = 102, | 216 | ADDON_INSTANCE_AUDIODECODER = 102, |
| 197 | 217 | ||
| 198 | /// Audio encoder instance, see \ref cpp_kodi_addon_audioencoder "kodi::addon::CInstanceAudioEncoder" | 218 | /// Audio encoder instance, see @ref cpp_kodi_addon_audioencoder "kodi::addon::CInstanceAudioEncoder" |
| 199 | ADDON_INSTANCE_AUDIOENCODER = 103, | 219 | ADDON_INSTANCE_AUDIOENCODER = 103, |
| 200 | 220 | ||
| 201 | /// Game instance, see \ref cpp_kodi_addon_game "kodi::addon::CInstanceGame" | 221 | /// Game instance, see @ref cpp_kodi_addon_game "kodi::addon::CInstanceGame" |
| 202 | ADDON_INSTANCE_GAME = 104, | 222 | ADDON_INSTANCE_GAME = 104, |
| 203 | 223 | ||
| 204 | /// Input stream instance, see \ref cpp_kodi_addon_inputstream "kodi::addon::CInstanceInputStream" | 224 | /// Input stream instance, see @ref cpp_kodi_addon_inputstream "kodi::addon::CInstanceInputStream" |
| 205 | ADDON_INSTANCE_INPUTSTREAM = 105, | 225 | ADDON_INSTANCE_INPUTSTREAM = 105, |
| 206 | 226 | ||
| 207 | /// Peripheral instance, see \ref cpp_kodi_addon_peripheral "kodi::addon::CInstancePeripheral" | 227 | /// Peripheral instance, see @ref cpp_kodi_addon_peripheral "kodi::addon::CInstancePeripheral" |
| 208 | ADDON_INSTANCE_PERIPHERAL = 106, | 228 | ADDON_INSTANCE_PERIPHERAL = 106, |
| 209 | 229 | ||
| 210 | /// Game instance, see \ref cpp_kodi_addon_pvr "kodi::addon::CInstancePVRClient" | 230 | /// Game instance, see @ref cpp_kodi_addon_pvr "kodi::addon::CInstancePVRClient" |
| 211 | ADDON_INSTANCE_PVR = 107, | 231 | ADDON_INSTANCE_PVR = 107, |
| 212 | 232 | ||
| 213 | /// PVR client instance, see \ref cpp_kodi_addon_screensaver "kodi::addon::CInstanceScreensaver" | 233 | /// PVR client instance, see @ref cpp_kodi_addon_screensaver "kodi::addon::CInstanceScreensaver" |
| 214 | ADDON_INSTANCE_SCREENSAVER = 108, | 234 | ADDON_INSTANCE_SCREENSAVER = 108, |
| 215 | 235 | ||
| 216 | /// Music visualization instance, see \ref cpp_kodi_addon_visualization "kodi::addon::CInstanceVisualization" | 236 | /// Music visualization instance, see @ref cpp_kodi_addon_visualization "kodi::addon::CInstanceVisualization" |
| 217 | ADDON_INSTANCE_VISUALIZATION = 109, | 237 | ADDON_INSTANCE_VISUALIZATION = 109, |
| 218 | 238 | ||
| 219 | /// Virtual Filesystem (VFS) instance, see \ref cpp_kodi_addon_vfs "kodi::addon::CInstanceVFS" | 239 | /// Virtual Filesystem (VFS) instance, see @ref cpp_kodi_addon_vfs "kodi::addon::CInstanceVFS" |
| 220 | ADDON_INSTANCE_VFS = 110, | 240 | ADDON_INSTANCE_VFS = 110, |
| 221 | 241 | ||
| 222 | /// Image Decoder instance, see \ref cpp_kodi_addon_imagedecoder "kodi::addon::CInstanceImageDecoder" | 242 | /// Image Decoder instance, see @ref cpp_kodi_addon_imagedecoder "kodi::addon::CInstanceImageDecoder" |
| 223 | ADDON_INSTANCE_IMAGEDECODER = 111, | 243 | ADDON_INSTANCE_IMAGEDECODER = 111, |
| 224 | 244 | ||
| 225 | /// Video Decoder instance, see \ref cpp_kodi_addon_videocodec "kodi::addon::CInstanceVideoCodec" | 245 | /// Video Decoder instance, see @ref cpp_kodi_addon_videocodec "kodi::addon::CInstanceVideoCodec" |
| 226 | ADDON_INSTANCE_VIDEOCODEC = 112, | 246 | ADDON_INSTANCE_VIDEOCODEC = 112, |
| 227 | } ADDON_TYPE; | 247 | } ADDON_TYPE; |
| 248 | ///@} | ||
| 228 | //------------------------------------------------------------------------------ | 249 | //------------------------------------------------------------------------------ |
| 229 | 250 | ||
| 230 | #ifdef __cplusplus | 251 | #ifdef __cplusplus |
| @@ -490,3 +511,5 @@ inline int GetTypeId(const char* name) | |||
| 490 | } /* namespace kodi */ | 511 | } /* namespace kodi */ |
| 491 | } /* extern "C" */ | 512 | } /* extern "C" */ |
| 492 | #endif | 513 | #endif |
| 514 | |||
| 515 | #endif /* !KODI_VERSIONS_H */ | ||
diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt index f0bec16..3621beb 100644 --- a/xbmc/interfaces/json-rpc/schema/version.txt +++ b/xbmc/interfaces/json-rpc/schema/version.txt | |||
| @@ -1 +1 @@ | |||
| JSONRPC_VERSION 11.15.0 | JSONRPC_VERSION 12.2.1 | ||
