Commit afc6e765 authored by Antoine Cellerier's avatar Antoine Cellerier

v4l2: Display supported framesizes in debug.

parent 5f8020da
......@@ -1730,6 +1730,43 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
msg_Dbg( p_demux, "device supports chroma %4s [%s]",
psz_fourcc,
p_sys->p_codecs[i_index].description );
/* List valid frame sizes for this format */
struct v4l2_frmsizeenum frmsize;
frmsize.index = 0;
frmsize.pixel_format = p_sys->p_codecs[i_index].pixelformat;
if( ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES, &frmsize ) < 0 )
{
msg_Err( p_demux, "Error while querying for frame size" );
}
else
{
switch( frmsize.type )
{
case V4L2_FRMSIZE_TYPE_DISCRETE:
do
{
msg_Dbg( p_demux,
"device supports size %dx%d",
frmsize.discrete.width, frmsize.discrete.height );
frmsize.index++;
} while( ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES, &frmsize ) >= 0 );
break;
case V4L2_FRMSIZE_TYPE_STEPWISE:
msg_Dbg( p_demux,
"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 );
break;
case V4L2_FRMSIZE_TYPE_CONTINUOUS:
msg_Dbg( p_demux,
"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 );
break;
}
}
}
}
if( !b_codec_supported )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment