FFmpeg
Data Structures | Macros | Functions | Variables
astenc.c File Reference
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "ast.h"
#include "mux.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  ASTMuxContext
 

Macros

#define CHECK_LOOP(type)
 
#define OFFSET(obj)   offsetof(ASTMuxContext, obj)
 

Functions

static int ast_write_header (AVFormatContext *s)
 
static int ast_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int ast_write_trailer (AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass ast_muxer_class
 
const FFOutputFormat ff_ast_muxer
 

Macro Definition Documentation

◆ CHECK_LOOP

#define CHECK_LOOP (   type)
Value:
if (ast->loop ## type > 0) { \
ast->loop ## type = av_rescale_rnd(ast->loop ## type, par->sample_rate, 1000, AV_ROUND_DOWN); \
if (ast->loop ## type < 0 || ast->loop ## type > UINT_MAX) { \
av_log(s, AV_LOG_ERROR, "Invalid loop" #type " value\n"); \
return AVERROR(EINVAL); \
} \
}

Definition at line 39 of file astenc.c.

◆ OFFSET

#define OFFSET (   obj)    offsetof(ASTMuxContext, obj)

Definition at line 179 of file astenc.c.

Function Documentation

◆ ast_write_header()

static int ast_write_header ( AVFormatContext s)
static

Definition at line 48 of file astenc.c.

◆ ast_write_packet()

static int ast_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 101 of file astenc.c.

◆ ast_write_trailer()

static int ast_write_trailer ( AVFormatContext s)
static

Definition at line 122 of file astenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "loopstart", "Loopstart position in milliseconds.", OFFSET(loopstart), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "loopend", "Loopend position in milliseconds.", OFFSET(loopend), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
}

Definition at line 180 of file astenc.c.

◆ ast_muxer_class

const AVClass ast_muxer_class
static
Initial value:
= {
.class_name = "AST muxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 186 of file astenc.c.

◆ ff_ast_muxer

const FFOutputFormat ff_ast_muxer
Initial value:
= {
.p.name = "ast",
.p.long_name = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"),
.p.extensions = "ast",
.priv_data_size = sizeof(ASTMuxContext),
.p.audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR,
.p.video_codec = AV_CODEC_ID_NONE,
.p.subtitle_codec = AV_CODEC_ID_NONE,
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH,
.write_header = ast_write_header,
.write_packet = ast_write_packet,
.write_trailer = ast_write_trailer,
.p.priv_class = &ast_muxer_class,
.p.codec_tag = ff_ast_codec_tags_list,
}

Definition at line 193 of file astenc.c.

OFFSET
#define OFFSET(obj)
Definition: astenc.c:179
AVERROR
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
ast_write_trailer
static int ast_write_trailer(AVFormatContext *s)
Definition: astenc.c:122
AV_CODEC_ID_PCM_S16BE_PLANAR
@ AV_CODEC_ID_PCM_S16BE_PLANAR
Definition: codec_id.h:358
type
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 type
Definition: writing_filters.txt:86
loop
static int loop
Definition: ffplay.c:338
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
ast_muxer_class
static const AVClass ast_muxer_class
Definition: astenc.c:186
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:236
options
static const AVOption options[]
Definition: astenc.c:180
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:269
av_rescale_rnd
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
Definition: mathematics.c:58
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:106
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
FF_OFMT_FLAG_MAX_ONE_OF_EACH
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
Definition: mux.h:50
AV_ROUND_DOWN
@ AV_ROUND_DOWN
Round toward -infinity.
Definition: mathematics.h:133
ff_ast_codec_tags_list
const AVCodecTag *const ff_ast_codec_tags_list[]
Definition: ast.c:32
ast_write_header
static int ast_write_header(AVFormatContext *s)
Definition: astenc.c:48
ast_write_packet
static int ast_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: astenc.c:101
ASTMuxContext
Definition: astenc.c:30