資源簡介
linux下的基于V4L2的UVC攝像頭驅動測試程序,使用命令./xxxx xx.jpg,即可生成xx.jpg,用來測試UVC驅動。
代碼片段和文件信息
/*?Standard?Include?Files?*/
#include?
????
/*?Verification?Test?Environment?Include?Files?*/
#include?
#include?
#include?
#include?
#include?????
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
struct?testbuffer
{
????????unsigned?char?*start;
????????size_t?offset;
????????unsigned?int?length;
};
struct?testbuffer?buffers;
int?g_width?=?640;
int?g_height?=?480;
int?g_capture_count?=?1;
int?g_rotate?=?0;
int?g_cap_fmt?=?V4L2_PIX_FMT_MJPEG;
int?start_capturing(int?fd_v4l)
{
????????unsigned?int?i=0;
????????struct?v4l2_buffer?buf;
????????enum?v4l2_buf_type?type;
????????memset(&buf?0?sizeof
評論
共有 條評論