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

Stefano Sabatini stefano.sabatini-lala
Sat Nov 6 14:12:43 CET 2010


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
find it, also using it is less awkward than:
av_pix_fmt_descriptors[pix_fmt].name

so I don't think it will hurt the API that much (and of course I'm not
going to push other patches for the other fields).
-- 
FFmpeg = Fanciful and Funny Minimal Peaceful Enchanting Gem



More information about the ffmpeg-devel mailing list