FFmpeg
Data Structures | Macros | Functions | Variables
apngenc.c File Reference
#include "avformat.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavcodec/png.h"
#include "libavcodec/apng.h"

Go to the source code of this file.

Data Structures

struct  APNGMuxContext
 

Macros

#define OFFSET(x)   offsetof(APNGMuxContext, x)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static uint8_tapng_find_chunk (uint32_t tag, uint8_t *buf, size_t length)
 
static void apng_write_chunk (AVIOContext *io_context, uint32_t tag, uint8_t *buf, size_t length)
 
static int apng_write_header (AVFormatContext *format_context)
 
static int flush_packet (AVFormatContext *format_context, AVPacket *packet)
 
static int apng_write_packet (AVFormatContext *format_context, AVPacket *packet)
 
static int apng_write_trailer (AVFormatContext *format_context)
 

Variables

static const AVOption options []
 
static const AVClass apng_muxer_class
 
AVOutputFormat ff_apng_muxer
 

Macro Definition Documentation

#define OFFSET (   x)    offsetof(APNGMuxContext, x)

Definition at line 275 of file apngenc.c.

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 276 of file apngenc.c.

Function Documentation

static uint8_t* apng_find_chunk ( uint32_t  tag,
uint8_t buf,
size_t  length 
)
static

Definition at line 52 of file apngenc.c.

Referenced by flush_packet().

static void apng_write_chunk ( AVIOContext io_context,
uint32_t  tag,
uint8_t buf,
size_t  length 
)
static

Definition at line 61 of file apngenc.c.

Referenced by apng_write_trailer(), and flush_packet().

static int apng_write_header ( AVFormatContext format_context)
static

Definition at line 81 of file apngenc.c.

static int flush_packet ( AVFormatContext format_context,
AVPacket packet 
)
static

Definition at line 116 of file apngenc.c.

Referenced by apng_write_packet(), and apng_write_trailer().

static int apng_write_packet ( AVFormatContext format_context,
AVPacket packet 
)
static

Definition at line 225 of file apngenc.c.

static int apng_write_trailer ( AVFormatContext format_context)
static

Definition at line 245 of file apngenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "plays", "Number of times to play the output: 0 - infinite loop, 1 - no loop", OFFSET(plays),
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, UINT_MAX, ENC },
{ "final_delay", "Force delay after the last frame", OFFSET(last_delay),
AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, USHRT_MAX, ENC },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define ENC
Definition: apngenc.c:276
#define OFFSET(x)
Definition: apngenc.c:275

Definition at line 277 of file apngenc.c.

const AVClass apng_muxer_class
static
Initial value:
= {
.class_name = "APNG muxer",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: apngenc.c:277

Definition at line 285 of file apngenc.c.

AVOutputFormat ff_apng_muxer
Initial value:
= {
.name = "apng",
.long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
.mime_type = "image/png",
.extensions = "apng",
.priv_data_size = sizeof(APNGMuxContext),
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_APNG,
.priv_class = &apng_muxer_class,
}
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:689
static int apng_write_trailer(AVFormatContext *format_context)
Definition: apngenc.c:245
static const AVClass apng_muxer_class
Definition: apngenc.c:285
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet)
Definition: apngenc.c:225
#define flags(name, subs,...)
Definition: cbs_av1.c:561
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:470
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:349
static int apng_write_header(AVFormatContext *format_context)
Definition: apngenc.c:81

Definition at line 292 of file apngenc.c.