[FFmpeg-devel] [PACTH] Change av_get_channel_layout() syntax
stefasab at gmail.com
Tue Oct 15 17:37:46 CEST 2013
On date Tuesday 2013-10-15 15:27:36 +0200, Michael Niedermayer encoded:
> On Tue, Oct 15, 2013 at 03:10:54PM +0200, Stefano Sabatini wrote:
> > On date Tuesday 2013-10-15 11:35:16 +0200, Michael Niedermayer encoded:
> > > On Tue, Oct 15, 2013 at 10:48:35AM +0200, Stefano Sabatini wrote:
> > [...]
> > > > > i just meant that we could deprecate the use of decimal numbers for
> > > > > channel masks as its somewhat odd and allows typos (lost c letter)
> > > > > that is
> > > > > 0x123 -> channel mask
> > > > > 12c -> channel count
> > > > > 55 -> interpreted as mask for compatibility but deprecated
> > > >
> > > > decimal syntax as channel mask is currently not supported, but it will
> > > > be at the next major bump (in order to emulate the way we set channel
> > > > layouts in lswr). So I can't see how we can deprecate something which
> > > > is not yet supported.
> > >
> > > i meant that it should be deprecated for lswr to do that and also
> > > probably the newly added stuff shouldnt really recommand its use
> > At the moment you set ocl/icl with: aresample=[io]cl=DECIMAL
> > since it's using AV_OPT_TYPE_INT to set the channel mask. Switching to
> > AV_OPT_TYPE_CHANNEL_LAYOUT will be painless due to the hacked version
> > of av_get_channel_layout.
> > > but thats just a suggestion, as the decimal variant seems ambigous
> > > if one doesnt "know" how its exactly interpreted
> > You was the one to note that setting "aresample=ocl="PRId64"..." is
> > quite handy, so now I can't see why it should be deprecated.
> people should use 0x%"PRIx64" it avoids the ambiguity
having to specify an hexadecimal is as ambiguous
> > And yes it is ambiguous, but I think that "a number expresses the
> > corresponding channel layout mask code" is still better (more
> > intuitive) than "a number expresses the default channel layout with
> > that number of channels".
> agree of course
> ia just trying to say we should not recommand the use of decimals
> for channel masks
> it even might make debuging harder if these show up in a bug report
> that way
Which is not different from the hexadecimal form.
In short I think users should favor nominal forms, but both decimal
and hexadecimal forms should be accepted. About bug reports, there is
no way to prevent users to send unintelligible reports, restraining
design because of that looks wrong to me.
Anyway the issue seems orthogonal with respect to the present patch,
and can be addressed later.
FFmpeg = Funny and Fantastic Miracolous Peaceful Ecumenical Glue
More information about the ffmpeg-devel