[FFmpeg-devel] [PATCH] lavd/v4l2: reduce code duplication by using enqueue_buffer()

Stefano Sabatini stefasab at gmail.com
Fri Mar 8 19:35:52 CET 2013


On date Friday 2013-03-08 15:18:54 +0100, Giorgio Vazzana encoded:
> Hi,
> 
> commit message says it all. Please review.
> 
> Giorgio Vazzana

> From ba419f7f485f0187653a5e747a65fa2d454c34af Mon Sep 17 00:00:00 2001
> From: Giorgio Vazzana <mywing81 at gmail.com>
> Date: Fri, 8 Mar 2013 15:11:52 +0100
> Subject: [PATCH] lavd/v4l2: reduce code duplication by using enqueue_buffer()
> 
> ---
>  libavdevice/v4l2.c |   12 ++----------
>  1 files changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index b1a9c75..6915b06 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -663,17 +663,9 @@ static int mmap_start(AVFormatContext *ctx)
>      int i, res;
>  
>      for (i = 0; i < s->buffers; i++) {
> -        struct v4l2_buffer buf = {
> -            .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
> -            .index  = i,
> -            .memory = V4L2_MEMORY_MMAP
> -        };
> -
> -        if (v4l2_ioctl(s->fd, VIDIOC_QBUF, &buf) < 0) {
> -            res = AVERROR(errno);
> -            av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QBUF): %s\n", av_err2str(res));
> +        res = enqueue_buffer(s->fd, i);
> +        if (res < 0)
>              return res;
> -        }
>      }

Patch looks good, but it doesn't apply to current master after the
last merge. Please test if there are regressions (and BTW we need a
v4l2 maintainer).
-- 
FFmpeg = Friendly and Fascinating Meaningful Patchable Enhancing Game


More information about the ffmpeg-devel mailing list