|
#ifndef __STREAMPARSE_H_
|
#define __STREAMPARSE_H_
|
|
#ifndef __int64
|
#define __int64 long long
|
#endif
|
|
enum eStreamType
|
{
|
STREAM_TYPE_UNKNOWN = 0,
|
|
//VIDEO
|
STREAM_TYPE_H264 = 0xE0,
|
STREAM_TYPE_H265 = 0xE1,
|
STREAM_TYPE_MPEG4 = 0xE2,
|
STREAM_TYPE_MPEG2 = 0xE3,
|
|
//AUDIO
|
STREAM_TYPE_G711A = 0xC0,
|
STREAM_TYPE_G711U = 0xC1,
|
STREAM_TYPE_G722 = 0xC2,
|
STREAM_TYPE_AAC = 0xC3
|
};
|
|
typedef enum
|
{
|
STREAMPARSE_NONE,
|
STREAMPARSE_GENERATESEI = 1, //Éú³ÉÒ»¸öSEIÖ¡
|
STREAMPARSE_PSTOES = 96, //½«PSÁ÷תΪESÁ÷£¬Êä³öΪһ֡ESÁ÷
|
STREAMPARSE_MERGEAFRAME = 97, //¼òµ¥×éºÏ³ÉÒ»Ö¡£¬Ò»°ãΪ˽ÓÐÁ÷(¸ù¾Ýmark±êÖ¾×éºÏ)
|
STREAMPARSE_RTPH264TOES = 98, //Ö÷ÒªÕë¶Ôpayloadtype 98£¬½â¸´ÓÃÇÒ×é³ÉÒ»Ö¡ESÁ÷(¸ù¾Ýmark±êÖ¾×éºÏ)
|
STREAMPARSE_MERGEAMPEG4 = 99, //½«²»ÍêÕûµÄMPEG4Ö¡×éºÏ³ÉÒ»¸öÍêÕûÖ¡
|
STREAMPARSE_MERGEAMPEG2 = 100, //½«²»ÍêÕûµÄMPEG2Ö¡×éºÏ³ÉÒ»¸öÍêÕûÖ¡
|
STREAMPARSE_ESTOES = 110 , //Ö÷ÒªÕë¶ÔÎÞÐòµÄESÁ÷×éºÏ³ÉÒ»Ö¡ESÁ÷
|
STREAMPARSE_TSTOES = 111, //½«TSÁ÷תΪESÁ÷(Êä³ö²»Ò»¶¨ÎªÍêÕûÖ¡)
|
STREAMPARSE_FLVTOES = 112, //½«FLVÁ÷תΪESÁ÷(Êä³ö²»Ò»¶¨ÎªÍêÕûÖ¡)
|
STREAMPARSE_TSTOES2 = 113, //½«TSÁ÷תΪESÁ÷(Êä³ö²»Ò»¶¨ÎªÍêÕûÖ¡)---а汾
|
|
STREAMPARSE_ESTOPS = 1096, //½«ESÁ÷תΪPSÁ÷£¬ÊäÈë±ØÐëΪһ֡esÁ÷
|
STREAMPARSE_OTHERTOPS = 1097, //´ò°üΪPSÁ÷£¬ÊäÈëÈÎÒâ
|
STREAMPARSE_AUDIOTOPS = 1008, //½«ÒôƵÁ÷תΪPSÁ÷
|
STREAMPARSE_ESTOFLV = 1009, //½«ESÁ÷תΪFLVÁ÷
|
STREAMPARSE_G711ATOPS = 1200, //½«G711AÒôƵÁ÷תΪPSÁ÷
|
STREAMPARSE_G711UTOPS = 1201, //½«G711UÒôƵÁ÷תΪPSÁ÷
|
STREAMPARSE_G722TOPS = 1202, //½«G722ÒôƵÁ÷תΪPSÁ÷
|
}StreamParseType_E;
|
|
|
typedef struct _StreamParseParamIn
|
{
|
unsigned char *pBufIn; //ÊäÈëÁ÷
|
int nSizeIn; //ÊäÈëÁ÷´óС
|
StreamParseType_E PayLoadType; //´¦ÀíÊäÈëÁ÷µÄÀàÐÍ
|
bool bMark; //mark񈬀
|
}StreamParseParamIn;
|
|
typedef struct _StreamParseParamOut
|
{
|
unsigned char* pBufOut; //Êä³öÁ÷
|
int nSizeOut; //Êä³öÁ÷´óС
|
__int64 pts; //Êä³öÁ÷PTS(ÏÔʾʱ¼ä´Á)
|
__int64 dts; //Êä³öÁ÷DTS(½âÂëʱ¼ä´Á)
|
unsigned char streamtype; //Êä³öÁ÷ÀàÐÍ 0xE0:ÊÓÆµ£¬0xC0ÒôƵ £¨Õë¶ÔPayLoadTypeΪ96µÄʱºòÓã©
|
}StreamParseParamOut;
|
|
#ifdef __cplusplus
|
extern "C"{
|
#endif
|
|
//³õʼ»¯
|
long STREAMPARSE_Init();
|
|
//´ò¿ªÒ»¸ö¾ä±ú
|
long STREAMPARSE_Open();
|
|
//¹Ø±Õ¾ä±ú
|
long STREAMPARSE_Close(long Handle);
|
|
//½âÎö»òÕßת»»ÂëÁ÷
|
long STREAMPARSE_Parse(long Handle, StreamParseParamIn* pIn, StreamParseParamOut* pOut);
|
|
#ifdef __cplusplus
|
}
|
#endif
|
|
|
#endif
|