summaryrefslogtreecommitdiffstats
path: root/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2018-01-01 16:26:10 +0100
committermanuel <manuel@mausz.at>2018-01-01 16:26:10 +0100
commita51f51db67e3eab80ac2ed28d403a6d77f7acc45 (patch)
tree72e41d0283d3db549ea5a22e3c9063ef2a971d54 /xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
parent4830f27a40323fe859dc166337a2b861877b7121 (diff)
downloadkodi-pvr-build-a51f51db67e3eab80ac2ed28d403a6d77f7acc45.tar.gz
kodi-pvr-build-a51f51db67e3eab80ac2ed28d403a6d77f7acc45.tar.bz2
kodi-pvr-build-a51f51db67e3eab80ac2ed28d403a6d77f7acc45.zip
sync with upstream
Diffstat (limited to 'xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h')
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h85
1 files changed, 0 insertions, 85 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
deleted file mode 100644
index a32f4fe..0000000
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2* Copyright (C) 2005-2016 Team XBMC
3* http://xbmc.org
4*
5* This Program is free software; you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation; either version 2, or (at your option)
8* any later version.
9*
10* This Program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with XBMC; see the file COPYING. If not, see
17* <http://www.gnu.org/licenses/>.
18*
19*/
20
21#pragma once
22
23#include <inttypes.h>
24#include <string.h>
25
26//CryptoSession is usually obtained once per stream, but could change if an key expires
27
28enum CryptoSessionSystem :uint8_t
29{
30 CRYPTO_SESSION_SYSTEM_NONE,
31 CRYPTO_SESSION_SYSTEM_WIDEVINE,
32 CRYPTO_SESSION_SYSTEM_PLAYREADY
33};
34
35struct DemuxCryptoSession
36{
37 DemuxCryptoSession(const CryptoSessionSystem sys, const uint16_t sSize, const char *sData, const uint8_t flags)
38 : sessionId(new char[sSize])
39 , sessionIdSize(sSize)
40 , keySystem(sys)
41 , flags(flags)
42 {
43 memcpy(sessionId, sData, sSize);
44 };
45
46 ~DemuxCryptoSession()
47 {
48 delete[] sessionId;
49 }
50
51 // encryped stream infos
52 char * sessionId;
53 uint16_t sessionIdSize;
54 CryptoSessionSystem keySystem;
55
56 static const uint8_t FLAG_SECURE_DECODER = 1;
57 uint8_t flags;
58};
59
60//CryptoInfo stores the information to decrypt a sample
61
62struct DemuxCryptoInfo
63{
64 explicit DemuxCryptoInfo(const unsigned int numSubs)
65 : numSubSamples(numSubs)
66 , flags(0)
67 , clearBytes(new uint16_t[numSubs])
68 , cipherBytes(new uint32_t[numSubs])
69 {};
70
71 ~DemuxCryptoInfo()
72 {
73 delete[] clearBytes;
74 delete[] cipherBytes;
75 }
76
77 uint16_t numSubSamples; //number of subsamples
78 uint16_t flags; //flags for later use
79
80 uint16_t *clearBytes; // numSubSamples uint16_t's wich define the size of clear size of a subsample
81 uint32_t *cipherBytes; // numSubSamples uint32_t's wich define the size of cipher size of a subsample
82
83 uint8_t iv[16]; // initialization vector
84 uint8_t kid[16]; // key id
85};