Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
}
static void
-error_callback (GstRtmpConnection * connection, GstRtmp2Sink * self)
+error_callback (GstRtmpConnection * connection, const GError * error,
+ GstRtmp2Sink * self)
{
g_mutex_lock (&self->lock);
if (self->cancellable) {
g_cancellable_cancel (self->cancellable);
} else if (self->loop) {
- GST_ELEMENT_ERROR (self, RESOURCE, WRITE, ("Connection error"), (NULL));
+ GST_ELEMENT_ERROR (self, RESOURCE, WRITE,
+ ("Connection error: %s", error->message),
+ ("domain %s, code %d", g_quark_to_string (error->domain), error->code));
stop_task (self);
}
g_mutex_unlock (&self->lock);
}
static void
-error_callback (GstRtmpConnection * connection, GstRtmp2Src * self)
+error_callback (GstRtmpConnection * connection, const GError * error,
+ GstRtmp2Src * self)
{
g_mutex_lock (&self->lock);
if (self->cancellable) {
g_cancellable_cancel (self->cancellable);
} else if (self->loop) {
- GST_INFO_OBJECT (self, "Connection error");
+ GST_INFO_OBJECT (self, "Connection error: %s %d %s",
+ g_quark_to_string (error->domain), error->code, error->message);
stop_task (self);
}
g_mutex_unlock (&self->lock);
static void send_secure_token_response (GTask * task,
GstRtmpConnection * connection, const gchar * challenge);
static void connection_error (GstRtmpConnection * connection,
- gpointer user_data);
+ const GError * error, gpointer user_data);
#define DEFAULT_TIMEOUT 5
}
static void
-connection_error (GstRtmpConnection * connection, gpointer user_data)
+connection_error (GstRtmpConnection * connection, const GError * error,
+ gpointer user_data)
{
GTask *task = user_data;
+
if (!g_task_had_error (task))
- g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "error during connection attempt");
+ g_task_return_error (task, g_error_copy (error));
}
static gchar *
gobject_class->finalize = gst_rtmp_connection_finalize;
signals[SIGNAL_ERROR] = g_signal_new ("error", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_ERROR);
signals[SIGNAL_STREAM_CONTROL] = g_signal_new ("stream-control",
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
if (!self->error) {
self->error = TRUE;
cancel_all_commands (self, error->message);
- g_signal_emit (self, signals[SIGNAL_ERROR], 0);
+ g_signal_emit (self, signals[SIGNAL_ERROR], 0, error);
}
g_error_free (error);