You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avfilter/avfilter: add sample_count_in and sample_count_out
This commit is contained in:
@@ -1013,6 +1013,7 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
|
|||||||
|
|
||||||
link->frame_blocked_in = link->frame_wanted_out = 0;
|
link->frame_blocked_in = link->frame_wanted_out = 0;
|
||||||
link->frame_count_in++;
|
link->frame_count_in++;
|
||||||
|
link->sample_count_in += frame->nb_samples;
|
||||||
filter_unblock(link->dst);
|
filter_unblock(link->dst);
|
||||||
ret = ff_framequeue_add(&link->fifo, frame);
|
ret = ff_framequeue_add(&link->fifo, frame);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@@ -1372,6 +1373,7 @@ static void consume_update(AVFilterLink *link, const AVFrame *frame)
|
|||||||
ff_inlink_process_commands(link, frame);
|
ff_inlink_process_commands(link, frame);
|
||||||
link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
|
link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
|
||||||
link->frame_count_out++;
|
link->frame_count_out++;
|
||||||
|
link->sample_count_out += frame->nb_samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
|
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
|
||||||
|
@@ -584,6 +584,11 @@ struct AVFilterLink {
|
|||||||
*/
|
*/
|
||||||
int64_t frame_count_in, frame_count_out;
|
int64_t frame_count_in, frame_count_out;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of past samples sent through the link.
|
||||||
|
*/
|
||||||
|
int64_t sample_count_in, sample_count_out;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pointer to a FFFramePool struct.
|
* A pointer to a FFFramePool struct.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user