提交 7dc9069c 编写于 作者: F fryshorts

linux-v4l2: Add helper function for video standard

Add a helper function to get/set the video standard for the input.
上级 a9df1d92
......@@ -220,3 +220,19 @@ int_fast32_t v4l2_set_framerate(int_fast32_t dev, int *framerate)
par.parm.capture.timeperframe.denominator);
return 0;
}
int_fast32_t v4l2_set_standard(int_fast32_t dev, int *standard)
{
if (!dev || !standard)
return -1;
if (*standard == -1) {
if (v4l2_ioctl(dev, VIDIOC_G_STD, standard) < 0)
return -1;
} else {
if (v4l2_ioctl(dev, VIDIOC_S_STD, standard) < 0)
return -1;
}
return 0;
}
......@@ -258,6 +258,18 @@ int_fast32_t v4l2_set_format(int_fast32_t dev, int *resolution,
*/
int_fast32_t v4l2_set_framerate(int_fast32_t dev, int *framerate);
/**
* Set a video standard on the device.
*
* If the action succeeds standard is set to the used video standard id.
*
* @param dev handle to the v4l2 device
* @param standard id of the standard to use or -1 to leave as is
*
* @return negative on failure
*/
int_fast32_t v4l2_set_standard(int_fast32_t dev, int *standard);
#ifdef __cplusplus
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册