提交 7905197b 编写于 作者: F fryshorts

linux-v4l2: Remove "Leave Unchanged" option

Remove the "Leave Unchanged" option for the input and video format
select.

This option was primarily added for cases in which the
resolution and framerate are set by another program or the capture
device itself and the values are not directly supported by the plugin.
One major usecase here would be capture devices for tv signals which
might be set to a spcific resolution and refresh rate, and might fail
to initialize in case any other combination of those settings is forced.

In case of the input this option did not make much sense, as the first
input is probably the best default option in most cases.

For the video format this default is even bad in some cases. If an
format emulated by libv4l2 is selected for example, this will usually
configure the device to use mjpeg with libv4l2 converting it to some
format obs can use. When obs or the source is then restarted and the
"Leave Unchanged" is enabled the plugin will fail, because it will only
notice that the device is set to mjpeg, without any knowledge about the
possibility of letting libv4l2 handle the conversion.

Using the first available and supported format is not nescessarily the
best choice, but still preferable to some random format that will
cause the plugin to not capture at all. Forcing a choice here will
hopefully also make the plugin behaviour more predicatable for the user.
上级 aca409dd
......@@ -337,8 +337,6 @@ static void v4l2_input_list(int_fast32_t dev, obs_property_t *prop)
obs_property_list_clear(prop);
obs_property_list_add_int(prop, obs_module_text("LeaveUnchanged"), -1);
while (v4l2_ioctl(dev, VIDIOC_ENUMINPUT, &in) == 0) {
obs_property_list_add_int(prop, (char *) in.name, in.index);
blog(LOG_INFO, "Found input '%s' (Index %d)", in.name,
......@@ -360,8 +358,6 @@ static void v4l2_format_list(int dev, obs_property_t *prop)
obs_property_list_clear(prop);
obs_property_list_add_int(prop, obs_module_text("LeaveUnchanged"), -1);
while (v4l2_ioctl(dev, VIDIOC_ENUM_FMT, &fmt) == 0) {
dstr_copy(&buffer, (char *) fmt.description);
if (fmt.flags & V4L2_FMT_FLAG_EMULATED)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册