* Copyright (c) 2002 Francois Revol
* Copyright (c) 2006 Baptiste Coudurier
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
const uint8_t *buf, int linesize)
{
GIFContext *s = avctx->priv_data;
- int len, height;
+ int len = 0, height;
const uint8_t *ptr;
/* image block */
avctx->coded_frame = &s->picture;
s->lzw = av_mallocz(ff_lzw_encode_state_size);
if (!s->lzw)
- return AVERROR_NOMEM;
+ return AVERROR(ENOMEM);
s->buf = av_malloc(avctx->width*avctx->height*2);
if (!s->buf)
- return AVERROR_NOMEM;
+ return AVERROR(ENOMEM);
return 0;
}
uint8_t *end = outbuf + buf_size;
*p = *pict;
- p->pict_type = FF_I_TYPE;
+ p->pict_type = AV_PICTURE_TYPE_I;
p->key_frame = 1;
gif_image_write_header(avctx, &outbuf_ptr, (uint32_t *)pict->data[1]);
gif_image_write_image(avctx, &outbuf_ptr, end, pict->data[0], pict->linesize[0]);
return 0;
}
-AVCodec gif_encoder = {
- "gif",
- CODEC_TYPE_VIDEO,
- CODEC_ID_GIF,
- sizeof(GIFContext),
- gif_encode_init,
- gif_encode_frame,
- gif_encode_close,
+AVCodec ff_gif_encoder = {
+ .name = "gif",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = CODEC_ID_GIF,
+ .priv_data_size = sizeof(GIFContext),
+ .init = gif_encode_init,
+ .encode = gif_encode_frame,
+ .close = gif_encode_close,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, PIX_FMT_GRAY8, PIX_FMT_PAL8, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
};