FFmpeg
Data Structures | Macros | Functions | Variables
webp_anim_dec.c File Reference
#include "avio_internal.h"
#include "demux.h"
#include "avformat.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  WebPAnimDemuxContext
 

Macros

#define VP8X_FLAG_ANIMATION   0x02
 
#define VP8X_FLAG_XMP_METADATA   0x04
 
#define VP8X_FLAG_EXIF_METADATA   0x08
 
#define VP8X_FLAG_ALPHA   0x10
 
#define VP8X_FLAG_ICC   0x20
 
#define WEBP_DEFAULT_DELAY   100
 Major web browsers display WebPs at ~10-15fps when rate is not explicitly set or have too low values. More...
 
#define WEBP_MIN_DELAY   10
 By default delay values less than this threshold considered to be invalid. More...
 

Functions

static int webp_anim_probe (const AVProbeData *p)
 
static int webp_anim_read_header (AVFormatContext *s)
 
static int webp_anim_read_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const AVClass demuxer_class
 
const FFInputFormat ff_webp_anim_demuxer
 

Detailed Description

Animated WebP demuxer.

Definition in file webp_anim_dec.c.

Macro Definition Documentation

◆ VP8X_FLAG_ANIMATION

#define VP8X_FLAG_ANIMATION   0x02

Definition at line 36 of file webp_anim_dec.c.

◆ VP8X_FLAG_XMP_METADATA

#define VP8X_FLAG_XMP_METADATA   0x04

Definition at line 37 of file webp_anim_dec.c.

◆ VP8X_FLAG_EXIF_METADATA

#define VP8X_FLAG_EXIF_METADATA   0x08

Definition at line 38 of file webp_anim_dec.c.

◆ VP8X_FLAG_ALPHA

#define VP8X_FLAG_ALPHA   0x10

Definition at line 39 of file webp_anim_dec.c.

◆ VP8X_FLAG_ICC

#define VP8X_FLAG_ICC   0x20

Definition at line 40 of file webp_anim_dec.c.

◆ WEBP_DEFAULT_DELAY

#define WEBP_DEFAULT_DELAY   100

Major web browsers display WebPs at ~10-15fps when rate is not explicitly set or have too low values.

We assume default rate to be 10. Default delay = 1000 microseconds / 10fps = 100 milliseconds per frame.

Definition at line 82 of file webp_anim_dec.c.

◆ WEBP_MIN_DELAY

#define WEBP_MIN_DELAY   10

By default delay values less than this threshold considered to be invalid.

Definition at line 86 of file webp_anim_dec.c.

Function Documentation

◆ webp_anim_probe()

static int webp_anim_probe ( const AVProbeData p)
static

Definition at line 88 of file webp_anim_dec.c.

◆ webp_anim_read_header()

static int webp_anim_read_header ( AVFormatContext s)
static

Definition at line 102 of file webp_anim_dec.c.

◆ webp_anim_read_packet()

static int webp_anim_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 234 of file webp_anim_dec.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "min_delay", "minimum valid delay between frames (in milliseconds)", 0x42, AV_OPT_TYPE_INT, {.i64 = WEBP_MIN_DELAY}, 0, 1000 * 60, AV_OPT_FLAG_DECODING_PARAM },
{ "max_webp_delay", "maximum valid delay between frames (in milliseconds)", 0x42, AV_OPT_TYPE_INT, {.i64 = 0xffffff}, 0, 0xffffff, AV_OPT_FLAG_DECODING_PARAM },
{ "default_delay", "default delay between frames (in milliseconds)", 0x42, AV_OPT_TYPE_INT, {.i64 = WEBP_DEFAULT_DELAY}, 0, 1000 * 60, AV_OPT_FLAG_DECODING_PARAM },
{ "ignore_loop", "ignore loop setting", 0x42, AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ "usebgcolor", "use background color from ANIM chunk", 0x42, AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
}

Definition at line 345 of file webp_anim_dec.c.

◆ demuxer_class

const AVClass demuxer_class
static
Initial value:
= {
.class_name = "Animated WebP demuxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 354 of file webp_anim_dec.c.

◆ ff_webp_anim_demuxer

const FFInputFormat ff_webp_anim_demuxer
Initial value:
= {
.p.name = "webp_anim",
.p.long_name = NULL_IF_CONFIG_SMALL("Animated WebP"),
.p.flags = AVFMT_GENERIC_INDEX,
.p.priv_class = &demuxer_class,
.priv_data_size = sizeof(WebPAnimDemuxContext),
}

Definition at line 362 of file webp_anim_dec.c.

WEBP_DEFAULT_DELAY
#define WEBP_DEFAULT_DELAY
Major web browsers display WebPs at ~10-15fps when rate is not explicitly set or have too low values.
Definition: webp_anim_dec.c:82
demuxer_class
static const AVClass demuxer_class
Definition: webp_anim_dec.c:354
AVFMT_GENERIC_INDEX
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:479
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
WEBP_MIN_DELAY
#define WEBP_MIN_DELAY
By default delay values less than this threshold considered to be invalid.
Definition: webp_anim_dec.c:86
AV_CLASS_CATEGORY_DEMUXER
@ AV_CLASS_CATEGORY_DEMUXER
Definition: log.h:33
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
webp_anim_read_packet
static int webp_anim_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: webp_anim_dec.c:234
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:242
WebPAnimDemuxContext
Definition: webp_anim_dec.c:42
webp_anim_probe
static int webp_anim_probe(const AVProbeData *p)
Definition: webp_anim_dec.c:88
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:94
webp_anim_read_header
static int webp_anim_read_header(AVFormatContext *s)
Definition: webp_anim_dec.c:102
read_header
static int read_header(FFV1Context *f, RangeCoder *c)
Definition: ffv1dec.c:501
options
static const AVOption options[]
Definition: webp_anim_dec.c:345
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition: opt.h:356
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327