videodecoder: request sync-points regularly on error

If we are not receiving a sync-point for a very long time, we need to
keep asking for them. The request-sync-point logic keeps track of how
many keyunitrequests we are allowed to send, but that would not matter
if we don't keep asking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/930>
This commit is contained in:
Havard Graff 2021-09-27 00:53:34 +02:00 committed by GStreamer Marge Bot
parent dc30676002
commit 6d4d4edfcc

View file

@ -3921,6 +3921,9 @@ gst_video_decoder_decode_frame (GstVideoDecoder * decoder,
frame->pts = GST_BUFFER_PTS (frame->input_buffer); frame->pts = GST_BUFFER_PTS (frame->input_buffer);
frame->dts = GST_BUFFER_DTS (frame->input_buffer); frame->dts = GST_BUFFER_DTS (frame->input_buffer);
frame->duration = GST_BUFFER_DURATION (frame->input_buffer); frame->duration = GST_BUFFER_DURATION (frame->input_buffer);
frame->deadline =
gst_segment_to_running_time (&decoder->input_segment, GST_FORMAT_TIME,
frame->pts);
/* For keyframes, PTS = DTS + constant_offset, usually 0 to 3 frame /* For keyframes, PTS = DTS + constant_offset, usually 0 to 3 frame
* durations. */ * durations. */
@ -3960,6 +3963,10 @@ gst_video_decoder_decode_frame (GstVideoDecoder * decoder,
GST_WARNING_OBJECT (decoder, GST_WARNING_OBJECT (decoder,
"Subclass requires a sync point but we didn't receive one yet, discarding input"); "Subclass requires a sync point but we didn't receive one yet, discarding input");
GST_OBJECT_UNLOCK (decoder); GST_OBJECT_UNLOCK (decoder);
if (priv->automatic_request_sync_points) {
gst_video_decoder_request_sync_point (decoder, frame,
priv->automatic_request_sync_point_flags);
}
gst_video_decoder_release_frame (decoder, frame); gst_video_decoder_release_frame (decoder, frame);
return GST_FLOW_OK; return GST_FLOW_OK;
} }
@ -3992,10 +3999,6 @@ gst_video_decoder_decode_frame (GstVideoDecoder * decoder,
"possible internal leaking?", priv->frames.length); "possible internal leaking?", priv->frames.length);
} }
frame->deadline =
gst_segment_to_running_time (&decoder->input_segment, GST_FORMAT_TIME,
frame->pts);
/* do something with frame */ /* do something with frame */
ret = decoder_class->handle_frame (decoder, frame); ret = decoder_class->handle_frame (decoder, frame);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)