FFmpeg
Data Structures | Macros | Functions | Variables
gif.c File Reference
#include "avformat.h"
#include "internal.h"
#include "mux.h"
#include "libavutil/imgutils.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/gif.h"

Go to the source code of this file.

Data Structures

struct  GIFContext
 

Macros

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

Functions

static int gif_write_header (AVFormatContext *s)
 
static int gif_parse_packet (AVFormatContext *s, const uint8_t *data, int size)
 
static int gif_get_delay (GIFContext *gif, AVPacket *prev, AVPacket *new)
 
static int gif_write_packet (AVFormatContext *s, AVPacket *new_pkt)
 
static int gif_write_trailer (AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass gif_muxer_class
 
const FFOutputFormat ff_gif_muxer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 189 of file gif.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 190 of file gif.c.

Function Documentation

◆ gif_write_header()

static int gif_write_header ( AVFormatContext s)
static

Definition at line 43 of file gif.c.

◆ gif_parse_packet()

static int gif_parse_packet ( AVFormatContext s,
const uint8_t *  data,
int  size 
)
static

Definition at line 58 of file gif.c.

Referenced by gif_write_packet().

◆ gif_get_delay()

static int gif_get_delay ( GIFContext gif,
AVPacket prev,
AVPacket new 
)
static

Definition at line 85 of file gif.c.

Referenced by gif_write_packet().

◆ gif_write_packet()

static int gif_write_packet ( AVFormatContext s,
AVPacket new_pkt 
)
static

Definition at line 95 of file gif.c.

Referenced by gif_write_trailer().

◆ gif_write_trailer()

static int gif_write_trailer ( AVFormatContext s)
static

Definition at line 172 of file gif.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "loop", "Number of times to loop the output: -1 - no loop, 0 - infinite loop", OFFSET(loop),
AV_OPT_TYPE_INT, { .i64 = 0 }, -1, 65535, ENC },
{ "final_delay", "Force delay (in centiseconds) after the last frame", OFFSET(last_delay),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 65535, ENC },
{ NULL },
}

Definition at line 191 of file gif.c.

◆ gif_muxer_class

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

Definition at line 199 of file gif.c.

◆ ff_gif_muxer

const FFOutputFormat ff_gif_muxer
Initial value:
= {
.p.name = "gif",
.p.long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
.p.mime_type = "image/gif",
.p.extensions = "gif",
.priv_data_size = sizeof(GIFContext),
.p.audio_codec = AV_CODEC_ID_NONE,
.p.video_codec = AV_CODEC_ID_GIF,
.write_header = gif_write_header,
.write_packet = gif_write_packet,
.write_trailer = gif_write_trailer,
.p.priv_class = &gif_muxer_class,
.p.flags = AVFMT_VARIABLE_FPS,
}

Definition at line 206 of file gif.c.

gif_write_header
static int gif_write_header(AVFormatContext *s)
Definition: gif.c:43
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:482
ENC
#define ENC
Definition: gif.c:190
loop
static int loop
Definition: ffplay.c:340
gif_muxer_class
static const AVClass gif_muxer_class
Definition: gif.c:199
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:115
GIFContext
Definition: gif.c:43
gif_write_trailer
static int gif_write_trailer(AVFormatContext *s)
Definition: gif.c:172
AV_CODEC_ID_GIF
@ AV_CODEC_ID_GIF
Definition: codec_id.h:149
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
options
static const AVOption options[]
Definition: gif.c:191
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
gif_write_packet
static int gif_write_packet(AVFormatContext *s, AVPacket *new_pkt)
Definition: gif.c:95
OFFSET
#define OFFSET(x)
Definition: gif.c:189