[FFmpeg-devel] [PATCH 5/6] Add support for V4L2 mem2mem codecs.

Alexis Ballier aballier at gentoo.org
Fri Nov 21 08:38:44 CET 2014


On Thu, 20 Nov 2014 21:41:56 +0100
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Thu, Nov 20, 2014 at 05:51:56PM +0100, Alexis Ballier wrote:
> > Default buffer settings should work with all drivers (mmaped memory
> > from the driver) but would imply useless memcpy()'s if used in the
> > standard way. libavcodec/v4l2.h is now installed to allow
> > applications to get the proper buffers to avoid these copies.
> > 
> > This has been tested on MFC5, on a Samsung exynos 4412 SOC (odroid
> > u3).
> [...]
> > +/**
> > + * Sets the status of a V4LBufferPool.
> > + *
> > + * @param[in] bp A pointer to a V4LBufferPool.
> > + * @param[in] cmd The status to set (VIDIOC_STREAMON or
> > VIDIOC_STREAMOFF).
> > + *                Warning: If VIDIOC_STREAMOFF is sent to a buffer
> > pool that still has some frames buffered,
> > + *                those frames will be dropped.
> > + * @return 0 in case of success, a negative value representing the
> > error otherwise.
> 
> in general ffmpeg uses larger or equal than 0 for success
> the advantage of this is that we can use positive return values
> to return some information in the future without breaking API/ABI

yep I can change the doc here; though I don't have much more to return
than "it has been done"


> [...]
> > diff --git a/libavcodec/v4l2.h b/libavcodec/v4l2.h
> > new file mode 100644
> > index 0000000..8771b4f
> > --- /dev/null
> > +++ b/libavcodec/v4l2.h
> > @@ -0,0 +1,66 @@
> > +/*
> > + * V4L2 bufferpools helper functions
> > + * Copyright (C) 2014 Alexis Ballier
> > + *
> > + * This file is part of FFmpeg.
> > + *
> > + * FFmpeg is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later
> > version.
> > + *
> > + * FFmpeg is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with FFmpeg; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> > 02110-1301 USA
> > + */
> > +
> > +#ifndef AVCODEC_V4L2_H
> > +#define AVCODEC_V4L2_H
> > +
> 
> > +#include <libavutil/frame.h>
> > +#include <libavcodec/avcodec.h>
> 
> we use #include "" in other installed headers
> 
> is it intentional that you dont use that form ?

didn't notice that public headers were doing this, this was intentional
only because this header ends up installed; I will change it to the
standard "" then

thanks


More information about the ffmpeg-devel mailing list