1
0
Эх сурвалжийг харах

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.
fryshorts 10 жил өмнө
parent
commit
cc57222aa9

+ 18 - 0
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
  */