2 Copyright 2008 Mark Calderbank
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef DVBSUBTITLES_H
22 #define DVBSUBTITLES_H
24 #include "threadsystem.h"
41 void setEntry(int bpp, UINT index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T);
42 const Palette& getPalette(int bpp) const;
47 const static ULONG defaultPalette2[4];
48 const static ULONG defaultPalette4[16];
49 const static ULONG defaultPalette8[256];
52 class DVBSubtitleRegion : public Bitmap
63 UINT horizontalPosition;
64 UINT verticalPosition;
66 typedef std::vector<struct ObjectRef> ObjectList;
80 typedef std::map<UCHAR, DVBSubtitleCLUT> CLUTMap;
82 typedef std::map<UCHAR, DVBSubtitleRegion> RegionMap;
84 struct Coords { UINT x; UINT y; };
85 typedef std::map<UCHAR, Coords> DisplayMap;
86 DisplayMap currentDisplay;
87 DisplayMap pendingDisplay;
89 void setState(UCHAR s);
90 void updateRegionPalettes(const DVBSubtitleCLUT&);
93 class DVBSubtitles : public Thread_TYPE
96 DVBSubtitles(OSDReceiver* tosd = NULL);
98 void put(const PESPacket& packet);
106 std::deque<PESPacket> worklist;
107 typedef std::map<UINT, DVBSubtitlePage> PageMap;
110 bool decodePacket(const PESPacket&);
111 void finishPage(const DVBSubtitlePage&);
122 void threadPostStopCleanup() {};
124 pthread_mutex_t input_mutex;
125 pthread_mutex_t output_mutex;