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