Showing the changes to libavfilter/avfilter.c (1 of 56 files). Show all
Unified · Split
| @@ -991,6 +991,7 @@ static int default_filter_frame(AVFilterLink *link, AVFrame *frame) · 990 unmodified lines | |||
| 991 | 991 | ||
| 992 | static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame) | 992 | static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame) |
| 993 | { | 993 | { |
| 994 | FilterLink *l = ff_filter_link(link); | ||
| 994 | int (*filter_frame)(AVFilterLink *, AVFrame *); | 995 | int (*filter_frame)(AVFilterLink *, AVFrame *); |
| 995 | AVFilterContext *dstctx = link->dst; | 996 | AVFilterContext *dstctx = link->dst; |
| 996 | AVFilterPad *dst = link->dstpad; | 997 | AVFilterPad *dst = link->dstpad; |
| @@ -1012,7 +1013,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame) · 15 unmodified lines | |||
| 1012 | (dstctx->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC)) | 1013 | (dstctx->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC)) |
| 1013 | filter_frame = default_filter_frame; | 1014 | filter_frame = default_filter_frame; |
| 1014 | ret = filter_frame(link, frame); | 1015 | ret = filter_frame(link, frame); |
| 1015 | link->frame_count_out++; | 1016 | l->frame_count_out++; |
| 1016 | return ret; | 1017 | return ret; |
| 1017 | 1018 | ||
| 1018 | fail: | 1019 | fail: |
| @@ -1058,8 +1059,8 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame) · 39 unmodified lines | |||
| 1058 | } | 1059 | } |
| 1059 | 1060 | ||
| 1060 | li->frame_blocked_in = link->frame_wanted_out = 0; | 1061 | li->frame_blocked_in = link->frame_wanted_out = 0; |
| 1061 | link->frame_count_in++; | 1062 | li->l.frame_count_in++; |
| 1062 | link->sample_count_in += frame->nb_samples; | 1063 | li->l.sample_count_in += frame->nb_samples; |
| 1063 | filter_unblock(link->dst); | 1064 | filter_unblock(link->dst); |
| 1064 | ret = ff_framequeue_add(&li->fifo, frame); | 1065 | ret = ff_framequeue_add(&li->fifo, frame); |
| 1065 | if (ret < 0) { | 1066 | if (ret < 0) { |
| @@ -1163,7 +1164,7 @@ static int ff_filter_frame_to_filter(AVFilterLink *link) · 97 unmodified lines | |||
| 1163 | filter_unblock(dst); | 1164 | filter_unblock(dst); |
| 1164 | /* AVFilterPad.filter_frame() expect frame_count_out to have the value | 1165 | /* AVFilterPad.filter_frame() expect frame_count_out to have the value |
| 1165 | before the frame; ff_filter_frame_framed() will re-increment it. */ | 1166 | before the frame; ff_filter_frame_framed() will re-increment it. */ |
| 1166 | link->frame_count_out--; | 1167 | li->l.frame_count_out--; |
| 1167 | ret = ff_filter_frame_framed(link, frame); | 1168 | ret = ff_filter_frame_framed(link, frame); |
| 1168 | if (ret < 0 && ret != li->status_out) { | 1169 | if (ret < 0 && ret != li->status_out) { |
| 1169 | link_set_out_status(link, ret, AV_NOPTS_VALUE); | 1170 | link_set_out_status(link, ret, AV_NOPTS_VALUE); |
| @@ -1444,8 +1445,8 @@ static void consume_update(FilterLinkInternal *li, const AVFrame *frame) · 274 unmodified lines | |||
| 1444 | ff_inlink_process_commands(link, frame); | 1445 | ff_inlink_process_commands(link, frame); |
| 1445 | if (link == link->dst->inputs[0]) | 1446 | if (link == link->dst->inputs[0]) |
| 1446 | link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame); | 1447 | link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame); |
| 1447 | link->frame_count_out++; | 1448 | li->l.frame_count_out++; |
| 1448 | link->sample_count_out += frame->nb_samples; | 1449 | li->l.sample_count_out += frame->nb_samples; |
| 1449 | } | 1450 | } |
| 1450 | 1451 | ||
| 1451 | int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe) | 1452 | int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe) |
| @@ -1552,6 +1553,7 @@ int ff_inlink_process_commands(AVFilterLink *link, const AVFrame *frame) · 100 unmodified lines | |||
| 1552 | 1553 | ||
| 1553 | int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *frame) | 1554 | int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *frame) |
| 1554 | { | 1555 | { |
| 1556 | FilterLink *l = ff_filter_link(link); | ||
| 1555 | AVFilterContext *dstctx = link->dst; | 1557 | AVFilterContext *dstctx = link->dst; |
| 1556 | int64_t pts = frame->pts; | 1558 | int64_t pts = frame->pts; |
| 1557 | #if FF_API_FRAME_PKT | 1559 | #if FF_API_FRAME_PKT |
| @@ -1563,7 +1565,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 5 unmodified lines | |||
| 1563 | if (!dstctx->enable_str) | 1565 | if (!dstctx->enable_str) |
| 1564 | return 1; | 1566 | return 1; |
| 1565 | 1567 | ||
| 1566 | dstctx->var_values[VAR_N] = link->frame_count_out; | 1568 | dstctx->var_values[VAR_N] = l->frame_count_out; |
| 1567 | dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base); | 1569 | dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base); |
| 1568 | dstctx->var_values[VAR_W] = link->w; | 1570 | dstctx->var_values[VAR_W] = link->w; |
| 1569 | dstctx->var_values[VAR_H] = link->h; | 1571 | dstctx->var_values[VAR_H] = link->h; |