Commit 0d8ccdcd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

v4l2: non-video capture devices cannot currently be used

This is not to say that devices of some other types should not be
supported. But none of them currently are really supported.
(Also I think a different MRL scheme would be preferable for some.)
parent bda8acb3
...@@ -809,6 +809,12 @@ int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys, ...@@ -809,6 +809,12 @@ int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys,
( cap.capabilities & V4L2_CAP_STREAMING ? 'X':' ' ), ( cap.capabilities & V4L2_CAP_STREAMING ? 'X':' ' ),
( cap.capabilities & V4L2_CAP_ASYNCIO ? 'X':' ' ) ); ( cap.capabilities & V4L2_CAP_ASYNCIO ? 'X':' ' ) );
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
{
msg_Err (p_obj, "not a video capture device");
return -1;
}
if( cap.capabilities & V4L2_CAP_STREAMING ) if( cap.capabilities & V4L2_CAP_STREAMING )
p_sys->io = IO_METHOD_MMAP; p_sys->io = IO_METHOD_MMAP;
else if( cap.capabilities & V4L2_CAP_READWRITE ) else if( cap.capabilities & V4L2_CAP_READWRITE )
...@@ -822,30 +828,27 @@ int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys, ...@@ -822,30 +828,27 @@ int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys,
/* Now, enumerate all the video inputs. This is useless at the moment /* Now, enumerate all the video inputs. This is useless at the moment
since we have no way to present that info to the user except with since we have no way to present that info to the user except with
debug messages */ debug messages */
if( cap.capabilities & V4L2_CAP_VIDEO_CAPTURE ) struct v4l2_input input;
{ unsigned index = var_InheritInteger( p_obj, CFG_PREFIX"input" );
struct v4l2_input input;
unsigned index = var_InheritInteger( p_obj, CFG_PREFIX"input" );
input.index = 0; input.index = 0;
while( v4l2_ioctl( i_fd, VIDIOC_ENUMINPUT, &input ) >= 0 ) while( v4l2_ioctl( i_fd, VIDIOC_ENUMINPUT, &input ) >= 0 )
{ {
msg_Dbg( p_obj, "video input %u (%s) has type: %s %c", msg_Dbg( p_obj, "video input %u (%s) has type: %s %c",
input.index, input.name, input.index, input.name,
input.type == V4L2_INPUT_TYPE_TUNER input.type == V4L2_INPUT_TYPE_TUNER
? "Tuner adapter" : "External analog input", ? "Tuner adapter" : "External analog input",
input.index == index ? '*' : ' ' ); input.index == index ? '*' : ' ' );
input.index++; input.index++;
} }
/* Select input */ /* Select input */
if( v4l2_ioctl( i_fd, VIDIOC_S_INPUT, &index ) < 0 ) if( v4l2_ioctl( i_fd, VIDIOC_S_INPUT, &index ) < 0 )
{ {
msg_Err( p_obj, "cannot set input %u: %m", index ); msg_Err( p_obj, "cannot set input %u: %m", index );
return -1; return -1;
}
msg_Dbg( p_obj, "input set to %u", index );
} }
msg_Dbg( p_obj, "input set to %u", index );
/* Select standard */ /* Select standard */
bool bottom_first; bool bottom_first;
......
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