| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include <memory> |
| 12 |
#include <stdint.h> |
| 13 |
|
| 14 |
struct AVFrame; |
| 15 |
class CDVDOverlaySpu; |
| 16 |
|
| 17 |
typedef struct SPUData |
| 18 |
{ |
| 19 |
uint8_t* data; |
| 20 |
unsigned int iSize; |
| 21 |
unsigned int iNeededSize; |
| 22 |
unsigned int iAllocatedSize; |
| 23 |
double pts; |
| 24 |
} |
| 25 |
SPUData; |
| 26 |
|
| 27 |
|
| 28 |
#define DVD_MAX_SPUSTREAMS 32 |
| 29 |
|
| 30 |
class CDVDDemuxSPU final |
| 31 |
{ |
| 32 |
public: |
| 33 |
CDVDDemuxSPU(); |
| 34 |
~CDVDDemuxSPU(); |
| 35 |
|
| 36 |
std::shared_ptr<CDVDOverlaySpu> AddData( |
| 37 |
uint8_t* data, int iSize, double pts); |
| 38 |
|
| 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]); |
| 43 |
|
| 44 |
void Reset(); |
| 45 |
void FlushCurrentPacket(); |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
uint8_t m_clut[16][3]; |
| 51 |
bool m_bHasClut; |
| 52 |
|
| 53 |
protected: |
| 54 |
std::shared_ptr<CDVDOverlaySpu> ParsePacket(SPUData* pSPUData); |
| 55 |
|
| 56 |
SPUData m_spuData; |
| 57 |
}; |