FFmpeg
Loading...
Searching...
No Matches
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)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static av_cold int gif_init (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)
Value:
offsetof(GIFContext, x)

Definition at line 183 of file gif.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 184 of file gif.c.

Function Documentation

◆ gif_init()

static av_cold int gif_init ( 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 50 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 77 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 89 of file gif.c.

Referenced by gif_write_trailer().

◆ gif_write_trailer()

static int gif_write_trailer ( AVFormatContext * s)
static

Definition at line 166 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 },
}
#define ENC
Definition caca.c:198
#define NULL
Definition coverity.c:32
#define OFFSET(x)
static int loop
Definition ffplay.c:338
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258

Definition at line 185 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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 193 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,
.p.subtitle_codec = AV_CODEC_ID_NONE,
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
.init = gif_init,
.write_packet = gif_write_packet,
.write_trailer = gif_write_trailer,
.p.priv_class = &gif_muxer_class,
.p.flags = AVFMT_VARIABLE_FPS,
}
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition avformat.h:501
@ AV_CODEC_ID_GIF
Definition codec_id.h:147
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
static int gif_write_packet(AVFormatContext *s, AVPacket *new_pkt)
Definition gif.c:89
static const AVClass gif_muxer_class
Definition gif.c:193
static av_cold int gif_init(AVFormatContext *s)
Definition gif.c:43
static int gif_write_trailer(AVFormatContext *s)
Definition gif.c:166
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
Definition mux.h:50
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
Definition mux.h:59

Definition at line 200 of file gif.c.