summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2021-03-04 23:36:40 +0100
committermanuel <manuel@mausz.at>2021-03-04 23:36:40 +0100
commit3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f (patch)
tree921f4829b32126f80f9113c124f2e14c0ebce8d9 /xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h
parentbe933ef2241d79558f91796cc5b3a161f72ebf9c (diff)
downloadkodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.tar.gz
kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.tar.bz2
kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.zip
sync with upstreamMatrix
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h')
-rw-r--r--xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/inputstream/stream_crypto.h129
1 files changed, 129 insertions, 0 deletions
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
18extern "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 */