diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-09-15 18:48:03 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-11 02:30:30 +0100 |
commit | 0441ef80b0fbe22b0a6270958e4ad2058dc0d423 (patch) | |
tree | 2f6f07f9dec07a4da704487e1b8bcf9f0123e2af /gst/rtpmanager/gstrtpsession.c | |
parent | a93348cc6da0eff1a30fd08b2ec17962079a38a6 (diff) |
gst/rtpmanager/gstrtpbin.c: Also set NTP base time on new sessions.
Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (create_session):
Also set NTP base time on new sessions.
* gst/rtpmanager/gstrtpjitterbuffer.c:
(gst_rtp_jitter_buffer_loop), (gst_rtp_jitter_buffer_query),
(gst_rtp_jitter_buffer_set_property),
(gst_rtp_jitter_buffer_get_property):
Use the right lock to protect our variables.
Fix some comment.
* gst/rtpmanager/gstrtpsession.c:
(gst_rtp_session_getcaps_send_rtp),
(gst_rtp_session_chain_send_rtp), (create_send_rtp_sink):
Implement getcaps on the sender sinkpad so that payloaders can negotiate
the right SSRC.
Diffstat (limited to 'gst/rtpmanager/gstrtpsession.c')
-rw-r--r-- | gst/rtpmanager/gstrtpsession.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 44f6535a..6d4cf8b0 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1226,6 +1226,33 @@ gst_rtp_session_event_send_rtp_sink (GstPad * pad, GstEvent * event) return ret; } +static GstCaps * +gst_rtp_session_getcaps_send_rtp (GstPad * pad) +{ + GstRtpSession *rtpsession; + GstRtpSessionPrivate *priv; + GstCaps *result; + GstStructure *s1, *s2; + + rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad)); + priv = rtpsession->priv; + + /* we can basically accept anything but we prefer to receive packets with our + * internal SSRC so that we don't have to patch it. Create a structure with + * the SSRC and another one without. */ + s1 = gst_structure_new ("application/x-rtp", + "ssrc", G_TYPE_UINT, priv->session->source->ssrc, NULL); + s2 = gst_structure_new ("application/x-rtp", NULL); + + result = gst_caps_new_full (s1, s2, NULL); + + GST_DEBUG_OBJECT (rtpsession, "getting caps %" GST_PTR_FORMAT, result); + + gst_object_unref (rtpsession); + + return result; +} + /* Recieve an RTP packet to be send to the receivers, send to RTP session * manager and forward to send_rtp_src. */ @@ -1252,8 +1279,11 @@ gst_rtp_session_chain_send_rtp (GstPad * pad, GstBuffer * buffer) timestamp); /* convert to NTP time by adding the NTP base */ ntpnstime += priv->ntpnsbase; - } else + } else { + /* no timestamp, we could take the current running_time and convert it to + * NTP time. */ ntpnstime = -1; + } ret = rtp_session_send_rtp (priv->session, buffer, ntpnstime); @@ -1341,6 +1371,8 @@ create_send_rtp_sink (GstRtpSession * rtpsession) "send_rtp_sink"); gst_pad_set_chain_function (rtpsession->send_rtp_sink, gst_rtp_session_chain_send_rtp); + gst_pad_set_getcaps_function (rtpsession->send_rtp_sink, + gst_rtp_session_getcaps_send_rtp); gst_pad_set_event_function (rtpsession->send_rtp_sink, gst_rtp_session_event_send_rtp_sink); gst_pad_set_internal_link_function (rtpsession->send_rtp_sink, |