v4l2 very simple example [closed]

风流意气都作罢 提交于 2019-11-30 01:04:19
Raulp

Try the uvccapture code here -> http://staticwave.ca/source/uvccapture/ It is very small yet very concrete example which makes use of all the V4l2 concepts (open,set format, allocate memory, Request Buffer, Dqbuffer and Query-buffer - all intems of ioclts).

uvcgrab() function is the one to look for which makes use of Dqbuffer and Query-buffer.

ioctl (vd->fd, VIDIOC_DQBUF, &vd->buf);

ioctl (vd->fd, VIDIOC_QBUF, &vd->buf)

While Studying it you can keep looking for the ioctl definition in this link which will ease your understanding.

I would advice also trying out v4l-utils.

http://linuxtv.org/downloads/v4l-utils/

It has some easy to use API calls to v4l devices and there is a qt based example in the source to build a custom interface for video devices.

In the API specification, there is an example, also downloadable as a C file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!