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

Michael Niedermayer michaelni
Thu Nov 26 17:54:41 CET 2009


On Thu, Nov 26, 2009 at 12:19:31AM +0100, Stefano Sabatini wrote:
> On date Wednesday 2009-11-25 12:38:13 +0100, Michael Niedermayer encoded:
> > On Wed, Nov 25, 2009 at 01:49:45AM +0100, Stefano Sabatini wrote:
> [...]
> > > Updated (also I forgot gray -> gray8).
> > > 
> > > The test I attached for reference issues this:
> > > pix_fmt_info name:gray != av_pix_fmt_descriptors name:gray8
> > > pix_fmt_info name:monow != av_pix_fmt_descriptors name:monowhite
> > > pix_fmt_info name:monob != av_pix_fmt_descriptors name:monoblack
> > > pix_fmt_info name:xvmcmc != av_pix_fmt_descriptors name:xvmc_mpeg2_mc
> > > pix_fmt_info name:xvmcidct != av_pix_fmt_descriptors name:xvmc_mpeg2_idct
> > 
> > so it still break compatibility
> > patch rejected
> 
> No, the test was testing something else, new test and patch attached.
> 
> Regards.
> -- 
> FFmpeg = Frightening & Friendly MultiPurpose Entertaining Genius

>  imgconvert.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 21640d9ba13d15adb20ddd98cd516ec89f07c160  use-av-pix-desc-for-pixname2.patch
> 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.


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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/f23d369d/attachment.pgp>



More information about the ffmpeg-devel mailing list