Kodi Development
22.0
for Binary and Script based Add-Ons
Loading...
Searching...
No Matches
stream_crypto.h
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
//============================================================================
33
enum
STREAM_CRYPTO_KEY_SYSTEM
34
{
36
STREAM_CRYPTO_KEY_SYSTEM_NONE
= 0,
37
39
STREAM_CRYPTO_KEY_SYSTEM_WIDEVINE
,
40
42
STREAM_CRYPTO_KEY_SYSTEM_PLAYREADY
,
43
45
STREAM_CRYPTO_KEY_SYSTEM_WISEPLAY
,
46
48
STREAM_CRYPTO_KEY_SYSTEM_CLEARKEY
,
49
51
STREAM_CRYPTO_KEY_SYSTEM_COUNT
52
};
54
//----------------------------------------------------------------------------
55
56
//============================================================================
66
enum
STREAM_CRYPTO_FLAGS
67
{
69
STREAM_CRYPTO_FLAG_NONE
= 0,
70
73
STREAM_CRYPTO_FLAG_SECURE_DECODER
= (1 << 0)
74
};
76
//----------------------------------------------------------------------------
77
78
//============================================================================
85
struct
DEMUX_CRYPTO_INFO
86
{
88
uint16_t
numSubSamples
;
89
91
uint16_t
flags
;
92
95
uint16_t*
clearBytes
;
96
99
uint32_t*
cipherBytes
;
100
102
uint8_t
iv
[16];
103
105
uint8_t
kid
[16];
106
108
uint16_t
mode
;
109
111
uint8_t
cryptBlocks
;
112
114
uint8_t
skipBlocks
;
115
};
117
//----------------------------------------------------------------------------
118
119
// Data to manage stream cryptography
120
struct
STREAM_CRYPTO_SESSION
121
{
122
// keysystem for encrypted media, STREAM_CRYPTO_KEY_SYSTEM_NONE for unencrypted
123
// media.
124
//
125
// See STREAM_CRYPTO_KEY_SYSTEM for available options.
126
enum
STREAM_CRYPTO_KEY_SYSTEM
keySystem;
127
128
// Flags to use special conditions, see STREAM_CRYPTO_FLAGS for available flags.
129
uint8_t flags;
130
131
// The crypto session key id.
132
char
sessionId[256];
133
};
135
//----------------------------------------------------------------------------
136
137
#ifdef __cplusplus
138
}
/* extern "C" */
139
#endif
/* __cplusplus */
140
141
#endif
/* !C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H */
DEMUX_CRYPTO_INFO::kid
uint8_t kid[16]
Key id.
Definition
stream_crypto.h:105
DEMUX_CRYPTO_INFO::flags
uint16_t flags
Flags for later use.
Definition
stream_crypto.h:91
DEMUX_CRYPTO_INFO::cipherBytes
uint32_t * cipherBytes
numSubSamples uint32_t's which define the size of cipher size of a subsample.
Definition
stream_crypto.h:99
DEMUX_CRYPTO_INFO::numSubSamples
uint16_t numSubSamples
Number of subsamples.
Definition
stream_crypto.h:88
DEMUX_CRYPTO_INFO::skipBlocks
uint8_t skipBlocks
Skip blocks - number of blocks to skip in sample encryption pattern.
Definition
stream_crypto.h:114
DEMUX_CRYPTO_INFO::cryptBlocks
uint8_t cryptBlocks
Crypt blocks - number of blocks to encrypt in sample encryption pattern.
Definition
stream_crypto.h:111
DEMUX_CRYPTO_INFO::iv
uint8_t iv[16]
Initialization vector.
Definition
stream_crypto.h:102
DEMUX_CRYPTO_INFO::clearBytes
uint16_t * clearBytes
numSubSamples uint16_t's which define the size of clear size of a subsample.
Definition
stream_crypto.h:95
DEMUX_CRYPTO_INFO::mode
uint16_t mode
Encryption mode.
Definition
stream_crypto.h:108
DEMUX_CRYPTO_INFO
Definition
stream_crypto.h:86
STREAM_CRYPTO_FLAGS
STREAM_CRYPTO_FLAGS
Definition
stream_crypto.h:67
STREAM_CRYPTO_FLAG_SECURE_DECODER
@ STREAM_CRYPTO_FLAG_SECURE_DECODER
0000 0001 - Is set in flags if decoding has to be done in trusted execution environment (TEE).
Definition
stream_crypto.h:73
STREAM_CRYPTO_FLAG_NONE
@ STREAM_CRYPTO_FLAG_NONE
0000 0000 - Empty to set if nothing is used.
Definition
stream_crypto.h:69
STREAM_CRYPTO_KEY_SYSTEM
STREAM_CRYPTO_KEY_SYSTEM
Definition
stream_crypto.h:34
STREAM_CRYPTO_KEY_SYSTEM_CLEARKEY
@ STREAM_CRYPTO_KEY_SYSTEM_CLEARKEY
4 - To use ClearKey for processing
Definition
stream_crypto.h:48
STREAM_CRYPTO_KEY_SYSTEM_WIDEVINE
@ STREAM_CRYPTO_KEY_SYSTEM_WIDEVINE
1 - To use Widevine for processing
Definition
stream_crypto.h:39
STREAM_CRYPTO_KEY_SYSTEM_WISEPLAY
@ STREAM_CRYPTO_KEY_SYSTEM_WISEPLAY
3 - To use Wiseplay for processing
Definition
stream_crypto.h:45
STREAM_CRYPTO_KEY_SYSTEM_NONE
@ STREAM_CRYPTO_KEY_SYSTEM_NONE
0 - If no path is to be used, this is the default
Definition
stream_crypto.h:36
STREAM_CRYPTO_KEY_SYSTEM_PLAYREADY
@ STREAM_CRYPTO_KEY_SYSTEM_PLAYREADY
2 - To use Playready for processing
Definition
stream_crypto.h:42
STREAM_CRYPTO_KEY_SYSTEM_COUNT
@ STREAM_CRYPTO_KEY_SYSTEM_COUNT
5 - The maximum value to use in a list.
Definition
stream_crypto.h:51
STREAM_CRYPTO_SESSION
Definition
stream_crypto.h:121
include
kodi
c-api
addon-instance
inputstream
stream_crypto.h
Generated by
1.12.0