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/6688>
This commit is contained in:
He Junyan 2024-04-19 00:14:15 +08:00 committed by GStreamer Marge Bot
parent f68bc7f49a
commit b8871c87a2

View file

@ -4038,23 +4038,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;
@ -4097,6 +4080,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);