FFmpeg  4.0
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

◆ OFFSET

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

Definition at line 275 of file apngenc.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 276 of file apngenc.c.

Function Documentation

◆ apng_find_chunk()

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().

◆ apng_write_chunk()

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().

◆ apng_write_header()

static int apng_write_header ( AVFormatContext format_context)
static

Definition at line 81 of file apngenc.c.

◆ flush_packet()

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().

◆ apng_write_packet()

static int apng_write_packet ( AVFormatContext format_context,
AVPacket packet 
)
static

Definition at line 225 of file apngenc.c.

◆ apng_write_trailer()

static int apng_write_trailer ( AVFormatContext format_context)
static

Definition at line 245 of file apngenc.c.

Variable Documentation

◆ options

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.

◆ apng_muxer_class

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.

◆ ff_apng_muxer

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:679
static int apng_write_trailer(AVFormatContext *format_context)
Definition: apngenc.c:245
static const AVClass apng_muxer_class
Definition: apngenc.c:285
static int flags
Definition: log.c:55
#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 AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:472
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:337
static int apng_write_header(AVFormatContext *format_context)
Definition: apngenc.c:81

Definition at line 292 of file apngenc.c.