mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
vaapidecode: handle EOS events.
Flush all decoded frames to downstream when EOS is received. This is performed by implementing GstVideoDecoder::finish() hook.
This commit is contained in:
parent
cbcdc3bfae
commit
236e8833d1
1 changed files with 20 additions and 0 deletions
|
@ -303,6 +303,25 @@ gst_vaapidecode_handle_frame(GstVideoDecoder *vdec, GstVideoCodecFrame *frame)
|
||||||
return gst_vaapidecode_push_decoded_frames(vdec);
|
return gst_vaapidecode_push_decoded_frames(vdec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_vaapidecode_finish(GstVideoDecoder *vdec)
|
||||||
|
{
|
||||||
|
GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec);
|
||||||
|
GstVaapiDecoderStatus status;
|
||||||
|
|
||||||
|
status = gst_vaapi_decoder_flush(decode->decoder);
|
||||||
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
|
goto error_flush;
|
||||||
|
return gst_vaapidecode_push_decoded_frames(vdec);
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
error_flush:
|
||||||
|
{
|
||||||
|
GST_ERROR("failed to flush decoder (status %d)", status);
|
||||||
|
return GST_FLOW_UNEXPECTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
gst_vaapidecode_ensure_display(GstVaapiDecode *decode)
|
gst_vaapidecode_ensure_display(GstVaapiDecode *decode)
|
||||||
{
|
{
|
||||||
|
@ -532,6 +551,7 @@ gst_vaapidecode_class_init(GstVaapiDecodeClass *klass)
|
||||||
vdec_class->set_format = GST_DEBUG_FUNCPTR(gst_vaapidecode_set_format);
|
vdec_class->set_format = GST_DEBUG_FUNCPTR(gst_vaapidecode_set_format);
|
||||||
vdec_class->parse = GST_DEBUG_FUNCPTR(gst_vaapidecode_parse);
|
vdec_class->parse = GST_DEBUG_FUNCPTR(gst_vaapidecode_parse);
|
||||||
vdec_class->handle_frame = GST_DEBUG_FUNCPTR(gst_vaapidecode_handle_frame);
|
vdec_class->handle_frame = GST_DEBUG_FUNCPTR(gst_vaapidecode_handle_frame);
|
||||||
|
vdec_class->finish = GST_DEBUG_FUNCPTR(gst_vaapidecode_finish);
|
||||||
|
|
||||||
gst_element_class_set_details_simple(
|
gst_element_class_set_details_simple(
|
||||||
element_class,
|
element_class,
|
||||||
|
|
Loading…
Reference in a new issue