diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-11-24 19:08:15 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-12-14 08:11:05 +0100 |
commit | 9d7000b1bea097d715166e93475c71a0fb237f05 (patch) | |
tree | 8c5fc7d07e595ed4e8813e7cc67d7c23b1e081f6 /fftools/ffmpeg_filter.c | |
parent | c9f38210fc498ada2605a1faac8aceb3d76e69c6 (diff) | |
download | ffmpeg-9d7000b1bea097d715166e93475c71a0fb237f05.tar.gz |
fftools/ffmpeg: attach wallclock timing information to packets and frames
Will become useful in following commits.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r-- | fftools/ffmpeg_filter.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index ada235b084..21f823be12 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -36,6 +36,7 @@ #include "libavutil/pixfmt.h" #include "libavutil/imgutils.h" #include "libavutil/samplefmt.h" +#include "libavutil/time.h" #include "libavutil/timestamp.h" // FIXME private header, used for mid_pred() @@ -2364,6 +2365,8 @@ static int fg_output_step(OutputFilterPriv *ofp, FilterGraphThread *fgt, return AVERROR(ENOMEM); } + fd->wallclock[LATENCY_PROBE_FILTER_POST] = av_gettime_relative(); + // only use bits_per_raw_sample passed through from the decoder // if the filtergraph did not touch the frame data if (!fgp->is_meta) @@ -2576,6 +2579,7 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt, InputFilter *ifilter, AVFrame *frame) { InputFilterPriv *ifp = ifp_from_ifilter(ifilter); + FrameData *fd; AVFrameSideData *sd; int need_reinit, ret; @@ -2651,6 +2655,11 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt, ) #endif + fd = frame_data(frame); + if (!fd) + return AVERROR(ENOMEM); + fd->wallclock[LATENCY_PROBE_FILTER_PRE] = av_gettime_relative(); + ret = av_buffersrc_add_frame_flags(ifp->filter, frame, AV_BUFFERSRC_FLAG_PUSH); if (ret < 0) { |