sample_comm.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. #ifndef __SAMPLE_COMM_H__
  2. #define __SAMPLE_COMM_H__
  3. #include <pthread.h>
  4. #include "hi_common.h"
  5. #include "hi_buffer.h"
  6. #include "hi_comm_sys.h"
  7. #include "hi_comm_vb.h"
  8. #include "hi_comm_isp.h"
  9. #include "hi_comm_vi.h"
  10. #include "hi_comm_vo.h"
  11. #include "hi_comm_venc.h"
  12. #include "hi_comm_vdec.h"
  13. #include "hi_comm_vpss.h"
  14. #include "hi_comm_avs.h"
  15. #include "hi_comm_region.h"
  16. #include "hi_comm_adec.h"
  17. #include "hi_comm_aenc.h"
  18. #include "hi_comm_ai.h"
  19. #include "hi_comm_ao.h"
  20. #include "hi_comm_aio.h"
  21. #include "hi_defines.h"
  22. #include "hi_comm_hdmi.h"
  23. #include "hi_mipi.h"
  24. #include "hi_comm_hdr.h"
  25. #include "hi_comm_vgs.h"
  26. #include "mpi_sys.h"
  27. #include "mpi_vb.h"
  28. #include "mpi_vi.h"
  29. #include "mpi_vo.h"
  30. #include "mpi_venc.h"
  31. #include "mpi_vdec.h"
  32. #include "mpi_vpss.h"
  33. #include "mpi_avs.h"
  34. #include "mpi_region.h"
  35. #include "mpi_audio.h"
  36. #include "mpi_isp.h"
  37. #include "mpi_ae.h"
  38. #include "mpi_awb.h"
  39. #include "hi_math.h"
  40. #include "hi_sns_ctrl.h"
  41. #include "mpi_hdmi.h"
  42. #include "mpi_hdr.h"
  43. #include "mpi_vgs.h"
  44. #ifdef __cplusplus
  45. #if __cplusplus
  46. extern "C" {
  47. #endif
  48. #endif /* End of #ifdef __cplusplus */
  49. /*******************************************************
  50. macro define
  51. *******************************************************/
  52. #define FILE_NAME_LEN 128
  53. #define CHECK_CHN_RET(express,Chn,name)\
  54. do{\
  55. HI_S32 Ret;\
  56. Ret = express;\
  57. if (HI_SUCCESS != Ret)\
  58. {\
  59. printf("\033[0;31m%s chn %d failed at %s: LINE: %d with %#x!\033[0;39m\n", name, Chn, __FUNCTION__, __LINE__, Ret);\
  60. fflush(stdout);\
  61. return Ret;\
  62. }\
  63. }while(0)
  64. #define CHECK_RET(express,name)\
  65. do{\
  66. HI_S32 Ret;\
  67. Ret = express;\
  68. if (HI_SUCCESS != Ret)\
  69. {\
  70. printf("\033[0;31m%s failed at %s: LINE: %d with %#x!\033[0;39m\n", name, __FUNCTION__, __LINE__, Ret);\
  71. return Ret;\
  72. }\
  73. }while(0)
  74. #define SAMPLE_PIXEL_FORMAT PIXEL_FORMAT_YVU_SEMIPLANAR_420
  75. #define TLV320_FILE "/dev/tlv320aic31"
  76. #define COLOR_RGB_RED 0xFF0000
  77. #define COLOR_RGB_GREEN 0x00FF00
  78. #define COLOR_RGB_BLUE 0x0000FF
  79. #define COLOR_RGB_BLACK 0x000000
  80. #define COLOR_RGB_YELLOW 0xFFFF00
  81. #define COLOR_RGB_CYN 0x00ffff
  82. #define COLOR_RGB_WHITE 0xffffff
  83. #define SAMPLE_VO_DEV_DHD0 0 /* VO's device HD0 */
  84. #define SAMPLE_VO_DEV_DHD1 1 /* VO's device HD1 */
  85. #define SAMPLE_VO_DEV_UHD SAMPLE_VO_DEV_DHD0 /* VO's ultra HD device:HD0 */
  86. #define SAMPLE_VO_DEV_HD SAMPLE_VO_DEV_DHD1 /* VO's HD device:HD1 */
  87. #define SAMPLE_VO_LAYER_VHD0 0
  88. #define SAMPLE_VO_LAYER_VHD1 1
  89. #define SAMPLE_VO_LAYER_VHD2 2
  90. #define SAMPLE_VO_LAYER_PIP SAMPLE_VO_LAYER_VHD2
  91. #define SAMPLE_AUDIO_EXTERN_AI_DEV 0
  92. #define SAMPLE_AUDIO_EXTERN_AO_DEV 0
  93. #define SAMPLE_AUDIO_INNER_AI_DEV 1
  94. #define SAMPLE_AUDIO_INNER_AO_DEV 1
  95. #define SAMPLE_AUDIO_INNER_HDMI_AO_DEV 2
  96. #define SAMPLE_AUDIO_PTNUMPERFRM 480
  97. #define WDR_MAX_PIPE_NUM 4
  98. #define PAUSE() do {\
  99. printf("---------------press Enter key to exit!---------------\n");\
  100. getchar();\
  101. } while (0)
  102. #define SAMPLE_PRT(fmt...) \
  103. do {\
  104. printf("[%s]-%d: ", __FUNCTION__, __LINE__);\
  105. printf(fmt);\
  106. }while(0)
  107. #define CHECK_NULL_PTR(ptr)\
  108. do{\
  109. if(NULL == ptr)\
  110. {\
  111. printf("func:%s,line:%d, NULL pointer\n",__FUNCTION__,__LINE__);\
  112. return HI_FAILURE;\
  113. }\
  114. }while(0)
  115. /*******************************************************
  116. enum define
  117. *******************************************************/
  118. typedef enum hiPIC_SIZE_E
  119. {
  120. PIC_CIF,
  121. PIC_D1_PAL, /* 720 * 576 */
  122. PIC_D1_NTSC, /* 720 * 480 */
  123. PIC_720P, /* 1280 * 720 */
  124. PIC_1080P, /* 1920 * 1080 */
  125. PIC_2592x1520,
  126. PIC_2592x1944,
  127. PIC_3840x2160,
  128. PIC_4096x2160,
  129. PIC_3000x3000,
  130. PIC_4000x3000,
  131. PIC_7680x4320,
  132. PIC_3840x8640,
  133. PIC_BUTT
  134. } PIC_SIZE_E;
  135. typedef enum hiSAMPLE_SNS_TYPE_E
  136. {
  137. SONY_IMX477_MIPI_12M_30FPS_12BIT,
  138. SONY_IMX477_MIPI_9M_50FPS_10BIT,
  139. SONY_IMX477_MIPI_9M_60FPS_10BIT,
  140. SONY_IMX477_MIPI_8M_60FPS_12BIT,
  141. SONY_IMX477_MIPI_8M_30FPS_12BIT,
  142. SONY_IMX290_MIPI_2M_30FPS_12BIT,
  143. SONY_IMX290_MIPI_2M_30FPS_12BIT_WDR3TO1,
  144. SONY_IMX334_SLAVE_MIPI_8M_30FPS_12BIT,
  145. SONY_IMX334_MIPI_8M_30FPS_12BIT,
  146. SONY_IMX334_MIPI_8M_30FPS_12BIT_WDR2TO1,
  147. SONY_IMX277_SLVS_8M_120FPS_10BIT,
  148. SONY_IMX277_SLVS_8M_30FPS_12BIT,
  149. SONY_IMX277_SLVS_8M_60FPS_12BIT,
  150. SONY_IMX277_SLVS_12M_30FPS_12BIT,
  151. SONY_IMX277_SLVS_2M_240FPS_12BIT,
  152. SAMPLE_SNS_TYPE_BUTT,
  153. } SAMPLE_SNS_TYPE_E;
  154. typedef enum hiSAMPLE_VO_MODE_E
  155. {
  156. VO_MODE_1MUX ,
  157. VO_MODE_2MUX ,
  158. VO_MODE_4MUX ,
  159. VO_MODE_8MUX ,
  160. VO_MODE_9MUX ,
  161. VO_MODE_16MUX ,
  162. VO_MODE_25MUX ,
  163. VO_MODE_36MUX ,
  164. VO_MODE_49MUX ,
  165. VO_MODE_64MUX ,
  166. VO_MODE_2X4 ,
  167. VO_MODE_BUTT
  168. } SAMPLE_VO_MODE_E;
  169. typedef enum hiSAMPLE_RC_E
  170. {
  171. SAMPLE_RC_CBR = 0,
  172. SAMPLE_RC_VBR,
  173. SAMPLE_RC_AVBR,
  174. SAMPLE_RC_QPMAP,
  175. SAMPLE_RC_FIXQP
  176. } SAMPLE_RC_E;
  177. /*******************************************************
  178. structure define
  179. *******************************************************/
  180. typedef struct hiSAMPLE_VENC_GETSTREAM_PARA_S
  181. {
  182. HI_BOOL bThreadStart;
  183. VENC_CHN VeChn[VENC_MAX_CHN_NUM];
  184. HI_S32 s32Cnt;
  185. } SAMPLE_VENC_GETSTREAM_PARA_S;
  186. typedef struct hiSAMPLE_VENC_QPMAP_SENDFRAME_PARA_S
  187. {
  188. HI_BOOL bThreadStart;
  189. VPSS_GRP VpssGrp;
  190. VPSS_CHN VpssChn;
  191. VENC_CHN VeChn[VENC_MAX_CHN_NUM];
  192. HI_S32 s32Cnt;
  193. SIZE_S stSize;
  194. } SAMPLE_VENC_QPMAP_SENDFRAME_PARA_S;
  195. typedef struct hiSAMPLE_VI_DUMP_THREAD_INFO_S
  196. {
  197. VI_PIPE ViPipe;
  198. HI_S32 s32Cnt;
  199. HI_BOOL bDump;
  200. HI_CHAR aszName[128];
  201. pthread_t ThreadId;
  202. } SAMPLE_VI_DUMP_THREAD_INFO_S;
  203. typedef struct hiSAMPLE_SENSOR_INFO_S
  204. {
  205. SAMPLE_SNS_TYPE_E enSnsType;
  206. HI_S32 s32SnsId;
  207. HI_S32 s32BusId;
  208. combo_dev_t MipiDev;
  209. } SAMPLE_SENSOR_INFO_S;
  210. typedef struct hiSAMPLE_SNAP_INFO_S
  211. {
  212. HI_BOOL bSnap;
  213. HI_BOOL bDoublePipe;
  214. VI_PIPE VideoPipe;
  215. VI_PIPE SnapPipe;
  216. VI_VPSS_MODE_E enVideoPipeMode;
  217. VI_VPSS_MODE_E enSnapPipeMode;
  218. }SAMPLE_SNAP_INFO_S;
  219. typedef struct hiSAMPLE_DEV_INFO_S
  220. {
  221. VI_DEV ViDev;
  222. WDR_MODE_E enWDRMode;
  223. } SAMPLE_DEV_INFO_S;
  224. typedef struct hiSAMPLE_PIPE_INFO_S
  225. {
  226. VI_PIPE aPipe[WDR_MAX_PIPE_NUM];
  227. VI_VPSS_MODE_E enMastPipeMode;
  228. } SAMPLE_PIPE_INFO_S;
  229. typedef struct hiSAMPLE_CHN_INFO_S
  230. {
  231. VI_CHN ViChn;
  232. PIXEL_FORMAT_E enPixFormat;
  233. DYNAMIC_RANGE_E enDynamicRange;
  234. VIDEO_FORMAT_E enVideoFormat;
  235. COMPRESS_MODE_E enCompressMode;
  236. } SAMPLE_CHN_INFO_S;
  237. typedef struct hiSAMPLE_VI_INFO_S
  238. {
  239. SAMPLE_SENSOR_INFO_S stSnsInfo;
  240. SAMPLE_DEV_INFO_S stDevInfo;
  241. SAMPLE_PIPE_INFO_S stPipeInfo;
  242. SAMPLE_CHN_INFO_S stChnInfo;
  243. SAMPLE_SNAP_INFO_S stSnapInfo;
  244. } SAMPLE_VI_INFO_S;
  245. typedef struct hiSAMPLE_VI_CONFIG_S
  246. {
  247. SAMPLE_VI_INFO_S astViInfo[VI_MAX_DEV_NUM];
  248. HI_S32 as32WorkingViId[VI_MAX_DEV_NUM];
  249. HI_S32 s32WorkingViNum;
  250. } SAMPLE_VI_CONFIG_S;
  251. typedef struct tag_SAMPLE_VO_WBC_CONFIG
  252. {
  253. VO_WBC_SOURCE_TYPE_E enSourceType;
  254. DYNAMIC_RANGE_E enDynamicRange;
  255. COMPRESS_MODE_E enCompressMode;
  256. HI_S32 s32Depth;
  257. HI_S32 VoWbc;
  258. VO_WBC_ATTR_S stWbcAttr;
  259. VO_WBC_SOURCE_S stWbcSource;
  260. VO_WBC_MODE_E enWbcMode;
  261. }SAMPLE_VO_WBC_CONFIG;
  262. typedef struct hiSAMPLE_COMM_VO_LAYER_CONFIG_S
  263. {
  264. /* for layer */
  265. VO_LAYER VoLayer;
  266. VO_INTF_SYNC_E enIntfSync;
  267. RECT_S stDispRect;
  268. SIZE_S stImageSize;
  269. PIXEL_FORMAT_E enPixFormat;
  270. HI_U32 u32DisBufLen;
  271. DYNAMIC_RANGE_E enDstDynamicRange;
  272. /* for chn */
  273. SAMPLE_VO_MODE_E enVoMode;
  274. }SAMPLE_COMM_VO_LAYER_CONFIG_S;
  275. typedef struct hiSAMPLE_VO_CONFIG_S
  276. {
  277. /* for device */
  278. VO_DEV VoDev;
  279. VO_INTF_TYPE_E enVoIntfType;
  280. VO_INTF_SYNC_E enIntfSync;
  281. PIC_SIZE_E enPicSize;
  282. HI_U32 u32BgColor;
  283. /* for layer */
  284. PIXEL_FORMAT_E enPixFormat;
  285. RECT_S stDispRect;
  286. SIZE_S stImageSize;
  287. VO_PART_MODE_E enVoPartMode;
  288. HI_U32 u32DisBufLen;
  289. DYNAMIC_RANGE_E enDstDynamicRange;
  290. /* for chnnel */
  291. SAMPLE_VO_MODE_E enVoMode;
  292. } SAMPLE_VO_CONFIG_S;
  293. typedef enum hiTHREAD_CONTRL_E
  294. {
  295. THREAD_CTRL_START,
  296. THREAD_CTRL_PAUSE,
  297. THREAD_CTRL_STOP,
  298. }THREAD_CONTRL_E;
  299. typedef struct hiVDEC_THREAD_PARAM_S
  300. {
  301. HI_S32 s32ChnId;
  302. PAYLOAD_TYPE_E enType;
  303. HI_CHAR cFilePath[128];
  304. HI_CHAR cFileName[128];
  305. HI_S32 s32StreamMode;
  306. HI_S32 s32MilliSec;
  307. HI_S32 s32MinBufSize;
  308. HI_S32 s32IntervalTime;
  309. THREAD_CONTRL_E eThreadCtrl;
  310. HI_U64 u64PtsInit;
  311. HI_U64 u64PtsIncrease;
  312. HI_BOOL bCircleSend;
  313. }VDEC_THREAD_PARAM_S;
  314. typedef struct hiSAMPLE_VDEC_BUF
  315. {
  316. HI_U32 u32PicBufSzie;
  317. HI_U32 u32TmvBufSzie;
  318. HI_BOOL bPicBufAlloc;
  319. HI_BOOL bTmvBufAlloc;
  320. }SAMPLE_VDEC_BUF;
  321. typedef struct hiSAMPLE_VDEC_VIDEO_ATTR
  322. {
  323. VIDEO_DEC_MODE_E enDecMode;
  324. HI_U32 u32RefFrameNum;
  325. DATA_BITWIDTH_E enBitWidth;
  326. }SAMPLE_VDEC_VIDEO_ATTR;
  327. typedef struct hiSAMPLE_VDEC_PICTURE_ATTR
  328. {
  329. PIXEL_FORMAT_E enPixelFormat;
  330. HI_U32 u32Alpha;
  331. }SAMPLE_VDEC_PICTURE_ATTR;
  332. typedef struct hiSAMPLE_VDEC_ATTR
  333. {
  334. PAYLOAD_TYPE_E enType;
  335. VIDEO_MODE_E enMode;
  336. HI_U32 u32Width;
  337. HI_U32 u32Height;
  338. HI_U32 u32FrameBufCnt;
  339. HI_U32 u32DisplayFrameNum;
  340. union
  341. {
  342. SAMPLE_VDEC_VIDEO_ATTR stSapmleVdecVideo; /* structure with video ( h265/h264) */
  343. SAMPLE_VDEC_PICTURE_ATTR stSapmleVdecPicture; /* structure with picture (jpeg/mjpeg )*/
  344. };
  345. }SAMPLE_VDEC_ATTR;
  346. typedef struct hiSAMPLE_VB_BASE_INFO_S
  347. {
  348. PIXEL_FORMAT_E enPixelFormat;
  349. HI_U32 u32Width;
  350. HI_U32 u32Height;
  351. HI_U32 u32Align;
  352. DYNAMIC_RANGE_E enDynamicRange;
  353. COMPRESS_MODE_E enCompressMode;
  354. VIDEO_FORMAT_E enVideoFormat;
  355. HI_BOOL b3DNRBuffer;
  356. }SAMPLE_VB_BASE_INFO_S;
  357. typedef struct hiSAMPLE_VB_CAL_CONFIG_S
  358. {
  359. HI_U32 u32VBSize;
  360. HI_U32 u32HeadStride;
  361. HI_U32 u32HeadSize;
  362. HI_U32 u32HeadYSize;
  363. HI_U32 u32MainStride;
  364. HI_U32 u32MainSize;
  365. HI_U32 u32MainYSize;
  366. HI_U32 u32ExtStride;
  367. HI_U32 u32ExtYSize;
  368. }SAMPLE_VB_CAL_CONFIG_S;
  369. /*******************************************************
  370. function announce
  371. *******************************************************/
  372. HI_VOID * SAMPLE_SYS_IOMmap(HI_U64 u64PhyAddr, HI_U32 u32Size);
  373. HI_S32 SAMPLE_SYS_Munmap(HI_VOID* pVirAddr, HI_U32 u32Size);
  374. HI_S32 SAMPLE_SYS_SetReg(HI_U64 u64Addr, HI_U32 u32Value);
  375. HI_S32 SAMPLE_SYS_GetReg(HI_U64 u64Addr, HI_U32 *pu32Value);
  376. HI_S32 SAMPLE_COMM_SYS_GetPicSize(PIC_SIZE_E enPicSize, SIZE_S* pstSize);
  377. HI_S32 SAMPLE_COMM_SYS_MemConfig(HI_VOID);
  378. HI_VOID SAMPLE_COMM_SYS_Exit(void);
  379. HI_S32 SAMPLE_COMM_SYS_Init(VB_CONFIG_S* pstVbConfig);
  380. HI_S32 SAMPLE_COMM_SYS_InitWithVbSupplement(VB_CONFIG_S* pstVbConf, HI_U32 u32SupplementConfig);
  381. HI_S32 SAMPLE_COMM_VI_Bind_VO(VI_PIPE ViPipe, VI_CHN ViChn, VO_LAYER VoLayer, VO_CHN VoChn);
  382. HI_S32 SAMPLE_COMM_VI_UnBind_VO(VI_PIPE ViPipe, VI_CHN ViChn, VO_LAYER VoLayer, VO_CHN VoChn);
  383. HI_S32 SAMPLE_COMM_VI_Bind_VPSS(VI_PIPE ViPipe, VI_CHN ViChn, VPSS_GRP VpssGrp);
  384. HI_S32 SAMPLE_COMM_VI_UnBind_VPSS(VI_PIPE ViPipe, VI_CHN ViChn, VPSS_GRP VpssGrp);
  385. HI_S32 SAMPLE_COMM_VI_Bind_VENC(VI_PIPE ViPipe, VI_CHN ViChn, VENC_CHN VencChn);
  386. HI_S32 SAMPLE_COMM_VI_UnBind_VENC(VI_PIPE ViPipe, VI_CHN ViChn, VENC_CHN VencChn);
  387. HI_S32 SAMPLE_COMM_VPSS_Bind_AVS(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, AVS_GRP AvsGrp, AVS_PIPE AvsPipe);
  388. HI_S32 SAMPLE_COMM_VPSS_UnBind_AVS(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, AVS_GRP AvsGrp, AVS_PIPE AvsPipe);
  389. HI_S32 SAMPLE_COMM_VPSS_Bind_VO(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VO_LAYER VoLayer, VO_CHN VoChn);
  390. HI_S32 SAMPLE_COMM_VPSS_UnBind_VO(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VO_LAYER VoLayer, VO_CHN VoChn);
  391. HI_S32 SAMPLE_COMM_VPSS_Bind_VENC(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VENC_CHN VencChn);
  392. HI_S32 SAMPLE_COMM_VPSS_UnBind_VENC(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VENC_CHN VencChn);
  393. HI_S32 SAMPLE_COMM_AVS_Bind_AVS(AVS_GRP AvsSrcGrp, AVS_CHN AvsSrcChn, AVS_GRP AvsDestGrp, AVS_CHN AvsDestChn);
  394. HI_S32 SAMPLE_COMM_AVS_UnBind_AVS(AVS_GRP AvsSrcGrp, AVS_CHN AvsSrcChn, AVS_GRP AvsDestGrp, AVS_CHN AvsDestChn);
  395. HI_S32 SAMPLE_COMM_AVS_Bind_VPSS(AVS_GRP AvsGrp, AVS_CHN AvsChn, VPSS_GRP VpssGrp);
  396. HI_S32 SAMPLE_COMM_AVS_UnBind_VPSS(AVS_GRP AvsGrp, AVS_CHN AvsChn, VPSS_GRP VpssGrp);
  397. HI_S32 SAMPLE_COMM_AVS_Bind_VENC(AVS_GRP AvsGrp, AVS_CHN AvsChn, VENC_CHN VencChn);
  398. HI_S32 SAMPLE_COMM_AVS_UnBind_VENC(AVS_GRP AvsGrp, AVS_CHN AvsChn, VENC_CHN VencChn);
  399. HI_S32 SAMPLE_COMM_AVS_Bind_VO(AVS_GRP AvsGrp, AVS_CHN AvsChn, VO_LAYER VoLayer, VO_CHN VoChn);
  400. HI_S32 SAMPLE_COMM_AVS_UnBind_VO(AVS_GRP AvsGrp, AVS_CHN AvsChn, VO_LAYER VoLayer, VO_CHN VoChn);
  401. HI_S32 SAMPLE_COMM_VDEC_Bind_VPSS(VDEC_CHN VdecChn, VPSS_GRP VpssGrp);
  402. HI_S32 SAMPLE_COMM_VDEC_UnBind_VPSS(VDEC_CHN VdecChn, VPSS_GRP VpssGrp);
  403. HI_S32 SAMPLE_COMM_VO_Bind_VO(VO_LAYER SrcVoLayer, VO_CHN SrcVoChn, VO_LAYER DstVoLayer, VO_CHN DstVoChn);
  404. HI_S32 SAMPLE_COMM_VO_UnBind_VO(VO_LAYER DstVoLayer, VO_CHN DstVoChn);
  405. HI_VOID SAMPLE_COMM_ISP_Stop(ISP_DEV IspDev);
  406. HI_VOID SAMPLE_COMM_All_ISP_Stop(HI_VOID);
  407. HI_S32 SAMPLE_COMM_ISP_Run(ISP_DEV* pIspDev);
  408. HI_S32 SAMPLE_COMM_ISP_BindSns(ISP_DEV IspDev, HI_U32 u32SnsId, SAMPLE_SNS_TYPE_E enSnsType, HI_S8 s8SnsDev);
  409. HI_S32 SAMPLE_COMM_ISP_Sensor_Regiter_callback(ISP_DEV IspDev, HI_U32 u32SnsId);
  410. HI_S32 SAMPLE_COMM_ISP_Sensor_UnRegiter_callback(ISP_DEV IspDev);
  411. HI_S32 SAMPLE_COMM_ISP_Aelib_Callback(ISP_DEV IspDev);
  412. HI_S32 SAMPLE_COMM_ISP_Aelib_UnCallback(ISP_DEV IspDev);
  413. HI_S32 SAMPLE_COMM_ISP_Awblib_Callback(ISP_DEV IspDev);
  414. HI_S32 SAMPLE_COMM_ISP_Awblib_UnCallback(ISP_DEV IspDev);
  415. HI_S32 SAMPLE_COMM_ISP_GetIspAttrBySns(SAMPLE_SNS_TYPE_E enSnsType, ISP_PUB_ATTR_S* pstPubAttr);
  416. HI_S32 SAMPLE_COMM_VI_GetWDRModeBySensor(SAMPLE_SNS_TYPE_E enMode, WDR_MODE_E* penWDRMode);
  417. HI_S32 SAMPLE_COMM_VI_GetPipeBySensor(SAMPLE_SNS_TYPE_E enMode, SAMPLE_PIPE_INFO_S* pstPipeInfo);
  418. HI_S32 SAMPLE_COMM_VI_GetSizeBySensor(SAMPLE_SNS_TYPE_E enMode, PIC_SIZE_E* penSize);
  419. HI_S32 SAMPLE_COMM_VI_GetFrameRateBySensor(SAMPLE_SNS_TYPE_E enMode, HI_U32* pu32FrameRate);
  420. HI_S32 SAMPLE_COMM_VI_StartDev(SAMPLE_VI_INFO_S* pstViInfo);
  421. HI_S32 SAMPLE_COMM_VI_StartChn(VI_CHN ViChn, RECT_S* pstCapRect, SIZE_S* pstTarSize, SAMPLE_VI_CONFIG_S* pstViConfig);
  422. HI_S32 SAMPLE_COMM_VI_StartMIPI(SAMPLE_VI_CONFIG_S* pstViConfig);
  423. HI_S32 SAMPLE_COMM_VI_StartVi(SAMPLE_VI_CONFIG_S* pstViConfig);
  424. HI_S32 SAMPLE_COMM_VI_StopVi(SAMPLE_VI_CONFIG_S* pstViConfig);
  425. HI_S32 SAMPLE_COMM_VI_SetMipiAttr(SAMPLE_VI_CONFIG_S* pstViConfig);
  426. HI_S32 SAMPLE_COMM_VI_GetDevAttrBySns(SAMPLE_SNS_TYPE_E enSnsType, VI_DEV_ATTR_S *pstViDevAttr);
  427. HI_VOID SAMPLE_COMM_VI_GetSensorInfo(SAMPLE_VI_CONFIG_S* pstViConfig);
  428. combo_dev_t SAMPLE_COMM_VI_GetComboDevBySensor(SAMPLE_SNS_TYPE_E enMode, HI_S32 s32SnsIdx);
  429. HI_S32 SAMPLE_COMM_VI_SaveRaw(VIDEO_FRAME_S* pVBuf, HI_U32 u32Nbit, FILE* pfd);
  430. HI_VOID* SAMPLE_COMM_VI_DumpRaw(HI_VOID *arg);
  431. HI_S32 SAMPLE_COMM_VI_StartDumpRawThread(VI_PIPE ViPipe, HI_S32 s32Cnt, const HI_CHAR *pzsName);
  432. HI_S32 SAMPLE_COMM_VI_StopDumpRawThread(HI_VOID);
  433. HI_S32 SAMPLE_COMM_VI_SetParam(SAMPLE_VI_CONFIG_S* pstViConfig);
  434. HI_S32 SAMPLE_COMM_VI_SwitchMode_StopVI(SAMPLE_VI_CONFIG_S* pstViConfigSrc);
  435. HI_S32 SAMPLE_COMM_VI_SwitchMode(SAMPLE_VI_CONFIG_S* pstViConfigDes);
  436. HI_S32 SAMPLE_COMM_VPSS_Start(VPSS_GRP VpssGrp, HI_BOOL* pabChnEnable, VPSS_GRP_ATTR_S* pstVpssGrpAttr, VPSS_CHN_ATTR_S* pastVpssChnAttr);
  437. HI_S32 SAMPLE_COMM_VPSS_Stop(VPSS_GRP VpssGrp, HI_BOOL* pabChnEnable);
  438. HI_S32 SAMPLE_COMM_VO_GetWH(VO_INTF_SYNC_E enIntfSync, HI_U32* pu32W, HI_U32* pu32H, HI_U32* pu32Frm);
  439. HI_S32 SAMPLE_COMM_VO_MemConfig(VO_DEV VoDev, HI_CHAR* pcMmzName);
  440. HI_S32 SAMPLE_COMM_VO_StartDev(VO_DEV VoDev, VO_PUB_ATTR_S* pstPubAttr);
  441. HI_S32 SAMPLE_COMM_VO_StopDev(VO_DEV VoDev);
  442. HI_S32 SAMPLE_COMM_VO_StartLayer(VO_LAYER VoLayer, const VO_VIDEO_LAYER_ATTR_S* pstLayerAttr);
  443. HI_S32 SAMPLE_COMM_VO_StopLayer(VO_LAYER VoLayer);
  444. HI_S32 SAMPLE_COMM_VO_StartChn(VO_LAYER VoLayer, SAMPLE_VO_MODE_E enMode);
  445. HI_S32 SAMPLE_COMM_VO_StopChn(VO_LAYER VoLayer, SAMPLE_VO_MODE_E enMode);
  446. HI_S32 SAMPLE_COMM_VO_StartWBC(SAMPLE_VO_WBC_CONFIG * pWbcConfig);
  447. HI_S32 SAMPLE_COMM_VO_StopWBC(SAMPLE_VO_WBC_CONFIG * pWbcConfig);
  448. HI_S32 SAMPLE_COMM_VO_GetDefWBCConfig(SAMPLE_VO_WBC_CONFIG * pWbcConfig);
  449. HI_S32 SAMPLE_COMM_VO_BindVpss(VO_LAYER VoLayer, VO_CHN VoChn, VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
  450. HI_S32 SAMPLE_COMM_VO_UnBindVpss(VO_LAYER VoLayer, VO_CHN VoChn, VPSS_GRP VpssGrp, VPSS_CHN VpssChn);
  451. HI_S32 SAMPLE_COMM_VO_BindVi(VO_LAYER VoLayer, VO_CHN VoChn, VI_CHN ViChn);
  452. HI_S32 SAMPLE_COMM_VO_UnBindVi(VO_LAYER VoLayer, VO_CHN VoChn);
  453. HI_S32 SAMPLE_COMM_VO_HdmiStart(VO_INTF_SYNC_E enIntfSync);
  454. HI_S32 SAMPLE_COMM_VO_HdmiStartByDyRg(VO_INTF_SYNC_E enIntfSync, DYNAMIC_RANGE_E enDyRg);
  455. HI_S32 SAMPLE_COMM_VO_HdmiStop(HI_VOID);
  456. HI_S32 SAMPLE_COMM_VO_GetDefConfig(SAMPLE_VO_CONFIG_S *pstVoConfig);
  457. HI_S32 SAMPLE_COMM_VO_StopVO(SAMPLE_VO_CONFIG_S *pstVoConfig);
  458. HI_S32 SAMPLE_COMM_VO_StartVO(SAMPLE_VO_CONFIG_S *pstVoConfig);
  459. HI_S32 SAMPLE_COMM_VO_GetDefLayerConfig(SAMPLE_COMM_VO_LAYER_CONFIG_S * pstVoLayerConfig);
  460. HI_S32 SAMPLE_COMM_VO_StartLayerChn(SAMPLE_COMM_VO_LAYER_CONFIG_S * pstVoLayerConfig);
  461. HI_S32 SAMPLE_COMM_VO_StopLayerChn(SAMPLE_COMM_VO_LAYER_CONFIG_S * pstVoLayerConfig);
  462. HI_S32 SAMPLE_COMM_VENC_MemConfig(HI_VOID);
  463. HI_S32 SAMPLE_COMM_VENC_Creat(VENC_CHN VencChn, PAYLOAD_TYPE_E enType, PIC_SIZE_E enSize, SAMPLE_RC_E enRcMode, HI_U32 u32Profile, VENC_GOP_ATTR_S *pstGopAttr);
  464. HI_S32 SAMPLE_COMM_VENC_Start(VENC_CHN VencChn, PAYLOAD_TYPE_E enType, PIC_SIZE_E enSize, SAMPLE_RC_E enRcMode, HI_U32 u32Profile, VENC_GOP_ATTR_S *pstGopAttr);
  465. HI_S32 SAMPLE_COMM_VENC_Stop(VENC_CHN VencChn);
  466. HI_S32 SAMPLE_COMM_VENC_SnapStart(VENC_CHN VencChn, SIZE_S* pstSize, HI_BOOL bSupportDCF);
  467. HI_S32 SAMPLE_COMM_VENC_SnapProcess(VENC_CHN VencChn, HI_U32 SnapCnt, HI_BOOL bSaveJpg, HI_BOOL bSaveThm);
  468. HI_S32 SAMPLE_COMM_VENC_SaveJpeg(VENC_CHN VencChn, HI_U32 SnapCnt);
  469. HI_S32 SAMPLE_COMM_VENC_SnapStop(VENC_CHN VencChn);
  470. HI_S32 SAMPLE_COMM_VENC_StartGetStream(VENC_CHN VeChn[],HI_S32 s32Cnt);
  471. HI_S32 SAMPLE_COMM_VENC_StopGetStream(void);
  472. HI_S32 SAMPLE_COMM_VENC_StartGetStream_Svc_t(HI_S32 s32Cnt);
  473. HI_S32 SAMPLE_COMM_VENC_GetGopAttr(VENC_GOP_MODE_E enGopMode,VENC_GOP_ATTR_S *pstGopAttr);
  474. HI_S32 SAMPLE_COMM_VENC_QpmapSendFrame(VPSS_GRP VpssGrp,VPSS_CHN VpssChn,VENC_CHN VeChn[],HI_S32 s32Cnt,SIZE_S stSize);
  475. HI_S32 SAMPLE_COMM_VENC_StopSendQpmapFrame(void);
  476. HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAiAo(AUDIO_DEV AiDev, AI_CHN AiChn, AUDIO_DEV AoDev, AO_CHN AoChn);
  477. HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAiAenc(AUDIO_DEV AiDev, AI_CHN AiChn, AENC_CHN AeChn);
  478. HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAencAdec(AENC_CHN AeChn, ADEC_CHN AdChn, FILE* pAecFd);
  479. HI_S32 SAMPLE_COMM_AUDIO_CreatTrdFileAdec(ADEC_CHN AdChn, FILE* pAdcFd);
  480. HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAoVolCtrl(AUDIO_DEV AoDev);
  481. HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdAi(AUDIO_DEV AiDev, AI_CHN AiChn);
  482. HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdAencAdec(AENC_CHN AeChn);
  483. HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdFileAdec(ADEC_CHN AdChn);
  484. HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdAoVolCtrl(AUDIO_DEV AoDev);
  485. HI_S32 SAMPLE_COMM_AUDIO_DestoryAllTrd(void);
  486. HI_S32 SAMPLE_COMM_AUDIO_AoBindAdec(AUDIO_DEV AoDev, AO_CHN AoChn, ADEC_CHN AdChn);
  487. HI_S32 SAMPLE_COMM_AUDIO_AoUnbindAdec(AUDIO_DEV AoDev, AO_CHN AoChn, ADEC_CHN AdChn);
  488. HI_S32 SAMPLE_COMM_AUDIO_AoBindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AUDIO_DEV AoDev, AO_CHN AoChn);
  489. HI_S32 SAMPLE_COMM_AUDIO_AoUnbindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AUDIO_DEV AoDev, AO_CHN AoChn);
  490. HI_S32 SAMPLE_COMM_AUDIO_AencBindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AENC_CHN AeChn);
  491. HI_S32 SAMPLE_COMM_AUDIO_AencUnbindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AENC_CHN AeChn);
  492. HI_S32 SAMPLE_COMM_AUDIO_CfgAcodec(AIO_ATTR_S* pstAioAttr);
  493. HI_S32 SAMPLE_COMM_AUDIO_StartAi(AUDIO_DEV AiDevId, HI_S32 s32AiChnCnt,
  494. AIO_ATTR_S* pstAioAttr, AUDIO_SAMPLE_RATE_E enOutSampleRate, HI_BOOL bResampleEn, HI_VOID* pstAiVqeAttr, HI_U32 u32AiVqeType);
  495. HI_S32 SAMPLE_COMM_AUDIO_StopAi(AUDIO_DEV AiDevId, HI_S32 s32AiChnCnt, HI_BOOL bResampleEn, HI_BOOL bVqeEn);
  496. HI_S32 SAMPLE_COMM_AUDIO_StartAo(AUDIO_DEV AoDevId, HI_S32 s32AoChnCnt,
  497. AIO_ATTR_S* pstAioAttr, AUDIO_SAMPLE_RATE_E enInSampleRate, HI_BOOL bResampleEn);
  498. HI_S32 SAMPLE_COMM_AUDIO_StartAoWithVQE(AUDIO_DEV AoDevId, HI_S32 s32AoChnCnt,
  499. AIO_ATTR_S* pstAioAttr, AUDIO_SAMPLE_RATE_E enInSampleRate,
  500. HI_BOOL bResampleEn, AO_VQE_CONFIG_S* pstAoVqeAttr, HI_U32 u32AiVqeType);
  501. HI_S32 SAMPLE_COMM_AUDIO_StopAo(AUDIO_DEV AoDevId, HI_S32 s32AoChnCnt, HI_BOOL bResampleEn);
  502. HI_S32 SAMPLE_COMM_AUDIO_StartAenc(HI_S32 s32AencChnCnt, AIO_ATTR_S *pstAioAttr, PAYLOAD_TYPE_E enType);
  503. HI_S32 SAMPLE_COMM_AUDIO_StopAenc(HI_S32 s32AencChnCnt);
  504. HI_S32 SAMPLE_COMM_AUDIO_StartAdec(ADEC_CHN AdChn, PAYLOAD_TYPE_E enType);
  505. HI_S32 SAMPLE_COMM_AUDIO_StopAdec(ADEC_CHN AdChn);
  506. HI_S32 SAMPLE_COMM_VDEC_InitVBPool(HI_U32 ChnNum, SAMPLE_VDEC_ATTR *pastSampleVdec);
  507. HI_VOID SAMPLE_COMM_VDEC_ExitVBPool(HI_VOID);
  508. HI_VOID SAMPLE_COMM_VDEC_CmdCtrl(HI_S32 s32ChnNum,VDEC_THREAD_PARAM_S *pstVdecSend, pthread_t *pVdecThread);
  509. HI_VOID SAMPLE_COMM_VDEC_StartSendStream(HI_S32 s32ChnNum, VDEC_THREAD_PARAM_S *pstVdecSend, pthread_t *pVdecThread);
  510. HI_VOID SAMPLE_COMM_VDEC_StopSendStream(HI_S32 s32ChnNum, VDEC_THREAD_PARAM_S *pstVdecSend, pthread_t *pVdecThread);
  511. HI_VOID* SAMPLE_COMM_VDEC_SendStream(HI_VOID *pArgs);
  512. HI_VOID SAMPLE_COMM_VDEC_StartGetPic(HI_S32 s32ChnNum, VDEC_THREAD_PARAM_S *pstVdecGet, pthread_t *pVdecThread);
  513. HI_VOID SAMPLE_COMM_VDEC_StopGetPic(HI_S32 s32ChnNum, VDEC_THREAD_PARAM_S *pstVdecGet, pthread_t *pVdecThread);
  514. HI_S32 SAMPLE_COMM_VDEC_Start(HI_S32 s32ChnNum, SAMPLE_VDEC_ATTR *pastSampleVdec);
  515. HI_S32 SAMPLE_COMM_VDEC_Stop(HI_S32 s32ChnNum);
  516. #ifdef __cplusplus
  517. #if __cplusplus
  518. }
  519. #endif
  520. #endif /* End of #ifdef __cplusplus */
  521. #endif /* End of #ifndef __SAMPLE_COMMON_H__ */