good:rtsp: Modify to use GError for post error message 35/283635/5 accepted/tizen/unified/20221115.022404
authorjiyong.min <jiyong.min@samsung.com>
Mon, 31 Oct 2022 22:19:14 +0000 (07:19 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Thu, 3 Nov 2022 06:42:28 +0000 (06:42 +0000)
 - The streaming error message on gstreamer did not use GError,
  so it could cause problems on the other side.
  We modify to use standard GError.

[Version] 1.20.0-40
[Issue Type] Bug fix

Change-Id: I3b96d492ae37f14a4e480605227710bafc0f8640

subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c

index 56775bf..d28f241 100644 (file)
@@ -544,24 +544,20 @@ static void
 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