On Fri, Aug 1, 2008 at 4:05 PM, Michael Jerris <[EMAIL PROTECTED]> wrote:
> Look at the i_state callback.

Hi,
that was only the first step, what I couldn't understand was all the GST part.

After diving into the libgstreamer metaphysics:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html

I'm finally starting to figure out the big scheme of things.

I'm reporting it (a probably partly wrong) description of it, both for
the archive and for fostering comments.

ssc_media_activate() in ssc_media.c is called by the ssc_invite()
method, and this call the activate method of the media subsystem
object.

Looking at the gst media subsystem as defined in ssc_media_gst.[hc],
the activate method corresponds to the priv_activate_gst callback().
What it does is to fill the information relative to the local and
remote SDP, then it calls priv_setup_rtpelements().

This function bind the application to the local UDP port for receiving
(farsight_netsocket_bind_udp_port()), create the netsocket object and
register on it the
signal handler "priv_cb_ready", which is called when a "ready" signal
is delivered to the netsocket object:
g_signal_connect (G_OBJECT (netsocket), "ready",
                          G_CALLBACK (priv_cb_ready), self)

For what regards the priv_cb_ready, this creates multimedia pipeline
which works like this:
RX: udp_source -> rtp_depayloader -> decoder -> audio_sink
TX: alsa_source -> encoder -> rtp_payloader -> udp_sink

calls the callback functions:
  priv_update_rx_elements(self);
  priv_update_tx_elements(self);

and finally sets the state of the pipeline to GST_STATE_PLAYING.

The priv_update_?x_elements() functions take the SDP from the context
and set it in the media elements, in the case of
priv_update_tx_elements if the SDP isn't set
(as when the first invite is sent, we need to await for the response
SDP before to be able to send media), I think the transmitting
elements stay inactive.

Finally when the respone to the invite arrives, ssc_sip.c:ssc_i_state
will call the set methods on the media subsystem object:
  if (l_sdp) {
    g_return_if_fail(answer_sent || offer_sent);
    g_object_set(G_OBJECT(ssc->ssc_media), "localsdp", l_sdp, NULL);
    /* printf("%s: local SDP updated:\n%s\n\n", ssc->ssc_name, l_sdp); */
  }

  if (r_sdp) {
    g_return_if_fail(answer_recv || offer_recv);
    g_object_set(G_OBJECT(ssc->ssc_media), "remotesdp", r_sdp, NULL);
    /* printf("%s: remote SDP updated:\n%s\n\n", ssc->ssc_name, r_sdp); */
  }

ssc_media.c:ssc_media_set_property () is called, which call
ssc_media_refresh(self);

In the case of ssc_media_gst() such method corresponds to the priv_refresh_gst:

static int priv_refresh_gst(SscMedia *parent)
{
  SscMediaGst *self = SSC_MEDIA_GST (parent);
  int res = 0;

  /* XXX: no RX hot updates supported yet */
  priv_update_tx_elements(self);

  return res;
}

which simply update the transmitting elements, setting the target RTP
destination and likely actually activating the trasmitting elements.

Regards.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to