[farsight2/master] Define the error signal in the rawudp component and forwards the errors in the streams.
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:22:27 PST 2008
---
transmitters/rawudp/fs-rawudp-component.c | 25 +++++++++++--
transmitters/rawudp/fs-rawudp-marshal.c | 39 ++++++++++++++++++++
transmitters/rawudp/fs-rawudp-marshal.h | 8 ++++
transmitters/rawudp/fs-rawudp-marshal.list | 1 +
transmitters/rawudp/fs-rawudp-stream-transmitter.c | 19 +++++++++-
5 files changed, 88 insertions(+), 4 deletions(-)
diff --git a/transmitters/rawudp/fs-rawudp-component.c b/transmitters/rawudp/fs-rawudp-component.c
index 0a9fb88..e63ebd7 100644
--- a/transmitters/rawudp/fs-rawudp-component.c
+++ b/transmitters/rawudp/fs-rawudp-component.c
@@ -293,7 +293,7 @@ fs_rawudp_component_class_init (FsRawUdpComponentClass *klass)
G_PARAM_WRITABLE));
/**
- * FsComponent::new-local-candidate:
+ * FsRawUdpComponent::new-local-candidate:
* @self: #FsStream that emitted the signal
* @local_candidate: #FsCandidate of the local candidate
*
@@ -310,7 +310,7 @@ fs_rawudp_component_class_init (FsRawUdpComponentClass *klass)
G_TYPE_NONE, 1, FS_TYPE_CANDIDATE);
/**
- * FsComponent::local-candidates-prepared:
+ * FsRawUdpComponent::local-candidates-prepared:
* @self: #FsStream that emitted the signal
*
* This signal is emitted when all local candidates have been
@@ -327,7 +327,7 @@ fs_rawudp_component_class_init (FsRawUdpComponentClass *klass)
G_TYPE_NONE, 0);
/**
- * FsComponent::new-active-candidate-pair:
+ * FsiRawUdpComponent::new-active-candidate-pair:
* @self: #FsStream that emitted the signal
* @local_candidate: #FsCandidate of the local candidate being used
* @remote_candidate: #FsCandidate of the remote candidate being used
@@ -347,6 +347,25 @@ fs_rawudp_component_class_init (FsRawUdpComponentClass *klass)
G_TYPE_NONE, 2, FS_TYPE_CANDIDATE, FS_TYPE_CANDIDATE);
+ /**
+ * FsRawUdpComponent::error:
+ * @self: #FsStreamTransmitter that emitted the signal
+ * @errorno: The number of the error
+ * @error_msg: Error message to be displayed to user
+ * @debug_msg: Debugging error message
+ *
+ * This signal is emitted in any error condition
+ *
+ */
+ signals[ERROR_SIGNAL] = g_signal_new ("error",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ _fs_rawudp_marshal_VOID__INT_STRING_STRING,
+ G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING);
+
g_type_class_add_private (klass, sizeof (FsRawUdpComponentPrivate));
}
diff --git a/transmitters/rawudp/fs-rawudp-marshal.c b/transmitters/rawudp/fs-rawudp-marshal.c
index 95f33b0..0aee4dc 100644
--- a/transmitters/rawudp/fs-rawudp-marshal.c
+++ b/transmitters/rawudp/fs-rawudp-marshal.c
@@ -86,3 +86,42 @@ _fs_rawudp_marshal_VOID__BOXED_BOXED (GClosure *closure,
data2);
}
+/* VOID:INT,STRING,STRING (./fs-rawudp-marshal.list:2) */
+void
+_fs_rawudp_marshal_VOID__INT_STRING_STRING (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef void (*GMarshalFunc_VOID__INT_STRING_STRING) (gpointer data1,
+ gint arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ gpointer data2);
+ register GMarshalFunc_VOID__INT_STRING_STRING callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+
+ g_return_if_fail (n_param_values == 4);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__INT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
+
+ callback (data1,
+ g_marshal_value_peek_int (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ data2);
+}
+
diff --git a/transmitters/rawudp/fs-rawudp-marshal.h b/transmitters/rawudp/fs-rawudp-marshal.h
index 8532627..4e5256a 100644
--- a/transmitters/rawudp/fs-rawudp-marshal.h
+++ b/transmitters/rawudp/fs-rawudp-marshal.h
@@ -14,6 +14,14 @@ extern void _fs_rawudp_marshal_VOID__BOXED_BOXED (GClosure *closure,
gpointer invocation_hint,
gpointer marshal_data);
+/* VOID:INT,STRING,STRING (./fs-rawudp-marshal.list:2) */
+extern void _fs_rawudp_marshal_VOID__INT_STRING_STRING (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+
G_END_DECLS
#endif /* ___fs_rawudp_marshal_MARSHAL_H__ */
diff --git a/transmitters/rawudp/fs-rawudp-marshal.list b/transmitters/rawudp/fs-rawudp-marshal.list
index 73ccad0..2c46dad 100644
--- a/transmitters/rawudp/fs-rawudp-marshal.list
+++ b/transmitters/rawudp/fs-rawudp-marshal.list
@@ -1 +1,2 @@
VOID:BOXED,BOXED
+VOID:INT,STRING,STRING
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index e6b4214..bd5ad51 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -172,7 +172,9 @@ _component_local_candidates_prepared (FsRawUdpComponent *component,
static void
_component_new_active_candidate_pair (FsRawUdpComponent *component,
FsCandidate *local, FsCandidate *remote, gpointer user_data);
-
+static void
+_component_error (FsRawUdpComponent *component,
+ gint error_no, gchar *error_msg, gchar *debug_msg, gpointer user_data);
static GObjectClass *parent_class = NULL;
@@ -492,6 +494,8 @@ fs_rawudp_stream_transmitter_build (FsRawUdpStreamTransmitter *self,
G_CALLBACK (_component_local_candidates_prepared), self);
g_signal_connect (self->priv->component[c], "new-active-candidate-pair",
G_CALLBACK (_component_new_active_candidate_pair), self);
+ g_signal_connect (self->priv->component[c], "error",
+ G_CALLBACK (_component_error), self);
/* If we dont get the requested port and it wasnt a forced port,
* then we rewind up to the last forced port and jump to the next
@@ -707,3 +711,16 @@ _component_new_active_candidate_pair (FsRawUdpComponent *component,
g_signal_emit_by_name (self, "new-active-candidate-pair", local, remote);
}
+
+
+
+static void
+_component_error (FsRawUdpComponent *component,
+ gint error_no, gchar *error_msg, gchar *debug_msg, gpointer user_data)
+{
+ FsRawUdpStreamTransmitter *self = FS_RAWUDP_STREAM_TRANSMITTER (user_data);
+
+ fs_stream_transmitter_emit_error (FS_STREAM_TRANSMITTER (self), error_no,
+ error_msg, debug_msg);
+}
+
--
1.5.6.5
More information about the farsight-commits
mailing list