summaryrefslogtreecommitdiffstats
path: root/xbmc/cores
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
committermanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
commitf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch)
treed8de60fc7e17edeb6f0921726c038ee54b281445 /xbmc/cores
parentae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff)
downloadkodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip
sync with upstream
Diffstat (limited to 'xbmc/cores')
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h16
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h81
-rw-r--r--xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h36
3 files changed, 96 insertions, 37 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
index 4f47118..a769788 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
@@ -21,13 +21,25 @@
21 */ 21 */
22 22
23#include <cstdint> 23#include <cstdint>
24#include <memory>
24 25
25#define DMX_SPECIALID_STREAMINFO -10 26#define DMX_SPECIALID_STREAMINFO -10
26#define DMX_SPECIALID_STREAMCHANGE -11 27#define DMX_SPECIALID_STREAMCHANGE -11
27 28
29struct DemuxCryptoInfo;
30
28typedef struct DemuxPacket 31typedef struct DemuxPacket
29{ 32{
30 unsigned char* pData; // data 33 DemuxPacket() {};
34
35 DemuxPacket(unsigned char *pData, int const iSize, double const pts, double const dts)
36 : pData(pData)
37 , iSize(iSize)
38 , pts(pts)
39 , dts(dts)
40 {};
41
42 unsigned char *pData; // data
31 int iSize; // data size 43 int iSize; // data size
32 int iStreamId; // integer representing the stream index 44 int iStreamId; // integer representing the stream index
33 int64_t demuxerId; // id of the demuxer that created the packet 45 int64_t demuxerId; // id of the demuxer that created the packet
@@ -38,4 +50,6 @@ typedef struct DemuxPacket
38 double duration; // duration in DVD_TIME_BASE if available 50 double duration; // duration in DVD_TIME_BASE if available
39 51
40 int dispTime; 52 int dispTime;
53
54 std::shared_ptr<DemuxCryptoInfo> cryptoInfo;
41} DemuxPacket; 55} DemuxPacket;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
new file mode 100644
index 0000000..522def6
--- /dev/null
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
@@ -0,0 +1,81 @@
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 :uint16_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)
38 : sessionId(new char[sSize])
39 , sessionIdSize(sSize)
40 , keySystem(sys)
41 {
42 memcpy(sessionId, sData, sSize);
43 };
44
45 ~DemuxCryptoSession()
46 {
47 delete[] sessionId;
48 }
49
50 // encryped stream infos
51 char * sessionId;
52 uint16_t sessionIdSize;
53 CryptoSessionSystem keySystem;
54};
55
56//CryptoInfo stores the information to decrypt a sample
57
58struct DemuxCryptoInfo
59{
60 DemuxCryptoInfo(const unsigned int numSubs)
61 : numSubSamples(numSubs)
62 , flags(0)
63 , clearBytes(new uint16_t[numSubs])
64 , cipherBytes(new uint32_t[numSubs])
65 {};
66
67 ~DemuxCryptoInfo()
68 {
69 delete[] clearBytes;
70 delete[] cipherBytes;
71 }
72
73 uint16_t numSubSamples; //number of subsamples
74 uint16_t flags; //flags for later use
75
76 uint16_t *clearBytes; // numSubSamples uint16_t's wich define the size of clear size of a subsample
77 uint32_t *cipherBytes; // numSubSamples uint32_t's wich define the size of cipher size of a subsample
78
79 uint8_t iv[16]; // initialization vector
80 uint8_t kid[16]; // key id
81};
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
deleted file mode 100644
index d64fbb3..0000000
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPacket.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#pragma once
2
3/*
4 * Copyright (C) 2012-2013 Team XBMC
5 * http://xbmc.org
6 *
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#define DMX_SPECIALID_STREAMINFO -10
24#define DMX_SPECIALID_STREAMCHANGE -11
25
26 typedef struct DemuxPacket
27{
28 unsigned char* pData; // data
29 int iSize; // data size
30 int iStreamId; // integer representing the stream index
31 int iGroupId; // the group this data belongs to, used to group data from different streams together
32
33 double pts; // pts in DVD_TIME_BASE
34 double dts; // dts in DVD_TIME_BASE
35 double duration; // duration in DVD_TIME_BASE if available
36} DemuxPacket;