📄 hi_comm_venc.h
字号:
HI_U32 u32Seq; /*the serial number of stream*/ VENC_CHN ChnID; /*venc channel number*/} VENC_STREAM_INFO_S;typedef struct hiUSER_BUFFER_S{ /* bit stream is put in the front, following is MD data */ IO_VECTOR_S *pstruVector; /* slice count that memory pointed by "pstruVector" contains */ HI_U32 u32Count; HI_U32 u32BSBufCount; HI_U32 u32MDBufCount; HI_U32 u32Index; HI_BOOL bIsField;}USER_BUFFER_S;typedef struct hiPACK_PROP_S{ HI_U16 FrameLastPacketFlag :1; /* Last stream packet flag for one frame. 0: Normal stream packet 1: The last stream packet*/ HI_U16 LastByteOverLapFlag :1; /* Last byte valid flag when saving pure stream 0: Last byte is not valid, data length should minus one 1: Last byte is valid, data length should not be changed */ HI_U16 RTPModeAFlag :1; /* Flag for 2190 PayLoad Mode A 0: Mode B 1: Mode A */ HI_U16 CheckSumEnableFlag :1; /* Flag for Check Sum Mode Enable Not Used */ HI_U16 ResvFlags :12; /* Reserve flags */}PACK_PROP_S;typedef struct hiVENC_STREAM_S{ HI_U32 u32DataNum; /* slice number in one frame */ HI_U32 u32DataLen; /* all the stream length in one frame */ VENC_DATA_S struData[VENC_MAX_NALU_NUM_IN_FRAME];/*stream data address*/ PACK_PROP_S struProp[VENC_MAX_NALU_NUM_IN_FRAME];/*field for H.263 protocol*/ VENC_STREAM_INFO_S struDataInfo; /*stream infomation */ USER_BUFFER_S struUbuff; } VENC_STREAM_S;#ifndef __KERNEL__struct usr_list_head { struct usr_list_head *next, *prev;};#else#include <linux/list.h>#endiftypedef struct hiVIDEO_BUFFER_S{ HI_U32 ChanID; /* video encode channel id */ PIXEL_FORMAT_E enPixelFormat; /* the format of video input */ HI_U32 u32Width; /* the width of video input */ HI_U32 u32Height; /* the height of video input */ #define VIDEO_FIELD_TOP 0x01 /* even field */ #define VIDEO_FIELD_BOTTOM 0x02 /* odd field */ #define VIDEO_FIELD_FRAME 0x04 /* frame field */ HI_U32 u32Field; HI_U32 u32DownScaled; /* the flag down scaling */ /* ** if format is RGB or PackageYUV, u32PhyAddr[0] make effect ** if format is Semi-Planar YUV , u32PhyAddr[0~1] make effect, ** if format is Planar , u32PhyAddr[0~2] make effect, */ HI_U32 u32PhyAddr[3]; /* physical address */ HI_VOID *pVirAddr[3]; /* vitual address */ HI_U32 u32Stride[3]; /* stride of line */ HI_U64 pts; HI_U32 timeRef; HI_U32 privateData; HI_U32 owner; /* ATTENTION: The defination of list must be consistent. */ #ifndef __KERNEL__ struct usr_list_head list; #else struct list_head list; #endif} VIDEO_BUFFER_S;#define VENC_MAX_BITRATE 4000000#define VENC_MIN_BITRATE 16000#define VENC_MAX_PAL_FRAMERATE 25#define VENC_MAX_NTSC_FRAMERATE 30#define VENC_MIN_FRAMERATE 1#define VENC_MIN_DELAY 10#define VENC_MAX_DELAY 4000#define VENC_MAX_MAXQP 51#define VENC_MIN_MAXQP 10#define VENC_MAX_GOP 0x7FFF#define VENC_MIN_GOP 0#define VENC_CAP_DEFAULT 0x07 /* capture all the data from VI */#define VENC_CAP_TOP 0x01 /* capture top field */#define VENC_CAP_BOTTOM 0x02 /* capture bottom field */#define VENC_CAP_BOTH 0x03 /* capture top and bottom field */#define VENC_CAP_FRAME 0x04 /* capture frame */#define VENC_STRATEGY_DEFAULT 0#define VENC_STRATEGY_ONE 1#define VENC_STRATEGY_TWO 2typedef struct hiVENC_CONFIG_H264_S{ HI_U32 u32PicWidth; /* the width of stream,align 16 pixel , larger than 64 */ HI_U32 u32PicHeight; /* the width of stream, align 16 pixel , larger than 64 */ HI_U32 u32CapSel; /* the way that Video encoder how to deal with the data from VI, the default value: VENC_CAP_DEFAULT */ HI_U32 u32StaticParam; /* set the graphic quality of image with static mode (0..4095, default:1800)*/ HI_U32 u32TargetBitrate; /* target bitrate(106,000-4000,000), change freedom */ HI_U32 u32TargetFramerate; /* target frame rate (1-30), change freedom */ HI_U32 u32Gop; /* interval of I frame(0-32767), change freedom */ HI_U32 u32MaxQP; /* max QP(10-51), change freedom */ HI_U32 u32PreferFrameRate; /* mode switch, 1: frame rate preference, 0: quality preference change freedom */ HI_U32 u32Strategy; /* strategy for codeing, VENC_STRATEGY_DEFAULT : encoder select the strategy */ HI_U32 u32VencMode; /* encode mode, 0 - CBR, 1 - VBR */ HI_U32 u32BaseQP; /* 0- maxQP,change freedom */ HI_U32 u32MaxBitRate; /* max bitrate(16,000-4000,000) >= targetBitRate,change freedom*/} VENC_CONFIG_H264_S;typedef struct hiVENC_CONFIG_H263_S{ HI_U32 u32PicWidth; /* the width of stream,align 16 pixel */ HI_U32 u32PicHeight; /* the width of stream, align 16 pixel */ HI_U32 u32CapSel; /* the way that Video encoder how to deal with the data from VI */ HI_U32 u32TargetBitrate; /* target bitrate */ HI_U32 u32TargetFramerate; /* target frame rate */ HI_U32 u32MaxQP; /* max Quantization parameter */ /* Fields for H.263 protocol particular configuration*/ HI_U32 u32UMV; /* Unrestricted Motion Vector (UMV) mode enable flag */ HI_U32 u32DF; /* Deblocking Filter (DF ) mode enable flag */ HI_U32 u32MQ; /* Modified Quantization (MQ ) mode enable flag */ HI_U32 u32PreferFrameRate; /* mode switch:1frame rate preference,0: quality preference*/ HI_U32 UpdateTime; /* update time (1~4)*/ HI_U32 reserved; /* reserved */ HI_U32 reserved1; /* reserved1 */} VENC_CONFIG_H263_S;typedef struct hiVENC_CONFIG_MJPEG_S{ HI_U32 u32PicWidth; /*the width of stream , align 16 pixel*/ HI_U32 u32PicHeight; /*the height of stream ,align 16 pixel*/ HI_U32 u32MAXQP; /* max Quantization parameter */ HI_U32 u32TargetFramerate; /* target frame rate */} VENC_CONFIG_MJPEG_S;typedef union hiVENC_CONFIG_U{ VENC_CONFIG_H263_S h263; VENC_CONFIG_H264_S h264; VENC_CONFIG_MJPEG_S mjpeg;} VENC_CONFIG_U;typedef struct VENC_CONFIG_S{ VENC_FORMAT_E enVencType; /*encoding format */ HI_VOID * pValue; /*point to the structure of attribute*/}VENC_CONFIG_S;typedef struct hiVENC_VALUE_S{ HI_U32 type; HI_S32 value;} VENC_VALUE_S;typedef struct hiVENC_USRINFO_CONFIG_S{ HI_U8 *pUserData;/*the address of user data */ HI_U32 len; /*the user data length,max length is 256 byte*/}VENC_USRINFO_CONFIG_S;typedef struct hiVENC_STREAM_BUFFER_CONFIG_S{ HI_U32 u32BufSize; HI_BOOL bIsFrame; } VENC_STREAM_BUFFER_CONFIG_S;typedef struct venc_capability_struct{ HI_U32 u32MaxSupportChnNum; /* the max number that the encoder can support */ HI_U32 u32VencVersion; /* encode version information */ VENC_FORMAT_E enVencType;; /* video encode type */ }VENC_CAPABILITY_S;typedef struct hiVENC_WATERMARK_S{ HI_CHAR u8Key[8]; /*water mark key, length is 8*/ HI_CHAR u8Symbol[16]; /*water mark symbol, lenghth is 16*/ VENC_WMDENSITY_E Density; /*water mark density*/} VENC_WATERMARK_S;#ifdef __cplusplus#if __cplusplus}#endif#endif /* __cplusplus */#endif /* __HI_COMM_VENC_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -