提交 1c0df043 编写于 作者: F fryshorts

linux-v4l2: Use dv timing property in source

Use the dv timing selected in the source properties to configure the
device instead of resolution/framerate.
上级 99b6a018
......@@ -57,6 +57,7 @@ struct v4l2_data {
int input;
int pixfmt;
int standard;
int dv_timing;
int resolution;
int framerate;
bool sys_timing;
......@@ -825,6 +826,15 @@ static void v4l2_init(struct v4l2_data *data)
data->resolution = -1;
data->framerate = -1;
}
/* set dv timing if supported */
if (input_caps & V4L2_IN_CAP_DV_TIMINGS) {
if (v4l2_set_dv_timing(data->dev, &data->dv_timing) < 0) {
blog(LOG_ERROR, "Unable to set dv timing");
goto fail;
}
data->resolution = -1;
data->framerate = -1;
}
/* set pixel format and resolution */
if (v4l2_set_format(data->dev, &data->resolution, &data->pixfmt,
......@@ -887,6 +897,7 @@ static void v4l2_update(void *vptr, obs_data_t *settings)
data->input = obs_data_get_int(settings, "input");
data->pixfmt = obs_data_get_int(settings, "pixelformat");
data->standard = obs_data_get_int(settings, "standard");
data->dv_timing = obs_data_get_int(settings, "dv_timing");
data->resolution = obs_data_get_int(settings, "resolution");
data->framerate = obs_data_get_int(settings, "framerate");
data->sys_timing = obs_data_get_bool(settings, "system_timing");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册