FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_join.c File Reference

Audio join filter. More...

#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChannelMap
 
struct  JoinContext
 
struct  JoinBufferPriv
 To avoid copying the data from input buffers, this filter creates a custom output buffer that stores references to all inputs and unrefs them on free. More...
 

Macros

#define OFFSET(x)   offsetof(JoinContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 
#define PARSE_CHANNEL(str, var, inout)
 

Functions

static int filter_frame (AVFilterLink *link, AVFilterBufferRef *buf)
 
static int parse_maps (AVFilterContext *ctx)
 
static int join_init (AVFilterContext *ctx, const char *args)
 
static void join_uninit (AVFilterContext *ctx)
 
static int join_query_formats (AVFilterContext *ctx)
 
static void guess_map_matching (AVFilterContext *ctx, ChannelMap *ch, uint64_t *inputs)
 
static void guess_map_any (AVFilterContext *ctx, ChannelMap *ch, uint64_t *inputs)
 
static int join_config_output (AVFilterLink *outlink)
 
static void join_free_buffer (AVFilterBuffer *buf)
 
static int join_request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption join_options []
 
static const AVClass join_class
 
static const AVFilterPad avfilter_af_join_outputs []
 
AVFilter avfilter_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

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

Definition at line 77 of file af_join.c.

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 78 of file af_join.c.

Definition at line 79 of file af_join.c.

#define PARSE_CHANNEL (   str,
  var,
  inout 
)
Value:
if (!(var = av_get_channel_layout(str))) { \
av_log(ctx, AV_LOG_ERROR, "Invalid " inout " channel: %s.\n", str);\
return AVERROR(EINVAL); \
} \
av_log(ctx, AV_LOG_ERROR, "Channel map describes more than one " \
inout " channel.\n"); \
return AVERROR(EINVAL); \
}

Referenced by parse_maps().

Function Documentation

static int filter_frame ( AVFilterLink link,
AVFilterBufferRef buf 
)
static

Definition at line 97 of file af_join.c.

Referenced by join_init().

static int parse_maps ( AVFilterContext ctx)
static

Definition at line 113 of file af_join.c.

Referenced by join_init().

static int join_init ( AVFilterContext ctx,
const char *  args 
)
static

Definition at line 191 of file af_join.c.

static void join_uninit ( AVFilterContext ctx)
static

Definition at line 244 of file af_join.c.

static int join_query_formats ( AVFilterContext ctx)
static

Definition at line 259 of file af_join.c.

static void guess_map_matching ( AVFilterContext ctx,
ChannelMap ch,
uint64_t *  inputs 
)
static

Definition at line 278 of file af_join.c.

Referenced by join_config_output().

static void guess_map_any ( AVFilterContext ctx,
ChannelMap ch,
uint64_t *  inputs 
)
static

Definition at line 296 of file af_join.c.

Referenced by join_config_output().

static int join_config_output ( AVFilterLink outlink)
static

Definition at line 315 of file af_join.c.

static void join_free_buffer ( AVFilterBuffer buf)
static

Definition at line 397 of file af_join.c.

Referenced by join_request_frame().

static int join_request_frame ( AVFilterLink outlink)
static

Definition at line 416 of file af_join.c.

Variable Documentation

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(channel_layout_str), AV_OPT_TYPE_STRING, {.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 80 of file af_join.c.

const AVClass join_class
static
Initial value:
= {
.class_name = "join filter",
.item_name = av_default_item_name,
.option = join_options,
}

Definition at line 90 of file af_join.c.

Referenced by join_init().

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

Definition at line 487 of file af_join.c.

AVFilter avfilter_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 497 of file af_join.c.