vaav1enc: Do not change the PTS/DTS of output frames

The AV1 encoder does not reorder the frames, so there is no need
to change the timestamp related meta data of output frames, just
inheriting it from the input frames.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6751>
This commit is contained in:
He Junyan 2024-04-19 00:14:15 +08:00 committed by Backport Bot
parent 7ec4a7cc01
commit 8c4aa7067d

View file

@ -4012,23 +4012,6 @@ gst_va_av1_enc_prepare_output (GstVaBaseEnc * base,
return TRUE;
}
if (frame_enc->flags & FRAME_FLAG_NOT_SHOW &&
((frame_enc->type & FRAME_TYPE_REPEAT) == 0)) {
frame->pts = self->last_pts;
frame->dts = self->last_dts;
frame->duration = GST_CLOCK_TIME_NONE;
} else {
frame->pts =
base->start_pts + base->frame_duration * frame_enc->total_frame_count;
/* The PTS should always be later than the DTS. */
frame->dts = frame->pts - base->frame_duration;
base->output_frame_count++;
frame->duration = base->frame_duration;
self->last_pts = frame->pts;
self->last_dts = frame->dts;
}
if (frame_enc->flags & FRAME_FLAG_ALREADY_OUTPUTTED) {
gsize sz;
@ -4071,6 +4054,7 @@ gst_va_av1_enc_prepare_output (GstVaBaseEnc * base,
}
*complete = TRUE;
base->output_frame_count++;
gst_buffer_replace (&frame->output_buffer, buf);
gst_clear_buffer (&buf);