提交 0a6cf208 编写于 作者: F fryshorts

linux-v4l2: Add helper function to get dv timings

Add a helper function to get a dv timing by index for the input.
上级 fe144c89
......@@ -236,3 +236,21 @@ int_fast32_t v4l2_set_standard(int_fast32_t dev, int *standard)
return 0;
}
int_fast32_t v4l2_enum_dv_timing(int_fast32_t dev, struct v4l2_dv_timings *dvt,
int index)
{
if (!dev || !dvt)
return -1;
struct v4l2_enum_dv_timings iter;
memset(&iter, 0, sizeof(iter));
iter.index = index;
if (v4l2_ioctl(dev, VIDIOC_ENUM_DV_TIMINGS, &iter) < 0)
return -1;
memcpy(dvt, &iter.timings, sizeof(struct v4l2_dv_timings));
return 0;
}
......@@ -270,6 +270,18 @@ int_fast32_t v4l2_set_framerate(int_fast32_t dev, int *framerate);
*/
int_fast32_t v4l2_set_standard(int_fast32_t dev, int *standard);
/**
* Get the dv timing for an input with a specified index
*
* @param dev handle to the v4l2 device
* @param timing pointer to the timing structure to fill
* @param index index of the dv timing to fetch
*
* @return negative on failure
*/
int_fast32_t v4l2_enum_dv_timing(int_fast32_t dev, struct v4l2_dv_timings *dvt,
int index);
#ifdef __cplusplus
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册