51 "ref[%p buf:%p data:%p linesize[%d, %d, %d, %d] pts:%"PRId64,
53 ref->linesize[0],
ref->linesize[1],
ref->linesize[2],
ref->linesize[3],
57 ff_tlog(
ctx,
" a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
58 ref->sample_aspect_ratio.num,
ref->sample_aspect_ratio.den,
65 if (
ref->nb_samples) {
105 unsigned idx = *count;
113 if (!newpads || !newlinks) {
120 (*links)[idx] =
NULL;
129 return append_pad(&
f->nb_inputs, &
f->input_pads, &
f->inputs, p);
140 return append_pad(&
f->nb_outputs, &
f->output_pads, &
f->outputs, p);
159 if (
src->nb_outputs <= srcpad ||
dst->nb_inputs <= dstpad ||
160 src->outputs[srcpad] ||
dst->inputs[dstpad])
169 if (
src->output_pads[srcpad].type !=
dst->input_pads[dstpad].type) {
171 "Media type mismatch between the '%s' filter output pad %d (%s) and the '%s' filter input pad %d (%s)\n",
182 src->outputs[srcpad] =
dst->inputs[dstpad] = link;
186 link->
srcpad = &
src->output_pads[srcpad];
188 link->
type =
src->output_pads[srcpad].type;
243 for (
i = 0;
i <
filter->nb_outputs;
i++) {
283 unsigned filt_srcpad_idx,
unsigned filt_dstpad_idx)
289 "between the filter '%s' and the filter '%s'\n",
301 link->
dstpad = &
filt->input_pads[filt_srcpad_idx];
302 filt->inputs[filt_srcpad_idx] = link;
308 &
filt->outputs[filt_dstpad_idx]->outcfg.formats);
311 &
filt->outputs[filt_dstpad_idx]->outcfg.color_spaces);
314 &
filt->outputs[filt_dstpad_idx]->outcfg.color_ranges);
317 &
filt->outputs[filt_dstpad_idx]->outcfg.alpha_modes);
320 &
filt->outputs[filt_dstpad_idx]->outcfg.samplerates);
323 &
filt->outputs[filt_dstpad_idx]->outcfg.channel_layouts);
334 for (
i = 0;
i <
filter->nb_inputs;
i ++) {
341 if (!link->
src || !link->
dst) {
343 "Not all input and output are properly linked (%d).\n",
i);
355 case AVLINK_STARTINIT:
367 "with more than one input "
368 "must set config_props() "
369 "callbacks on all outputs\n");
387 if (config_link && (ret = config_link(link)) < 0) {
389 "Failed to configure output pad on %s\n",
394 switch (link->
type) {
410 }
else if (!link->
w || !link->
h) {
412 "Video source filters must set their output link's "
413 "width and height\n");
433 "should not be set by non-hwframe-aware filter");
443 if ((ret = config_link(link)) < 0) {
445 "Failed to configure input pad on %s\n",
462 "link[%p s:%dx%d fmt:%s %s->%s]%s",
463 link, link->
w, link->
h,
473 "link[%p r:%d cl:%s fmt:%s %s->%s]%s",
515 for (
i = 0;
i <
ctx->nb_inputs;
i++) {
523 for (
i = 0;
i <
ctx->nb_inputs;
i++) {
578 "with filter '%s'\n",
ctx->filter->name);
598 "Error when evaluating the expression '%s' for enable\n",
606 ctx->enable_str = expr_dup;
612 if(!strcmp(cmd,
"ping")){
613 char local_res[256] = {0};
617 res_len =
sizeof(local_res);
620 if (res == local_res)
623 }
else if(!strcmp(cmd,
"enable")) {
639 return ctx->name ?
ctx->name :
ctx->filter->name;
645 if (!prev &&
ctx->filter &&
ctx->filter->priv_class &&
ctx->priv)
656 return f->priv_class;
661#define OFFSET(x) offsetof(AVFilterContext, x)
662#define FLAGS AV_OPT_FLAG_FILTERING_PARAM
663#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
670 { .i64 = 0 }, 0, INT_MAX,
FLAGS, .unit =
"threads" },
671 {
"auto",
"autodetect a suitable number of threads to use", 0,
AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags =
FLAGS, .unit =
"threads"},
672 {
"extra_hw_frames",
"Number of extra hardware frames to allocate for the user",
678 .class_name =
"AVFilter",
689 int *ret,
int nb_jobs)
693 for (
i = 0;
i < nb_jobs;
i++) {
815 for (
i = 0;
i <
filter->nb_inputs;
i++) {
820 for (
i = 0;
i <
filter->nb_outputs;
i++) {
826 if (
filter->filter->priv_class)
848 if (
ctx->nb_threads > 0)
849 return FFMIN(
ctx->nb_threads,
ctx->graph->nb_threads);
850 return ctx->graph->nb_threads;
864 char *parsed_key, *
value;
866 const char *shorthand =
NULL;
867 int additional_flags = 0;
869 if (priv_class && (o =
av_opt_next(&priv_class, o))) {
878 &parsed_key, &
value);
907 const char *
arg,
char *res,
int res_len,
int flags)
911 if (!
ctx->filter->priv_class)
941 ctx->thread_type = 0;
949 if (
ctx->enable_str) {
990 return pads[pad_idx].
name;
995 return pads[pad_idx].
type;
1140 unsigned nb_samples, nb_frames,
i, p;
1154 if (nb_samples +
frame->nb_samples >
max) {
1155 if (nb_samples <
min)
1159 nb_samples +=
frame->nb_samples;
1176 for (
i = 0;
i < nb_frames;
i++) {
1180 p +=
frame->nb_samples;
1183 if (p < nb_samples) {
1184 unsigned n = nb_samples - p;
1218 if (ret < 0 && ret != li->status_out) {
1231 unsigned out = 0, progress = 0;
1235 if (!
filter->nb_outputs) {
1268 for (
i = 0;
i <
filter->nb_outputs;
i++)
1270 if (
filter->nb_outputs && nb_eofs ==
filter->nb_outputs) {
1271 for (
int j = 0; j <
filter->nb_inputs; j++)
1276 for (
i = 0;
i <
filter->nb_inputs;
i++) {
1282 for (
i = 0;
i <
filter->nb_inputs;
i++) {
1289 for (
i = 0;
i <
filter->nb_outputs;
i++) {
1296 for (
i = 0;
i <
filter->nb_outputs;
i++) {
1301 if (!
filter->nb_outputs) {
1472 return *rstatus = 0;
1476 return *rstatus = 0;
1577 switch (link->
type) {
1614 "Processing command time:%f command:%s arg:%s\n",
1615 cmd->time, cmd->command, cmd->arg);
1628 li->frame_wanted_out = 1;
1669 int default_pool_size)
1679 if (
frames->initial_pool_size == 0) {
1684 frames->initial_pool_size = default_pool_size;
1697 void *
arg,
int *ret,
int nb_jobs)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int request_frame(AVFilterLink *outlink)
static const int8_t filt[NUMTAPS *2]
static AVFormatContext * ctx
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_append_outpad(AVFilterContext *f, AVFilterPad *p)
static int filter_frame_to_filter(AVFilterLink *link)
AVFilterContext * ff_filter_alloc(const AVFilter *filter, const char *inst_name)
Allocate a new filter context and return it.
int ff_inoutlink_check_flow(AVFilterLink *inlink, AVFilterLink *outlink)
Check for flow control between input and output.
static int append_pad(unsigned *count, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad)
Append a new pad.
static void tlog_ref(void *ctx, AVFrame *ref, int end)
static int default_filter_frame(AVFilterLink *link, AVFrame *frame)
int ff_append_inpad_free_name(AVFilterContext *f, AVFilterPad *p)
static void free_link(AVFilterLink *link)
static void consume_update(FilterLinkInternal *li, const AVFrame *frame)
void ff_inlink_set_status(AVFilterLink *link, int status)
Set the status on an input link.
int ff_outlink_get_status(AVFilterLink *link)
Get the status on an output link.
static void * filter_child_next(void *obj, void *prev)
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
int ff_inlink_check_available_frame(AVFilterLink *link)
Test if a frame is available on the link.
int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min)
Test if enough samples are available on the link.
int ff_filter_config_links(AVFilterContext *filter)
Negotiate the media format, dimensions, etc of all inputs to a filter.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_append_inpad(AVFilterContext *f, AVFilterPad *p)
Append a new input/output pad to the filter's list of such pads.
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link, int default_pool_size)
Perform any additional setup required for hardware frames.
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.
static int take_samples(FilterLinkInternal *li, unsigned min, unsigned max, AVFrame **rframe)
static const AVClass avfilter_class
static int set_enable_expr(FFFilterContext *ctxi, const char *expr)
void ff_avfilter_link_set_in_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
static void link_set_out_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the destination filter.
static const AVOption avfilter_options[]
size_t ff_inlink_queued_frames(AVFilterLink *link)
Get the number of frames available on the link.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, AVDictionary **options, const char *args)
Parse filter options into a dictionary.
int ff_inlink_process_commands(AVFilterLink *link, const AVFrame *frame)
Process the commands queued in the link up to the time of the frame.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p)
int ff_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe)
Take samples from the link's FIFO and update the link's stats.
static int filter_frame_framed(AVFilterLink *link, AVFrame *frame)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
static int default_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
static int64_t guess_status_pts(AVFilterContext *ctx, int status, AVRational link_time_base)
AVFrame * ff_inlink_peek_frame(AVFilterLink *link, size_t idx)
Access a frame in the link fifo without consuming it.
static const AVClass * filter_child_class_iterate(void **iter)
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
static void filter_unblock(AVFilterContext *filter)
Clear frame_blocked_in on all outputs.
int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe)
Make sure a frame is writable.
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 evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *frame)
Evaluate the timeline expression of the link for the time and properties of the frame.
static int filter_activate_default(AVFilterContext *filter)
static void command_queue_pop(AVFilterContext *filter)
static const char * default_filter_name(void *filter_ctx)
static int request_frame_to_filter(AVFilterLink *link)
int ff_inlink_queued_samples(AVFilterLink *link)
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
int ff_filter_activate(AVFilterContext *filter)
static int samples_ready(FilterLinkInternal *link, unsigned min)
static void update_link_current_pts(FilterLinkInternal *li, int64_t pts)
static int forward_status_change(AVFilterContext *filter, FilterLinkInternal *li_in)
static void link_free(AVFilterLink **link)
Main libavfilter public API header.
static FFFilterContext * fffilterctx(AVFilterContext *ctx)
void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter)
Remove a filter from a graph;.
static FFFilterGraph * fffiltergraph(AVFilterGraph *graph)
void ff_avfilter_graph_update_heap(AVFilterGraph *graph, struct FilterLinkInternal *li)
Update the position of a link in the age heap.
#define ff_tlog_link(ctx, link, end)
#define FF_TPRINTF_START(ctx, func)
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AV_BPRINT_SIZE_UNLIMITED
static BitStreamFilterLinkInternal * ff_link_internal(AVBitStreamFilterLink *link)
refcounted data buffer API
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
common internal and external API header
static __device__ float fabs(float a)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
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.
simple arithmetic expression evaluator
reference-counted frame API
AVFrame * ff_framequeue_take(FFFrameQueue *fq)
Take the first frame in the queue.
void ff_framequeue_init(FFFrameQueue *fq, FFFrameQueueGlobal *fqg)
Init a frame queue and attach it to a global structure.
int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame)
Add a frame.
void ff_framequeue_free(FFFrameQueue *fq)
Free the queue and all queued frames.
AVFrame * ff_framequeue_peek(FFFrameQueue *fq, size_t idx)
Access a frame in the queue, without removing it.
void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base)
Skip samples from the first frame in the queue.
static size_t ff_framequeue_queued_frames(const FFFrameQueue *fq)
Get the number of queued frames.
static uint64_t ff_framequeue_queued_samples(const FFFrameQueue *fq)
Get the number of queued samples.
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
#define AV_OPT_FLAG_RUNTIME_PARAM
A generic parameter which can be set by the user at runtime.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
int avfilter_init_str(AVFilterContext *filter, const char *args)
Initialize a filter with the supplied parameters.
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, unsigned filt_srcpad_idx, unsigned filt_dstpad_idx)
Insert a filter in the middle of an existing link.
void avfilter_free(AVFilterContext *filter)
Free a filter context.
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
Get the type of an AVFilterPad.
unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output)
Get the number of elements in an AVFilter's inputs or outputs array.
int avfilter_action_func(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
A function pointer passed to the AVFilterGraph::execute callback to be executed multiple times,...
const char * avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
Get the name of an AVFilterPad.
const AVFilter * av_filter_iterate(void **opaque)
Iterate over all registered filters.
int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)
Make the filter instance process a command.
AVBufferRef * avfilter_link_get_hw_frames_ctx(AVFilterLink *link)
Get the hardware frames context of a filter link.
#define AVFILTER_THREAD_SLICE
Process multiple parts of the frame concurrently.
int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
Initialize a filter with the supplied dictionary of options.
#define AVFILTER_FLAG_SUPPORT_TIMELINE
Handy mask to test whether the filter supports or no the timeline feature (internally or generically)...
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.
const AVClass * avfilter_get_class(void)
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, AVBPrint *bp)
bprint variant of av_channel_layout_describe().
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define AV_DICT_MULTIKEY
Allow to store several equal keys in the dictionary.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AV_DICT_DONT_STRDUP_KEY
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_EOF
End of file.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AVERROR_OPTION_NOT_FOUND
Option not found.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd)
Free all side data entries and their contents, then zeroes out the values which the pointers are poin...
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
int av_frame_side_data_clone(AVFrameSideData ***sd, int *nb_sd, const AVFrameSideData *src, unsigned int flags)
Add a new side data entry to an array based on existing side data, taking a reference towards the con...
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
int av_samples_copy(uint8_t *const *dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Copy samples from src to dst.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
#define LIBAVUTIL_VERSION_INT
int av_opt_get_key_value(const char **ropts, const char *key_val_sep, const char *pairs_sep, unsigned flags, char **rkey, char **rval)
Extract a key-value pair from the beginning of a string.
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
const AVOption * av_opt_find2(void *obj, const char *name, const char *unit, int opt_flags, int search_flags, void **target_obj)
Look for an option in an object.
void av_opt_free(void *obj)
Free all allocated objects in obj.
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
const AVOption * av_opt_next(const void *obj, const AVOption *last)
Iterate over all AVOptions belonging to obj.
@ AV_OPT_FLAG_IMPLICIT_KEY
Accept to parse a value without a key; the key will then be returned as NULL.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
Set all the options from a given dictionary on an object.
int(* func)(AVBPrint *dst, const char *in, const char *arg)
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
#define AVFILTERPAD_FLAG_FREE_NAME
The pad's name is allocated and should be freed generically.
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
static FilterLink * ff_filter_link(AVFilterLink *link)
static const FFFilter * fffilter(const AVFilter *f)
av_cold void ff_frame_pool_uninit(FFFramePool *pool)
Deallocate the frame pool.
common internal API header
@ AV_CLASS_STATE_INITIALIZED
Object initialization has finished and it is now in the 'runtime' stage.
@ AV_CLASS_CATEGORY_FILTER
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static const char *const var_names[]
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Utilities for rational number calculation.
A reference to a data buffer.
uint8_t * data
The data buffer.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
const AVClass * av_class
needed for av_log() and filters common options
int extra_hw_frames
Sets the number of extra hardware frames which the filter will allocate on its output links for use i...
char * name
name of this filter instance
unsigned nb_inputs
number of input pads
AVFilterLink ** inputs
array of pointers to input links
char * enable_str
enable expression string
const AVFilter * filter
the AVFilter of which this is an instance
AVFilterPad * input_pads
array of input pads
void * priv
private data for use by the filter
unsigned nb_outputs
number of output pads
AVFilterPad * output_pads
array of output pads
int is_disabled
MUST NOT be accessed from outside avfilter.
AVFilterLink ** outputs
array of pointers to output links
A link between two filters.
AVFilterFormatsConfig incfg
Lists of supported formats / etc.
int w
agreed upon image width
int h
agreed upon image height
AVFilterFormatsConfig outcfg
Lists of supported formats / etc.
enum AVMediaType type
filter media type
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
enum AVColorSpace colorspace
For non-YUV links, these are respectively set to fallback values (as appropriate for that colorspace)...
AVFilterPad * srcpad
output pad on the source filter
enum AVAlphaMode alpha_mode
alpha mode (for videos with an alpha channel)
AVFilterPad * dstpad
input pad on the dest filter
AVFilterContext * dst
dest filter
int format
agreed upon media format
AVFrameSideData ** side_data
A filter pad used for either input or output.
int flags
A combination of AVFILTERPAD_FLAG_* flags.
int(* request_frame)(AVFilterLink *link)
Frame request callback.
int(* config_props)(AVFilterLink *link)
Link configuration callback.
enum AVMediaType type
AVFilterPad type.
const char * name
Pad name.
const char * name
Filter name.
int flags
A combination of AVFILTER_FLAG_*.
This structure describes decoded (raw) audio or video data.
uint8_t ** extended_data
pointers to the data planes/channels.
This struct describes a set or pool of "hardware" frames (i.e.
int offset
Native access only.
uint64_t flags
Combination of AV_PIX_FMT_FLAG_... flags.
Rational number (pair of numerator and denominator).
struct AVFilterCommand * command_queue
struct AVExpr * enable
parsed expression
AVFilterContext p
The public AVFilterContext.
double * var_values
variable values for the enable expression
unsigned ready
Ready status of the filter.
avfilter_execute_func * execute
avfilter_execute_func * thread_execute
AVFilter p
The public AVFilter.
int(* init)(AVFilterContext *ctx)
Filter initialization function.
uint8_t nb_inputs
The number of entries in the list of inputs.
uint8_t nb_outputs
The number of entries in the list of outputs.
void(* uninit)(AVFilterContext *ctx)
Filter uninitialization function.
int(* process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags)
Make the filter instance process a command.
int(* preinit)(AVFilterContext *ctx)
Filter pre-initialization function.
int(* activate)(AVFilterContext *ctx)
Filter activation function.
int priv_size
size of private data to allocate for the filter
Structure to hold global options and statistics for frame queues.
size_t queued
Total number of queued frames in the queues combined.
size_t max_queued
Maximum number of allowed frames in the queues combined.
FFFrameQueueGlobal * global
Pointer to the global frame queue struct holding statistics and limits.
int samples_skipped
Indicate that samples are skipped.
int64_t status_in_pts
Timestamp of the input status change.
int frame_wanted_out
True if a frame is currently wanted on the output of this filter.
int age_index
Index in the age array.
int status_in
Link input status.
FFFrameQueue fifo
Queue of frames waiting to be filtered.
enum FilterLinkInternal::@336377057131212365164072214263227110225222156364 init_state
stage of the initialization of the link properties (dimensions, etc)
int frame_blocked_in
If set, the source filter can not generate a frame as is.
FFFramePool frame_pool
Pool of frames used for allocations.
int status_out
Link output status.
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
int64_t sample_count_in
Number of past samples sent through the link.
int min_samples
Minimum number of samples to filter at once.
int max_samples
Maximum number of samples to filter at once.
int64_t current_pts_us
Current timestamp of the link, as defined by the most recent frame(s), in AV_TIME_BASE units.
int64_t current_pts
Current timestamp of the link, as defined by the most recent frame(s), in link time_base units.
int64_t frame_count_in
Number of past frames sent through the link.
struct AVFilterGraph * graph
Graph the filter belongs to.
static void error(const char *err)
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static int ref[MAX_W *MAX_W]
static FilteringContext * filter_ctx
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.