3
Copyright (C) 1999 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
17
#ifndef __MPEGVIDEOSTREAM_H
18
#define __MPEGVIDEOSTREAM_H
21
#include "startCodes.h"
22
#include "mpegVideoHeader.h"
23
#include "mpegSystemStream.h"
24
#include "mpegVideoBitWindow.h"
26
#define _BYTE_TEST 1024
29
A really ugly class. Most of the methods have names
30
which does not make it clear for what they are usefull.
31
(Don't touch a running system :-)
33
We wrap the inputStream and offer functions for getting
34
bits, appending to the internal buffer, flushing, syncing
40
class MpegVideoStream {
44
MpegSystemStream* mpegSystemStream;
45
MpegSystemHeader* mpegSystemHeader;
46
MpegVideoBitWindow* mpegVideoBitWindow;
51
MpegVideoStream(InputStream* input);
54
// returns true if init successfull
55
int firstInitialize(MpegVideoHeader* mpegHeader);
58
int next_start_code();
60
int hasBytes(int bytes);
64
mpegVideoBitWindow->clear();
67
inline void flushBits(int bits) {
69
mpegVideoBitWindow->flushBitsDirect(bits);
72
inline unsigned int showBits(int bits) {
74
return mpegVideoBitWindow->showBits(bits);
77
inline unsigned int showBits32() {
78
return mpegVideoBitWindow->showBits32();
81
inline unsigned int showBits16() {
82
return mpegVideoBitWindow->showBits(16);
85
inline void flushBitsDirect(unsigned int bits) {
86
mpegVideoBitWindow->flushBitsDirect(bits);
89
unsigned int getBits(int bits) {
91
return mpegVideoBitWindow->getBits(bits);
94
inline void flushByteOffset() {
95
mpegVideoBitWindow->flushByteOffset();
98
TimeStamp* getCurrentTimeStamp();
102
int get_more_video_data();
103
void fill_videoBuffer(MpegSystemHeader* mpegSystemHeader);
104
int isStartCode(unsigned int data);