3ad8a8005d
ok jasper@
143 lines
5.8 KiB
Plaintext
143 lines
5.8 KiB
Plaintext
$OpenBSD: patch-sys_v4l2_gstv4l2object_c,v 1.1.1.1 2012/09/06 13:01:31 ajacoutot Exp $
|
|
|
|
No more anonymous unions in video(4).
|
|
|
|
--- sys/v4l2/gstv4l2object.c.orig Wed Aug 8 12:31:57 2012
|
|
+++ sys/v4l2/gstv4l2object.c Wed Sep 5 13:44:49 2012
|
|
@@ -1625,8 +1625,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l
|
|
g_value_init (&rate, GST_TYPE_FRACTION);
|
|
|
|
do {
|
|
- num = ival.discrete.numerator;
|
|
- denom = ival.discrete.denominator;
|
|
+ num = ival.un.discrete.numerator;
|
|
+ denom = ival.un.discrete.denominator;
|
|
|
|
if (num > G_MAXINT || denom > G_MAXINT) {
|
|
/* let us hope we don't get here... */
|
|
@@ -1658,8 +1658,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l
|
|
g_value_init (&max, GST_TYPE_FRACTION);
|
|
|
|
/* get the min */
|
|
- minnum = ival.stepwise.min.numerator;
|
|
- mindenom = ival.stepwise.min.denominator;
|
|
+ minnum = ival.un.stepwise.min.numerator;
|
|
+ mindenom = ival.un.stepwise.min.denominator;
|
|
if (minnum > G_MAXINT || mindenom > G_MAXINT) {
|
|
minnum >>= 1;
|
|
mindenom >>= 1;
|
|
@@ -1669,8 +1669,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l
|
|
gst_value_set_fraction (&min, minnum, mindenom);
|
|
|
|
/* get the max */
|
|
- maxnum = ival.stepwise.max.numerator;
|
|
- maxdenom = ival.stepwise.max.denominator;
|
|
+ maxnum = ival.un.stepwise.max.numerator;
|
|
+ maxdenom = ival.un.stepwise.max.denominator;
|
|
if (maxnum > G_MAXINT || maxdenom > G_MAXINT) {
|
|
maxnum >>= 1;
|
|
maxdenom >>= 1;
|
|
@@ -1681,8 +1681,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l
|
|
gst_value_set_fraction (&max, maxnum, maxdenom);
|
|
|
|
/* get the step */
|
|
- num = ival.stepwise.step.numerator;
|
|
- denom = ival.stepwise.step.denominator;
|
|
+ num = ival.un.stepwise.step.numerator;
|
|
+ denom = ival.un.stepwise.step.denominator;
|
|
if (num > G_MAXINT || denom > G_MAXINT) {
|
|
num >>= 1;
|
|
denom >>= 1;
|
|
@@ -1733,15 +1733,15 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l
|
|
|
|
g_value_init (&rates, GST_TYPE_FRACTION_RANGE);
|
|
|
|
- num = ival.stepwise.min.numerator;
|
|
- denom = ival.stepwise.min.denominator;
|
|
+ num = ival.un.stepwise.min.numerator;
|
|
+ denom = ival.un.stepwise.min.denominator;
|
|
if (num > G_MAXINT || denom > G_MAXINT) {
|
|
num >>= 1;
|
|
denom >>= 1;
|
|
}
|
|
|
|
- maxnum = ival.stepwise.max.numerator;
|
|
- maxdenom = ival.stepwise.max.denominator;
|
|
+ maxnum = ival.un.stepwise.max.numerator;
|
|
+ maxdenom = ival.un.stepwise.max.denominator;
|
|
if (maxnum > G_MAXINT || maxdenom > G_MAXINT) {
|
|
maxnum >>= 1;
|
|
maxdenom >>= 1;
|
|
@@ -1837,10 +1837,10 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object *
|
|
if (size.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
|
|
do {
|
|
GST_LOG_OBJECT (v4l2object->element, "got discrete frame size %dx%d",
|
|
- size.discrete.width, size.discrete.height);
|
|
+ size.un.discrete.width, size.un.discrete.height);
|
|
|
|
- w = MIN (size.discrete.width, G_MAXINT);
|
|
- h = MIN (size.discrete.height, G_MAXINT);
|
|
+ w = MIN (size.un.discrete.width, G_MAXINT);
|
|
+ h = MIN (size.un.discrete.height, G_MAXINT);
|
|
|
|
if (w && h) {
|
|
tmp =
|
|
@@ -1858,21 +1858,21 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object *
|
|
} else if (size.type == V4L2_FRMSIZE_TYPE_STEPWISE) {
|
|
GST_DEBUG_OBJECT (v4l2object->element, "we have stepwise frame sizes:");
|
|
GST_DEBUG_OBJECT (v4l2object->element, "min width: %d",
|
|
- size.stepwise.min_width);
|
|
+ size.un.stepwise.min_width);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "min height: %d",
|
|
- size.stepwise.min_height);
|
|
+ size.un.stepwise.min_height);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "max width: %d",
|
|
- size.stepwise.max_width);
|
|
+ size.un.stepwise.max_width);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "min height: %d",
|
|
- size.stepwise.max_height);
|
|
+ size.un.stepwise.max_height);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "step width: %d",
|
|
- size.stepwise.step_width);
|
|
+ size.un.stepwise.step_width);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "step height: %d",
|
|
- size.stepwise.step_height);
|
|
+ size.un.stepwise.step_height);
|
|
|
|
- for (w = size.stepwise.min_width, h = size.stepwise.min_height;
|
|
- w <= size.stepwise.max_width && h <= size.stepwise.max_height;
|
|
- w += size.stepwise.step_width, h += size.stepwise.step_height) {
|
|
+ for (w = size.un.stepwise.min_width, h = size.un.stepwise.min_height;
|
|
+ w <= size.un.stepwise.max_width && h <= size.un.stepwise.max_height;
|
|
+ w += size.un.stepwise.step_width, h += size.un.stepwise.step_height) {
|
|
if (w == 0 || h == 0)
|
|
continue;
|
|
|
|
@@ -1890,18 +1890,18 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object *
|
|
|
|
GST_DEBUG_OBJECT (v4l2object->element, "we have continuous frame sizes:");
|
|
GST_DEBUG_OBJECT (v4l2object->element, "min width: %d",
|
|
- size.stepwise.min_width);
|
|
+ size.un.stepwise.min_width);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "min height: %d",
|
|
- size.stepwise.min_height);
|
|
+ size.un.stepwise.min_height);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "max width: %d",
|
|
- size.stepwise.max_width);
|
|
+ size.un.stepwise.max_width);
|
|
GST_DEBUG_OBJECT (v4l2object->element, "min height: %d",
|
|
- size.stepwise.max_height);
|
|
+ size.un.stepwise.max_height);
|
|
|
|
- w = MAX (size.stepwise.min_width, 1);
|
|
- h = MAX (size.stepwise.min_height, 1);
|
|
- maxw = MIN (size.stepwise.max_width, G_MAXINT);
|
|
- maxh = MIN (size.stepwise.max_height, G_MAXINT);
|
|
+ w = MAX (size.un.stepwise.min_width, 1);
|
|
+ h = MAX (size.un.stepwise.min_height, 1);
|
|
+ maxw = MIN (size.un.stepwise.max_width, G_MAXINT);
|
|
+ maxh = MIN (size.un.stepwise.max_height, G_MAXINT);
|
|
|
|
tmp =
|
|
gst_v4l2_object_probe_caps_for_format_and_size (v4l2object, pixelformat,
|