[FFmpeg-devel] [PATCH] Move sample format definitions from libavcodec to libavcore.

Michael Niedermayer michaelni
Fri Oct 29 23:06:05 CEST 2010


On Fri, Oct 29, 2010 at 05:16:38PM -0700, Stefano Sabatini wrote:
> On date Thursday 2010-10-28 20:22:18 +0200, Michael Niedermayer encoded:
> > On Thu, Oct 28, 2010 at 04:28:18PM -0700, Stefano Sabatini wrote:
> > > On date Wednesday 2010-10-27 11:22:43 +0200, Michael Niedermayer encoded:
> > > > On Mon, Oct 25, 2010 at 08:12:43PM -0700, Stefano Sabatini wrote:
> > > > > On date Monday 2010-10-25 14:53:59 +0200, Michael Niedermayer encoded:
> > > > > > On Sun, Oct 24, 2010 at 11:38:20PM -0700, Stefano Sabatini wrote:
> > > > > > > ---
> > > > > > >  libavcodec/avcodec.h  |   27 +++++++++++++++------------
> > > > > > >  libavcore/Makefile    |    1 +
> > > > > > >  libavcore/samplefmt.h |   35 +++++++++++++++++++++++++++++++++++
> > > > > > >  3 files changed, 51 insertions(+), 12 deletions(-)
> > > > > > >  create mode 100644 libavcore/samplefmt.h
> > > > > [...]
> > > > > > > --- /dev/null
> > > > > > > +++ b/libavcore/samplefmt.h
> > > > > > 
> > > > > > do we really want a header per enum ?
> > > > > 
> > > > > No, I'm also planning to move there these functions from
> > > > > libavcodec/audioconvert.h (with some renamings):
> > > > > 
> > > > > void avcodec_sample_fmt_string(char *buf, int buf_size, int sample_fmt);
> > > > > const char *avcodec_get_sample_fmt_name(int sample_fmt);
> > > > > enum SampleFormat avcodec_get_sample_fmt(const char* name);
> > > > > const char *avcodec_get_channel_name(int channel_id);
> > > > > int64_t avcodec_get_channel_layout(const char *name);
> > > > > void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout);
> > > > > int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name);
> > > > > int avcodec_channel_layout_num_channels(int64_t channel_layout);
> > > > > 
> > > > > suggest a better name for the file or place where to move them.
> > > > 
> > > > audio.h maybe?
> > > 
> > > Not that I care much about the name, but audio.h seems a bit too
> > > generic while samplefmt.h is more specific and is symmetric to
> > > pixfmt.h, which is in my opinion a nice feature.
> > 
> > the channel stuff has nothing to do with sample formats
> 
> OK but please let's try not to waste time bikeshedding on the
> names. This is my overall plan:

these are public names and if they make no sense at all it will hurt useability
similarly having one header per struct and enum is a nightmare for anyone trying
to use avcore

if you want samplefmt.h its no problem but if the number of headers
grows while there is no logic seperation between them then we need a audio.h
that includes all and no single user will ever do anything but use audio.h.
Its just evolution, unfit headers die ;)
And the easiest to remember is fitter ...


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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101029/d47ce68f/attachment.pgp>



More information about the ffmpeg-devel mailing list