[Ffmpeg-devel] [PATCH] AVImageFormat kill

Michael Niedermayer michaelni
Thu Nov 2 22:47:27 CET 2006


Hi

On Thu, Nov 02, 2006 at 09:40:08PM +0100, Baptiste Coudurier wrote:
> Hi
> 
> Here is the patch that kills AVImageFormat, and removes image format in
> favor of image2. Can be applied as soon as gif encoder patch is applied.
> Michael ?

this must increase the major version number of libavformat


[...]
> Index: libavformat/gifdec.c
> ===================================================================
> --- libavformat/gifdec.c	(revision 6872)
> +++ libavformat/gifdec.c	(working copy)
> @@ -20,8 +20,6 @@
>   */
>  #include "avformat.h"
>  
> -int gif_write(ByteIOContext *pb, AVImageInfo *info);
> -
>  //#define DEBUG
>  
>  #define MAXBITS                 12
> @@ -144,17 +142,6 @@
>      return 0;
>  }
>  
> -static int gif_image_probe(AVProbeData * pd)
> -{
> -    if (pd->buf_size >= 24 &&
> -        (memcmp(pd->buf, gif87a_sig, 6) == 0 ||
> -         memcmp(pd->buf, gif89a_sig, 6) == 0))
> -        return AVPROBE_SCORE_MAX - 1;
> -    else
> -        return 0;
> -}
> -
> -
>  static void GLZWDecodeInit(GifState * s, int csize)
>  {
>      /* read buffer */
> @@ -594,33 +581,6 @@
>      return 0;
>  }
>  
> -/* read gif as image */
> -static int gif_read(ByteIOContext *f,
> -                    int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
> -{
> -    GifState s1, *s = &s1;
> -    AVImageInfo info1, *info = &info1;
> -    int ret;
> -
> -    memset(s, 0, sizeof(GifState));
> -    s->f = f;
> -    if (gif_read_header1(s) < 0)
> -        return -1;
> -    info->width = s->screen_width;
> -    info->height = s->screen_height;
> -    info->pix_fmt = PIX_FMT_PAL8;
> -    ret = alloc_cb(opaque, info);
> -    if (ret)
> -        return ret;
> -    s->image_buf = info->pict.data[0];
> -    s->image_linesize = info->pict.linesize[0];
> -    s->image_palette = (uint32_t *)info->pict.data[1];
> -
> -    if (gif_parse_next_image(s) < 0)
> -        return -1;
> -    return 0;
> -}
> -
>  AVInputFormat gif_demuxer =
>  {
>      "gif",
> @@ -631,14 +591,3 @@
>      gif_read_packet,
>      gif_read_close,
>  };
> -
> -AVImageFormat gif_image_format = {
> -    "gif",
> -    "gif",
> -    gif_image_probe,
> -    gif_read,
> -    (1 << PIX_FMT_PAL8),
> -#ifdef CONFIG_GIF_MUXER
> -    gif_write,
> -#endif
> -};

why dont you remove gifdec.c completely? what is in it that 
libavcodec/gifdec.c doesnt support?


> Index: libavformat/avformat.h
> ===================================================================
> --- libavformat/avformat.h	(revision 6872)
> +++ libavformat/avformat.h	(working copy)
> @@ -122,7 +122,7 @@
>      int width;
>      int height;
>      enum PixelFormat pix_fmt;
> -    struct AVImageFormat *image_format;
> +    void *place_holder;

senseless, compatibility is already broken by removing the image formats

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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list