ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef __HAL_CAMERA_PLATFORM_H__
#define __HAL_CAMERA_PLATFORM_H__
 
#include <memory/memoryAdapter.h>
#include <memory/sc_interface.h>
#include GPU_PUBLIC_INCLUDE
#include <HardwareAPI.h> //VideoNativeHandleMetadata strust dependencies
 
#ifdef __A80__
#define __PLATFORM_A80__
#define BUFFER_PHY_OFFSET 0
#define GPU_BUFFER_ALIGN
 
//#define __OPEN_FACEDECTION__
//#define __OPEN_SMILEDECTION__
//#define __OPEN_BLINKDECTION__
//#define __OPEN_SMARTDECTION__
 
#define __CEDARX_FRAMEWORK_2__
 
#define USE_ION_MEM_ALLOCATOR
#endif
 
#ifdef __A83__
#define __PLATFORM_A83__
#define BUFFER_PHY_OFFSET 0
#define GPU_BUFFER_ALIGN ALIGN_4K
 
#define __CEDARX_FRAMEWORK_2__
 
//#define __OPEN_FACEDECTION__
//#define __OPEN_SMILEDECTION__
//#define __OPEN_SMARTDECTION__
//#define __OPEN_BLINKDECTION__
 
 
#define USE_ION_MEM_ALLOCATOR
#define WATI_FACEDETECT
#define USE_SUNXI_CAMERA_H
#endif
 
#ifdef __T5__
#define BUFFER_PHY_OFFSET 0
#define GPU_BUFFER_ALIGN ALIGN_16B
 
#define __CEDARX_FRAMEWORK_2__
#define ENABLE_CAMERA_SOURCE  1
 
//#define USE_DEINTERLACE_HW
//#define __OPEN_FACEDECTION__
//#define __OPEN_SMILEDECTION__
//#define __OPEN_SMARTDECTION__
//#define __OPEN_BLINKDECTION__
 
 
#define USE_ION_MEM_ALLOCATOR
//#define WATI_FACEDETECT
//#define USE_SUNXI_CAMERA_H
#define USE_CSI_VIN_DRIVER
#endif
 
#ifdef __T7__
#define __PLATFORM_T7__
#define BUFFER_PHY_OFFSET 0
#define GPU_BUFFER_ALIGN ALIGN_16B
 
#define __CEDARX_FRAMEWORK_2__
#define ENABLE_CAMERA_SOURCE  1
 
#define USE_DEINTERLACE_HW
//#define __OPEN_FACEDECTION__
//#define __OPEN_SMILEDECTION__
//#define __OPEN_SMARTDECTION__
//#define __OPEN_BLINKDECTION__
 
 
#define USE_ION_MEM_ALLOCATOR
//#define WATI_FACEDETECT
//#define USE_SUNXI_CAMERA_H
#define USE_CSI_VIN_DRIVER
#endif
 
#ifdef __A64__
#define __PLATFORM_A64__
#define BUFFER_PHY_OFFSET 0
#define GPU_BUFFER_ALIGN
 
#define __CEDARX_FRAMEWORK_2__
 
//#define __OPEN_FACEDECTION__
//#define __OPEN_SMILEDECTION__
//#define __OPEN_SMARTDECTION__
//#define __OPEN_BLINKDECTION__
 
 
#define USE_ION_MEM_ALLOCATOR
//#define WATI_FACEDETECT
#define USE_SUNXI_CAMERA_H
#endif
 
 
#ifdef USE_ION_MEM_ALLOCATOR
extern "C" int ion_alloc_open();
extern "C" int ion_alloc_close();
extern "C" void* ion_alloc_palloc(int size);
extern "C" void ion_alloc_pfree(void * pbuf);
extern "C" void* ion_alloc_vir2phy_cpu(void * pbuf);
extern "C" void* ion_alloc_phy2vir_cpu(void * pbuf);
extern "C" void ion_alloc_flush_cache(void* startAddr, int size);
extern "C" void ion_flush_cache_all();
 
 
//extern struct ScMemOpsS* MemCamAdapterGetOpsS();
//struct ScMemOpsS* mMemOpsS = MemAdapterGetOpsS();
/*#define camera_phy_alloc_open()      mMemOpsS->open()
#define camera_phy_alloc_close()     mMemOpsS->close()
#define camera_phy_alloc_alloc(x)    mMemOpsS->palloc(x)
#define camera_phy_alloc_free(x)     mMemOpsS->pfree(x)
#define camera_phy_alloc_vir2phy(x)  mMemOpsS->cpu_get_phyaddr(x)
#define camera_phy_alloc_phy2vir(x)  mMemOpsS->cpu_get_viraddr(x)
#define camera_phy_flush_cache(x,y)  mMemOpsS->flush_cache(x,y)*/
//#define camera_phy_flush_cache_all() ion_flush_cache_all()
 
#elif USE_SUNXI_MEM_ALLOCATOR
extern "C" int sunxi_alloc_open();
extern "C" int sunxi_alloc_close();
extern "C" int sunxi_alloc_alloc(int size);
extern "C" void sunxi_alloc_free(void * pbuf);
extern "C" int sunxi_alloc_vir2phy(void * pbuf);
extern "C" int sunxi_alloc_phy2vir(void * pbuf);
extern "C" void sunxi_flush_cache(void * startAddr, int size);
extern "C" void sunxi_flush_cache_all();
 
#define camera_phy_alloc_open        sunxi_alloc_open()
#define camera_phy_alloc_close       sunxi_alloc_close()
#define camera_phy_alloc_alloc(x)    sunxi_alloc_alloc(x)
#define camera_phy_alloc_free(x)     sunxi_alloc_free(x)
#define camera_phy_alloc_vir2phy(x)  sunxi_alloc_vir2phy(x)
#define camera_phy_alloc_phy2vir(x)  int sunxi_alloc_phy2vir(x);
#define camera_phy_flush_cache(x,y)  sunxi_flush_cache(x,y);
#define camera_phy_flush_cache_all() sunxi_flush_cache_all()
#endif
 
#endif