[FFmpeg-devel] [PATCH 2/6] lavu/channel_layout: implement unknown layouts.

Michael Niedermayer michaelni at gmx.at
Thu Nov 29 04:59:19 CET 2012


On Wed, Nov 28, 2012 at 09:09:53PM +0100, Nicolas George wrote:
> L'octidi 8 frimaire, an CCXXI, Michael Niedermayer a écrit :
> > then the layout could be hacked at the very end, while it stays
> > correct throughout the filter graph
> > And one coukd add a flag that prevents the layout from being hacked
> > so new applications can set that flag and wont be affected.
> 
> That could probably made to work, but from an API design point of view, this
> is IMHO completely atrocious: it is inconsistent (sometimes the layout must
> match the count, sometimes not), and it exposes a backward compatibility in
> the public API. And still, it does not really solve anything, since it still
> can not code 5.1+mono.
> 
> The solution I propose is ugly, I am completely aware of that, but at least
> it is consistent with the current practice and with itself.
> 
> If we apply it now, then we can start working on a real solution for the
> next major bump.

IMHO we should decide what is the correct solution and work toward
that.

IMHO the correct solution is to never trust the layout to tell the
array size. And to just set it to 0 when its unknown.

I dont think this breaks ABI/API, an application that works within
the API that |layout| == channel count will never insert things into
the filter graph that dont conform to that and the filter framework
from itself wont produce a mismatch

Only an application for which layout=0 with channel count > 0 makes
sense would pass such a thing into the filter graph.

and it makes a lot more sense to me than setting a completely random
layout that matches the channel count and substituting a bit of it
toward a "this layout is not real and just for counting"
Iam concerned if we go the path of such fake layouts they will leak
into encoded files, into statistics output and possibly break code
that doesnt expect such layouts ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121129/c0b203c4/attachment.asc>


More information about the ffmpeg-devel mailing list