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
 

Macros

#define BITSTREAM_WRITER_LE
 
#define GIF_CHUNKS   100
 
#define GIF_ADD_APP_HEADER
 
#define OFFSET(x)   offsetof(GIFContext, x)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

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)
 

Variables

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

Macro Definition Documentation

#define BITSTREAM_WRITER_LE

Definition at line 48 of file gif.c.

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 352 of file gif.c.

#define GIF_ADD_APP_HEADER

Definition at line 57 of file gif.c.

#define GIF_CHUNKS   100

Definition at line 53 of file gif.c.

Referenced by gif_image_write_image().

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

Definition at line 351 of file gif.c.

Function Documentation

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

Definition at line 178 of file gif.c.

Referenced by gif_image_write_image().

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

Definition at line 112 of file gif.c.

Referenced by gif_write_header().

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

Definition at line 184 of file gif.c.

Referenced by gif_write_video().

static int gif_write_header ( AVFormatContext s)
static

Definition at line 256 of file gif.c.

static int gif_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 333 of file gif.c.

static int gif_write_trailer ( AVFormatContext s)
static

Definition at line 342 of file gif.c.

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

Definition at line 302 of file gif.c.

Referenced by gif_write_packet().

Variable Documentation

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 = CODEC_ID_NONE,
.video_codec = CODEC_ID_RAWVIDEO,
.priv_class = &gif_muxer_class,
}
static int write_header(AVFormatContext *s)
Definition: assenc.c:28
static int write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: assenc.c:58
static int gif_write_header(AVFormatContext *s)
Definition: gif.c:256
static const AVClass gif_muxer_class
Definition: gif.c:358
static int write_trailer(AVFormatContext *s)
Definition: assenc.c:67
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:191
Definition: gif.c:54
static int gif_write_trailer(AVFormatContext *s)
Definition: gif.c:342
static int gif_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: gif.c:333

Definition at line 365 of file gif.c.

const rgb_triplet gif_clut[216]
static

Definition at line 72 of file gif.c.

const AVClass gif_muxer_class
static
Initial value:
= {
.class_name = "GIF muxer",
.item_name = av_default_item_name,
.option = options,
}
LIBAVUTIL_VERSION_INT
Definition: eval.c:50
av_default_item_name
Definition: dnxhdenc.c:43
static const AVOption options[]
Definition: gif.c:353

Definition at line 358 of file gif.c.

const AVOption options[]
static
Initial value:
= {
{ "loop", "Number of times to loop the output.", OFFSET(loop), AV_OPT_TYPE_INT, {0}, 0, 65535, ENC },
{ NULL },
}
#define OFFSET(x)
Definition: gif.c:351
#define ENC
Definition: gif.c:352
NULL
Definition: eval.c:50
static int loop
Definition: avplay.c:259

Definition at line 353 of file gif.c.