|
@@ -0,0 +1,49 @@
|
|
|
+#ifndef __VI_MEM_H__
|
|
|
+#define __VI_MEM_H__
|
|
|
+
|
|
|
+#include "csi_frame_ex.h"
|
|
|
+
|
|
|
+#ifdef __cplusplus
|
|
|
+extern "C" {
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+typedef enum vi_component{
|
|
|
+ VI_COMPONENT_VIPRE,
|
|
|
+ VI_COMPONENT_ISP,
|
|
|
+ VI_COMPONENT_RY,
|
|
|
+ VI_COMPONENT_DW,
|
|
|
+ VI_COMPONENT_DSP,
|
|
|
+ VI_COMPONENT_OTHER,
|
|
|
+ VI_COMPONENT_INVALID
|
|
|
+}vi_component_e;
|
|
|
+
|
|
|
+int vi_mem_init();
|
|
|
+int vi_mem_uninit();
|
|
|
+void *vi_mem_alloc(int size, int vi_mem_pool_region_id);
|
|
|
+void vi_mem_free(void *addr);
|
|
|
+void vi_mem_retain(void *addr);
|
|
|
+
|
|
|
+//phyaddr to viraddr
|
|
|
+void *vi_mem_map(void *addr);
|
|
|
+//viraddr to phyaddr
|
|
|
+void *vi_mem_unmap(void *viraddr);
|
|
|
+//input is phyaddr, return dmabuf fd
|
|
|
+int vi_mem_export(void *addr);
|
|
|
+//input is dmabuf fd, return phyaddr
|
|
|
+void *vi_mem_import(int fd);
|
|
|
+// input is phyaddr, release dmabuf.It's not free dmabuf.
|
|
|
+int vi_mem_release(void *addr);
|
|
|
+int vi_mem_remove_ext_buf_region(int region_id);
|
|
|
+int vi_mem_remove_ext_buf_fd(int fd);
|
|
|
+int vi_mem_ext_region_alloc(int id, int (*alloc)(void *ctx,int size), int (*free)(void *ctx,int fd),void* ctx);
|
|
|
+int vi_mem_ext_region_free(int id);
|
|
|
+int csi_camera_register_frame(csi_frame_ex_s *frame[],int frame_count);
|
|
|
+int vi_frames_uninit();
|
|
|
+int vi_frame_alloc(csi_frame_ex_s *frame);
|
|
|
+int csi_camera_release_frame(csi_frame_ex_s *frame);
|
|
|
+
|
|
|
+#ifdef __cplusplus
|
|
|
+}
|
|
|
+#endif
|
|
|
+#endif /* !__VI_MEM_H__ */
|