Go to the documentation of this file.
26 #include "config_components.h"
63 #define OFFSET(x) offsetof(SetTBContext, x)
64 #define DEFINE_OPTIONS(filt_name, filt_type) \
65 static const AVOption filt_name##_options[] = { \
66 { "expr", "set expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \
67 .flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \
68 { "tb", "set expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \
69 .flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \
94 time_base =
av_d2q(res, INT_MAX);
95 if (time_base.
num <= 0 || time_base.
den <= 0) {
97 "Invalid non-positive values for the timebase num:%d or den:%d.\n",
98 time_base.
num, time_base.
den);
113 int64_t new_pts = orig_pts;
118 inlink ->time_base.num,
inlink ->time_base.den, orig_pts,
163 #if CONFIG_SETTB_FILTER
168 static const AVFilterPad avfilter_vf_settb_outputs[] = {
180 .priv_class = &settb_class,
188 #if CONFIG_ASETTB_FILTER
193 static const AVFilterPad avfilter_af_asettb_outputs[] = {
207 .priv_class = &asettb_class,
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
#define DEFINE_OPTIONS(filt_name, filt_type)
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.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
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.
const char * name
Filter name.
static const char *const var_names[]
A link between two filters.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
static int config_output_props(AVFilterLink *outlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
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.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define FILTER_INPUTS(array)
static int activate(AVFilterContext *ctx)
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.
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
double var_values[VAR_VARS_NB]
AVFilterContext * src
source filter
FF_FILTER_FORWARD_WANTED(outlink, inlink)
#define AVFILTER_DEFINE_CLASS(fname)
static int64_t rescale_pts(AVFilterLink *inlink, AVFilterLink *outlink, int64_t orig_pts)
int w
agreed upon image width
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
const char * name
Pad name.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
int h
agreed upon image height
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
const AVFilter ff_af_asettb
#define FILTER_OUTPUTS(array)
const AVFilter ff_vf_settb