FFmpeg
|
#include "libavutil/attributes.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
Go to the source code of this file.
Data Structures | |
struct | FrameInfo |
struct | FrameList |
Linked list used to store timestamps and frame sizes of all frames in the FIFO for the first input. More... | |
struct | MixContext |
Macros | |
#define | INPUT_ON 1 |
input is active More... | |
#define | INPUT_EOF 2 |
input has reached EOF (may still be active) More... | |
#define | DURATION_LONGEST 0 |
#define | DURATION_SHORTEST 1 |
#define | DURATION_FIRST 2 |
#define | OFFSET(x) offsetof(MixContext, x) |
#define | A AV_OPT_FLAG_AUDIO_PARAM |
#define | F AV_OPT_FLAG_FILTERING_PARAM |
#define | T AV_OPT_FLAG_RUNTIME_PARAM |
Functions | |
static void | frame_list_clear (FrameList *frame_list) |
static int | frame_list_next_frame_size (FrameList *frame_list) |
static int64_t | frame_list_next_pts (FrameList *frame_list) |
static void | frame_list_remove_samples (FrameList *frame_list, int nb_samples) |
static int | frame_list_add_frame (FrameList *frame_list, int nb_samples, int64_t pts) |
AVFILTER_DEFINE_CLASS (amix) | |
static void | calculate_scales (MixContext *s, int nb_samples) |
Update the scaling factors to apply to each input during mixing. More... | |
static int | config_output (AVFilterLink *outlink) |
static int | output_frame (AVFilterLink *outlink) |
Read samples from the input FIFOs, mix, and write to the output link. More... | |
static int | request_samples (AVFilterContext *ctx, int min_samples) |
Requests a frame, if needed, from each input link other than the first. More... | |
static int | calc_active_inputs (MixContext *s) |
Calculates the number of active inputs and determines EOF based on the duration option. More... | |
static int | activate (AVFilterContext *ctx) |
static void | parse_weights (AVFilterContext *ctx) |
static av_cold int | init (AVFilterContext *ctx) |
static av_cold void | uninit (AVFilterContext *ctx) |
static int | process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags) |
Variables | |
static const AVOption | amix_options [] |
static const AVFilterPad | avfilter_af_amix_outputs [] |
const AVFilter | ff_af_amix |
Audio Mix Filter
Mixes audio from multiple sources into a single output. The channel layout, sample rate, and sample format will be the same for all inputs and the output.
Definition in file af_amix.c.
#define INPUT_EOF 2 |
#define OFFSET | ( | x | ) | offsetof(MixContext, x) |
#define A AV_OPT_FLAG_AUDIO_PARAM |
#define F AV_OPT_FLAG_FILTERING_PARAM |
#define T AV_OPT_FLAG_RUNTIME_PARAM |
|
static |
Definition at line 77 of file af_amix.c.
Referenced by frame_list_remove_samples(), and uninit().
|
static |
Definition at line 91 of file af_amix.c.
Referenced by activate(), and output_frame().
Definition at line 98 of file af_amix.c.
Referenced by output_frame().
|
static |
Definition at line 105 of file af_amix.c.
Referenced by output_frame().
Definition at line 132 of file af_amix.c.
Referenced by activate().
AVFILTER_DEFINE_CLASS | ( | amix | ) |
|
static |
Update the scaling factors to apply to each input during mixing.
This balances the full volume range between active inputs and handles volume transitions when EOF is encountered on an input but mixing continues with the remaining inputs.
Definition at line 212 of file af_amix.c.
Referenced by config_output(), output_frame(), and process_command().
|
static |
|
static |
Read samples from the input FIFOs, mix, and write to the output link.
Definition at line 296 of file af_amix.c.
Referenced by activate(), and request_samples().
|
static |
Requests a frame, if needed, from each input link other than the first.
Definition at line 394 of file af_amix.c.
Referenced by activate().
|
static |
Calculates the number of active inputs and determines EOF based on the duration option.
Definition at line 421 of file af_amix.c.
Referenced by activate().
|
static |
|
static |
Definition at line 517 of file af_amix.c.
Referenced by init(), and process_command().
|
static |
|
static |
|
static |
|
static |
|
static |
const AVFilter ff_af_amix |