History

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.

Stefano Sabatini committed 14 years ago

Commit 4d6a8a21 parent 7d8202026 files · +38 −119Browse files

Showing the changes to libavfilter/avfilter.c (1 of 26 files). Show all

Unified · Split

libavfilter/avfilter.c+4−4
@@ -366,15 +366,15 @@ static int pad_count(const AVFilterPad *pads) · 365 unmodified lines
366 return count;366 return count;
367}367}
368 368
369static const char *filter_name(void *p)369const char *avfilter_default_filter_name(void *filter_ctx)
370{370{
371 AVFilterContext *filter = p;371 AVFilterContext *ctx = filter_ctx;
372 return filter->filter->name;372 return ctx->name ? ctx->name : ctx->filter->name;
373}373}
374 374
375static const AVClass avfilter_class = {375static const AVClass avfilter_class = {
376 .class_name = "AVFilter",376 .class_name = "AVFilter",
377 .item_name = filter_name,377 .item_name = avfilter_default_filter_name,
378 .version = LIBAVUTIL_VERSION_INT,378 .version = LIBAVUTIL_VERSION_INT,
379 .category = AV_CLASS_CATEGORY_FILTER,379 .category = AV_CLASS_CATEGORY_FILTER,
380};380};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t