FFmpeg
Loading...
Searching...
No Matches
avf_concat.c File Reference

concat audio-video filter More...

#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "video.h"
#include "audio.h"

Go to the source code of this file.

Data Structures

struct  ConcatContext
 
struct  ConcatContext::concat_in
 

Macros

#define TYPE_ALL   2
 
#define OFFSET(x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (concat)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int config_output (AVFilterLink *outlink)
 
static int push_frame (AVFilterContext *ctx, unsigned in_no, AVFrame *buf)
 
static AVFrameget_video_buffer (AVFilterLink *inlink, int w, int h)
 
static AVFrameget_audio_buffer (AVFilterLink *inlink, int nb_samples)
 
static void close_input (AVFilterContext *ctx, unsigned in_no)
 
static void find_next_delta_ts (AVFilterContext *ctx, int64_t *seg_delta)
 
static int send_silence (AVFilterContext *ctx, unsigned in_no, unsigned out_no, int64_t seg_delta)
 
static int flush_segment (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int activate (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 concat_options []
 
const FFFilter ff_avf_concat
 

Detailed Description

concat audio-video filter

Definition in file avf_concat.c.

Macro Definition Documentation

◆ TYPE_ALL

#define TYPE_ALL   2

Definition at line 36 of file avf_concat.c.

Referenced by init(), and query_formats().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 53 of file avf_concat.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 54 of file avf_concat.c.

◆ F

Definition at line 55 of file avf_concat.c.

◆ V

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 56 of file avf_concat.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( concat )

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 75 of file avf_concat.c.

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 122 of file avf_concat.c.

◆ push_frame()

static int push_frame ( AVFilterContext * ctx,
unsigned in_no,
AVFrame * buf )
static

Definition at line 179 of file avf_concat.c.

Referenced by activate().

◆ get_video_buffer()

static AVFrame * get_video_buffer ( AVFilterLink * inlink,
int w,
int h )
static

Definition at line 205 of file avf_concat.c.

Referenced by ff_get_video_buffer(), and init().

◆ get_audio_buffer()

static AVFrame * get_audio_buffer ( AVFilterLink * inlink,
int nb_samples )
static

Definition at line 214 of file avf_concat.c.

Referenced by init().

◆ close_input()

static void close_input ( AVFilterContext * ctx,
unsigned in_no )
static

Definition at line 223 of file avf_concat.c.

Referenced by activate().

◆ find_next_delta_ts()

static void find_next_delta_ts ( AVFilterContext * ctx,
int64_t * seg_delta )
static

Definition at line 233 of file avf_concat.c.

Referenced by flush_segment().

◆ send_silence()

static int send_silence ( AVFilterContext * ctx,
unsigned in_no,
unsigned out_no,
int64_t seg_delta )
static

Definition at line 247 of file avf_concat.c.

Referenced by flush_segment().

◆ flush_segment()

static int flush_segment ( AVFilterContext * ctx)
static

Definition at line 284 of file avf_concat.c.

Referenced by activate(), and process_command().

◆ init()

static av_cold int init ( AVFilterContext * ctx)
static

Definition at line 311 of file avf_concat.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 354 of file avf_concat.c.

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 361 of file avf_concat.c.

◆ process_command()

static int process_command ( AVFilterContext * ctx,
const char * cmd,
const char * args,
char * res,
int res_len,
int flags )
static

Definition at line 441 of file avf_concat.c.

Variable Documentation

◆ concat_options

const AVOption concat_options[]
static
Initial value:
= {
{ "n", "specify the number of segments", OFFSET(nb_segments),
AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, V|A|F},
{ "v", "specify the number of video streams",
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, V|F },
{ "a", "specify the number of audio streams",
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A|F},
{ "unsafe", "enable unsafe mode",
OFFSET(unsafe),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|A|F},
{ NULL }
}
#define A(x)
Definition vpx_arith.h:28
#define V
Definition avdct.c:32
#define NULL
Definition coverity.c:32
#define F(x)
#define OFFSET(x)
static unsigned int nb_streams
Definition ffprobe.c:352
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 58 of file avf_concat.c.

◆ ff_avf_concat

const FFFilter ff_avf_concat
Initial value:
= {
.p.name = "concat",
.p.description = NULL_IF_CONFIG_SMALL("Concatenate audio and video streams."),
.p.inputs = NULL,
.p.outputs = NULL,
.p.priv_class = &concat_class,
.init = init,
.uninit = uninit,
.activate = activate,
.priv_size = sizeof(ConcatContext),
.process_command = process_command,
}
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static const AVClass concat_class
Definition concatdec.c:946
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
Definition avfilter.h:161
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition avfilter.h:155
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 454 of file avf_concat.c.