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_t * apng_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)
 
static void apng_deinit (AVFormatContext *s)
 

Variables

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

Macro Definition Documentation

◆ OFFSET

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

Definition at line 280 of file apngenc.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 281 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.

◆ apng_deinit()

static void apng_deinit ( AVFormatContext s)
static

Definition at line 271 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, UINT16_MAX, ENC },
{ "final_delay", "Force delay after the last frame", OFFSET(last_delay),
AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, UINT16_MAX, ENC },
{ NULL },
}

Definition at line 282 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,
}

Definition at line 290 of file apngenc.c.

◆ ff_apng_muxer

const 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,
}

Definition at line 297 of file apngenc.c.

APNGMuxContext
Definition: apngenc.c:34
apng_muxer_class
static const AVClass apng_muxer_class
Definition: apngenc.c:290
apng_write_trailer
static int apng_write_trailer(AVFormatContext *format_context)
Definition: apngenc.c:245
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:478
deinit
static void deinit(AVFormatContext *s)
Definition: chromaprint.c:50
AV_CODEC_ID_APNG
@ AV_CODEC_ID_APNG
Definition: codec_id.h:264
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:229
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
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:117
ENC
#define ENC
Definition: apngenc.c:281
options
static const AVOption options[]
Definition: apngenc.c:282
write_packet
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:727
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
OFFSET
#define OFFSET(x)
Definition: apngenc.c:280
apng_write_packet
static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet)
Definition: apngenc.c:225
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
apng_write_header
static int apng_write_header(AVFormatContext *format_context)
Definition: apngenc.c:81
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:347
apng_deinit
static void apng_deinit(AVFormatContext *s)
Definition: apngenc.c:271