FFmpeg
Data Structures | Macros | Functions | Variables
gif.c File Reference
#include "avformat.h"
#include "internal.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, 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 AVOutputFormat ff_gif_muxer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 188 of file gif.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 189 of file gif.c.

Function Documentation

◆ gif_write_header()

static int gif_write_header ( AVFormatContext s)
static

Definition at line 42 of file gif.c.

◆ gif_parse_packet()

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

Definition at line 57 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 84 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 94 of file gif.c.

Referenced by gif_write_trailer().

◆ gif_write_trailer()

static int gif_write_trailer ( AVFormatContext s)
static

Definition at line 171 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 190 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 198 of file gif.c.

◆ ff_gif_muxer

const AVOutputFormat ff_gif_muxer
Initial value:
= {
.name = "gif",
.long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
.mime_type = "image/gif",
.extensions = "gif",
.priv_data_size = sizeof(GIFContext),
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_GIF,
.priv_class = &gif_muxer_class,
}

Definition at line 205 of file gif.c.

gif_write_header
static int gif_write_header(AVFormatContext *s)
Definition: gif.c:42
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:478
ENC
#define ENC
Definition: gif.c:189
loop
static int loop
Definition: ffplay.c:339
gif_muxer_class
static const AVClass gif_muxer_class
Definition: gif.c:198
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
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:117
GIFContext
Definition: gif.c:47
gif_write_trailer
static int gif_write_trailer(AVFormatContext *s)
Definition: gif.c:171
write_packet
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:727
AV_CODEC_ID_GIF
@ AV_CODEC_ID_GIF
Definition: codec_id.h:147
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
options
static const AVOption options[]
Definition: gif.c:190
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
gif_write_packet
static int gif_write_packet(AVFormatContext *s, AVPacket *new_pkt)
Definition: gif.c:94
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
OFFSET
#define OFFSET(x)
Definition: gif.c:188
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:347