summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/mpegplay/videoDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'mpeglib/lib/mpegplay/videoDecoder.h')
-rw-r--r--mpeglib/lib/mpegplay/videoDecoder.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/mpeglib/lib/mpegplay/videoDecoder.h b/mpeglib/lib/mpegplay/videoDecoder.h
new file mode 100644
index 00000000..cba45a29
--- /dev/null
+++ b/mpeglib/lib/mpegplay/videoDecoder.h
@@ -0,0 +1,118 @@
+/*
+ mpeg I video decoder (derived from mpeg_play)
+ Copyright (C) 2000 Martin Vogt
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Library General Public License as published by
+ the Free Software Foundation.
+
+ For more information look at the file COPYRIGHT in this package
+
+ */
+
+
+#ifndef __VIDEO_H
+#define __VIDEO_H
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "decoderClass.h"
+#include "recon.h"
+#include "motionVector.h"
+#include "slice.h"
+#include "proto.h"
+#include "../input/inputStream.h"
+#include "../output/outputStream.h"
+#include "../util/timeStamp.h"
+#include "mpegVideoHeader.h"
+#include "gop.h"
+#include "picture.h"
+#include "macroBlock.h"
+#include "startCodes.h"
+
+
+
+/* Define Parsing error codes. */
+
+
+
+#define SYNC_TO_CLOSED_GOP 1
+#define SYNC_HAS_CLOSED_GOP 2
+#define SYNC_HAS_I_FRAME_SYNC 3
+#define SYNC_HAS_P_FRAME_SYNC 4
+#define SYNC_HAS_FRAME_SYNC 5
+
+#define _SYNC_TO_GOP 1
+#define _SYNC_TO_PIC 2
+#define _SYNC_TO_NONE 3
+
+
+
+/* Number of macroblocks to process in one call to mpegVidRsrc. */
+
+#define MB_QUANTUM 100
+
+
+/* Video stream structure. */
+class VideoDecoder {
+
+
+ public:
+ VideoDecoder(MpegVideoStream* mpegVideoStream,
+ MpegVideoHeader* initSequence);
+
+ ~VideoDecoder();
+ int mpegVidRsrc(PictureArray* pictureArray);
+
+
+ // ugly callbacks FIX ME!
+ class MpegVideoStream* mpegVideoStream;
+ class DecoderClass* decoderClass;
+ class Recon* recon;
+ class MotionVector* motionVector;
+ class Slice* slice; /* Current slice. */
+ class MpegVideoHeader* mpegVideoHeader; /* Sequence info in stream */
+ class GOP* group;
+ class Picture* picture; /* Current picture. */
+ class MacroBlock* macroBlock; /* Current macroblock. */
+
+ void resyncToI_Frame();
+
+
+
+ private:
+
+ int syncState;
+
+ int ParseSeqHead();
+ int ParseGOP();
+ int ParsePicture();
+ int ParseSlice();
+ void doPictureDisplay(PictureArray* pictureArray);
+ MpegExtension* extension;
+ int frameCounter;
+
+};
+
+
+
+/* Declaration of global display pointer. */
+
+
+
+extern int qualityFlag;
+
+
+
+
+extern int gXErrorFlag;
+
+
+
+
+#endif /* videoDecoder.h already included */
+
+