diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2009-07-25 20:01:11 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-10-11 15:36:06 -0400 |
commit | 1e79915c6e26e57aafc91766c2fdeb9d08fe6d24 (patch) | |
tree | 84f79114118d38d0e983669a4ca1dd24769fc421 | |
parent | 93491d1e99f3362023800094717b74ce546920dd (diff) | |
download | farstream-1e79915c6e26e57aafc91766c2fdeb9d08fe6d24.tar.gz |
session: Remove debug-msg from error signal
-rw-r--r-- | gst-libs/gst/farsight/fs-base-conference.c | 24 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-session.c | 18 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-session.h | 3 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-transmitter.c | 2 | ||||
-rw-r--r-- | gst/fsrawconference/fs-raw-session.c | 12 | ||||
-rw-r--r-- | gst/fsrtpconference/fs-rtp-session.c | 45 | ||||
-rw-r--r-- | gst/fsrtpconference/fs-rtp-substream.c | 30 | ||||
-rw-r--r-- | python/pyfarsight.defs | 1 |
8 files changed, 60 insertions, 75 deletions
diff --git a/gst-libs/gst/farsight/fs-base-conference.c b/gst-libs/gst/farsight/fs-base-conference.c index db2b7fd2..31e66ed1 100644 --- a/gst-libs/gst/farsight/fs-base-conference.c +++ b/gst-libs/gst/farsight/fs-base-conference.c @@ -77,9 +77,11 @@ static FsSession *fs_base_conference_new_session (FsConference *conf, static FsParticipant *fs_base_conference_new_participant (FsConference *conf, GError **error); -void fs_base_conference_error (GObject *signal_src, GObject *error_src, - FsError error_no, gchar *error_msg, - gchar *debug_msg, FsBaseConference *conf); +static void fs_base_conference_error (GObject *signal_src, + GObject *error_src, + FsError error_no, + gchar *error_msg, + FsBaseConference *conf); void _fs_base_conference_init_debug (void) @@ -151,30 +153,26 @@ fs_base_conference_new_session (FsConference *conf, return new_session; } -void -fs_base_conference_error (GObject *signal_src, GObject *error_src, - FsError error_no, gchar *error_msg, - gchar *debug_msg, FsBaseConference *conf) +static void +fs_base_conference_error (GObject *signal_src, + GObject *error_src, + FsError error_no, + gchar *error_msg, + FsBaseConference *conf) { GstMessage *gst_msg = NULL; GstStructure *error_struct = NULL; - if (debug_msg == NULL) - debug_msg = error_msg; - error_struct = gst_structure_new ("farsight-error", "src-object", G_TYPE_OBJECT, error_src, "error-no", FS_TYPE_ERROR, error_no, "error-msg", G_TYPE_STRING, error_msg, - "debug-msg", G_TYPE_STRING, debug_msg, NULL); gst_msg = gst_message_new_element (GST_OBJECT (conf), error_struct); if (!gst_element_post_message (GST_ELEMENT (conf), gst_msg)) - { GST_WARNING_OBJECT (conf, "Could not post error on bus"); - } } diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c index 696ca4af..109df01c 100644 --- a/gst-libs/gst/farsight/fs-session.c +++ b/gst-libs/gst/farsight/fs-session.c @@ -335,8 +335,7 @@ fs_session_class_init (FsSessionClass *klass) * @self: #FsSession that emitted the signal * @object: The #Gobject that emitted the signal * @error_no: The number of the error - * @error_msg: Error message to be displayed to user - * @debug_msg: Debugging error message + * @error_msg: Error message * * This signal is emitted in any error condition, it can be emitted on any * thread. Applications should listen to the GstBus for errors. @@ -348,9 +347,8 @@ fs_session_class_init (FsSessionClass *klass) 0, NULL, NULL, - _fs_marshal_VOID__OBJECT_ENUM_STRING_STRING, - G_TYPE_NONE, 4, G_TYPE_OBJECT, FS_TYPE_ERROR, G_TYPE_STRING, - G_TYPE_STRING); + _fs_marshal_VOID__OBJECT_ENUM_STRING, + G_TYPE_NONE, 3, G_TYPE_OBJECT, FS_TYPE_ERROR, G_TYPE_STRING); } static void @@ -401,7 +399,7 @@ fs_session_error_forward (GObject *signal_src, /* We just need to forward the error signal including a ref to the stream * object (signal_src) */ g_signal_emit (session, signals[ERROR_SIGNAL], 0, signal_src, error_no, - error_msg, NULL); + error_msg); } /** @@ -603,8 +601,7 @@ fs_session_set_codec_preferences (FsSession *session, * fs_session_emit_error: * @session: #FsSession on which to emit the error signal * @error_no: The number of the error of type #FsError - * @error_msg: Error message to be displayed to user - * @debug_msg: Debugging error message + * @error_msg: Error message * * This function emit the "error" signal on a #FsSession, it should only be * called by subclasses. @@ -612,11 +609,10 @@ fs_session_set_codec_preferences (FsSession *session, void fs_session_emit_error (FsSession *session, gint error_no, - const gchar *error_msg, - const gchar *debug_msg) + const gchar *error_msg) { g_signal_emit (session, signals[ERROR_SIGNAL], 0, session, error_no, - error_msg, debug_msg); + error_msg); } /** diff --git a/gst-libs/gst/farsight/fs-session.h b/gst-libs/gst/farsight/fs-session.h index af161267..88d57fe2 100644 --- a/gst-libs/gst/farsight/fs-session.h +++ b/gst-libs/gst/farsight/fs-session.h @@ -194,8 +194,7 @@ gchar **fs_session_list_transmitters (FsSession *session); void fs_session_emit_error (FsSession *session, gint error_no, - const gchar *error_msg, - const gchar *debug_msg); + const gchar *error_msg); GType fs_session_get_stream_transmitter_type (FsSession *session, const gchar *transmitter); diff --git a/gst-libs/gst/farsight/fs-transmitter.c b/gst-libs/gst/farsight/fs-transmitter.c index c1cdd06e..52859da9 100644 --- a/gst-libs/gst/farsight/fs-transmitter.c +++ b/gst-libs/gst/farsight/fs-transmitter.c @@ -180,7 +180,7 @@ fs_transmitter_class_init (FsTransmitterClass *klass) 0, NULL, NULL, - _fs_marshal_VOID__ENUM_STRING_STRING, + _fs_marshal_VOID__ENUM_STRING, G_TYPE_NONE, 2, FS_TYPE_ERROR, G_TYPE_STRING); /** diff --git a/gst/fsrawconference/fs-raw-session.c b/gst/fsrawconference/fs-raw-session.c index 658b9c0b..d2647bdc 100644 --- a/gst/fsrawconference/fs-raw-session.c +++ b/gst/fsrawconference/fs-raw-session.c @@ -920,12 +920,10 @@ _stream_remote_codecs_changed (FsRawStream *stream, GParamSpec *pspec, error: if (error != NULL) - fs_session_emit_error (FS_SESSION (self), error->code, error->message, - "Unable to change transform bin"); + fs_session_emit_error (FS_SESSION (self), error->code, error->message); else fs_session_emit_error (FS_SESSION (self), FS_ERROR_INTERNAL, - "Unable to change transform bin", - "Unknown error"); + "Unable to change transform bin"); if (conference != NULL) gst_object_unref (conference); @@ -1073,8 +1071,7 @@ fs_raw_session_update_direction (FsRawSession *self, if (!conference) { - fs_session_emit_error (FS_SESSION (self), error->code, error->message, - "Unable to add transmitter sink"); + fs_session_emit_error (FS_SESSION (self), error->code, error->message); g_clear_error (&error); return; } @@ -1105,8 +1102,7 @@ fs_raw_session_update_direction (FsRawSession *self, if (!_add_transmitter_sink (self, transmitter_sink, &error)) { gst_object_unref (transmitter_sink); - fs_session_emit_error (FS_SESSION (self), error->code, error->message, - "Unable to add transmitter sink"); + fs_session_emit_error (FS_SESSION (self), error->code, error->message); g_clear_error (&error); goto out; } diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c index fd29792d..6238a6fe 100644 --- a/gst/fsrtpconference/fs-rtp-session.c +++ b/gst/fsrtpconference/fs-rtp-session.c @@ -2166,7 +2166,7 @@ _transmitter_error ( { FsSession *session = FS_SESSION (user_data); - fs_session_emit_error (session, errorno, error_msg, NULL); + fs_session_emit_error (session, errorno, error_msg); } static GstElement * @@ -2754,7 +2754,7 @@ _substream_error (FsRtpSubStream *substream, { FsSession *session = FS_SESSION (user_data); - fs_session_emit_error (session, errorno, error_msg, debug_msg); + fs_session_emit_error (session, errorno, error_msg); } static void @@ -2881,14 +2881,10 @@ fs_rtp_session_new_recv_pad (FsRtpSession *session, GstPad *new_pad, if (substream == NULL) { - if (error && error->domain == FS_ERROR) - fs_session_emit_error (FS_SESSION (session), error->code, - "Could not create a substream for the new pad", error->message); - else - fs_session_emit_error (FS_SESSION (session), FS_ERROR_CONSTRUCTION, - "Could not create a substream for the new pad", - "No error details returned"); - + g_prefix_error (&error, "Could not create a substream for the new pad: "); + fs_session_emit_error (FS_SESSION (session), + error ? error->code : FS_ERROR_CONSTRUCTION, + error ? error->message : "No error details returned"); g_clear_error (&error); fs_rtp_session_has_disposed_exit (session); return; @@ -2958,9 +2954,12 @@ fs_rtp_session_new_recv_pad (FsRtpSession *session, GstPad *new_pad, if (stream) { if (!fs_rtp_stream_add_substream_unlock (stream, substream, &error)) + { + g_prefix_error (&error, + "Could not add the output ghostpad to the new substream: "); fs_session_emit_error (FS_SESSION (session), error->code, - "Could not add the output ghostpad to the new substream", error->message); + } g_clear_error (&error); } @@ -3486,8 +3485,7 @@ fs_rtp_session_remove_send_codec_bin (FsRtpSession *self, " succeed"); if (error_emit) fs_session_emit_error (FS_SESSION (self), FS_ERROR_INTERNAL, - "Could not stop the codec bin", - "Setting the codec bin to NULL did not succeed" ); + "Setting the codec bin to NULL did not succeed"); return FALSE; } @@ -3772,8 +3770,8 @@ _send_src_pad_blocked_callback (GstPad *pad, gboolean blocked, if (!ca) { - fs_session_emit_error (FS_SESSION (self), error->code, - "Could not select a new send codec", error->message); + g_prefix_error (&error, "Could not select a new send codec: "); + fs_session_emit_error (FS_SESSION (self), error->code, error->message); goto done_locked; } @@ -3814,8 +3812,9 @@ _send_src_pad_blocked_callback (GstPad *pad, gboolean blocked, if (!ca) { + g_prefix_error (&error, "Could not select a new send codec: "); fs_session_emit_error (FS_SESSION (self), error->code, - "Could not select a new send codec", error->message); + error->message); goto done_locked; } @@ -3827,8 +3826,9 @@ _send_src_pad_blocked_callback (GstPad *pad, gboolean blocked, if (!fs_rtp_session_add_send_codec_bin_unlock (self, ca, &other_codecs, &error)) { + g_prefix_error (&error, "Could not build a new send codec bin: "); fs_session_emit_error (FS_SESSION (self), error->code, - "Could not build a new send codec bin", error->message); + error->message); } changed = TRUE; @@ -3998,8 +3998,9 @@ fs_rtp_session_associate_free_substreams (FsRtpSession *session, { GST_ERROR ("Could not associate a substream with its stream : %s", error->message); + g_prefix_error (&error, + "Could not associate a substream with its stream: "); fs_session_emit_error (FS_SESSION (session), error->code, - "Could not associate a substream with its stream", error->message); } g_clear_error (&error); @@ -4118,10 +4119,13 @@ _substream_no_rtcp_timedout_cb (FsRtpSubStream *substream, first_stream = g_list_first (session->priv->streams)->data; g_object_ref (first_stream); if (!fs_rtp_stream_add_substream_unlock (first_stream, substream, &error)) + { + g_prefix_error (&error, + "Could not link the substream to a stream: "); fs_session_emit_error (FS_SESSION (session), error ? error->code : FS_ERROR_INTERNAL, - "Could not link the substream to a stream", error ? error->message : "No error message"); + } g_clear_error (&error); g_object_unref (first_stream); @@ -4626,8 +4630,9 @@ _discovery_pad_blocked_callback (GstPad *pad, gboolean blocked, { FS_RTP_SESSION_LOCK (session); fs_rtp_session_stop_codec_param_gathering_unlock (session); + g_prefix_error (&error, + "Error while discovering codec data, discovery cancelled: "); fs_session_emit_error (FS_SESSION (session), error->code, - "Error while discovering codec data, discovery cancelled", error->message); } diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c index 3d63a3fd..305a6985 100644 --- a/gst/fsrtpconference/fs-rtp-substream.c +++ b/gst/fsrtpconference/fs-rtp-substream.c @@ -1385,25 +1385,17 @@ _rtpbin_pad_blocked_callback (GstPad *pad, gboolean blocked, gpointer user_data) return; error: - { - if (substream->priv->stream) - { - g_prefix_error (&error, "Could not add the new recv codec bin for" - " ssrc %u and payload type %d to the state NULL", substream->ssrc, - substream->pt); - fs_stream_emit_error (FS_STREAM (substream->priv->stream), - FS_ERROR_CONSTRUCTION, error->message); - } - else - { - gchar *str = g_strdup_printf ("Could not add the new recv codec bin for" - " ssrc %u and payload type %d to the state NULL", substream->ssrc, - substream->pt); - fs_session_emit_error (FS_SESSION (substream->priv->session), - FS_ERROR_CONSTRUCTION, str, error->message); - g_free (str); - } - } + + g_prefix_error (&error, "Could not add the new recv codec bin for" + " ssrc %u and payload type %d to the state NULL", substream->ssrc, + substream->pt); + + if (substream->priv->stream) + fs_stream_emit_error (FS_STREAM (substream->priv->stream), + FS_ERROR_CONSTRUCTION, error->message); + else + fs_session_emit_error (FS_SESSION (substream->priv->session), + FS_ERROR_CONSTRUCTION, error->message); goto out; } diff --git a/python/pyfarsight.defs b/python/pyfarsight.defs index e4371f8e..7443a449 100644 --- a/python/pyfarsight.defs +++ b/python/pyfarsight.defs @@ -497,7 +497,6 @@ (parameters '("gint" "error_no") '("const-gchar*" "error_msg") - '("const-gchar*" "debug_msg") ) ) |