openbsd-ports/x11/vlc/patches/patch-modules_access_v4l2_c
phessler 7ccc4d7c1c Update to VLC 1.1.12
Most of the bits from Brad, a minor runtime fix by me.

Tested on amd64, i386, macppc

OK dhill@, rpointel@, sthen@, jasper@
2011-11-16 13:33:15 +00:00

215 lines
12 KiB
Plaintext

$OpenBSD: patch-modules_access_v4l2_c,v 1.4 2011/11/16 13:33:15 phessler Exp $
--- modules/access/v4l2.c.orig Sun Jan 23 11:05:21 2011
+++ modules/access/v4l2.c Thu Apr 28 21:47:48 2011
@@ -1675,8 +1675,8 @@ static float GetMaxFrameRate( demux_t *p_demux, int i_
float f_fps_max = -1;
do
{
- float f_fps = (float)frmival.discrete.denominator
- / (float)frmival.discrete.numerator;
+ float f_fps = (float)frmival.un.discrete.denominator
+ / (float)frmival.un.discrete.numerator;
if( f_fps > f_fps_max ) f_fps_max = f_fps;
frmival.index++;
} while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMEINTERVALS,
@@ -1685,10 +1685,10 @@ static float GetMaxFrameRate( demux_t *p_demux, int i_
}
case V4L2_FRMSIZE_TYPE_STEPWISE:
case V4L2_FRMIVAL_TYPE_CONTINUOUS:
- return __MAX( (float)frmival.stepwise.max.denominator
- / (float)frmival.stepwise.max.numerator,
- (float)frmival.stepwise.min.denominator
- / (float)frmival.stepwise.min.numerator );
+ return __MAX( (float)frmival.un.stepwise.max.denominator
+ / (float)frmival.un.stepwise.max.numerator,
+ (float)frmival.un.stepwise.min.denominator
+ / (float)frmival.un.stepwise.min.numerator );
}
}
#endif
@@ -1717,21 +1717,21 @@ static float GetAbsoluteMaxFrameRate( demux_t *p_demux
frmsize.index++;
float f_fps = GetMaxFrameRate( p_demux, i_fd,
i_pixel_format,
- frmsize.discrete.width,
- frmsize.discrete.height );
+ frmsize.un.discrete.width,
+ frmsize.un.discrete.height );
if( f_fps > f_fps_max ) f_fps_max = f_fps;
} while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES,
&frmsize ) >= 0 );
break;
case V4L2_FRMSIZE_TYPE_STEPWISE:
{
- uint32_t i_width = frmsize.stepwise.min_width;
- uint32_t i_height = frmsize.stepwise.min_height;
+ uint32_t i_width = frmsize.un.stepwise.min_width;
+ uint32_t i_height = frmsize.un.stepwise.min_height;
for( ;
- i_width <= frmsize.stepwise.max_width &&
- i_height <= frmsize.stepwise.max_width;
- i_width += frmsize.stepwise.step_width,
- i_height += frmsize.stepwise.step_height )
+ i_width <= frmsize.un.stepwise.max_width &&
+ i_height <= frmsize.un.stepwise.max_width;
+ i_width += frmsize.un.stepwise.step_width,
+ i_height += frmsize.un.stepwise.step_height )
{
float f_fps = GetMaxFrameRate( p_demux, i_fd,
i_pixel_format,
@@ -1745,8 +1745,8 @@ static float GetAbsoluteMaxFrameRate( demux_t *p_demux
msg_Err( p_demux, "GetAbsoluteMaxFrameRate implementation for V4L2_FRMSIZE_TYPE_CONTINUOUS isn't correct" );
f_fps_max = GetMaxFrameRate( p_demux, i_fd,
i_pixel_format,
- frmsize.stepwise.max_width,
- frmsize.stepwise.max_height );
+ frmsize.un.stepwise.max_width,
+ frmsize.un.stepwise.max_height );
break;
}
}
@@ -1778,26 +1778,26 @@ static void GetMaxDimensions( demux_t *p_demux, int i_
frmsize.index++;
float f_fps = GetMaxFrameRate( p_demux, i_fd,
i_pixel_format,
- frmsize.discrete.width,
- frmsize.discrete.height );
+ frmsize.un.discrete.width,
+ frmsize.un.discrete.height );
if( f_fps >= f_fps_min &&
- frmsize.discrete.width > *pi_width )
+ frmsize.un.discrete.width > *pi_width )
{
- *pi_width = frmsize.discrete.width;
- *pi_height = frmsize.discrete.height;
+ *pi_width = frmsize.un.discrete.width;
+ *pi_height = frmsize.un.discrete.height;
}
} while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES,
&frmsize ) >= 0 );
break;
case V4L2_FRMSIZE_TYPE_STEPWISE:
{
- uint32_t i_width = frmsize.stepwise.min_width;
- uint32_t i_height = frmsize.stepwise.min_height;
+ uint32_t i_width = frmsize.un.stepwise.min_width;
+ uint32_t i_height = frmsize.un.stepwise.min_height;
for( ;
- i_width <= frmsize.stepwise.max_width &&
- i_height <= frmsize.stepwise.max_width;
- i_width += frmsize.stepwise.step_width,
- i_height += frmsize.stepwise.step_height )
+ i_width <= frmsize.un.stepwise.max_width &&
+ i_height <= frmsize.un.stepwise.max_width;
+ i_width += frmsize.un.stepwise.step_width,
+ i_height += frmsize.un.stepwise.step_height )
{
float f_fps = GetMaxFrameRate( p_demux, i_fd,
i_pixel_format,
@@ -1815,13 +1815,13 @@ static void GetMaxDimensions( demux_t *p_demux, int i_
msg_Err( p_demux, "GetMaxDimension implementation for V4L2_FRMSIZE_TYPE_CONTINUOUS isn't correct" );
float f_fps = GetMaxFrameRate( p_demux, i_fd,
i_pixel_format,
- frmsize.stepwise.max_width,
- frmsize.stepwise.max_height );
+ frmsize.un.stepwise.max_width,
+ frmsize.un.stepwise.max_height );
if( f_fps >= f_fps_min &&
- frmsize.stepwise.max_width > *pi_width )
+ frmsize.un.stepwise.max_width > *pi_width )
{
- *pi_width = frmsize.stepwise.max_width;
- *pi_height = frmsize.stepwise.max_height;
+ *pi_width = frmsize.un.stepwise.max_width;
+ *pi_height = frmsize.un.stepwise.max_height;
}
break;
}
@@ -2249,27 +2249,27 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sy
do
{
msg_Dbg( p_obj, " supported frame interval: %d/%d",
- frmival.discrete.numerator,
- frmival.discrete.denominator );
+ frmival.un.discrete.numerator,
+ frmival.un.discrete.denominator );
frmival.index++;
} while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival ) >= 0 );
break;
case V4L2_FRMIVAL_TYPE_STEPWISE:
msg_Dbg( p_obj, " supported frame intervals: %d/%d to "
"%d/%d using %d/%d increments",
- frmival.stepwise.min.numerator,
- frmival.stepwise.min.denominator,
- frmival.stepwise.max.numerator,
- frmival.stepwise.max.denominator,
- frmival.stepwise.step.numerator,
- frmival.stepwise.step.denominator );
+ frmival.un.stepwise.min.numerator,
+ frmival.un.stepwise.min.denominator,
+ frmival.un.stepwise.max.numerator,
+ frmival.un.stepwise.max.denominator,
+ frmival.un.stepwise.step.numerator,
+ frmival.un.stepwise.step.denominator );
break;
case V4L2_FRMIVAL_TYPE_CONTINUOUS:
msg_Dbg( p_obj, " supported frame intervals: %d/%d to %d/%d",
- frmival.stepwise.min.numerator,
- frmival.stepwise.min.denominator,
- frmival.stepwise.max.numerator,
- frmival.stepwise.max.denominator );
+ frmival.un.stepwise.min.numerator,
+ frmival.un.stepwise.min.denominator,
+ frmival.un.stepwise.max.numerator,
+ frmival.un.stepwise.max.denominator );
break;
}
}
@@ -2718,22 +2718,22 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_
{
msg_Dbg( p_obj,
" device supports size %dx%d",
- frmsize.discrete.width, frmsize.discrete.height );
+ frmsize.un.discrete.width, frmsize.un.discrete.height );
frmsize.index++;
} while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES, &frmsize ) >= 0 );
break;
case V4L2_FRMSIZE_TYPE_STEPWISE:
msg_Dbg( p_obj,
" device supports sizes %dx%d to %dx%d using %dx%d increments",
- frmsize.stepwise.min_width, frmsize.stepwise.min_height,
- frmsize.stepwise.max_width, frmsize.stepwise.max_height,
- frmsize.stepwise.step_width, frmsize.stepwise.step_height );
+ frmsize.un.stepwise.min_width, frmsize.un.stepwise.min_height,
+ frmsize.un.stepwise.max_width, frmsize.un.stepwise.max_height,
+ frmsize.un.stepwise.step_width, frmsize.un.stepwise.step_height );
break;
case V4L2_FRMSIZE_TYPE_CONTINUOUS:
msg_Dbg( p_obj,
" device supports all sizes %dx%d to %dx%d",
- frmsize.stepwise.min_width, frmsize.stepwise.min_height,
- frmsize.stepwise.max_width, frmsize.stepwise.max_height );
+ frmsize.un.stepwise.min_width, frmsize.un.stepwise.min_height,
+ frmsize.un.stepwise.max_width, frmsize.un.stepwise.max_height );
break;
}
}
@@ -3268,7 +3268,7 @@ static int Control( vlc_object_t *p_obj, demux_sys_t *
if( i_value >= queryctrl.minimum && i_value <= queryctrl.maximum )
{
- ext_control.value = i_value;
+ ext_control.un.value = i_value;
if( v4l2_ioctl( i_fd, VIDIOC_S_EXT_CTRLS, &ext_controls ) < 0 )
{
control.value = i_value;
@@ -3283,7 +3283,7 @@ static int Control( vlc_object_t *p_obj, demux_sys_t *
else
{
i_ret = v4l2_ioctl( i_fd, VIDIOC_G_EXT_CTRLS, &ext_controls );
- control.value = ext_control.value;
+ control.value = ext_control.un.value;
}
}