openncc frame
cameraCtrl.h File Reference

Control and configure general parameters of NCC camera. More...

Go to the source code of this file.

Classes

struct  SensorModesPara_t
 List of camera control parameters. More...
 
struct  SensorModesList_t
 List of camera control parameters. More...
 

Macros

#define MAX_MODE_SIZE   5
 The maximum of the modes which the ncc cameras supported. More...
 

Enumerations

enum  CAM_CTRL_AWB_MODE {
  CAMERA_CONTROL_AWB_MODE__OFF, CAMERA_CONTROL_AWB_MODE__AUTO, CAMERA_CONTROL_AWB_MODE__INCANDESCENT, CAMERA_CONTROL_AWB_MODE__FLUORESCENT,
  CAMERA_CONTROL_AWB_MODE__WARM_FLUORESCENT, CAMERA_CONTROL_AWB_MODE__DAYLIGHT, CAMERA_CONTROL_AWB_MODE__CLOUDY_DAYLIGHT, CAMERA_CONTROL_AWB_MODE__TWILIGHT,
  CAMERA_CONTROL_AWB_MODE__SHADE
}
 The WB modes list,could disable or enable the AWB,swithc to MWB mode. More...
 
enum  VIDEO_CTRL_OUT_MDOE { VIDEO_OUT_DISABLE, VIDEO_OUT_SINGLE, VIDEO_OUT_CONTINUOUS }
 Set the video stream mode of the ncc camera. More...
 

Functions

int device_ctrl_id_get (char *serial_num)
 Get index of device handle according to serial number. More...
 
int device_ctrl_get_sensor_mode_list (int dev_index, SensorModesList_t *list)
 Get mode list which camera supported. More...
 
int device_ctrl_select_sensor_mode (int dev_index, int mode_index)
 Select sensor and resolution. More...
 
int device_ctrl_get_fw_version (int dev_index, char *fw_version, int size)
 Get firmware version. More...
 
int camera_ctrl_ae_enabled (int dev_index)
 Enable AE of the camera. More...
 
int camera_ctrl_me_set_exp_gain (int dev_index, unsigned int exp_us, unsigned int iso_val)
 Set the exposure time and gain of the camera. More...
 
int camera_ctrl_set_awb_mode (int dev_index, CAM_CTRL_AWB_MODE awb_mode)
 Set white balance mode. More...
 

Detailed Description

Control and configure general parameters of NCC camera.

Author
Zed
Date
2021.11.15

Macro Definition Documentation

◆ MAX_MODE_SIZE

#define MAX_MODE_SIZE   5

The maximum of the modes which the ncc cameras supported.

MAX_MODE_SIZE

Enumeration Type Documentation

◆ CAM_CTRL_AWB_MODE

The WB modes list,could disable or enable the AWB,swithc to MWB mode.

Enumerator
CAMERA_CONTROL_AWB_MODE__OFF 
CAMERA_CONTROL_AWB_MODE__AUTO 

< Disable the WB mode,and switch to MWB mode,user could set the WB mode,0

CAMERA_CONTROL_AWB_MODE__INCANDESCENT 

< Enable the WB mode,1

CAMERA_CONTROL_AWB_MODE__FLUORESCENT 

< MWB for INCANDESCENT,2

CAMERA_CONTROL_AWB_MODE__WARM_FLUORESCENT 

< MWB for FLUORESCENT,3

CAMERA_CONTROL_AWB_MODE__DAYLIGHT 

< MWB for WARM_FLUORESCENT,4

CAMERA_CONTROL_AWB_MODE__CLOUDY_DAYLIGHT 

< MWB for DAYLIGHT,5

MWB for CLOUDY_DAYLIGHT,6

CAMERA_CONTROL_AWB_MODE__TWILIGHT 
CAMERA_CONTROL_AWB_MODE__SHADE 

< for MWB for TWILIGHT,7

◆ VIDEO_CTRL_OUT_MDOE

Set the video stream mode of the ncc camera.

Enumerator
VIDEO_OUT_DISABLE 
VIDEO_OUT_SINGLE 

< disable video out

VIDEO_OUT_CONTINUOUS 

< output one frame,could used to capture frame

Function Documentation

◆ camera_ctrl_ae_enabled()

int camera_ctrl_ae_enabled ( int  dev_index)

Enable AE of the camera.

Parameters
[in]dev_index[Range from 0 to SensorModesConfig.num]
Returns
Successful acquisition return or failure
Return values
0success, others follow enum usb_error
Note
After call camera_ctrl_me_set_exp_gain(...),the camera would automatic enter ME mode.We need call camera_ctrl_ae_enabled switch back to AE mode.

◆ camera_ctrl_me_set_exp_gain()

int camera_ctrl_me_set_exp_gain ( int  dev_index,
unsigned int  exp_us,
unsigned int  iso_val 
)

Set the exposure time and gain of the camera.

Parameters
[in]dev_index,ifdetected more than two cameras ,need selete one [Range from 0 to SensorModesConfig.num]
[in]exp_us,[unitus, Max value: 1/fps*1000*1000]
[in]iso_val,exposuregain.The range of the value is get from SensorModesPara_t.minGain and SensorModesPara_t.maxGain
Returns
Successful acquisition return or failure
Return values
0success, others follow enum usb_error
You could get the frame rate from SensorModesPara_t.camFps

◆ camera_ctrl_set_awb_mode()

int camera_ctrl_set_awb_mode ( int  dev_index,
CAM_CTRL_AWB_MODE  awb_mode 
)

Set white balance mode.

Parameters
[in]dev_index,ifdetected more than two cameras ,need selete one [Range from 0 to SensorModesConfig.num]
[in]awb_mode,CAM_CTRL_AWB_MODEmode
Returns
Successful acquisition return or failure
Return values
0success, others follow enum usb_error

◆ device_ctrl_get_fw_version()

int device_ctrl_get_fw_version ( int  dev_index,
char *  fw_version,
int  size 
)

Get firmware version.

Parameters
[in]dev_index,theactive ncc device scaned by ncc sdk,could use the device's index to config camera
[out]*fw_version,getthe firmware version from ncc camera or device
Returns
Successful acquisition return or failure
Return values
0success, others follow enum usb_error
null
int devNum = ncc_get_dev_number();
if(devNum<=0)
return -1;
..if your ncc device don't have flash on it,need download firmware to the device...
ret = nccDevInit("/usr/local/lib/openncc/OpenNcc.mvcmd", devNum);
....
char version[100];
ret = device_ctrl_get_fw_version(0, version);
See also
native_vpu_api.h ncc_get_dev_number(void)
native_vpu_api.h nccDevInit(...)

◆ device_ctrl_get_sensor_mode_list()

int device_ctrl_get_sensor_mode_list ( int  dev_index,
SensorModesList_t list 
)

Get mode list which camera supported.

Parameters
[in]dev_index,theactive ncc device scaned by ncc sdk,could use the device's index to config camera
[out]*list,pointto a SensorModesList_t
Returns
Successful acquisition return or failure
Return values
0success, others follow enum usb_error
Before call this function,you need call ncc_get_dev_number(void) to scan the ncc devices
int devNum = ncc_get_dev_number();
if(devNum<=0)
return -1;
..if your ncc device don't have flash on it...
ret = nccDevInit("/usr/local/lib/openncc/OpenNcc.mvcmd", devNum);
....
SensorModesList_t list;
int num = device_ctrl_get_sensor_mode_list(0, &list);
See also
native_vpu_api.h ncc_get_dev_number(void)
native_vpu_api.h enum usb_error

◆ device_ctrl_id_get()

int device_ctrl_id_get ( char *  serial_num)

Get index of device handle according to serial number.

Parameters
[in]*serial_numserial number of device
Returns
Return values
>0index of device controller corresponding to serial number
-1No corresponding serial number found

◆ device_ctrl_select_sensor_mode()

int device_ctrl_select_sensor_mode ( int  dev_index,
int  mode_index 
)

Select sensor and resolution.

Parameters
[in]dev_index[Range from 0 to SensorModesConfig.num]
[in]mode_index,selectethe SensorModesPara_t index get from camera
Returns
Successful acquisition return or failure
Return values
0success, others follow enum usb_error
After you selected the mode,the camera would work as the SensorModesPara listed,
could call it after device_ctrl_get_sensor_mode_list(...)
Bug:
Currently only support 1080P