gst_rtspsrc_post_error_message (GstRTSPSrc * src, GstRTSPSrcError error_id,
const gchar * error_string)
{
- GstMessage *message;
- GstStructure *structure;
gboolean ret = TRUE;
+ g_autoptr(GError) *gerror = NULL;
GST_ERROR_OBJECT (src, "[%d] %s", error_id, error_string);
- structure = gst_structure_new ("streaming_error",
- "error_id", G_TYPE_UINT, error_id,
- "error_string", G_TYPE_STRING, error_string, NULL);
+ gerror = g_error_new_literal (GST_RESOURCE_ERROR, error_id, error_string);
- message =
- gst_message_new_custom (GST_MESSAGE_ERROR, GST_OBJECT (src), structure);
-
- ret = gst_element_post_message (GST_ELEMENT (src), message);
+ ret = gst_element_post_message (GST_ELEMENT (src),
+ gst_message_new_custom (GST_MESSAGE_ERROR, GST_OBJECT (src),
+ gst_structure_new ("streaming_error",
+ "gerror", G_TYPE_ERROR, gerror,
+ "debug", G_TYPE_STRING, NULL, NULL)));
if (!ret)
GST_ERROR_OBJECT (src, "fail to post error message.");
-
- return;
}
#endif