[FFmpeg-devel] [PATCH 4/4] mmaldec: limit internal buffering

Michael Niedermayer michael at niedermayer.cc
Wed Jan 27 23:31:25 CET 2016


On Wed, Jan 27, 2016 at 09:18:53PM +0100, wm4 wrote:
> On Wed, 27 Jan 2016 20:41:33 +0100
> Michael Niedermayer <michael at niedermayer.cc> wrote:
> 
> > On Wed, Jan 27, 2016 at 05:17:56PM +0100, wm4 wrote:
> > > This uses a new MMAL feature, which limits the number of extra frames
> > > that can be buffered within the decoder. VIDEO_MAX_NUM_CALLBACKS can
> > > be defined as positive or negative number. Positive numbers are
> > > absolute, and can lead to deadlocks if the user underestimates the
> > > required buffers. Negative numbers specify the number of extra
> > > buffers, e.g. -1 means no extra buffer, (-1-N) means N extra buffers.
> > > 
> > > Set a gratuitous default of -11 (N=10). This is much lower than the
> > > firmware default, which appears to be 96.
> > > 
> > > This is backwards compatible, but needs a symbol only present in newer
> > > firmware headers. (It's an enum item, so it requires a check in
> > > configure.)
> > > ---
> > >  configure            | 4 ++++
> > >  libavcodec/mmaldec.c | 7 +++++++
> > >  2 files changed, 11 insertions(+)
> > > 
> > > diff --git a/configure b/configure
> > > index 9b195c9..e5f513b 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -5546,6 +5546,10 @@ enabled mmal              && { check_lib interface/mmal/mmal.h mmal_port_connect
> > >                                      check_lib interface/mmal/mmal.h mmal_port_connect ; }
> > >                                  check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
> > >                                 die "ERROR: mmal not found"; }
> > > +enabled mmal &&
> > > +    check_code cc interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS" ||
> > > +    die "ERROR: mmal firmware headers too old"
> > > +
> > >  enabled netcdf            && require_pkg_config netcdf netcdf.h nc_inq_libvers
> > >  enabled nvenc             && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
> > >                               { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||  
> > 
> > this or a previous change breaks build
> > make distclean ; ../configure --cc='ccache x86_64-w64-mingw32-gcc' --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- && make -j12
> > ERROR: mmal firmware headers too old
> > 
> > 
> > [...]
> 
> Thanks for catching it. I'll change it to:
> 
> enabled mmal &&
>     (check_code cc interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS" ||
>      die "ERROR: mmal firmware headers too old")
> 
> This should work, shouldn't it?

works
thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160127/4f4f3afa/attachment.sig>


More information about the ffmpeg-devel mailing list