Go to the documentation of this file.
44 "NB_CONSUMED_SAMPLES",
176 #define d2istr(v) double2int64str((char[BUF_SIZE]){0}, v)
181 int64_t in_pts =
frame->pts;
188 "N:%"PRId64
" PTS:%s T:%f POS:%s",
264 #define OFFSET(x) offsetof(SetPTSContext, x)
265 #define V AV_OPT_FLAG_VIDEO_PARAM
266 #define A AV_OPT_FLAG_AUDIO_PARAM
267 #define F AV_OPT_FLAG_FILTERING_PARAM
269 #if CONFIG_SETPTS_FILTER
270 static const AVOption setpts_options[] = {
271 {
"expr",
"Expression determining the frame timestamp",
OFFSET(expr_str),
AV_OPT_TYPE_STRING, { .str =
"PTS" }, .flags =
V|
F },
276 static const AVFilterPad avfilter_vf_setpts_inputs[] = {
284 static const AVFilterPad avfilter_vf_setpts_outputs[] = {
300 .priv_class = &setpts_class,
307 #if CONFIG_ASETPTS_FILTER
309 static const AVOption asetpts_options[] = {
310 {
"expr",
"Expression determining the frame timestamp",
OFFSET(expr_str),
AV_OPT_TYPE_STRING, { .str =
"PTS" }, .flags =
A|
F },
337 .priv_class = &asetpts_class,
they must not be accessed directly The fifo field contains the frames that are queued in the input for processing by the filter The status_in and status_out fields contains the queued status(EOF or error) of the link
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
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.
#define AV_LOG_VERBOSE
Detailed information.
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)
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.
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.
FF_FILTER_FORWARD_WANTED(outlink, inlink)
@ VAR_NB_CONSUMED_SAMPLES
#define AVFILTER_DEFINE_CLASS(fname)
const AVFilter ff_vf_setpts
static char * double2int64str(char *buf, double v)
const char * name
Pad name.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#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 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)