[FFmpeg-devel] [PATCH] Use pixdesc for avcodec_get_pix_fmt_name()

Stefano Sabatini stefano.sabatini-lala
Thu Nov 26 21:13:37 CET 2009


On date Thursday 2009-11-26 17:54:41 +0100, Michael Niedermayer encoded:
> On Thu, Nov 26, 2009 at 12:19:31AM +0100, Stefano Sabatini wrote:
[...]
> > Index: libavcodec/imgconvert.c
> > ===================================================================
> > --- libavcodec/imgconvert.c	(revision 20610)
> > +++ libavcodec/imgconvert.c	(working copy)
> > @@ -33,6 +33,7 @@
> >  #include "avcodec.h"
> >  #include "dsputil.h"
> >  #include "colorspace.h"
> > +#include "libavutil/pixdesc.h"
> >  
> >  #if HAVE_MMX
> >  #include "x86/mmx.h"
> > @@ -539,8 +540,14 @@ const char *avcodec_get_pix_fmt_name(enum PixelFor
> >  {
> >      if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
> >          return NULL;
> > +
> > +    if      (pix_fmt == PIX_FMT_GRAY8)           return "gray";
> > +    else if (pix_fmt == PIX_FMT_MONOWHITE)       return "monow";
> > +    else if (pix_fmt == PIX_FMT_MONOBLACK)       return "monob";
> > +    else if (pix_fmt == PIX_FMT_XVMC_MPEG2_MC)   return "xvmcmc";
> > +    else if (pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT) return "xvmcidct";
> >      else
> > -        return pix_fmt_info[pix_fmt].name;
> > +        return av_pix_fmt_descriptors[pix_fmt].name;
> 
> special casing hack rejected and all variants you might come up with as well
> change the entries of the table. I do not care if you prefer to have
> your favorit strings in the table and then add a hack to not use them.
> thats just insane.
>
> If we want to make a compatibility breaking change (and at least i do NOT
> want this because it has no point at all). Then the table entries can be
> changed when this compatibility breaking change is done.

I'm OK with this, but I continue to prefer names which are consistent
with the enum name, that's true for all the other pixel format, I
don't want to keep that arbitrary asymetry.

Please check again if you like this approach.

Regards.
-- 
FFmpeg = Fast & Frightening Mortal Powered Enlightening Genius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-weird-names-in-pixdescs.patch
Type: text/x-diff
Size: 1233 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091126/2425d91f/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-av-pix-desc-for-pixname.patch
Type: text/x-diff
Size: 527 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091126/2425d91f/attachment-0001.patch>



More information about the ffmpeg-devel mailing list