1 /* 2 * Copyright (C) 2021-2023 Alibaba Group Holding Limited 3 */ 4 5 #ifndef _CAMERA_DEVICE_H_ 6 #define _CAMERA_DEVICE_H_ 7 #include <stdint.h> 8 #include <stdbool.h> 9 #include "wifi_camera.h" 10 #include "ucamera_service.h" 11 #include "ucamera_common.h" 12 13 typedef struct _ucamera_device_t { 14 /* * * */ 15 /* The name of this camera device */ 16 const char *name; 17 18 bool is_dummy; 19 20 char *stream_buf; 21 int32_t stream_len; 22 23 /*frame size*/ 24 int16_t width; 25 int16_t height; 26 27 /*frame*/ 28 frame_buffer_t frame; 29 30 /*init camera*/ 31 int32_t (*camera_init) (struct _ucamera_device_t *dev); 32 33 /*uninit camera*/ 34 void (*camera_uninit) (struct _ucamera_device_t *dev); 35 36 /*connect to camera device*/ 37 int32_t (*camera_connect) (struct _ucamera_device_t *dev); 38 39 /*disconnect to camera device, this can be done after camera init*/ 40 int32_t (*camera_disconnect) (struct _ucamera_device_t *dev); 41 42 /*get camera frame*/ 43 frame_buffer_t *(*camera_get_frame) (struct _ucamera_device_t *dev); 44 45 void (*camera_free) (struct _ucamera_device_t *dev); 46 } ucamera_device_t; 47 48 ucamera_device_t *ucamera_device_init(const char *dev_name); 49 void ucamera_device_uninit(void); 50 const char *ucamera_get_device_name(void); 51 ucamera_device_t *ucamera_get_device(void); 52 53 #endif // _CAMERA_DEVICE_H_ 54