FFmpeg
Data Structures | Macros | Functions | Variables
af_join.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "filters.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChannelMap
 
struct  JoinContext
 
struct  ChannelList
 

Macros

#define OFFSET(x)   offsetof(JoinContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 
#define MAP_SEPARATOR   '|'
 

Functions

 AVFILTER_DEFINE_CLASS (join)
 
static int parse_maps (AVFilterContext *ctx)
 
static av_cold int join_init (AVFilterContext *ctx)
 
static av_cold void join_uninit (AVFilterContext *ctx)
 
static int join_query_formats (AVFilterContext *ctx)
 
static enum AVChannel channel_list_pop (ChannelList *chl, int idx)
 
static enum AVChannel channel_list_pop_ch (ChannelList *chl, enum AVChannel ch)
 
static void guess_map_matching (AVFilterContext *ctx, ChannelMap *ch, ChannelList *inputs)
 
static void guess_map_any (AVFilterContext *ctx, ChannelMap *ch, ChannelList *inputs)
 
static int join_config_output (AVFilterLink *outlink)
 
static int try_push_frame (AVFilterContext *ctx)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption join_options []
 
static const AVFilterPad avfilter_af_join_outputs []
 
const AVFilter ff_af_join
 

Detailed Description

Audio join filter

Join multiple audio inputs as different channels in a single output

Definition in file af_join.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 69 of file af_join.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 70 of file af_join.c.

◆ F

Definition at line 71 of file af_join.c.

◆ MAP_SEPARATOR

#define MAP_SEPARATOR   '|'

Definition at line 82 of file af_join.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( join  )

◆ parse_maps()

static int parse_maps ( AVFilterContext ctx)
static

Definition at line 86 of file af_join.c.

Referenced by join_init().

◆ join_init()

static av_cold int join_init ( AVFilterContext ctx)
static

Definition at line 154 of file af_join.c.

◆ join_uninit()

static av_cold void join_uninit ( AVFilterContext ctx)
static

Definition at line 190 of file af_join.c.

◆ join_query_formats()

static int join_query_formats ( AVFilterContext ctx)
static

Definition at line 204 of file af_join.c.

◆ channel_list_pop()

static enum AVChannel channel_list_pop ( ChannelList chl,
int  idx 
)
static

Definition at line 232 of file af_join.c.

Referenced by channel_list_pop_ch(), and guess_map_any().

◆ channel_list_pop_ch()

static enum AVChannel channel_list_pop_ch ( ChannelList chl,
enum AVChannel  ch 
)
static

Definition at line 245 of file af_join.c.

Referenced by guess_map_matching(), and join_config_output().

◆ guess_map_matching()

static void guess_map_matching ( AVFilterContext ctx,
ChannelMap ch,
ChannelList inputs 
)
static

Definition at line 253 of file af_join.c.

Referenced by join_config_output().

◆ guess_map_any()

static void guess_map_any ( AVFilterContext ctx,
ChannelMap ch,
ChannelList inputs 
)
static

Definition at line 267 of file af_join.c.

Referenced by join_config_output().

◆ join_config_output()

static int join_config_output ( AVFilterLink outlink)
static

Definition at line 281 of file af_join.c.

◆ try_push_frame()

static int try_push_frame ( AVFilterContext ctx)
static

Definition at line 418 of file af_join.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 544 of file af_join.c.

Variable Documentation

◆ join_options

const AVOption join_options[]
static
Initial value:
= {
{ "inputs", "Number of input streams.", OFFSET(inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, A|F },
{ "channel_layout", "Channel layout of the "
"output stream.", OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = "stereo"}, 0, 0, A|F },
{ "map", "A comma-separated list of channels maps in the format "
"'input_stream.input_channel-output_channel.",
OFFSET(map), AV_OPT_TYPE_STRING, .flags = A|F },
{ NULL }
}

Definition at line 72 of file af_join.c.

◆ avfilter_af_join_outputs

const AVFilterPad avfilter_af_join_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = join_config_output,
},
}

Definition at line 589 of file af_join.c.

◆ ff_af_join

const AVFilter ff_af_join
Initial value:
= {
.name = "join",
.description = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
"multi-channel output."),
.priv_size = sizeof(JoinContext),
.priv_class = &join_class,
}

Definition at line 597 of file af_join.c.

FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:159
join_query_formats
static int join_query_formats(AVFilterContext *ctx)
Definition: af_join.c:204
AVFILTER_FLAG_DYNAMIC_INPUTS
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:106
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
NULL
#define NULL
Definition: coverity.c:32
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
AV_OPT_TYPE_CHLAYOUT
@ AV_OPT_TYPE_CHLAYOUT
Definition: opt.h:252
F
#define F
Definition: af_join.c:71
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
A
#define A
Definition: af_join.c:70
JoinContext
Definition: af_join.c:46
join_uninit
static av_cold void join_uninit(AVFilterContext *ctx)
Definition: af_join.c:190
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
OFFSET
#define OFFSET(x)
Definition: af_join.c:69
activate
static int activate(AVFilterContext *ctx)
Definition: af_join.c:544
avfilter_af_join_outputs
static const AVFilterPad avfilter_af_join_outputs[]
Definition: af_join.c:589
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
map
const VDPAUPixFmtMap * map
Definition: hwcontext_vdpau.c:71
join_config_output
static int join_config_output(AVFilterLink *outlink)
Definition: af_join.c:281
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
join_init
static av_cold int join_init(AVFilterContext *ctx)
Definition: af_join.c:154
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239