From cc57222aa97f32adf00821fea1981c5f9bb80f5b Mon Sep 17 00:00:00 2001 From: fryshorts Date: Tue, 17 Feb 2015 20:09:58 +0100 Subject: [PATCH] linux-v4l2: Add function to enum video standards Add a helper function to enumerate video standards supported by the selected input and add them to a property. --- plugins/linux-v4l2/v4l2-input.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/linux-v4l2/v4l2-input.c b/plugins/linux-v4l2/v4l2-input.c index 2374db2d6..d8218af2e 100644 --- a/plugins/linux-v4l2/v4l2-input.c +++ b/plugins/linux-v4l2/v4l2-input.c @@ -379,6 +379,24 @@ static void v4l2_format_list(int dev, obs_property_t *prop) dstr_free(&buffer); } +/* + * List video standards for the device + */ +static void v4l2_standard_list(int dev, obs_property_t *prop) +{ + struct v4l2_standard std; + std.index = 0; + + obs_property_list_clear(prop); + + obs_property_list_add_int(prop, obs_module_text("LeaveUnchanged"), -1); + + while (v4l2_ioctl(dev, VIDIOC_ENUMSTD, &std) == 0) { + obs_property_list_add_int(prop, (char *) std.name, std.id); + std.index++; + } +} + /* * List resolutions for device and format */