32 int loop_count, uint32_t *
palette)
45 for (i = 0; i < 256; i++) {
46 const uint32_t
v = palette[i] & 0xffffff;
56 if (loop_count >= 0 ) {
61 avio_write(pb,
"NETSCAPE2.0",
sizeof(
"NETSCAPE2.0") - 1);
91 "GIF muxer supports only a single video GIF stream.\n");
96 width = video_enc->
width;
97 height = video_enc->
height;
131 unsigned i, smallest_alpha = 0xff;
134 const uint32_t
v = palette[i];
135 if (v >> 24 < smallest_alpha) {
136 smallest_alpha = v >> 24;
137 transparent_color_index = i;
140 if (smallest_alpha < 128)
155 avio_w8(pb, transparent_color_index);
192 #define OFFSET(x) offsetof(GIFContext, x)
193 #define ENC AV_OPT_FLAG_ENCODING_PARAM
195 {
"loop",
"Number of times to loop the output: -1 - no loop, 0 - infinite loop",
OFFSET(
loop),
197 {
"final_delay",
"Force delay (in centiseconds) after the last frame",
OFFSET(last_delay),
212 .mime_type =
"image/gif",
220 .priv_class = &gif_muxer_class,