2013-01-12 03:20:40 +00:00
|
|
|
#ifndef _VIDEOSTREAM_DECODER_H_
|
|
|
|
#define _VIDEOSTREAM_DECODER_H_
|
|
|
|
|
|
|
|
#include "VideoStream_Program.h"
|
|
|
|
#include "VideoStream_ReadPictureHeader.h"
|
|
|
|
#include "VideoStream_ReadPictureCodingExtension.h"
|
|
|
|
#include "VideoStream_ReadSequenceHeader.h"
|
|
|
|
#include "VideoStream_ReadSequenceExtension.h"
|
|
|
|
#include "VideoStream_ReadGroupOfPicturesHeader.h"
|
|
|
|
#include "VideoStream_ReadSlice.h"
|
|
|
|
#include "MpegVideoState.h"
|
|
|
|
|
|
|
|
namespace VideoStream
|
|
|
|
{
|
|
|
|
class Decoder : public Program
|
|
|
|
{
|
2013-01-26 09:10:10 +00:00
|
|
|
public:
|
2013-01-12 03:20:40 +00:00
|
|
|
typedef ReadSlice::OnMacroblockDecodedHandler OnMacroblockDecodedHandler;
|
2013-01-26 09:10:10 +00:00
|
|
|
typedef ReadSlice::OnPictureDecodedHandler OnPictureDecodedHandler;
|
2013-01-12 03:20:40 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
Decoder();
|
|
|
|
virtual ~Decoder();
|
2013-01-12 03:20:40 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
void InitializeState(MPEG_VIDEO_STATE*);
|
2013-01-12 03:20:40 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
void Reset();
|
|
|
|
void Execute(void*, Framework::CBitStream&);
|
|
|
|
|
|
|
|
void RegisterOnMacroblockDecodedHandler(const OnMacroblockDecodedHandler&);
|
|
|
|
void RegisterOnPictureDecodedHandler(const OnPictureDecodedHandler&);
|
2013-01-26 09:10:10 +00:00
|
|
|
|
2013-01-12 03:20:40 +00:00
|
|
|
private:
|
|
|
|
enum PROGRAM_STATE
|
|
|
|
{
|
|
|
|
STATE_GETMARKER = 0,
|
|
|
|
STATE_SKIPMARKER,
|
|
|
|
STATE_GETCOMMAND,
|
|
|
|
STATE_GETEXTENSIONID,
|
|
|
|
STATE_SKIPBITS,
|
|
|
|
STATE_EXECUTESUBPROGRAM,
|
|
|
|
STATE_FINISHEXECUTE,
|
|
|
|
};
|
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
PROGRAM_STATE m_programState;
|
|
|
|
uint32 m_marker;
|
|
|
|
uint8 m_commandType;
|
|
|
|
uint8 m_extensionType;
|
2013-01-12 03:20:40 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
Program* m_subProgram;
|
2013-01-12 03:20:40 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
ReadPictureHeader m_readPictureHeader;
|
|
|
|
ReadPictureCodingExtension m_readPictureCodingExtensionProgram;
|
|
|
|
ReadSequenceExtension m_readSequenceExtensionProgram;
|
|
|
|
ReadSequenceHeader m_readSequenceHeaderProgram;
|
|
|
|
ReadGroupOfPicturesHeader m_readGroupOfPicturesHeaderProgram;
|
|
|
|
ReadSlice m_readSliceProgram;
|
2013-01-12 03:20:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|