From 4830f27a40323fe859dc166337a2b861877b7121 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 1 Jan 2018 13:40:09 +0100 Subject: sync with upstream --- .../include/kodi/addon-instance/Inputstream.h | 50 +++++++++++++++++----- 1 file changed, 39 insertions(+), 11 deletions(-) (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h') diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h index 8db17c0..08d01ad 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h @@ -29,9 +29,9 @@ #include "../StreamCodec.h" #ifdef BUILD_KODI_ADDON -#include "../DVDDemuxPacket.h" +#include "../DemuxPacket.h" #else -#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" +#include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" #endif namespace kodi { namespace addon { class CInstanceInputStream; }} @@ -41,7 +41,7 @@ extern "C" { /*! * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. */ - typedef struct INPUTSTREAM_CAPABILITIES + struct INPUTSTREAM_CAPABILITIES { enum MASKTYPE: uint32_t { @@ -58,17 +58,20 @@ extern "C" { SUPPORTS_SEEK = (1 << 3), /// supports pause - SUPPORTS_PAUSE = (1 << 4) + SUPPORTS_PAUSE = (1 << 4), + + /// supports interface ITime + SUPPORTS_ITIME = (1 << 5) }; /// set of supported capabilities uint32_t m_mask; - } INPUTSTREAM_CAPABILITIES; + }; /*! * @brief structure of key/value pairs passed to addon on Open() */ - typedef struct INPUTSTREAM + struct INPUTSTREAM { static const unsigned int MAX_INFO_COUNT = 8; @@ -83,22 +86,22 @@ extern "C" { const char *m_libFolder; const char *m_profileFolder; - } INPUTSTREAM; + }; /*! * @brief Array of stream IDs */ - typedef struct INPUTSTREAM_IDS + struct INPUTSTREAM_IDS { static const unsigned int MAX_STREAM_COUNT = 32; unsigned int m_streamCount; unsigned int m_streamIds[MAX_STREAM_COUNT]; - } INPUTSTREAM_IDS; + }; /*! * @brief stream properties */ - typedef struct INPUTSTREAM_INFO + struct INPUTSTREAM_INFO { enum STREAM_TYPE { @@ -130,6 +133,7 @@ extern "C" { }; uint32_t m_flags; + char m_name[256]; /*!< @brief (optinal) name of the stream, \0 for default handling */ char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ STREAMCODEC_PROFILE m_codecProfile; /*!< @brief (optional) the profile of the codec */ @@ -153,7 +157,15 @@ extern "C" { unsigned int m_BlockAlign; CRYPTO_INFO m_cryptoInfo; - } INPUTSTREAM_INFO; + }; + + struct INPUTSTREAM_TIMES + { + time_t startTime; + double ptsStart; + double ptsBegin; + double ptsEnd; + }; /*! * @brief Structure to transfer the methods from xbmc_inputstream_dll.h to XBMC @@ -201,6 +213,9 @@ extern "C" { int (__cdecl* get_total_time)(const AddonInstance_InputStream* instance); int (__cdecl* get_time)(const AddonInstance_InputStream* instance); + // ITime + bool(__cdecl* get_times)(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES *times); + // IPosTime bool (__cdecl* pos_time)(const AddonInstance_InputStream* instance, int ms); @@ -363,6 +378,12 @@ namespace addon */ virtual int GetTime() { return -1; } + /*! + * Get current timing values in PTS scale + * @remarks + */ + virtual bool GetTimes(INPUTSTREAM_TIMES ×) { return false; } + /*! * Positions inputstream to playing time given in ms * @remarks @@ -483,6 +504,8 @@ namespace addon m_instanceData->toAddon.get_total_time = ADDON_GetTotalTime; m_instanceData->toAddon.get_time = ADDON_GetTime; + m_instanceData->toAddon.get_times = ADDON_GetTimes; + m_instanceData->toAddon.pos_time = ADDON_PosTime; m_instanceData->toAddon.can_pause_stream = ADDON_CanPauseStream; @@ -580,6 +603,11 @@ namespace addon return instance->toAddon.addonInstance->GetTime(); } + // ITime + inline static bool ADDON_GetTimes(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES *times) + { + return instance->toAddon.addonInstance->GetTimes(*times); + } // IPosTime inline static bool ADDON_PosTime(const AddonInstance_InputStream* instance, int ms) -- cgit v1.2.3