[FFmpeg-cvslog] lavfi/vf_libplacebo: move temporary vars into per-input struct
Niklas Haas
git at videolan.org
Tue Jun 20 18:11:18 EEST 2023
ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Thu Jun 15 15:32:39 2023 +0200| [ad445a7030fa62d4ef750b78f7756db219702ead] | committer: Niklas Haas
lavfi/vf_libplacebo: move temporary vars into per-input struct
Including the queue status, because these will need to be re-queried
inside output_frame_mix when that function is refactored to handle
multiple inputs.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad445a7030fa62d4ef750b78f7756db219702ead
---
libavfilter/vf_libplacebo.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index beddd2f796..4baa766bac 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -117,6 +117,8 @@ enum var_name {
typedef struct LibplaceboInput {
pl_renderer renderer;
pl_queue queue;
+ enum pl_queue_status qstatus;
+ struct pl_frame_mix mix; ///< temporary storage
AVFilterLink *link;
AVFifo *out_pts; ///< timestamps of wanted output frames
int64_t status_pts;
@@ -952,9 +954,6 @@ static int libplacebo_activate(AVFilterContext *ctx)
return ret;
if (ff_outlink_frame_wanted(outlink)) {
- struct pl_frame_mix mix;
- enum pl_queue_status ret;
-
if (s->fps.num) {
pts = outlink->frame_count_out;
} else if (av_fifo_peek(in->out_pts, &pts, 1, 0) < 0) {
@@ -972,20 +971,20 @@ static int libplacebo_activate(AVFilterContext *ctx)
return 0;
}
- ret = pl_queue_update(in->queue, &mix, pl_queue_params(
+ in->qstatus = pl_queue_update(in->queue, &in->mix, pl_queue_params(
.pts = pts * av_q2d(outlink->time_base),
.radius = pl_frame_mix_radius(&s->params),
.vsync_duration = av_q2d(av_inv_q(outlink->frame_rate)),
));
- switch (ret) {
+ switch (in->qstatus) {
case PL_QUEUE_MORE:
ff_inlink_request_frame(in->link);
return 0;
case PL_QUEUE_OK:
if (!s->fps.num)
av_fifo_drain2(in->out_pts, 1);
- return output_frame_mix(ctx, &mix, pts);
+ return output_frame_mix(ctx, &in->mix, pts);
case PL_QUEUE_ERR:
return AVERROR_EXTERNAL;
}
More information about the ffmpeg-cvslog
mailing list