2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
17 typedef struct SPUData
20 unsigned int iSize
; // current data size
21 unsigned int iNeededSize
; // wanted packet size
22 unsigned int iAllocatedSize
;
27 // upto 32 streams can exist
28 #define DVD_MAX_SPUSTREAMS 32
30 class CDVDDemuxSPU final
36 std::shared_ptr
<CDVDOverlaySpu
> AddData(
37 uint8_t* data
, int iSize
, double pts
); // returns a packet from ParsePacket if possible
39 std::shared_ptr
<CDVDOverlaySpu
> ParseRLE(std::shared_ptr
<CDVDOverlaySpu
> pSPU
,
40 uint8_t* pUnparsedData
);
41 static void FindSubtitleColor(int last_color
, int stats
[4], CDVDOverlaySpu
& pSPU
);
42 static bool CanDisplayWithAlphas(const int a
[4], const int stats
[4]);
45 void FlushCurrentPacket(); // flushes current unparsed data
47 // m_clut set by libdvdnav once in a time
48 // color lookup table is representing 16 different yuv colors
49 // [][0] = Y, [][1] = Cr, [][2] = Cb
50 uint8_t m_clut
[16][3];
54 std::shared_ptr
<CDVDOverlaySpu
> ParsePacket(SPUData
* pSPUData
);