va: encoder: Do not reset the frame count when reconfig().

We should not reset the input/output_frame_count when some configure
changes. For example, the if resolution changes, the current way just
resets the frame count and make the PTS of the output buffer restart
from the original PTS of the first frame. That causes a lot of QOS
event and drop all the new frames.
We should only reset them when encoder start().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2489>
This commit is contained in:
He Junyan 2022-05-25 20:01:34 +08:00 committed by GStreamer Marge Bot
parent 994f2c56e2
commit d47416d3a2

View file

@ -62,8 +62,6 @@ static void
gst_va_base_enc_reset_state (GstVaBaseEnc * base)
{
base->frame_duration = GST_CLOCK_TIME_NONE;
base->input_frame_count = 0;
base->output_frame_count = 0;
base->width = 0;
base->height = 0;
@ -122,6 +120,9 @@ gst_va_base_enc_start (GstVideoEncoder * venc)
klass->reset_state (base);
base->input_frame_count = 0;
base->output_frame_count = 0;
base->input_state = NULL;
/* Set the minimum pts to some huge value (1000 hours). This keeps