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 [...] > 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 ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer.
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel