summaryrefslogtreecommitdiff
path: root/libavfilter/vf_idet.c
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-11-01 04:10:15 -0700
committerMichael Niedermayer <michaelni@gmx.at>2014-11-01 18:03:38 +0100
commit2847843868c9d7d7e75e771fd79136a00840a8aa (patch)
tree2336ea45a3378554f6d79e7ab13b79d2244061de /libavfilter/vf_idet.c
parent8d9277c3c01c24616532f05a5a09c8bfc7387010 (diff)
avfilter/idet: add metadata to "current" frame instead of "next" frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_idet.c')
-rw-r--r--libavfilter/vf_idet.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index b9c4070d48..56d4cfabb6 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -82,6 +82,7 @@ static void filter(AVFilterContext *ctx)
int64_t delta=0;
Type type, best_type;
int match = 0;
+ AVDictionary **metadata = avpriv_frame_get_metadatap(idet->cur);
for (i = 0; i < idet->csp->nb_components; i++) {
int w = idet->cur->width;
@@ -147,14 +148,25 @@ static void filter(AVFilterContext *ctx)
idet->prestat [ type] ++;
idet->poststat[idet->last_type] ++;
+
av_log(ctx, AV_LOG_DEBUG, "Single frame:%s, Multi frame:%s\n", type2str(type), type2str(idet->last_type));
+
+ av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0);
+ av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0);
+ av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0);
+ av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0);
+
+ av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0);
+ av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0);
+ av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0);
+ av_dict_set_int(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 0);
+
}
static int filter_frame(AVFilterLink *link, AVFrame *picref)
{
AVFilterContext *ctx = link->dst;
IDETContext *idet = ctx->priv;
- AVDictionary **metadata = avpriv_frame_get_metadatap(picref);
if (idet->prev)
av_frame_free(&idet->prev);
@@ -178,16 +190,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
filter(ctx);
- av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0);
- av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0);
- av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0);
- av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0);
-
- av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0);
- av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0);
- av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0);
- av_dict_set_int(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 0);
-
return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));
}