mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
vaapidecode: remove gst_vaapidecode_internal_flush()
As gst_vaapidecode_finish() is the only callee of gst_vaapidecode_internal_flush(), it is better to inline it. https://bugzilla.gnome.org/show_bug.cgi?id=768652
This commit is contained in:
parent
b392b4f064
commit
cb0ec6b60c
1 changed files with 12 additions and 23 deletions
|
@ -707,40 +707,29 @@ gst_vaapidecode_drain (GstVideoDecoder * vdec)
|
|||
return gst_vaapidecode_push_all_decoded_frames (decode);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_vaapidecode_internal_flush (GstVideoDecoder * vdec)
|
||||
{
|
||||
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
|
||||
GstVaapiDecoderStatus status;
|
||||
|
||||
if (!decode->decoder)
|
||||
return TRUE;
|
||||
|
||||
gst_vaapidecode_flush_output_adapter (decode);
|
||||
status = gst_vaapi_decoder_flush (decode->decoder);
|
||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) {
|
||||
GST_WARNING_OBJECT (decode, "failed to flush decoder (status %d)", status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_vaapidecode_finish (GstVideoDecoder * vdec)
|
||||
{
|
||||
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
|
||||
gboolean flushed;
|
||||
GstVaapiDecoderStatus status;
|
||||
GstFlowReturn ret;
|
||||
|
||||
if (!decode->decoder)
|
||||
return GST_FLOW_OK;
|
||||
|
||||
flushed = gst_vaapidecode_internal_flush (vdec);
|
||||
gst_vaapidecode_flush_output_adapter (decode);
|
||||
status = gst_vaapi_decoder_flush (decode->decoder);
|
||||
ret = gst_vaapidecode_push_all_decoded_frames (decode);
|
||||
if (!flushed)
|
||||
return GST_FLOW_ERROR;
|
||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||
goto error_decoder_flush;
|
||||
return ret;
|
||||
|
||||
/* ERRORS: */
|
||||
error_decoder_flush:
|
||||
{
|
||||
GST_WARNING_OBJECT (decode, "failed to flush decoder (status %d)", status);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue