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

Michael Niedermayer michaelni
Thu Nov 26 21:40:36 CET 2009


On Thu, Nov 26, 2009 at 09:13:37PM +0100, Stefano Sabatini wrote:
> 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.

thats a seperate thing and does not belong in a patch switching between
2 structs, and even less just half of that change with a hack to undo
it again


> 
> Please check again if you like this approach.
> 
> Regards.
> -- 
> FFmpeg = Fast & Frightening Mortal Powered Enlightening Genius

>  pixdesc.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> cfc776b967774ef9dfe6c2a08222b4d97736eca7  use-weird-names-in-pixdescs.patch

ok
[..]
>  imgconvert.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 445a49f39094ac934ba43b7d6f810a70fe32dbbb  use-av-pix-desc-for-pixname.patch

ok

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091126/32619629/attachment.pgp>



More information about the ffmpeg-devel mailing list