|
@@ -399,6 +399,43 @@ static void v4l2_standard_list(int dev, obs_property_t *prop)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * List dv timings for the device
|
|
|
|
+ */
|
|
|
|
+static void v4l2_dv_timing_list(int dev, obs_property_t *prop)
|
|
|
|
+{
|
|
|
|
+ struct v4l2_dv_timings dvt;
|
|
|
|
+ struct dstr buf;
|
|
|
|
+ int index = 0;
|
|
|
|
+ dstr_init(&buf);
|
|
|
|
+
|
|
|
|
+ obs_property_list_clear(prop);
|
|
|
|
+
|
|
|
|
+ obs_property_list_add_int(prop, obs_module_text("LeaveUnchanged"), -1);
|
|
|
|
+
|
|
|
|
+ while (v4l2_enum_dv_timing(dev, &dvt, index) == 0) {
|
|
|
|
+ /* i do not pretend to understand, this is from qv4l2 ... */
|
|
|
|
+ double h = (double) dvt.bt.height + dvt.bt.vfrontporch +
|
|
|
|
+ dvt.bt.vsync + dvt.bt.vbackporch +
|
|
|
|
+ dvt.bt.il_vfrontporch + dvt.bt.il_vsync +
|
|
|
|
+ dvt.bt.il_vbackporch;
|
|
|
|
+ double w = (double) dvt.bt.width + dvt.bt.hfrontporch +
|
|
|
|
+ dvt.bt.hsync + dvt.bt.hbackporch;
|
|
|
|
+ double i = (dvt.bt.interlaced) ? 2.0f : 1.0f;
|
|
|
|
+ double rate = (double) dvt.bt.pixelclock / (w * (h / i));
|
|
|
|
+
|
|
|
|
+ dstr_printf(&buf, "%ux%u%c %.2f",
|
|
|
|
+ dvt.bt.width, dvt.bt.height,
|
|
|
|
+ (dvt.bt.interlaced) ? 'i' : 'p', rate);
|
|
|
|
+
|
|
|
|
+ obs_property_list_add_int(prop, buf.array, index);
|
|
|
|
+
|
|
|
|
+ index++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dstr_free(&buf);
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* List resolutions for device and format
|
|
* List resolutions for device and format
|
|
*/
|
|
*/
|