mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
lavfi: add avfilter_default_filter_name()
The function is modelled after av_default_item_name(), and will print the name of the instance filter if defined, otherwise the name of the filter. This allows to show the instance name in the log, which is useful when debugging complex filter graphs.
This commit is contained in:
@@ -366,15 +366,15 @@ static int pad_count(const AVFilterPad *pads)
|
||||
return count;
|
||||
}
|
||||
|
||||
static const char *filter_name(void *p)
|
||||
const char *avfilter_default_filter_name(void *filter_ctx)
|
||||
{
|
||||
AVFilterContext *filter = p;
|
||||
return filter->filter->name;
|
||||
AVFilterContext *ctx = filter_ctx;
|
||||
return ctx->name ? ctx->name : ctx->filter->name;
|
||||
}
|
||||
|
||||
static const AVClass avfilter_class = {
|
||||
.class_name = "AVFilter",
|
||||
.item_name = filter_name,
|
||||
.item_name = avfilter_default_filter_name,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.category = AV_CLASS_CATEGORY_FILTER,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user