Skip to content

Commit

Permalink
avcodec/vpp_qsv: Copy side data from input to output frame
Browse files Browse the repository at this point in the history
Signed-off-by: softworkz <[email protected]>
  • Loading branch information
softworkz committed Oct 24, 2022
1 parent 28c4b9e commit 43eb325
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
6 changes: 6 additions & 0 deletions libavfilter/qsvvpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,12 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
return AVERROR(EAGAIN);
break;
}

av_frame_remove_all_side_data(out_frame->frame);
ret = av_frame_copy_side_data(out_frame->frame, in_frame->frame, 0);
if (ret < 0)
return ret;

out_frame->frame->pts = av_rescale_q(out_frame->surface.Data.TimeStamp,
default_tb, outlink->time_base);

Expand Down
19 changes: 15 additions & 4 deletions libavfilter/vf_overlay_qsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,24 @@ static int process_frame(FFFrameSync *fs)
{
AVFilterContext *ctx = fs->parent;
QSVOverlayContext *s = fs->opaque;
AVFrame *frame0 = NULL;
AVFrame *frame = NULL;
int ret = 0, i;
int ret = 0;

for (i = 0; i < ctx->nb_inputs; i++) {
for (unsigned i = 0; i < ctx->nb_inputs; i++) {
ret = ff_framesync_get_frame(fs, i, &frame, 0);
if (ret == 0)
ret = ff_qsvvpp_filter_frame(s->qsv, ctx->inputs[i], frame);

if (ret == 0) {
if (i == 0)
frame0 = frame;
else {
av_frame_remove_all_side_data(frame);
ret = av_frame_copy_side_data(frame, frame0, 0);
}

ret = ret < 0 ? ret : ff_qsvvpp_filter_frame(s->qsv, ctx->inputs[i], frame);
}

if (ret < 0 && ret != AVERROR(EAGAIN))
break;
}
Expand Down

0 comments on commit 43eb325

Please sign in to comment.