openncc frame
native_vpu_api.h
Go to the documentation of this file.
1 
9 #ifndef __NATIVE_VPU_API_H__
10 #define __NATIVE_VPU_API_H__
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 
19 typedef enum
20 {
25 }LOG_LEVEL;
26 
31 #define MAX_DEV_NUM (2)
32 
37 #define MAX_PIPELINE_NUM (6)
38 
43 enum usb_error {
46 
49 
52 
55 
58 
61 
64 
67 
70 
73 
76 
79 
82 
83  /* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the
84  message strings in strerror.c when adding new error codes here. */
85 
88 };
89 
94 typedef enum
95 {
96  YUV420p = 2,
98  H26X = 22,
99  JPEG,
101  BLOB = 27,
104 }FRAMETYPE;
105 
110 typedef enum
111 {
115 }METATYPE;
116 
121 typedef enum
122 {
125 }PROCESS_MODE;
126 
131 typedef struct
132 {
133  unsigned char length;
134  unsigned char path[8];
136 
141 typedef struct
142 {
144  unsigned int seqNo;
145  int size;
146  unsigned int reserved[11];
147  char *input;
150 
155 typedef struct
156 {
158  unsigned int seqNo;
162  float elapsed_time;
163  unsigned int reserved[9];
164  void *output;
171 
191 typedef struct
192 {
193  void *parent;
194  char dev_sn[64];
195  char pipe_name[128];
196  char model_path[128];
197  char json_path[128];
199 
204 typedef struct{
205  int dim;
206  int tensor[4];
213 
214 #ifdef __cplusplus
215 extern "C" {
216 #endif
217 
254 int sync_process(NccPipeHandle_t *handle, NccPipeInput_t *input, NccPipeOutput_t *output, unsigned int timeout_ms);
255 
292 int async_process(NccPipeHandle_t *handle, NccPipeInput_t *input);
293 
303 int ncc_pipe_queue_read(NccPipeHandle_t *handle, NccPipeOutput_t *pbuf, int time_out);
304 
311 NccPipeInput_t *ncc_malloc(int size);
312 
318 void ncc_free(NccPipeInput_t *buff);
319 
325 int ncc_dev_number_get(void);
326 
337 int ncc_dev_init(char *fw_path, int dev_num);
338 
346 int ncc_dev_id_get(NccPipeHandle_t *handle);
347 
358 int ncc_dev_serial_number_get(NccUsbPortSpec_t *port, char *string, int size);
359 
382 int ncc_pipe_create(NccPipeHandle_t *handle, PROCESS_MODE mode);
383 
391 int ncc_dev_start(int dev_id);
392 
399 int ncc_pipe_id_get(NccPipeHandle_t *handle);
400 
410 
420 
425 void set_log_level(LOG_LEVEL level);
426 
427 #ifdef __cplusplus
428 }
429 #endif
430 #endif
Definition: native_vpu_api.h:123
AI Meta frame with header and data, get back from ncc device after finished one frame AI inference...
Definition: native_vpu_api.h:155
int actual_size
Definition: native_vpu_api.h:160
int async_process(NccPipeHandle_t *handle, NccPipeInput_t *input)
Inference function,Asynchronous non blocking operation. When the device inference is completed...
Definition: native_vpu_api.h:72
Inference engine handle. After the user initializes the model file information, the SDK will automat...
Definition: native_vpu_api.h:191
Definition: native_vpu_api.h:81
< planar YUV422 8 bit
Definition: native_vpu_api.h:98
Definition: native_vpu_api.h:63
FRAMETYPE
The list of the image format which ncc camera supported.
Definition: native_vpu_api.h:94
int ncc_dev_init(char *fw_path, int dev_num)
Initialize ncc device,if your device don&#39;t have flash on it,need download the firmware.
void ncc_free(NccPipeInput_t *buff)
ncc sdk free memory block
int ncc_dev_start(int dev_id)
Start all the pipelines on the device with specified serial number.
< H.264
Definition: native_vpu_api.h:99
unsigned int seqNo
Definition: native_vpu_api.h:158
float elapsed_time
Definition: native_vpu_api.h:162
Definition: native_vpu_api.h:87
Definition: native_vpu_api.h:75
METATYPE
The list of the AI meta format which ncc camera supported.
Definition: native_vpu_api.h:110
PROCESS_MODE
The list of the AI inference mode which ncc camera supported.
Definition: native_vpu_api.h:121
unsigned char length
Definition: native_vpu_api.h:133
Definition: native_vpu_api.h:21
< U8
Definition: native_vpu_api.h:113
usb_error
The list of the usb error code.
Definition: native_vpu_api.h:43
Definition: native_vpu_api.h:45
int sync_process(NccPipeHandle_t *handle, NccPipeInput_t *input, NccPipeOutput_t *output, unsigned int timeout_ms)
Synchronous inference function,blocking operation. return when the device inference is completed...
void * parent
Definition: native_vpu_api.h:193
int ncc_pipe_id_get(NccPipeHandle_t *handle)
Get the pipe index of this NccPipeHandle_t on the device. Generally speaking this pipe index is autom...
< AI modle config file
Definition: native_vpu_api.h:103
Definition: native_vpu_api.h:57
Definition: native_vpu_api.h:124
int ncc_dev_number_get(void)
scan all the ncc devices connected with the Host
int alloc_size
Definition: native_vpu_api.h:161
NccPipeInput_t * ncc_malloc(int size)
ncc sdk malloc memory block
Definition: native_vpu_api.h:60
int dim
Definition: native_vpu_api.h:205
Definition: native_vpu_api.h:54
int ncc_dev_id_get(NccPipeHandle_t *handle)
Get index of device handle according to handle.
int ncc_output_tensor_descriptor_get(NccPipeHandle_t *handle, NccTensorSpec_t *output_tensor)
Gets the output tensor information of the current pipeline.
< FP16
Definition: native_vpu_api.h:114
Definition: native_vpu_api.h:112
Definition: native_vpu_api.h:66
METATYPE type
Definition: native_vpu_api.h:157
unsigned int seqNo
Definition: native_vpu_api.h:144
Definition: native_vpu_api.h:48
Frame data send to ncc device for AI inference.
Definition: native_vpu_api.h:141
int ncc_input_tensor_descriptor_get(NccPipeHandle_t *handle, NccTensorSpec_t *input_tensor)
Gets the input tensor information of the current pipeline.
< AI model file for openvino
Definition: native_vpu_api.h:102
Definition: native_vpu_api.h:78
Definition: native_vpu_api.h:51
void * output
Definition: native_vpu_api.h:164
Definition: native_vpu_api.h:23
Definition: native_vpu_api.h:69
int size
Definition: native_vpu_api.h:145
int ncc_pipe_queue_read(NccPipeHandle_t *handle, NccPipeOutput_t *pbuf, int time_out)
Gets the output tensor information of the current pipeline.
Definition: native_vpu_api.h:22
LOG_LEVEL
Definition: native_vpu_api.h:19
< planar YUV4:2:0 format
Definition: native_vpu_api.h:97
int ncc_pipe_create(NccPipeHandle_t *handle, PROCESS_MODE mode)
Initialize the inference engine, read the parameters from the JSON file and .
Definition: native_vpu_api.h:24
void set_log_level(LOG_LEVEL level)
set level of log print
< MJPEG
Definition: native_vpu_api.h:100
Definition: native_vpu_api.h:96
< AI Meta data
Definition: native_vpu_api.h:101
Tensor structure.
Definition: native_vpu_api.h:204
char * input
Definition: native_vpu_api.h:147
USB port information to query device serial number.
Definition: native_vpu_api.h:131
int ncc_dev_serial_number_get(NccUsbPortSpec_t *port, char *string, int size)
Get serial number of device according to usb port.
FRAMETYPE type
Definition: native_vpu_api.h:143