58 x = bytestream2_get_byte(&gb);
62 x = bytestream2_get_byte(&gb);
64 int block_size = bytestream2_get_byte(&gb);
113 if (
pkt->data[10] & 0x80)
114 off += 3 * (1 << ((
pkt->data[10] & 0x07) + 1));
116 if (
pkt->size < off + 2)
124 if (
pkt->size <= off)
128 if (gif->
loop >= 0) {
132 avio_write(pb,
"NETSCAPE2.0",
sizeof(
"NETSCAPE2.0") - 1);
140 if (delay_pos > 0 && delay_pos < pkt->
size - off - 2) {
143 avio_write(pb,
pkt->data + off + delay_pos + 2,
pkt->size - off - delay_pos - 2);
150 if (delay_pos > 0 && delay_pos < pkt->
size - 2) {
183#define OFFSET(x) offsetof(GIFContext, x)
184#define ENC AV_OPT_FLAG_ENCODING_PARAM
186 {
"loop",
"Number of times to loop the output: -1 - no loop, 0 - infinite loop",
OFFSET(
loop),
188 {
"final_delay",
"Force delay (in centiseconds) after the last frame",
OFFSET(last_delay),
194 .class_name =
"GIF muxer",
203 .p.mime_type =
"image/gif",
204 .p.extensions =
"gif",
void avio_wl16(AVIOContext *s, unsigned int val)
void avio_w8(AVIOContext *s, int b)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_tell(const GetByteContext *g)
#define GIF_APP_EXT_LABEL
#define GIF_EXTENSION_INTRODUCER
#define GIF_GCE_EXT_LABEL
@ AV_OPT_TYPE_INT
Underlying C type is int.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
const char * av_default_item_name(void *ptr)
Return the context name.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define LIBAVUTIL_VERSION_INT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#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....
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
Describe the class of an AVClass context structure.
This structure stores compressed data.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...