Go to the documentation of this file.
27 #include "config_components.h"
46 "NB_CONSUMED_SAMPLES",
107 setpts->var_values[VAR_##name_]
124 V(PREV_OUTPTS) =
NAN;
141 V(SR) =
V(SAMPLE_RATE) =
144 V(FRAME_RATE) =
V(FR) =
149 V(
TB),
V(FRAME_RATE),
V(SAMPLE_RATE));
198 #define d2istr(v) double2int64str((char[BUF_SIZE]){0}, v)
211 "N:%"PRId64
" PTS:%s T:%f",
232 V(PREV_INPTS ) =
TS2D(in_pts);
282 char *res,
int res_len,
int flags)
293 if (!strcmp(cmd,
"expr")) {
301 setpts->
expr = new_expr;
312 #define OFFSET(x) offsetof(SetPTSContext, x)
313 #define V AV_OPT_FLAG_VIDEO_PARAM
314 #define A AV_OPT_FLAG_AUDIO_PARAM
315 #define R AV_OPT_FLAG_RUNTIME_PARAM
316 #define F AV_OPT_FLAG_FILTERING_PARAM
318 #if CONFIG_SETPTS_FILTER
319 static const AVOption setpts_options[] = {
325 static const AVFilterPad avfilter_vf_setpts_inputs[] = {
351 .priv_class = &setpts_class,
358 #if CONFIG_ASETPTS_FILTER
360 static const AVOption asetpts_options[] = {
382 .priv_class = &asetpts_class,
#define FF_ENABLE_DEPRECATION_WARNINGS
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int64_t duration
Duration of the frame, in the same units as pts.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_LOG_VERBOSE
Detailed information.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
const char * name
Filter name.
A link between two filters.
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
double var_values[VAR_VARS_NB]
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
A filter pad used for either input or output.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int init(AVFilterContext *ctx)
static int activate(AVFilterContext *ctx)
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static double eval_pts(SetPTSContext *setpts, AVFilterLink *inlink, AVFrame *frame, int64_t pts)
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
attribute_deprecated int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
FF_FILTER_FORWARD_WANTED(outlink, inlink)
@ VAR_NB_CONSUMED_SAMPLES
#define AVFILTER_DEFINE_CLASS(fname)
const AVFilter ff_vf_setpts
static int process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
int nb_samples
number of audio samples (per channel) described by this frame
static char * double2int64str(char *buf, double v)
const char * name
Pad name.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
static int config_output_video(AVFilterLink *outlink)
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
static const char *const var_names[]
int64_t av_gettime(void)
Get the current time in microseconds.
#define FF_DISABLE_DEPRECATION_WARNINGS
#define FILTER_OUTPUTS(array)
static int config_input(AVFilterLink *inlink)
#define flags(name, subs,...)
const AVFilter ff_af_asetpts
static av_cold void uninit(AVFilterContext *ctx)