From 4c3251ec645c8b71820dab7e51e612e5919d4e75 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 23 Jul 2017 16:59:43 +0200 Subject: sync with upstream --- .../cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h | 2 +- xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h | 166 +++++++++++---------- 2 files changed, 86 insertions(+), 82 deletions(-) (limited to 'xbmc/cores/VideoPlayer') 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; typedef struct DemuxPacket { - DemuxPacket() {}; + DemuxPacket() = default; DemuxPacket(unsigned char *pData, int const iSize, double const pts, double const dts) : 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 @@ -/* -* Copyright (C) 2005-2016 Team XBMC -* http://xbmc.org -* -* This Program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2, or (at your option) -* any later version. -* -* This Program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with XBMC; see the file COPYING. If not, see -* . -* -*/ - -#pragma once - -#include -#include - -//CryptoSession is usually obtained once per stream, but could change if an key expires - -enum CryptoSessionSystem :uint16_t -{ - CRYPTO_SESSION_SYSTEM_NONE, - CRYPTO_SESSION_SYSTEM_WIDEVINE, - CRYPTO_SESSION_SYSTEM_PLAYREADY -}; - -struct DemuxCryptoSession -{ - DemuxCryptoSession(const CryptoSessionSystem sys, const uint16_t sSize, const char *sData) - : sessionId(new char[sSize]) - , sessionIdSize(sSize) - , keySystem(sys) - { - memcpy(sessionId, sData, sSize); - }; - - ~DemuxCryptoSession() - { - delete[] sessionId; - } - - // encryped stream infos - char * sessionId; - uint16_t sessionIdSize; - CryptoSessionSystem keySystem; -}; - -//CryptoInfo stores the information to decrypt a sample - -struct DemuxCryptoInfo -{ - DemuxCryptoInfo(const unsigned int numSubs) - : numSubSamples(numSubs) - , flags(0) - , clearBytes(new uint16_t[numSubs]) - , cipherBytes(new uint32_t[numSubs]) - {}; - - ~DemuxCryptoInfo() - { - delete[] clearBytes; - delete[] cipherBytes; - } - - uint16_t numSubSamples; //number of subsamples - uint16_t flags; //flags for later use - - uint16_t *clearBytes; // numSubSamples uint16_t's wich define the size of clear size of a subsample - uint32_t *cipherBytes; // numSubSamples uint32_t's wich define the size of cipher size of a subsample - - uint8_t iv[16]; // initialization vector - uint8_t kid[16]; // key id -}; +/* +* Copyright (C) 2005-2016 Team XBMC +* http://xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, see +* . +* +*/ + +#pragma once + +#include +#include + +//CryptoSession is usually obtained once per stream, but could change if an key expires + +enum CryptoSessionSystem :uint8_t +{ + CRYPTO_SESSION_SYSTEM_NONE, + CRYPTO_SESSION_SYSTEM_WIDEVINE, + CRYPTO_SESSION_SYSTEM_PLAYREADY +}; + +struct DemuxCryptoSession +{ + DemuxCryptoSession(const CryptoSessionSystem sys, const uint16_t sSize, const char *sData, const uint8_t flags) + : sessionId(new char[sSize]) + , sessionIdSize(sSize) + , keySystem(sys) + , flags(flags) + { + memcpy(sessionId, sData, sSize); + }; + + ~DemuxCryptoSession() + { + delete[] sessionId; + } + + // encryped stream infos + char * sessionId; + uint16_t sessionIdSize; + CryptoSessionSystem keySystem; + + static const uint8_t FLAG_SECURE_DECODER = 1; + uint8_t flags; +}; + +//CryptoInfo stores the information to decrypt a sample + +struct DemuxCryptoInfo +{ + DemuxCryptoInfo(const unsigned int numSubs) + : numSubSamples(numSubs) + , flags(0) + , clearBytes(new uint16_t[numSubs]) + , cipherBytes(new uint32_t[numSubs]) + {}; + + ~DemuxCryptoInfo() + { + delete[] clearBytes; + delete[] cipherBytes; + } + + uint16_t numSubSamples; //number of subsamples + uint16_t flags; //flags for later use + + uint16_t *clearBytes; // numSubSamples uint16_t's wich define the size of clear size of a subsample + uint32_t *cipherBytes; // numSubSamples uint32_t's wich define the size of cipher size of a subsample + + uint8_t iv[16]; // initialization vector + uint8_t kid[16]; // key id +}; -- cgit v1.2.3