Go to the documentation of this file.
36 #define VP8X_FLAG_ANIMATION 0x02
37 #define VP8X_FLAG_XMP_METADATA 0x04
38 #define VP8X_FLAG_EXIF_METADATA 0x08
39 #define VP8X_FLAG_ALPHA 0x10
40 #define VP8X_FLAG_ICC 0x20
82 #define WEBP_DEFAULT_DELAY 100
86 #define WEBP_MIN_DELAY 10
90 const uint8_t *
b =
p->buf;
146 if (
size == UINT32_MAX)
154 case MKTAG(
'I',
'C',
'C',
'P'):
156 av_log(
s, loglevel,
"Extra ICCP chunk found\n");
163 "ICCP chunk present, but ICC Profile bit not set in the VP8X header\n");
179 case MKTAG(
'A',
'N',
'I',
'M'):
181 av_log(
s, loglevel,
"Extra ANIM chunk found\n");
190 if (
ctx->usebgcolor) {
198 "ANIM: background BGRA 0x%08x loop count %d\n",
199 bg_color,
ctx->loop_count);
203 case MKTAG(
'A',
'N',
'M',
'F'):
204 if (!
ctx->has_anim) {
206 "ANMF chunk present, but no previous ANIM chunk found\n");
210 }
else if (!
ctx->ignore_loop &&
ctx->loop_count != 1) {
212 if (file_size < 0 ||
offset < 0 ||
215 "Could not ensure seekback, will not loop\n");
247 if (
size == UINT32_MAX)
252 if (!
ctx->ignore_loop &&
253 (
ctx->loop_count == 0 || ++
ctx->cur_loop <
ctx->loop_count)) {
267 case MKTAG(
'A',
'N',
'M',
'F'):
273 if (!
ctx->cur_frame++)
278 if (duration <= ctx->min_delay)
282 case MKTAG(
'E',
'X',
'I',
'F'):
284 av_log(
s, loglevel,
"Extra EXIF chunk found\n");
291 "EXIF chunk present, but EXIF bit not set in the VP8X header\n");
308 case MKTAG(
'X',
'M',
'P',
' '):
310 av_log(
s, loglevel,
"Extra XMP chunk found\n");
317 "XMP chunk present, but XMP bit not set in the VP8X header\n");
363 .
p.
name =
"webp_anim",
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define AV_EF_EXPLODE
abort decoding on minor error detection
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
#define WEBP_DEFAULT_DELAY
Major web browsers display WebPs at ~10-15fps when rate is not explicitly set or have too low values.
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
#define VP8X_FLAG_XMP_METADATA
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t avio_size(AVIOContext *s)
Get the filesize.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int cur_frame
number of frames of the current animation file
static const AVClass demuxer_class
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int min_delay
Minimum allowed delay between frames in milliseconds.
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int loop_count
number of times to loop the animation
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define WEBP_MIN_DELAY
By default delay values less than this threshold considered to be invalid.
int width
The width of the video frame in pixels.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static AVFormatContext * ctx
int nb_coded_side_data
Amount of entries in coded_side_data.
@ AV_CLASS_CATEGORY_DEMUXER
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
@ AV_PKT_DATA_EXIF
Extensible image file format metadata.
Describe the class of an AVClass context structure.
#define VP8X_FLAG_EXIF_METADATA
static int webp_anim_read_packet(AVFormatContext *s, AVPacket *pkt)
const char * av_default_item_name(void *ptr)
Return the context name.
This structure contains the data a format has to probe a file.
int extradata_size
Size of the extradata content in bytes.
static int webp_anim_probe(const AVProbeData *p)
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ignore_loop
ignore loop setting
static int webp_anim_read_header(AVFormatContext *s)
#define AV_NOPTS_VALUE
Undefined timestamp value.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_RL24
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
int avio_r8(AVIOContext *s)
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int flags
A combination of AV_PKT_FLAG values.
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define VP8X_FLAG_ANIMATION
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
unsigned int avio_rl24(AVIOContext *s)
int64_t first_anmf_offset
int height
The height of the video frame in pixels.
const FFInputFormat ff_webp_anim_demuxer
@ AV_PKT_DATA_ICC_PROFILE
ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1.
int cur_loop
current loop counter
AVPacketSideData * coded_side_data
Additional data associated with the entire stream.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVPacketSideData * av_packet_side_data_new(AVPacketSideData **psd, int *pnb_sd, enum AVPacketSideDataType type, size_t size, int flags)
Allocate a new packet side data.
#define AV_INPUT_BUFFER_PADDING_SIZE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
static const AVOption options[]
@ AV_OPT_TYPE_INT
Underlying C type is int.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
static int read_probe(const AVProbeData *p)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
#define av_fourcc2str(fourcc)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.