[FFmpeg-devel] [PATCH] lavfi: add showspectrum filter.

Stefano Sabatini stefasab at gmail.com
Sat Aug 11 21:20:36 CEST 2012

On date Saturday 2012-08-11 12:14:05 +0200, Nicolas George encoded:
> Le quintidi 25 thermidor, an CCXX, Stefano Sabatini a écrit :
> > #define AV_PERM_REUSE2   0x10   ///< can output the buffer multiple times, modified each time
> > 
> > It won't make any difference since no allocator currently supports
> > REUSE2, but that may help in the future.
> There is still a lot of ambiguity about that permissions business, as shown
> by the recent thread between Michael and me.

The more I read about that thread, the more confused I get (which
explains why I still didn't intervene in the discussion).

> Currently, most filters (except
> the very buggy ones) use PERM_PRESERVE inconsistently with the
> documentation, and in a way that makes it redundant with PERM_WRITE (or more
> exactly equivalent to !PERM_WRITE). OTOH, if PERM_PRESERVE were used
> consistently with the docs, it looks like PERM_REUSE2 would become
> redundant.

I don't know why REUSE/REUSE2 were introduced in the first place, my
interpretation is that they specify permissions used by the *frame
allocator*, and ignored by filters which don't require special
treatment with allocated frames. (The exception here may be a video
sink directly accessing the video memory, but I'm not yet sure about
which advantages this could have.)

Regarding PRESERVE vs WRITE, I consider them redundant, and I'd
propose to drop PRESERVE, and simply remove write permissions for
buffers which shouldn't be written by other filters (on the other hand
changing API would have the effect of making merges harder).

> I would really like you to comment on this before starting to make patches
> to clean things up.

I read the discussion but still don't have a definite opinion, I'd
like to consider some specific cases and see what can be done (if this
can be fixed at the API level or at the implementation level),
especially with regards to scenarios involving the split filter.

If you could update the thread and point to a few cases where we have
a wrong implementation and/or buggy behavior that may help.
FFmpeg = Fabulous Friendly Mega Power Ephemeral Guide

More information about the ffmpeg-devel mailing list