[FFmpeg-devel] [PATCH] v4l2: Select input immediately after opening the device

Stephan Hilb stephan at ecshi.net
Thu Jan 24 18:04:39 CET 2013


> +    av_log(s1, AV_LOG_DEBUG, "Selecting V4L2 input_id: %d\n",
> s->channel);
> +    if (v4l2_ioctl(s->fd, VIDIOC_S_INPUT, &s->channel) < 0) {
> +        av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set input
> failed\n");
> +        return AVERROR(EIO);
> +    }
> +
> +    input.index = s->channel;
> +    if (v4l2_ioctl(s->fd, VIDIOC_ENUMINPUT, &input) < 0) {
> +        av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl enum input
> failed\n");
> +        return AVERROR(EIO);
> +    }
> +    av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set input_id: %d,
> input: %s\n",
> +            s->channel, input.name);

I prefer to VIDIOC_ENUMINPUT before VIDIOC_S_INPUT but that's not
absolutely necessary (then you can use input.name in your first log
message and leave the last log message out as it will say the same
thing).

Otherwise I think the patch is fine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130124/51763449/attachment.asc>


More information about the ffmpeg-devel mailing list