[FFmpeg-devel] [PATCH 1/8] Deprecate avcodec_get_pix_fmt_name() in favor of the new av_get_pix_fmt_name().

Michael Niedermayer michaelni
Sun Nov 7 00:57:08 CET 2010


On Sat, Nov 06, 2010 at 02:12:43PM +0100, Stefano Sabatini wrote:
> On date Saturday 2010-11-06 03:07:13 +0100, Michael Niedermayer encoded:
> > On Fri, Nov 05, 2010 at 12:00:32PM +0100, Stefano Sabatini wrote:
> > > Consistent with av_get_sample_fmt_name().
> [...]
> > > --- a/libavutil/pixdesc.c
> > > +++ b/libavutil/pixdesc.c
> > > @@ -814,6 +814,14 @@ static enum PixelFormat get_pix_fmt_internal(const char *name)
> > >      return PIX_FMT_NONE;
> > >  }
> > >  
> > > +const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt)
> > > +{
> > > +    if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
> > > +        return NULL;
> > > +    else
> > > +        return av_pix_fmt_descriptors[pix_fmt].name;
> > > +}
> > > +
> > 
> > iam against adding a function per field of a public structure.
> 
> Consistent with av_get_sample_fmt_name() so the user will expect to

The sample formats are desribed in a private struct, the pixel formats
in a public struct.
if we need a function then that would be one returining the struct for
a pixel format
liks av_pixel_desc(pix_fmt).name
but iam not saying we need that ...

[...]
-- 
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/20101107/3146e315/attachment.pgp>



More information about the ffmpeg-devel mailing list