mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
v4l2slh264dec: Wait on previous pending request in slice mode
In slice mode, we'll do one request per slice. In order to recycle bitstream buffer, and not run-out, wait for the last pending request to complete and mark it done. We only wait after having queued the current slice in order to reduce that potential driver starvation and maintain performance (using dual buffering). Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1395>
This commit is contained in:
parent
b20c6fe6c4
commit
a2eb1b57ff
1 changed files with 13 additions and 3 deletions
|
@ -948,7 +948,7 @@ gst_v4l2_codec_h264_dec_submit_bitstream (GstV4l2CodecH264Dec * self,
|
|||
GstH264Picture * picture, guint flags)
|
||||
{
|
||||
GstVideoCodecFrame *frame;
|
||||
GstV4l2Request *request;
|
||||
GstV4l2Request *prev_request, *request;
|
||||
gsize bytesused;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
|
@ -990,8 +990,6 @@ gst_v4l2_codec_h264_dec_submit_bitstream (GstV4l2CodecH264Dec * self,
|
|||
goto done;
|
||||
}
|
||||
|
||||
gst_h264_picture_set_user_data (picture, request,
|
||||
(GDestroyNotify) gst_v4l2_request_free);
|
||||
|
||||
frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (self),
|
||||
picture->system_frame_number);
|
||||
|
@ -1026,10 +1024,22 @@ gst_v4l2_codec_h264_dec_submit_bitstream (GstV4l2CodecH264Dec * self,
|
|||
goto done;
|
||||
}
|
||||
|
||||
prev_request = gst_h264_picture_get_user_data (picture);
|
||||
if (prev_request) {
|
||||
if (!gst_v4l2_codec_h264_dec_wait (self, prev_request))
|
||||
goto done;
|
||||
gst_v4l2_request_set_done (prev_request);
|
||||
}
|
||||
|
||||
gst_h264_picture_set_user_data (picture, g_steal_pointer (&request),
|
||||
(GDestroyNotify) gst_v4l2_request_free);
|
||||
ret = TRUE;
|
||||
|
||||
done:
|
||||
if (request)
|
||||
gst_v4l2_request_free (request);
|
||||
gst_v4l2_codec_h264_dec_reset_picture (self);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue