summaryrefslogtreecommitdiffstats
path: root/xbmc/cores/VideoPlayer/Interface/Addon
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/cores/VideoPlayer/Interface/Addon')
-rw-r--r--xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h5
-rw-r--r--xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h47
-rw-r--r--xbmc/cores/VideoPlayer/Interface/Addon/InputStreamConstants.h50
-rw-r--r--xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h6
4 files changed, 88 insertions, 20 deletions
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 @@
13 13
14//CryptoSession is usually obtained once per stream, but could change if an key expires 14//CryptoSession is usually obtained once per stream, but could change if an key expires
15 15
16enum CryptoSessionSystem :uint8_t 16enum CryptoSessionSystem : uint8_t
17{ 17{
18 CRYPTO_SESSION_SYSTEM_NONE, 18 CRYPTO_SESSION_SYSTEM_NONE,
19 CRYPTO_SESSION_SYSTEM_WIDEVINE, 19 CRYPTO_SESSION_SYSTEM_WIDEVINE,
20 CRYPTO_SESSION_SYSTEM_PLAYREADY 20 CRYPTO_SESSION_SYSTEM_PLAYREADY,
21 CRYPTO_SESSION_SYSTEM_WISEPLAY,
21}; 22};
22 23
23struct DemuxCryptoSession 24struct 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 @@
9#pragma once 9#pragma once
10 10
11#include "TimingConstants.h" 11#include "TimingConstants.h"
12
12#include <cstdint> 13#include <cstdint>
13#include <memory> 14#include <memory>
14 15
15#define DMX_SPECIALID_STREAMINFO -10 16#define DMX_SPECIALID_STREAMINFO -10
16#define DMX_SPECIALID_STREAMCHANGE -11 17#define DMX_SPECIALID_STREAMCHANGE -11
17 18
18struct DemuxCryptoInfo; 19#ifdef __cplusplus
19 20extern "C"
20typedef struct DemuxPacket
21{ 21{
22 DemuxPacket() = default; 22#endif /* __cplusplus */
23
24 struct DemuxCryptoInfo;
25
26 typedef struct DemuxPacket
27 {
28 DemuxPacket() = default;
29
30 uint8_t* pData = nullptr;
31 int iSize = 0;
32 int iStreamId = -1;
33 int64_t demuxerId = -1; // id of the demuxer that created the packet
34 int iGroupId =
35 -1; // the group this data belongs to, used to group data from different streams together
23 36
24 uint8_t *pData = nullptr; 37 void* pSideData = nullptr;
25 int iSize = 0; 38 int iSideDataElems = 0;
26 int iStreamId = -1;
27 int64_t demuxerId = -1; // id of the demuxer that created the packet
28 int iGroupId = -1; // the group this data belongs to, used to group data from different streams together
29 39
30 void *pSideData = nullptr; 40 double pts = DVD_NOPTS_VALUE;
31 int iSideDataElems = 0; 41 double dts = DVD_NOPTS_VALUE;
42 double duration = 0; // duration in DVD_TIME_BASE if available
43 int dispTime = 0;
44 bool recoveryPoint = false;
32 45
33 double pts = DVD_NOPTS_VALUE; 46 std::shared_ptr<DemuxCryptoInfo> cryptoInfo;
34 double dts = DVD_NOPTS_VALUE; 47 } DemuxPacket;
35 double duration = 0; // duration in DVD_TIME_BASE if available
36 int dispTime = 0;
37 bool recoveryPoint = false;
38 48
39 std::shared_ptr<DemuxCryptoInfo> cryptoInfo; 49#ifdef __cplusplus
40} DemuxPacket; 50} /* extern "C" */
51#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 @@
1/*
2 * Copyright (C) 2017-2019 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/*!
12 * @brief the name of the inputstream add-on that should be used by Kodi to
13 * play the stream denoted by STREAM_PROPERTY_STREAMURL. Leave blank to use
14 * Kodi's built-in playing capabilities or to allow ffmpeg to handle directly
15 * set to STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG.
16 */
17#define STREAM_PROPERTY_INPUTSTREAM "inputstream"
18
19/*!
20 * @brief Identification string for an input stream.
21 *
22 * This value can be used in addition to @ref STREAM_PROPERTY_INPUTSTREAM. It is
23 * used to provide the respective inpustream addon with additional
24 * identification.
25 *
26 * The difference between this and other stream properties is that it is also
27 * passed in the associated @ref kodi::addon::CAddonBase::CreateInstance call.
28 *
29 * This makes it possible to select different processing classes within the
30 * associated add-on.
31 */
32#define STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID "inputstream-instance-id"
33
34/*!
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 */
39#define STREAM_PROPERTY_ISREALTIMESTREAM "isrealtimestream"
40
41/*!
42 * @brief special value for STREAM_PROPERTY_INPUTSTREAM to use
43 * ffmpeg to directly play a stream URL.
44 */
45#define STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG "inputstream.ffmpeg"
46
47/*!
48 * @brief Max number of properties that can be sent to an Inputstream addon
49 */
50#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 @@
11#define DVD_TIME_BASE 1000000 11#define DVD_TIME_BASE 1000000
12#define DVD_NOPTS_VALUE 0xFFF0000000000000 12#define DVD_NOPTS_VALUE 0xFFF0000000000000
13 13
14#ifdef __cplusplus
14constexpr int DVD_TIME_TO_MSEC(double x) { return static_cast<int>(x * 1000 / DVD_TIME_BASE); } 15constexpr int DVD_TIME_TO_MSEC(double x) { return static_cast<int>(x * 1000 / DVD_TIME_BASE); }
15constexpr double DVD_SEC_TO_TIME(double x) { return x * DVD_TIME_BASE; } 16constexpr double DVD_SEC_TO_TIME(double x) { return x * DVD_TIME_BASE; }
16constexpr double DVD_MSEC_TO_TIME(double x) { return x * DVD_TIME_BASE / 1000; } 17constexpr double DVD_MSEC_TO_TIME(double x) { return x * DVD_TIME_BASE / 1000; }
18#else
19#define DVD_TIME_TO_MSEC(x) ((int)((double)(x) * 1000 / DVD_TIME_BASE))
20#define DVD_SEC_TO_TIME(x) ((double)(x) * DVD_TIME_BASE)
21#define DVD_MSEC_TO_TIME(x) ((double)(x) * DVD_TIME_BASE / 1000)
22#endif
17 23
18#define DVD_PLAYSPEED_PAUSE 0 // frame stepping 24#define DVD_PLAYSPEED_PAUSE 0 // frame stepping
19#define DVD_PLAYSPEED_NORMAL 1000 25#define DVD_PLAYSPEED_NORMAL 1000