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
This commit is contained in:
Olivier Crete 2015-02-18 11:19:26 +02:00 committed by Sreerenj Balachandran
parent a664a479a8
commit aaf4165819
2 changed files with 24 additions and 8 deletions

View file

@ -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;
}

View file

@ -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;
}