FFmpeg
Loading...
Searching...
No Matches
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)
 

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); \
} \
}
#define s(width, name)
Definition cbs_vp9.c:198
static int loop
Definition ffplay.c:338
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
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
@ AV_ROUND_DOWN
Round toward -infinity.
cl_device_type type

Definition at line 39 of file astenc.c.

Referenced by ast_write_header().

◆ OFFSET

#define OFFSET ( obj)
Value:
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 },
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition opt.h:351
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition opt.h:262

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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

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,
}
const AVCodecTag *const ff_ast_codec_tags_list[]
Definition ast.c:32
static int ast_write_trailer(AVFormatContext *s)
Definition astenc.c:122
static int ast_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition astenc.c:101
static const AVClass ast_muxer_class
Definition astenc.c:186
static int ast_write_header(AVFormatContext *s)
Definition astenc.c:48
@ AV_CODEC_ID_PCM_S16BE_PLANAR
Definition codec_id.h:360
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
#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

Definition at line 193 of file astenc.c.