uvc和v4l2簡介uvc和v4l2簡介

2021-10-08 10:44:30 字數 626 閱讀 2303

對這塊不是特別理解,看了幾篇部落格,還是一知半解,先記錄下,以後有機會深入後,再來更新;

首先介紹兩個概念:

uvc:

最新的uvc版本為uvc 1.5,由usb-if(usb implementers forum)定義包括基本協議及負載格式 [1] [2].

這是wikipedia的解釋。

v4l2:

從兩個的介紹也能看出來這兩者之間的關係。

1 uvc的camera硬體支援

2 uvc驅動支援,包括usb裝置驅動以及v4l2的支援

3 上層的應用程式支援

判斷乙個攝像頭是否屬於uvc規範可以使用如下方法:

1 使用lsusb命令或其他硬體資訊檢視工具,找出攝像頭的裝置號(vendor id)和產品號(product id)。

lsusb -d vid:pid -v | grep "14 video"

如果相容uvc,則會輸出類似資訊

bfunctionclass 14 video

binte***ceclass 14 video

binte***ceclass 14 video

binte***ceclass 14 video

如果沒有以上資訊,則是non-uvc裝置。

V4L2程式設計

include include include include include include include include include include typedef struct buftype buftype user buf int n buffer 0 開啟攝像頭裝置 int ope...

V4L2 程式設計

v4l2程式設計 1.定義 2.工作流程 開啟裝置 檢查和設定裝置屬性 設定幀格式 設定一種輸入輸出方法 緩衝區管理 迴圈獲取資料 關閉裝置。3.裝置的開啟和關閉 include int open const char device name,int flags include int close ...

v4l2框架v4l2 device API分析

涉及到的結構體 struct v4l2 device在v4l2框架中充當所有v4l2 subdev的父裝置,管理著註冊在其下的子裝置 struct v4l2 device struct device 代表子裝置,包含了子裝置的相關屬性和操作 struct device struct subdev s...