From 0ecf6b00d43a2f2a372ff0b8b0abd8a75b3c0f0e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 18 Sep 2011 11:36:38 +0200 Subject: Fixed handling DVB subtitles and implemented decoding textual DVB subtitles --- tools.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'tools.h') diff --git a/tools.h b/tools.h index 3d13c191..bcc6f171 100644 --- a/tools.h +++ b/tools.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 2.11 2011/08/15 14:13:42 kls Exp $ + * $Id: tools.h 2.12 2011/09/18 11:21:23 kls Exp $ */ #ifndef __TOOLS_H @@ -266,6 +266,28 @@ public: ///< is called, or until the object is destroyed. }; +class cBitStream { +private: + const uint8_t *data; + int length; // in bits + int index; // in bits +public: + cBitStream(const uint8_t *Data, int Length) : data(Data), length(Length), index(0) {} + ~cBitStream() {} + int GetBit(void); + uint32_t GetBits(int n); + void ByteAlign(void); + void WordAlign(void); + bool SetLength(int Length); + void SkipBits(int n) { index += n; } + void SkipBit(void) { SkipBits(1); } + bool IsEOF(void) const { return index >= length; } + void Reset(void) { index = 0; } + int Length(void) const { return length; } + int Index(void) const { return (IsEOF() ? length : index); } + const uint8_t *GetData(void) const { return (IsEOF() ? NULL : data + (index / 8)); } + }; + class cTimeMs { private: uint64_t begin; -- cgit v1.2.3