val_api_public.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. #ifndef _VAL_API_PUBLIC_H_
  2. #define _VAL_API_PUBLIC_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "val_types_public.h"
  7. /**
  8. * @par Function
  9. * eVideoInitMVA
  10. * @par Description
  11. * Alloc the handle for MVA usage
  12. * @param
  13. * a_pvHandle [IN] The handle for MVA usage
  14. * @par Returns
  15. * VAL_UINT32_T [OUT] Non-Used
  16. */
  17. VAL_UINT32_T eVideoInitMVA(VAL_VOID_T **a_pvHandle);
  18. /**
  19. * @par Function
  20. * eVideoAllocMVA
  21. * @par Description
  22. * Use the given va and size, to get the MVA
  23. * @param
  24. * a_pvHandle [IN] The handle for MVA usage
  25. * @param
  26. * a_u4Va [IN] The given va used to get MVA
  27. * @param
  28. * ap_u4Pa [OUT] The MVA
  29. * @param
  30. * a_u4Size [IN] The given size used to get MVA
  31. * @param
  32. * a_pvM4uConfig [IN] The MVA config info
  33. * @par Returns
  34. * VAL_UINT32_T [OUT] Non-Used
  35. */
  36. VAL_UINT32_T eVideoAllocMVA(
  37. VAL_VOID_T *a_pvHandle,
  38. VAL_UINT32_T a_u4Va,
  39. VAL_UINT32_T *ap_u4Pa,
  40. VAL_UINT32_T a_u4Size,
  41. VAL_VCODEC_M4U_BUFFER_CONFIG_T * a_pvM4uConfig
  42. );
  43. /**
  44. * @par Function
  45. * eVideoFreeMVA
  46. * @par Description
  47. * Use the given va, MVA and size, to free the MVA
  48. * @param
  49. * a_pvHandle [IN] The handle for MVA usage
  50. * @param
  51. * a_u4Va [IN] The given va used to free MVA
  52. * @param
  53. * a_u4Pa [IN] The given MVA used to free MVA
  54. * @param
  55. * a_u4Size [IN] The given size used to get MVA
  56. * @param
  57. * a_pvM4uConfig [IN] The MVA config info
  58. * @par Returns
  59. * VAL_UINT32_T [OUT] Non-Used
  60. */
  61. VAL_UINT32_T eVideoFreeMVA(
  62. VAL_VOID_T *a_pvHandle,
  63. VAL_UINT32_T a_u4Va,
  64. VAL_UINT32_T a_u4Pa,
  65. VAL_UINT32_T a_u4Size,
  66. VAL_VCODEC_M4U_BUFFER_CONFIG_T * a_pvM4uConfig
  67. );
  68. /**
  69. * @par Function
  70. * eVideoDeInitMVA
  71. * @par Description
  72. * Free the handle for MVA usage
  73. * @param
  74. * a_pvHandle [IN] The handle for MVA usage
  75. * @par Returns
  76. * VAL_UINT32_T [OUT] Non-Used
  77. */
  78. VAL_UINT32_T eVideoDeInitMVA(VAL_VOID_T *a_pvHandle);
  79. /**
  80. * @par Function
  81. * eVideoGetM4UModuleID
  82. * @par Description
  83. * Get the M4U module port ID
  84. * @param
  85. * u4MemType [IN] The memory usage for VENC or VDEC
  86. * @par Returns
  87. * VAL_UINT32_T [OUT] The M4U module port ID for VENC or VDEC
  88. */
  89. VAL_INT32_T eVideoGetM4UModuleID(VAL_UINT32_T u4MemType);
  90. /**
  91. * @par Function
  92. * eVideoAtoi
  93. * @par Description
  94. * The abstraction layer for atoi() function
  95. * @param
  96. * a_prParam [IN] The structure contains used info for atoi()
  97. * @param
  98. * a_u4ParamSize [IN] The size of a_prParam structure
  99. * @par Returns
  100. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_PARAMETER for fail
  101. */
  102. VAL_RESULT_T eVideoAtoi(VAL_ATOI_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  103. /**
  104. * @par Function
  105. * eVideoStrStr
  106. * @par Description
  107. * The abstraction layer for strstr() function
  108. * @param
  109. * a_prParam [IN] The structure contains used info for strstr()
  110. * @param
  111. * a_u4ParamSize [IN] The size of a_prParam structure
  112. * @par Returns
  113. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_PARAMETER for fail
  114. */
  115. VAL_RESULT_T eVideoStrStr(VAL_STRSTR_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  116. /**
  117. * @par Function
  118. * eVideoFlushCache
  119. * @par Description
  120. * The flush cache usage function
  121. * @param
  122. * a_prParam [IN] The structure contains used info for flush cache
  123. * @param
  124. * a_u4ParamSize [IN] The size of a_prParam structure
  125. * @param
  126. * optype [IN] 0 for flush all, 1 for flush by page
  127. * @par Returns
  128. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_MEMORY for fail
  129. */
  130. VAL_RESULT_T eVideoFlushCache(VAL_MEMORY_T *a_prParam, VAL_UINT32_T a_u4ParamSize, VAL_UINT32_T optype);
  131. /**
  132. * @par Function
  133. * eVideoInvalidateCache
  134. * @par Description
  135. * The invalidate cache usage function
  136. * @param
  137. * a_prParam [IN] The structure contains used info for invalidate cache
  138. * @param
  139. * a_u4ParamSize [IN] The size of a_prParam structure
  140. * @param
  141. * optype [IN] 0 for flush all, 1 for invalidate by page
  142. * @par Returns
  143. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_MEMORY for fail
  144. */
  145. VAL_RESULT_T eVideoInvalidateCache(VAL_MEMORY_T *a_prParam, VAL_UINT32_T a_u4ParamSize, VAL_UINT32_T optype);
  146. /**
  147. * @par Function
  148. * eVideoMemAlloc
  149. * @par Description
  150. * The memory allocate usage function
  151. * @param
  152. * a_prParam [IN] The structure contains used info for allocate memory
  153. * @param
  154. * a_u4ParamSize [IN] The size of a_prParam structure
  155. * @par Returns
  156. * VAL_RESULT_T [OUT]
  157. * VAL_RESULT_NO_ERROR for success,
  158. * VAL_RESULT_INVALID_MEMORY or VAL_RESULT_INVALID_PARAMETER for fail
  159. */
  160. VAL_RESULT_T eVideoMemAlloc(VAL_MEMORY_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  161. /**
  162. * @par Function
  163. * eVideoMemFree
  164. * @par Description
  165. * The memory free usage function
  166. * @param
  167. * a_prParam [IN] The structure contains used info for free memory
  168. * @param
  169. * a_u4ParamSize [IN] The size of a_prParam structure
  170. * @par Returns
  171. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_PARAMETER for fail
  172. */
  173. VAL_RESULT_T eVideoMemFree(VAL_MEMORY_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  174. /**
  175. * @par Function
  176. * eVideoMemSet
  177. * @par Description
  178. * The memory set usage function
  179. * @param
  180. * a_prParam [IN] The structure contains used info for set memory
  181. * @param
  182. * a_u4ParamSize [IN] The size of a_prParam structure
  183. * @param
  184. * a_u4Value [IN] The value for set to memory
  185. * @param
  186. * a_u4Size [IN] The size of "memory" want to be set
  187. * @par Returns
  188. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_PARAMETER for fail
  189. */
  190. VAL_RESULT_T eVideoMemSet(
  191. VAL_MEMORY_T *a_prParam,
  192. VAL_UINT32_T a_u4ParamSize,
  193. VAL_INT32_T a_u4Value,
  194. VAL_UINT32_T a_u4Size
  195. );
  196. /**
  197. * @par Function
  198. * eVideoMemCpy
  199. * @par Description
  200. * The memory copy usage function
  201. * @param
  202. * a_prParamDst [IN] The structure contains destination memory info for copy memory
  203. * @param
  204. * a_u4ParamDstSize [IN] The size of a_prParamDst structure
  205. * @param
  206. * a_prParamSrc [IN] The structure contains source memory info for copy memory
  207. * @param
  208. * a_u4ParamSrcSize [IN] The size of a_prParamSrc structure
  209. * @param
  210. * a_u4Size [IN] The size of "source memory" and "destination memory" want to be copied
  211. * @par Returns
  212. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_PARAMETER for fail
  213. */
  214. VAL_RESULT_T eVideoMemCpy(
  215. VAL_MEMORY_T *a_prParamDst,
  216. VAL_UINT32_T a_u4ParamDstSize,
  217. VAL_MEMORY_T *a_prParamSrc,
  218. VAL_UINT32_T a_u4ParamSrcSize,
  219. VAL_UINT32_T a_u4Size
  220. );
  221. /**
  222. * @par Function
  223. * eVideoMemCmp
  224. * @par Description
  225. * The memory compare usage function
  226. * @param
  227. * a_prParamSrc1 [IN] The structure contains memory 1 info for compare memory
  228. * @param
  229. * a_u4ParamSrc1Size [IN] The size of a_prParamSrc1 structure
  230. * @param
  231. * a_prParamSrc2 [IN] The structure contains memory 2 info for compare memory
  232. * @param
  233. * a_u4ParamSrc2Size [IN] The size of a_prParamSrc2 structure
  234. * @param
  235. * a_u4Size [IN] The size of "memory 1" and "memory 2" want to be compared
  236. * @par Returns
  237. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_INVALID_PARAMETER for fail
  238. */
  239. VAL_RESULT_T eVideoMemCmp(
  240. VAL_MEMORY_T *a_prParamSrc1,
  241. VAL_UINT32_T a_u4ParamSrc1Size,
  242. VAL_MEMORY_T *a_prParamSrc2,
  243. VAL_UINT32_T a_u4ParamSrc2Size,
  244. VAL_UINT32_T a_u4Size
  245. );
  246. /**
  247. * @par Function
  248. * WaitISR
  249. * @par Description
  250. * The ISR usage related function, whene trigger HW, we will use to wait HW complete
  251. * @param
  252. * a_prParam [IN] The structure contains used info for ISR usage
  253. * @param
  254. * a_u4ParamSize [IN] The size of a_prParam structure
  255. * @par Returns
  256. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_ISR_TIMEOUT for fail
  257. */
  258. VAL_RESULT_T WaitISR(VAL_ISR_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  259. /**
  260. * @par Function
  261. * eVideoLockHW
  262. * @par Description
  263. * The single/multiple instance usage function, to allow using HW
  264. * @param
  265. * a_prParam [IN] The structure contains used info for Lock HW
  266. * @param
  267. * a_u4ParamSize [IN] The size of a_prParam structure
  268. * @par Returns
  269. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_UNKNOWN_ERROR for fail
  270. */
  271. VAL_RESULT_T eVideoLockHW(VAL_HW_LOCK_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  272. /**
  273. * @par Function
  274. * eVideoLockHW
  275. * @par Description
  276. * The single/multiple instance usage function, to release HW for another instance
  277. * @param
  278. * a_prParam [IN] The structure contains used info for unLock HW
  279. * @param
  280. * a_u4ParamSize [IN] The size of a_prParam structure
  281. * @par Returns
  282. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success, VAL_RESULT_UNKNOWN_ERROR for fail
  283. */
  284. VAL_RESULT_T eVideoUnLockHW(VAL_HW_LOCK_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  285. /**
  286. * @par Function
  287. * eVideoGetTimeOfDay
  288. * @par Description
  289. * The timing usage function, used to performance profiling
  290. * @param
  291. * a_prParam [IN] The structure contains used info for timing usage
  292. * @param
  293. * a_u4ParamSize [IN] The size of a_prParam structure
  294. * @par Returns
  295. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success
  296. */
  297. VAL_RESULT_T eVideoGetTimeOfDay(VAL_TIME_T *a_prParam, VAL_UINT32_T a_u4ParamSize);
  298. /**
  299. * @par Function
  300. * eHalEMICtrlForRecordSize
  301. * @par Description
  302. * The recording info function, to get the record size for setting to EMI controller
  303. * @param
  304. * a_prDrvRecordSize [IN] The structure contains used info for recording size
  305. * @par Returns
  306. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success
  307. */
  308. VAL_RESULT_T eHalEMICtrlForRecordSize(VAL_RECORD_SIZE_T *a_prDrvRecordSize);
  309. /**
  310. * @par Function
  311. * eVideoVcodecSetThreadID
  312. * @par Description
  313. * The thread info function, to set thread ID for used to lock/unlock HW and priority adjustment
  314. * @param
  315. * a_prThreadID [IN] The structure contains used info for thread info
  316. * @par Returns
  317. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success
  318. */
  319. VAL_RESULT_T eVideoVcodecSetThreadID(VAL_VCODEC_THREAD_ID_T *a_prThreadID);
  320. /**
  321. * @par Function
  322. * eVideoGetParam
  323. * @par Description
  324. * The parameter info function, to get val parameter
  325. * @param
  326. * a_eType [IN] The VAL_GET_TYPE_T enum
  327. * @param
  328. * a_pvInParam [IN] The input parameter
  329. * @param
  330. * a_pvOutParam [OUT] The output parameter
  331. * @par Returns
  332. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success
  333. */
  334. VAL_RESULT_T eVideoGetParam(VAL_GET_TYPE_T a_eType, VAL_VOID_T *a_pvInParam, VAL_VOID_T *a_pvOutParam);
  335. /**
  336. * @par Function
  337. * eVideoSetParam
  338. * @par Description
  339. * The parameter info function, to set val parameter
  340. * @param
  341. * a_eType [IN] The VAL_SET_TYPE_T enum
  342. * @param
  343. * a_pvInParam [IN] The input parameter
  344. * @param
  345. * a_pvOutParam [OUT] The output parameter
  346. * @par Returns
  347. * VAL_RESULT_T [OUT] VAL_RESULT_NO_ERROR for success
  348. */
  349. VAL_RESULT_T eVideoSetParam(VAL_SET_TYPE_T a_eType, VAL_VOID_T *a_pvInParam, VAL_VOID_T *a_pvOutParam);
  350. VAL_RESULT_T eVideoE3TCMPowerON(VAL_UINT32_T a_u4E3TCMClk);
  351. VAL_RESULT_T eVideoE3TCMPowerOFF(VAL_UINT32_T a_u4E3TCMClk);
  352. #ifdef __cplusplus
  353. }
  354. #endif
  355. #endif /* #ifndef _VAL_API_PUBLIC_H_ */