FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_asyncts.c File Reference
#include <stdint.h>
#include "libavresample/avresample.h"
#include "libavutil/attributes.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ASyncContext
 

Macros

#define OFFSET(x)   offsetof(ASyncContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (asyncts)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *link)
 
static int64_t get_delay (ASyncContext *s)
 
static void handle_trimming (AVFilterContext *ctx)
 
static int request_frame (AVFilterLink *link)
 
static int write_to_fifo (ASyncContext *s, AVFrame *buf)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 

Variables

static const AVOption asyncts_options []
 
static const AVFilterPad avfilter_af_asyncts_inputs []
 
static const AVFilterPad avfilter_af_asyncts_outputs []
 
AVFilter ff_af_asyncts
 

Macro Definition Documentation

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

Definition at line 52 of file af_asyncts.c.

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 53 of file af_asyncts.c.

Definition at line 54 of file af_asyncts.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( asyncts  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 66 of file af_asyncts.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 76 of file af_asyncts.c.

static int config_props ( AVFilterLink link)
static

Definition at line 86 of file af_asyncts.c.

static int64_t get_delay ( ASyncContext s)
static

Definition at line 115 of file af_asyncts.c.

Referenced by filter_frame(), and request_frame().

static void handle_trimming ( AVFilterContext ctx)
static

Definition at line 120 of file af_asyncts.c.

Referenced by filter_frame(), and request_frame().

static int request_frame ( AVFilterLink link)
static

Definition at line 134 of file af_asyncts.c.

static int write_to_fifo ( ASyncContext s,
AVFrame buf 
)
static

Definition at line 168 of file af_asyncts.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 176 of file af_asyncts.c.

Variable Documentation

const AVOption asyncts_options[]
static
Initial value:
= {
{ "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, A|F },
{ "min_delta", "Minimum difference between timestamps and audio data "
"(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { .dbl = 0.1 }, 0, INT_MAX, A|F },
{ "max_comp", "Maximum compensation in samples per second.", OFFSET(max_comp), AV_OPT_TYPE_INT, { .i64 = 500 }, 0, INT_MAX, A|F },
{ "first_pts", "Assume the first pts should be this value.", OFFSET(first_pts), AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, A|F },
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int resample(ResampleContext *c, void *dst, const void *src, int *consumed, int src_size, int dst_size, int update_ctx, int nearest_neighbour)
Definition: resample.c:259
#define OFFSET(x)
Definition: af_asyncts.c:52
#define F
Definition: af_asyncts.c:54
#define A
Definition: af_asyncts.c:53
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:240

Definition at line 55 of file af_asyncts.c.

const AVFilterPad avfilter_af_asyncts_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_asyncts.c:176

Definition at line 294 of file af_asyncts.c.

const AVFilterPad avfilter_af_asyncts_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
.request_frame = request_frame
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *link)
Definition: af_asyncts.c:134
static int config_props(AVFilterLink *link)
Definition: af_asyncts.c:86

Definition at line 303 of file af_asyncts.c.

AVFilter ff_af_asyncts
Initial value:
= {
.name = "asyncts",
.description = NULL_IF_CONFIG_SMALL("Sync audio data to timestamps."),
.init = init,
.uninit = uninit,
.priv_size = sizeof(ASyncContext),
.priv_class = &asyncts_class,
}
static const AVFilterPad avfilter_af_asyncts_inputs[]
Definition: af_asyncts.c:294
static av_cold int init(AVFilterContext *ctx)
Definition: af_asyncts.c:66
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_asyncts.c:76
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad avfilter_af_asyncts_outputs[]
Definition: af_asyncts.c:303

Definition at line 313 of file af_asyncts.c.