summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-09-18 11:36:38 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-09-18 11:36:38 +0200
commit0ecf6b00d43a2f2a372ff0b8b0abd8a75b3c0f0e (patch)
tree1d82d2f900e435776ecc018c2910208f6e21bb73 /tools.h
parentb1f6b586d4116bb46fffe9473d55da22b12563c9 (diff)
downloadvdr-0ecf6b00d43a2f2a372ff0b8b0abd8a75b3c0f0e.tar.gz
vdr-0ecf6b00d43a2f2a372ff0b8b0abd8a75b3c0f0e.tar.bz2
Fixed handling DVB subtitles and implemented decoding textual DVB subtitles
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h24
1 files changed, 23 insertions, 1 deletions
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;