7 #ifndef LINUX_LIBV2_SOURCE_USB_CAMERA2_LIB_UVC2_H_ 8 #define LINUX_LIBV2_SOURCE_USB_CAMERA2_LIB_UVC2_H_ 21 #include <sys/ioctl.h> 22 #include <sys/types.h> 24 #include <asm/types.h> 25 #include <linux/videodev2.h> 60 #define UVC2_API extern "C" 137 UVC2_API int YUY2ToRGB(
unsigned char *src,
unsigned char *rgb,
int width,
int height,
int bits);
150 unsigned int height);
int v4l2_fd
打开设备name后的文件描述符
UVC2_API void * uvc2_capturing(struct uvc_fd *v)
获取采集到的缓存
UVC2_API void uvc2_close(struct uvc_fd v)
关闭摄像头
unsigned int buf_count
缓冲区个数
UVC2_API int uvc2_check(char *dev)
检测摄像头是否是 usb 摄像头
UVC2_API int YUY2ToRGB(unsigned char *src, unsigned char *rgb, int width, int height, int bits)
将YUV格式转RGB格式(YUY2是YUV422格式,排列是(YUYV),是1 plane)
UVC2_API int uvc2_init(struct uvc_fd *v, const char *devname, int width, int height)
初始化 usb 摄像头
UVC2_API int uvc2_get_buffsize(struct uvc_fd v)
获取采集数据缓存大小
UVC2_API int uvc2_release_capturing(struct uvc_fd v)
释放采集到的缓存
int camera_framerate
摄像头帧率
UVC2_API int ucv2_stop_capturing(struct uvc_fd v)
停止摄像头采集
unsigned char * start
缓冲区起始地址
UVC2_API int uvc2_start_capturing(struct uvc_fd *v)
开启摄像头采集
UVC2_API int convert_yuv_to_rgb_buffer(unsigned char *yuv, unsigned char *rgb, unsigned int width, unsigned int height)
将YUV格式转RGB格式(YUY2是YUV422格式,排列是(YUYV),是1 plane)