vkh26xdec: implement close() vmethod

Since a validation layer error is signaled at EOS because it's required to wait
for the last frame to be processed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6400>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-03-18 20:00:11 +01:00 committed by GStreamer Marge Bot
parent 316ca23cab
commit a6608d72e6
2 changed files with 30 additions and 12 deletions

View file

@ -177,12 +177,6 @@ gst_vulkan_h264_decoder_close (GstVideoDecoder * decoder)
{ {
GstVulkanH264Decoder *self = GST_VULKAN_H264_DECODER (decoder); GstVulkanH264Decoder *self = GST_VULKAN_H264_DECODER (decoder);
if (self->decoder)
gst_vulkan_decoder_stop (self->decoder);
if (self->output_state)
gst_video_codec_state_unref (self->output_state);
gst_clear_object (&self->decoder); gst_clear_object (&self->decoder);
gst_clear_object (&self->decode_queue); gst_clear_object (&self->decode_queue);
gst_clear_object (&self->graphic_queue); gst_clear_object (&self->graphic_queue);
@ -192,6 +186,20 @@ gst_vulkan_h264_decoder_close (GstVideoDecoder * decoder)
return TRUE; return TRUE;
} }
static gboolean
gst_vulkan_h264_decoder_stop (GstVideoDecoder * decoder)
{
GstVulkanH264Decoder *self = GST_VULKAN_H264_DECODER (decoder);
if (self->decoder)
gst_vulkan_decoder_stop (self->decoder);
if (self->output_state)
gst_video_codec_state_unref (self->output_state);
return TRUE;
}
static void static void
gst_vulkan_h264_decoder_set_context (GstElement * element, GstContext * context) gst_vulkan_h264_decoder_set_context (GstElement * element, GstContext * context)
{ {
@ -1312,6 +1320,7 @@ gst_vulkan_h264_decoder_class_init (GstVulkanH264DecoderClass * klass)
decoder_class->open = GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_open); decoder_class->open = GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_open);
decoder_class->close = GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_close); decoder_class->close = GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_close);
decoder_class->stop = GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_stop);
decoder_class->src_query = decoder_class->src_query =
GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_src_query); GST_DEBUG_FUNCPTR (gst_vulkan_h264_decoder_src_query);
decoder_class->sink_query = decoder_class->sink_query =

View file

@ -235,12 +235,6 @@ gst_vulkan_h265_decoder_close (GstVideoDecoder * decoder)
{ {
GstVulkanH265Decoder *self = GST_VULKAN_H265_DECODER (decoder); GstVulkanH265Decoder *self = GST_VULKAN_H265_DECODER (decoder);
if (self->decoder)
gst_vulkan_decoder_stop (self->decoder);
if (self->output_state)
gst_video_codec_state_unref (self->output_state);
gst_clear_object (&self->decoder); gst_clear_object (&self->decoder);
gst_clear_object (&self->decode_queue); gst_clear_object (&self->decode_queue);
gst_clear_object (&self->graphic_queue); gst_clear_object (&self->graphic_queue);
@ -250,6 +244,20 @@ gst_vulkan_h265_decoder_close (GstVideoDecoder * decoder)
return TRUE; return TRUE;
} }
static gboolean
gst_vulkan_h265_decoder_stop (GstVideoDecoder * decoder)
{
GstVulkanH265Decoder *self = GST_VULKAN_H265_DECODER (decoder);
if (self->decoder)
gst_vulkan_decoder_stop (self->decoder);
if (self->output_state)
gst_video_codec_state_unref (self->output_state);
return TRUE;
}
static gboolean static gboolean
gst_vulkan_h265_decoder_negotiate (GstVideoDecoder * decoder) gst_vulkan_h265_decoder_negotiate (GstVideoDecoder * decoder)
{ {
@ -1657,6 +1665,7 @@ gst_vulkan_h265_decoder_class_init (GstVulkanH265DecoderClass * klass)
GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_sink_query); GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_sink_query);
decoder_class->open = GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_open); decoder_class->open = GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_open);
decoder_class->close = GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_close); decoder_class->close = GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_close);
decoder_class->stop = GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_stop);
decoder_class->negotiate = decoder_class->negotiate =
GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_negotiate); GST_DEBUG_FUNCPTR (gst_vulkan_h265_decoder_negotiate);
decoder_class->decide_allocation = decoder_class->decide_allocation =