[farsight2/master] Always emit the codec-changed signal from the substream

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:21:48 PST 2008


---
 gst/fsrtpconference/fs-rtp-stream.c    |   25 ++++++-------------------
 gst/fsrtpconference/fs-rtp-substream.c |    4 ++--
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 9467ae0..1bde8ba 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -110,10 +110,6 @@ static gboolean fs_rtp_stream_select_candidate_pair (FsStream *stream,
 static gboolean fs_rtp_stream_set_remote_codecs (FsStream *stream,
                                                  GList *remote_codecs,
                                                  GError **error);
-static void
-fs_rtp_stream_maybe_emit_codecs_changed (FsRtpStream *stream,
-    FsRtpSubStream *substream);
-
 static void _local_candidates_prepared (
     FsStreamTransmitter *stream_transmitter,
     gpointer user_data);
@@ -132,6 +128,8 @@ static void _transmitter_error (
     gchar *error_msg,
     gchar *debug_msg,
     gpointer user_data);
+static void _substream_codec_changed (FsRtpSubStream *substream,
+    FsRtpStream *stream);
 
 
 
@@ -632,15 +630,6 @@ _substream_src_pad_added (FsRtpSubStream *substream, GstPad *pad,
 }
 
 static void
-_substream_codec_changed (FsRtpSubStream *substream,
-    gpointer user_data)
-{
-  FsRtpStream *stream = FS_RTP_STREAM (user_data);
-
-  fs_rtp_stream_maybe_emit_codecs_changed (stream, substream);
-}
-
-static void
 _substream_error (FsRtpSubStream *substream,
     gint errorno,
     gchar *error_msg,
@@ -690,8 +679,6 @@ fs_rtp_stream_add_substream (FsRtpStream *stream,
   if (codec) {
     ret = fs_rtp_sub_stream_add_output_ghostpad_locked (substream, error);
     fs_codec_destroy (codec);
-
-    fs_rtp_stream_maybe_emit_codecs_changed (stream, substream);
   }
 
   FS_RTP_SESSION_UNLOCK (stream->priv->session);
@@ -758,9 +745,9 @@ _idle_emit_recv_codecs_changed (gpointer data)
 }
 
 /**
- * fs_stream_maybe_emit_codecs_changed:
- * @stream: a #FsRtpStream
+ *  _substream_codec_changed
  * @substream: The #FsRtpSubStream that may have a new receive codec
+ * @stream: a #FsRtpStream
  *
  * This function checks if the specified substream introduces not a new codec
  * not present in another substream and if it does, it schedules an idle task
@@ -768,8 +755,8 @@ _idle_emit_recv_codecs_changed (gpointer data)
  */
 
 static void
-fs_rtp_stream_maybe_emit_codecs_changed (FsRtpStream *stream,
-    FsRtpSubStream *substream)
+_substream_codec_changed (FsRtpSubStream *substream,
+    FsRtpStream *stream)
 {
   GList *substream_item = NULL;
   FsCodec *codec = NULL;
diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c
index d29665d..8c6ee5c 100644
--- a/gst/fsrtpconference/fs-rtp-substream.c
+++ b/gst/fsrtpconference/fs-rtp-substream.c
@@ -672,8 +672,6 @@ fs_rtp_sub_stream_add_codecbin_locked (FsRtpSubStream *substream,
     if (!substream->priv->output_ghostpad)
       ret =  fs_rtp_sub_stream_add_output_ghostpad_locked (substream, error);
 
-    g_signal_emit (substream, signals[CODEC_CHANGED], 0);
-
     return ret;
   }
   else
@@ -838,6 +836,8 @@ fs_rtp_sub_stream_add_output_ghostpad_locked (FsRtpSubStream *substream,
   g_signal_emit (substream, signals[SRC_PAD_ADDED], 0,
                  ghostpad, substream->priv->codec);
 
+  g_signal_emit (substream, signals[CODEC_CHANGED], 0);
+
   if (substream->priv->receiving)
     g_object_set (substream->priv->valve, "drop", FALSE, NULL);
 
-- 
1.5.6.5




More information about the farsight-commits mailing list