UVC_CAMERA APIs

[English]

重要

The UVC_CAMERA API v1.0 is the lastest stable UVC_CAMERA APIs. All new applications should use UVC_CAMERA API v1.0.

UVC_CAMERA Interface

UVC camera only support full speed type

UVC_CAMERA API Categories

Most of UVC_CAMERA APIs can be categoried as:

  • UVC_CAMERA APIs

    The common APIs are prefixed with bk_uvc, e.g. bk_uvc_init() etc.

UVC_CAMERA APIs:
  • bk_uvc_camera_driver_init() - init uvc camera(open uvc device)

  • bk_uvc_camera_driver_deinit() - deinit uvc camera(close uvc device)

  • bk_uvc_camera_power_on() - power on uvc

  • bk_uvc_camera_get_config() - set uvc camera pps(image resolution) and fps(frame rate)

  • bk_uvc_camera_set_config() - set uvc camera pps(image resolution) and fps(frame rate)

  • bk_uvc_camera_driver_start() - start uvc, start simple image information

  • bk_uvc_camera_driver_stop() - stop uvc, stop simple image information

  • bk_uvc_camera_get_device() - get current working uvc device

API Reference

Header File

Functions

bk_err_t bk_uvc_power_on(uint32_t format, uint32_t timeout)

uvc power on

This API called by user, power on all port and register connect/disconnect cb

参数

trigger – 0:not wait uvc connect, 1: wait uvc connect 4 seconds

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_uvc_power_off(void)

uvc power on

This API called by user, power off all port

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_uvc_init(camera_handle_t *handle, uvc_config_t *config, bk_uvc_callback_t *cb)

Init the uvc.

This API open uvc

参数
  • open – handle

  • config – The port config

  • cb – The frame_buffer callback

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_uvc_deinit(camera_handle_t *handle)

Deinit the uvc.

This API stop and close uvc

@attation: port must 1 - other

参数

handle – The uvc open handle output

返回

  • BK_OK: succeed

  • others: other errors.

bk_usb_hub_port_info *bk_uvc_get_enum_info(uint8_t port, uint16_t format)

Get uvc config.

This API called by user, get port info

参数
  • port – The port user want to know

  • format – The image format you want to know(image_format_t)

返回

  • PTR: succeed

  • NULL: other errors.

bk_err_t bk_uvc_set_start(camera_handle_t *handle, uvc_config_t *config)

Set uvc config.

This API called by user, Set uvc support fps and resolutions and start stream

参数
  • handle – the uvc init device handle

  • config – the uvc need support param the user set

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_uvc_set_stop(camera_handle_t *handle)

Set uvc config.

This API called by user, Set stop uvc stream output

参数

handle – the uvc init device handle

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_uvc_register_packet_cb(void *cb)

register uvc packet analyse callback

This API will register uvc analyse callabck

参数

cb – @attation 1. this api called before bk_uvc_init. if not register, analyse uvc packet by default adk function

返回

  • BK_OK: set success

  • others: other errors.

bk_err_t bk_uvc_register_connect_state_cb(camera_state_cb_t cb)

register uvc connect state cb

This API will register uvc connect state cb, include uvc state change cb, and other ops error

参数

cb – @attation 1. this api called before bk_uvc_power_on.

返回

  • BK_OK: set success

  • others: other errors.

bk_err_t bk_uvc_register_separate_packet_callback(uvc_separate_config_t *cb)

register separate packet cb

This API will register separate packet data, some uvc device a endpoint will output mjpeg and h264 data meantime, need register this callback

参数

cb – @attation 1. this api called before bk_uvc_init, not all uvc need register

返回

  • BK_OK: set success

  • others: other errors.

API Typedefs