blob: 7f885edf65907b29ecb0ee9421f054256b47609d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include "ctrls.h"
#define DBG_TAG " ctrls"
int ctrl_get_min_bufs_for_capture(struct instance *i)
{
struct v4l2_control ctrl = {0};
int ret;
ctrl.id = V4L2_CID_MIN_BUFFERS_FOR_CAPTURE;
ret = ioctl(i->video.fd, VIDIOC_G_CTRL, &ctrl);
if (ret) {
err("get min capture buffers fail (%s)", strerror(errno));
return ret;
}
i->video.cap_min_bufs = ctrl.value;
info("minimum capture buffers count: %u", i->video.cap_min_bufs);
return 0;
}
|