mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-28 02:06:12 -04:00
linux-v4l2: Add helper function to get dv timings
Add a helper function to get a dv timing by index for the input.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user