summaryrefslogtreecommitdiffstats
path: root/ext/mplex/bits.hh
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-07-27 05:24:15 +0000
committerDavid Schleef <ds@schleef.org>2003-07-27 05:24:15 +0000
commitd1f62e8a4f976e11634d2f9187821e8686cec76d (patch)
tree7aeb45681425dc71469510056d67f4aa20d3574b /ext/mplex/bits.hh
parenta10432d76cb431d03e27b97d790d2ba7ae34f4b8 (diff)
downloadgst-plugins-bad-d1f62e8a4f976e11634d2f9187821e8686cec76d.tar.gz
gst-plugins-bad-d1f62e8a4f976e11634d2f9187821e8686cec76d.tar.bz2
gst-plugins-bad-d1f62e8a4f976e11634d2f9187821e8686cec76d.zip
Moved to gst-libs/ext/mplex
Original commit message from CVS: Moved to gst-libs/ext/mplex
Diffstat (limited to 'ext/mplex/bits.hh')
-rw-r--r--ext/mplex/bits.hh82
1 files changed, 0 insertions, 82 deletions
diff --git a/ext/mplex/bits.hh b/ext/mplex/bits.hh
deleted file mode 100644
index 275b8c0f..00000000
--- a/ext/mplex/bits.hh
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef __BITS_H__
-#define __BITS_H__
-
-#include <config.h>
-#include <stdio.h>
-
-typedef uint64_t bitcount_t;
-
-
-class BitStreamUndo
-{
-//protected:
-public:
- uint8_t outbyte;
- unsigned int byteidx;
- int bitidx;
- unsigned int bufcount;
- fpos_t actpos;
- bitcount_t totbits;
- bitcount_t buffer_start;
- bitcount_t readpos;
- uint8_t *bfr;
- unsigned int bfr_size;
-public:
- bool eobs;
-};
-
-typedef class BitStream _BitStream;
-
-typedef size_t (*ReadCallback) (_BitStream *bs, uint8_t *dest, size_t size, void *user_data);
-
-class BitStream : public BitStreamUndo
-{
-public:
- void *user_data;
- static const unsigned int BUFFER_SIZE = 4 * 1024;
-public:
- BitStream ();
- ~BitStream ();
- inline bitcount_t bitcount ()
- {
- return totbits;
- }
- inline bool eos ()
- {
- return eobs;
- }
-};
-
-
-//
-// Input bit stream class. Supports the "scanning" of a stream
-// into a large buffer which is flushed once it has been read.
-// N.b. if you scan ahead a long way and don't read its your
-// responsibility to flush manually...
-//
-
-class IBitStream:public BitStream
-{
-public:
- void open (ReadCallback read_callback, void *user_data, unsigned int buf_size = BUFFER_SIZE);
- void SetBufSize (unsigned int buf_size);
- void close ();
- uint32_t get1bit ();
- uint32_t getbits (int N);
- void prepareundo (BitStreamUndo & undobuf);
- void undochanges (BitStreamUndo & undobuf);
- bool seek_sync (unsigned int sync, int N, int lim);
- void flush (bitcount_t bitposition);
- inline unsigned int buffered_bytes ()
- {
- return (buffer_start + bufcount - readpos);
- }
- unsigned int read_buffered_bytes (uint8_t * dst, unsigned int length_bytes);
-
-private:
- bool refill_buffer ();
- static uint8_t masks[8];
- ReadCallback read_callback;
-};
-
-#endif // __BITS_H__