summaryrefslogtreecommitdiff
path: root/libavfilter/vsrc_testsrc.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-06-01 14:46:54 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-06-04 00:54:57 +0200
commit4d6a8a2bdb19c4380cc458759b7bd221942a028f (patch)
tree1488a8dd15ae00c556a1363e760370fcce8a597b /libavfilter/vsrc_testsrc.c
parent7d82020fcb7f81fcbbd30b7546ba62af45f1a33c (diff)
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.
Diffstat (limited to 'libavfilter/vsrc_testsrc.c')
-rw-r--r--libavfilter/vsrc_testsrc.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 7cf29eeefc..95bf168fc4 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -156,14 +156,9 @@ static int request_frame(AVFilterLink *outlink)
#if CONFIG_NULLSRC_FILTER
-static const char *nullsrc_get_name(void *ctx)
-{
- return "nullsrc";
-}
-
static const AVClass nullsrc_class = {
.class_name = "NullSourceContext",
- .item_name = nullsrc_get_name,
+ .item_name = avfilter_default_filter_name,
.option = testsrc_options,
};
@@ -196,14 +191,9 @@ AVFilter avfilter_vsrc_nullsrc = {
#if CONFIG_TESTSRC_FILTER
-static const char *testsrc_get_name(void *ctx)
-{
- return "testsrc";
-}
-
static const AVClass testsrc_class = {
.class_name = "TestSourceContext",
- .item_name = testsrc_get_name,
+ .item_name = avfilter_default_filter_name,
.option = testsrc_options,
};
@@ -423,14 +413,9 @@ AVFilter avfilter_vsrc_testsrc = {
#if CONFIG_RGBTESTSRC_FILTER
-static const char *rgbtestsrc_get_name(void *ctx)
-{
- return "rgbtestsrc";
-}
-
static const AVClass rgbtestsrc_class = {
.class_name = "RGBTestSourceContext",
- .item_name = rgbtestsrc_get_name,
+ .item_name = avfilter_default_filter_name,
.option = testsrc_options,
};