From aaf4165819ab3fee975e00dcfe754d665b3da3af Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Wed, 18 Feb 2015 11:19:26 +0200 Subject: [PATCH] vaapidecode: Emit error GstMessage when returning a GST_FLOW_ERROR This is required in GStreamer, elements should never return GST_FLOW_ERROR without posting an ERROR message on the bus. https://bugzilla.gnome.org/show_bug.cgi?id=744620 --- gst/vaapi/gstvaapidecode.c | 14 +++++++++++--- gst/vaapi/gstvaapipluginbase.c | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index f0e25cc..014e1ea 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -279,6 +279,8 @@ error_decode: ret = GST_FLOW_NOT_SUPPORTED; break; default: + GST_ELEMENT_ERROR (vdec, STREAM, DECODE, ("Decoding error"), + ("Decode error %d", status)); ret = GST_FLOW_ERROR; break; } @@ -365,9 +367,11 @@ error_create_buffer: const GstVaapiID surface_id = gst_vaapi_surface_get_id(GST_VAAPI_SURFACE_PROXY_SURFACE(proxy)); - GST_ERROR("video sink failed to create video buffer for proxy'ed " + GST_ELEMENT_ERROR(vdec, STREAM, FAILED, + ("Failed to create sink buffer"), + ("video sink failed to create video buffer for proxy'ed " "surface %" GST_VAAPI_ID_FORMAT, - GST_VAAPI_ID_ARGS(surface_id)); + GST_VAAPI_ID_ARGS(surface_id))); gst_video_decoder_drop_frame(vdec, out_frame); gst_video_codec_frame_unref(out_frame); return GST_FLOW_ERROR; @@ -375,7 +379,9 @@ error_create_buffer: #if GST_CHECK_VERSION(1,0,0) error_get_meta: { - GST_ERROR("failed to get vaapi video meta attached to video buffer"); + GST_ELEMENT_ERROR(vdec, STREAM, FAILED, + ("Failed to get vaapi video meta attached to video buffer"), + ("Failed to get vaapi video meta attached to video buffer")); gst_video_decoder_drop_frame(vdec, out_frame); gst_video_codec_frame_unref(out_frame); return GST_FLOW_ERROR; @@ -423,6 +429,8 @@ gst_vaapidecode_decode_loop(GstVaapiDecode *decode) ret = GST_VIDEO_DECODER_FLOW_NEED_DATA; break; default: + GST_ELEMENT_ERROR (vdec, STREAM, DECODE, ("Decoding failed"), + ("Unknown decoding error")); ret = GST_FLOW_ERROR; break; } diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index ca681aa..691d027 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -865,12 +865,16 @@ done: /* ERRORS */ error_no_pool: { - GST_ERROR ("no buffer pool was negotiated"); + GST_ELEMENT_ERROR (plugin, STREAM, FAILED, + ("no buffer pool was negotiated"), + ("no buffer pool was negotiated")); return GST_FLOW_ERROR; } error_active_pool: { - GST_ERROR ("failed to activate buffer pool"); + GST_ELEMENT_ERROR (plugin, STREAM, FAILED, + ("failed to activate buffer pool"), + ("failed to activate buffer pool")); return GST_FLOW_ERROR; } error_map_dst_buffer: @@ -907,17 +911,21 @@ error_map_src_buffer: /* ERRORS */ error_invalid_buffer: { - GST_ERROR ("failed to validate source buffer"); + GST_ELEMENT_ERROR (plugin, STREAM, FAILED, + ("failed to validate source buffer"), + ("failed to validate source buffer")); return GST_FLOW_ERROR; } error_create_buffer: { - GST_ERROR ("failed to create buffer"); + GST_ELEMENT_ERROR (plugin, STREAM, FAILED, ("Allocation failed"), + ("failed to create buffer")); return GST_FLOW_ERROR; } error_bind_dma_buffer: { - GST_ERROR ("failed to bind dma_buf to VA surface buffer"); + GST_ELEMENT_ERROR (plugin, STREAM, FAILED, ("Allocation failed"), + ("failed to bind dma_buf to VA surface buffer")); gst_buffer_unref (outbuf); return GST_FLOW_ERROR; } -- 2.7.4