UVC
UVC API Status
API |
BK7258_AP |
|---|---|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
UVC Marco defined and config
Marco name |
illustrate |
|---|---|
CONFIG_USB_CAMERA |
enable uvc camera or not |
CONFIG_UVC_URB_NUM |
config uvc urb number, range [0, 64] |
CONFIG_UVC_NUM_PACKET_PER_URB |
config number of packets a uvc urb, range [0, 32] |
UVC 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
- Parameters
trigger – 0:not wait uvc connect, 1: wait uvc connect 4 seconds
- Returns
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
- Returns
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
- Parameters
open – handle
config – The port config
cb – The frame_buffer callback
- Returns
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
- Parameters
handle – The uvc open handle output
- Returns
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
- Parameters
port – The port user want to know
format – The image format you want to know(image_format_t)
- Returns
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
- Parameters
handle – the uvc init device handle
config – the uvc need support param the user set
- Returns
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
- Parameters
handle – the uvc init device handle
- Returns
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
- Parameters
cb – @attation 1. this api called before bk_uvc_init. if not register, analyse uvc packet by default adk function
- Returns
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
- Parameters
cb – @attation 1. this api called before bk_uvc_power_on.
- Returns
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
- Parameters
cb – @attation 1. this api called before bk_uvc_init, not all uvc need register
- Returns
BK_OK: set success
others: other errors.
UVC API Typedefs
Header File
Structures
-
struct uvc_separate_info_t
-
struct uvc_config_t
-
struct bk_uvc_callback_t
-
struct uvc_separate_config_t
Macros
-
BK_UVC_CONNECT
-
BK_UVC_CONFIG_ERROR
-
BK_UVC_NO_MEMORY
-
BK_UVC_NO_RESOURCE
-
BK_UVC_PPI_ERROR
-
BK_UVC_DISCONNECT
-
BK_UVC_NO_RESPON
-
BK_UVC_DMA_ERROR
-
BK_UVC_NOT_PERMIT
-
BK_UVC_POWER_ERROR
Type Definitions
-
typedef void (*camera_state_cb_t)(bk_usb_hub_port_info *param, uint32_t state)
Enumerations
-
enum uvc_state_t
Values:
-
enumerator UVC_CLOSED_STATE
-
enumerator UVC_CLOSING_STATE
-
enumerator UVC_CONNECT_STATE
-
enumerator UVC_CONFIGING_STATE
-
enumerator UVC_STREAMING_STATE
-
enumerator UVC_DISCONNECT_STATE
-
enumerator UVC_STATE_UNKNOW
-
enumerator UVC_CLOSED_STATE