[WASAPI] set stream audio category
[xbmc.git] / xbmc / cores / VideoPlayer / DVDDemuxSPU.h
blobc5172f3405db06212af920f56adc2803db645146
1 /*
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.
7 */
9 #pragma once
11 #include <memory>
12 #include <stdint.h>
14 struct AVFrame;
15 class CDVDOverlaySpu;
17 typedef struct SPUData
19 uint8_t* data;
20 unsigned int iSize; // current data size
21 unsigned int iNeededSize; // wanted packet size
22 unsigned int iAllocatedSize;
23 double pts;
25 SPUData;
27 // upto 32 streams can exist
28 #define DVD_MAX_SPUSTREAMS 32
30 class CDVDDemuxSPU final
32 public:
33 CDVDDemuxSPU();
34 ~CDVDDemuxSPU();
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]);
44 void Reset();
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];
51 bool m_bHasClut;
53 protected:
54 std::shared_ptr<CDVDOverlaySpu> ParsePacket(SPUData* pSPUData);
56 SPUData m_spuData;