All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
gif.c File Reference
#include "avformat.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavcodec/put_bits.h"

Go to the source code of this file.

Data Structures

struct  rgb_triplet
struct  GIFContext


#define GIF_CHUNKS   100
#define OFFSET(x)   offsetof(GIFContext, x)


static int gif_image_write_header (AVIOContext *pb, int width, int height, int loop_count, uint32_t *palette)
static unsigned char gif_clut_index (uint8_t r, uint8_t g, uint8_t b)
static int gif_image_write_image (AVIOContext *pb, int x1, int y1, int width, int height, const uint8_t *buf, int linesize, int pix_fmt)
static int gif_write_header (AVFormatContext *s)
static int gif_write_video (AVFormatContext *s, AVCodecContext *enc, const uint8_t *buf, int size)
static int gif_write_packet (AVFormatContext *s, AVPacket *pkt)
static int gif_write_trailer (AVFormatContext *s)


static const rgb_triplet gif_clut [216]
static const AVOption options []
static const AVClass gif_muxer_class
AVOutputFormat ff_gif_muxer

Macro Definition Documentation


Definition at line 48 of file gif.c.

#define GIF_CHUNKS   100

Definition at line 53 of file gif.c.

Referenced by gif_image_write_image().


Definition at line 59 of file gif.c.

#define OFFSET (   x)    offsetof(GIFContext, x)

Definition at line 354 of file gif.c.


Definition at line 355 of file gif.c.

Function Documentation

static int gif_image_write_header ( AVIOContext pb,
int  width,
int  height,
int  loop_count,
uint32_t *  palette 

Definition at line 121 of file gif.c.

Referenced by gif_write_header().

static unsigned char gif_clut_index ( uint8_t  r,
uint8_t  g,
uint8_t  b 

Definition at line 187 of file gif.c.

Referenced by gif_image_write_image().

static int gif_image_write_image ( AVIOContext pb,
int  x1,
int  y1,
int  width,
int  height,
const uint8_t buf,
int  linesize,
int  pix_fmt 

Definition at line 192 of file gif.c.

Referenced by gif_write_video().

static int gif_write_header ( AVFormatContext s)

Definition at line 263 of file gif.c.

static int gif_write_video ( AVFormatContext s,
AVCodecContext enc,
const uint8_t buf,
int  size 

Definition at line 305 of file gif.c.

Referenced by gif_write_packet().

static int gif_write_packet ( AVFormatContext s,
AVPacket pkt 

Definition at line 336 of file gif.c.

static int gif_write_trailer ( AVFormatContext s)

Definition at line 345 of file gif.c.

Variable Documentation

const rgb_triplet gif_clut[216]

Definition at line 81 of file gif.c.

const AVOption options[]
Initial value:
= {
{ "loop", "Number of times to loop the output.", OFFSET(loop),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 65535, ENC },
{ NULL },

Definition at line 356 of file gif.c.

const AVClass gif_muxer_class
Initial value:
= {
.class_name = "GIF muxer",
.item_name = av_default_item_name,
.option = options,

Definition at line 362 of file gif.c.

AVOutputFormat ff_gif_muxer
Initial value:
= {
.name = "gif",
.long_name = NULL_IF_CONFIG_SMALL("GIF Animation"),
.mime_type = "image/gif",
.extensions = "gif",
.priv_data_size = sizeof(GIFContext),
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_RAWVIDEO,
.priv_class = &gif_muxer_class,

Definition at line 369 of file gif.c.