mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
vaapidecode: flush buffers when receiving EOS.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
84f308010f
commit
da1e4e3918
1 changed files with 17 additions and 0 deletions
|
@ -407,6 +407,18 @@ gst_vaapidecode_reset(GstVaapiDecode *decode, GstCaps *caps)
|
|||
return gst_vaapidecode_create(decode, caps);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_vaapidecode_flush(GstVaapiDecode *decode)
|
||||
{
|
||||
g_return_val_if_fail(decode->decoder, FALSE);
|
||||
|
||||
if (!gst_vaapi_decoder_put_buffer(decode->decoder, NULL))
|
||||
return FALSE;
|
||||
if (gst_vaapidecode_step(decode) != GST_FLOW_OK)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* GstImplementsInterface interface */
|
||||
|
||||
static gboolean
|
||||
|
@ -680,6 +692,11 @@ gst_vaapidecode_sink_event(GstPad *pad, GstEvent *event)
|
|||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_EOS:
|
||||
if (!gst_vaapidecode_flush(decode)) {
|
||||
GST_WARNING("failed to flush buffers");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue