40 if (
s->nb_streams != 1) {
80 if (
w->last_pkt.size) {
89 flags |=
w->last_pkt.data[skip + 4 + 4];
91 skip +=
AV_RL32(
w->last_pkt.data + skip + 4) + 8;
94 if (!
w->wrote_webp_header) {
96 w->wrote_webp_header = 1;
97 if (
w->frame_count > 1)
101 if (
w->frame_count == 1) {
123 if (
w->frame_count > trailer) {
136 avio_write(
s->pb,
w->last_pkt.data + skip,
w->last_pkt.size - skip);
153 w->using_webp_anim_encoder |= ret;
155 if (
w->using_webp_anim_encoder) {
157 w->wrote_webp_header = 1;
174 if (
w->using_webp_anim_encoder) {
175 if ((
w->frame_count > 1) &&
w->loop) {
201 #define OFFSET(x) offsetof(WebpContext, x)
202 #define ENC AV_OPT_FLAG_ENCODING_PARAM
204 {
"loop",
"Number of times to loop the output: 0 - infinite loop",
OFFSET(
loop),
218 .extensions =
"webp",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
void avio_wl32(AVIOContext *s, unsigned int val)
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_wl24(AVIOContext *s, unsigned int val)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define flags(name, subs,...)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
static void write_header(FFV1Context *f)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define LIBAVUTIL_VERSION_INT
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int using_webp_anim_encoder
static int write_trailer(AVFormatContext *s1)
static const AVOption options[]
static void webp_deinit(AVFormatContext *s)
static int webp_write_trailer(AVFormatContext *s)
AVOutputFormat ff_webp_muxer
static int webp_write_header(AVFormatContext *s)
static const AVClass webp_muxer_class
static int is_animated_webp_packet(AVPacket *pkt)
static int flush(AVFormatContext *s, int trailer, int64_t pts)
static int webp_write_packet(AVFormatContext *s, AVPacket *pkt)