From 5f8335c1e49ce108ef3481863833c98efa00411b Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 2 Jul 2020 23:09:26 +0200 Subject: sync with upstream --- .../VideoPlayer/Interface/Addon/DemuxCrypto.h | 5 ++- .../VideoPlayer/Interface/Addon/DemuxPacket.h | 47 ++++++++++++-------- .../Interface/Addon/InputStreamConstants.h | 50 ++++++++++++++++++++++ .../VideoPlayer/Interface/Addon/TimingConstants.h | 6 +++ 4 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 xbmc/cores/VideoPlayer/Interface/Addon/InputStreamConstants.h (limited to 'xbmc/cores/VideoPlayer/Interface') diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h index b48ef34..416e159 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h @@ -13,11 +13,12 @@ //CryptoSession is usually obtained once per stream, but could change if an key expires -enum CryptoSessionSystem :uint8_t +enum CryptoSessionSystem : uint8_t { CRYPTO_SESSION_SYSTEM_NONE, CRYPTO_SESSION_SYSTEM_WIDEVINE, - CRYPTO_SESSION_SYSTEM_PLAYREADY + CRYPTO_SESSION_SYSTEM_PLAYREADY, + CRYPTO_SESSION_SYSTEM_WISEPLAY, }; struct DemuxCryptoSession diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h index f8ceab2..6da4838 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h @@ -9,32 +9,43 @@ #pragma once #include "TimingConstants.h" + #include #include #define DMX_SPECIALID_STREAMINFO -10 #define DMX_SPECIALID_STREAMCHANGE -11 -struct DemuxCryptoInfo; - -typedef struct DemuxPacket +#ifdef __cplusplus +extern "C" { - DemuxPacket() = default; +#endif /* __cplusplus */ + + struct DemuxCryptoInfo; + + typedef struct DemuxPacket + { + DemuxPacket() = default; + + uint8_t* pData = nullptr; + int iSize = 0; + int iStreamId = -1; + int64_t demuxerId = -1; // id of the demuxer that created the packet + int iGroupId = + -1; // the group this data belongs to, used to group data from different streams together - uint8_t *pData = nullptr; - int iSize = 0; - int iStreamId = -1; - int64_t demuxerId = -1; // id of the demuxer that created the packet - int iGroupId = -1; // the group this data belongs to, used to group data from different streams together + void* pSideData = nullptr; + int iSideDataElems = 0; - void *pSideData = nullptr; - int iSideDataElems = 0; + double pts = DVD_NOPTS_VALUE; + double dts = DVD_NOPTS_VALUE; + double duration = 0; // duration in DVD_TIME_BASE if available + int dispTime = 0; + bool recoveryPoint = false; - double pts = DVD_NOPTS_VALUE; - double dts = DVD_NOPTS_VALUE; - double duration = 0; // duration in DVD_TIME_BASE if available - int dispTime = 0; - bool recoveryPoint = false; + std::shared_ptr cryptoInfo; + } DemuxPacket; - std::shared_ptr cryptoInfo; -} DemuxPacket; +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/InputStreamConstants.h b/xbmc/cores/VideoPlayer/Interface/Addon/InputStreamConstants.h new file mode 100644 index 0000000..ff4dbea --- /dev/null +++ b/xbmc/cores/VideoPlayer/Interface/Addon/InputStreamConstants.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2017-2019 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +/*! + * @brief the name of the inputstream add-on that should be used by Kodi to + * play the stream denoted by STREAM_PROPERTY_STREAMURL. Leave blank to use + * Kodi's built-in playing capabilities or to allow ffmpeg to handle directly + * set to STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG. + */ +#define STREAM_PROPERTY_INPUTSTREAM "inputstream" + +/*! + * @brief Identification string for an input stream. + * + * This value can be used in addition to @ref STREAM_PROPERTY_INPUTSTREAM. It is + * used to provide the respective inpustream addon with additional + * identification. + * + * The difference between this and other stream properties is that it is also + * passed in the associated @ref kodi::addon::CAddonBase::CreateInstance call. + * + * This makes it possible to select different processing classes within the + * associated add-on. + */ +#define STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID "inputstream-instance-id" + +/*! + * @brief "true" to denote that the stream that should be played is a + * realtime stream. Any other value indicates that this is not a realtime + * stream. + */ +#define STREAM_PROPERTY_ISREALTIMESTREAM "isrealtimestream" + +/*! + * @brief special value for STREAM_PROPERTY_INPUTSTREAM to use + * ffmpeg to directly play a stream URL. + */ +#define STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG "inputstream.ffmpeg" + +/*! + * @brief Max number of properties that can be sent to an Inputstream addon + */ +#define STREAM_MAX_PROPERTY_COUNT 30 diff --git a/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h b/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h index 0672002..c94e255 100644 --- a/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h +++ b/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h @@ -11,9 +11,15 @@ #define DVD_TIME_BASE 1000000 #define DVD_NOPTS_VALUE 0xFFF0000000000000 +#ifdef __cplusplus constexpr int DVD_TIME_TO_MSEC(double x) { return static_cast(x * 1000 / DVD_TIME_BASE); } constexpr double DVD_SEC_TO_TIME(double x) { return x * DVD_TIME_BASE; } constexpr double DVD_MSEC_TO_TIME(double x) { return x * DVD_TIME_BASE / 1000; } +#else +#define DVD_TIME_TO_MSEC(x) ((int)((double)(x) * 1000 / DVD_TIME_BASE)) +#define DVD_SEC_TO_TIME(x) ((double)(x) * DVD_TIME_BASE) +#define DVD_MSEC_TO_TIME(x) ((double)(x) * DVD_TIME_BASE / 1000) +#endif #define DVD_PLAYSPEED_PAUSE 0 // frame stepping #define DVD_PLAYSPEED_NORMAL 1000 -- cgit v1.2.3