AM_PROG_LIBTOOL
dnl *** required versions of GStreamer stuff ***
-GST_REQ=0.10.24
+GST_REQ=0.10.24.1
GSTPB_REQ=0.10.24
dnl *** autotools stuff ****
G_OBJECT_CLASS (parent_class)->finalize (object);
}
-typedef struct
-{
- GstIterator parent;
-
- GstRtpJitterBuffer *jitterbuffer;
- GstPad *pad;
- gboolean start;
-} GstRtpJitterBufferIterator;
-
-static void
-_iterate_free (GstIterator * it)
-{
- GstRtpJitterBufferIterator *jit = (GstRtpJitterBufferIterator *) it;
-
- g_object_unref (jit->jitterbuffer);
- g_object_unref (jit->pad);
-
- g_free (it);
-}
-
-static GstIteratorResult
-_iterate_next (GstIterator * it, gpointer * result)
-{
- GstRtpJitterBufferIterator *jit = (GstRtpJitterBufferIterator *) it;
- GstPad *res = NULL;
- GstRtpJitterBufferPrivate *priv;
-
- priv = jit->jitterbuffer->priv;
-
- if (!jit->start) {
- /* go out */
- } else if (jit->pad == priv->sinkpad) {
- res = priv->srcpad;
- } else if (jit->pad == priv->srcpad) {
- res = priv->sinkpad;
- } else if (jit->pad == priv->rtcpsinkpad) {
- res = NULL;
- }
-
- *result = res;
-
- return res ? GST_ITERATOR_OK : GST_ITERATOR_DONE;
-}
-
-static GstIteratorItem
-_iterate_item (GstIterator * it, gpointer item)
-{
- GstPad *pad = (GstPad *) item;
- gst_object_ref (pad);
-
- return GST_ITERATOR_ITEM_PASS;
-}
-
-static void
-_iterate_resync (GstIterator * it)
-{
- GstRtpJitterBufferIterator *jit = (GstRtpJitterBufferIterator *) it;
-
- jit->start = TRUE;
-}
-
static GstIterator *
gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad)
{
GstRtpJitterBuffer *jitterbuffer;
- GstRtpJitterBufferIterator *it;
+ GstPad *otherpad = NULL;
+ GstIterator *it;
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad));
- it = (GstRtpJitterBufferIterator *)
- gst_iterator_new (sizeof (GstRtpJitterBufferIterator),
- GST_TYPE_PAD,
- GST_OBJECT_CAST (jitterbuffer)->lock,
- &GST_ELEMENT_CAST (jitterbuffer)->pads_cookie,
- _iterate_next, _iterate_item, _iterate_resync, _iterate_free);
- it->start = TRUE;
- it->jitterbuffer = gst_object_ref (jitterbuffer);
- it->pad = gst_object_ref (pad);
+ if (pad == jitterbuffer->priv->sinkpad) {
+ otherpad = jitterbuffer->priv->srcpad;
+ } else if (pad == jitterbuffer->priv->srcpad) {
+ otherpad = jitterbuffer->priv->sinkpad;
+ } else if (pad == jitterbuffer->priv->rtcpsinkpad) {
+ otherpad = NULL;
+ }
+
+ it = gst_iterator_new_single (GST_TYPE_PAD, otherpad,
+ (GstCopyFunction) gst_object_ref, (GFreeFunc) gst_object_unref);
gst_object_unref (jitterbuffer);
- return (GstIterator *) it;
+ return it;
}
static GstPad *
}
-typedef struct
-{
- GstIterator parent;
-
- GstRtpSession *rtpsession;
- GstPad *pad;
- gboolean start;
-} GstRtpSessionIterator;
-
-static void
-_iterate_free (GstIterator * it)
-{
- GstRtpSessionIterator *sit = (GstRtpSessionIterator *) it;
-
- g_object_unref (sit->rtpsession);
- g_object_unref (sit->pad);
-
- g_free (it);
-}
-
-static GstIteratorResult
-_iterate_next (GstIterator * it, gpointer * result)
-{
- GstRtpSessionIterator *sit = (GstRtpSessionIterator *) it;
- GstPad *res = NULL;
-
- if (!sit->start) {
- /* go out */
- } else if (sit->pad == sit->rtpsession->recv_rtp_src) {
- res = sit->rtpsession->recv_rtp_sink;
- } else if (sit->pad == sit->rtpsession->recv_rtp_sink) {
- res = sit->rtpsession->recv_rtp_src;
- } else if (sit->pad == sit->rtpsession->send_rtp_src) {
- res = sit->rtpsession->send_rtp_sink;
- } else if (sit->pad == sit->rtpsession->send_rtp_sink) {
- res = sit->rtpsession->send_rtp_src;
- }
-
- *result = res;
-
- return res ? GST_ITERATOR_OK : GST_ITERATOR_DONE;
-}
-
-static GstIteratorItem
-_iterate_item (GstIterator * it, gpointer item)
-{
- GstPad *pad = (GstPad *) item;
- gst_object_ref (pad);
-
- return GST_ITERATOR_ITEM_PASS;
-}
-
-static void
-_iterate_resync (GstIterator * it)
-{
- GstRtpSessionIterator *sit = (GstRtpSessionIterator *) it;
-
- sit->start = TRUE;
-}
-
static GstIterator *
gst_rtp_session_iterate_internal_links (GstPad * pad)
{
GstRtpSession *rtpsession;
- GstRtpSessionIterator *it;
+ GstPad *otherpad = NULL;
+ GstIterator *it;
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
- it = (GstRtpSessionIterator *)
- gst_iterator_new (sizeof (GstRtpSessionIterator),
- GST_TYPE_PAD,
- rtpsession->priv->lock,
- &GST_ELEMENT_CAST (rtpsession)->pads_cookie,
- _iterate_next, _iterate_item, _iterate_resync, _iterate_free);
- it->start = TRUE;
- it->rtpsession = gst_object_ref (rtpsession);
- it->pad = gst_object_ref (pad);
+ if (pad == rtpsession->recv_rtp_src) {
+ otherpad = rtpsession->recv_rtp_sink;
+ } else if (pad == rtpsession->recv_rtp_sink) {
+ otherpad = rtpsession->recv_rtp_src;
+ } else if (pad == rtpsession->send_rtp_src) {
+ otherpad = rtpsession->send_rtp_sink;
+ } else if (pad == rtpsession->send_rtp_sink) {
+ otherpad = rtpsession->send_rtp_src;
+ }
+
+ it = gst_iterator_new_single (GST_TYPE_PAD, otherpad,
+ (GstCopyFunction) gst_object_ref, (GFreeFunc) gst_object_unref);
gst_object_unref (rtpsession);
- return (GstIterator *) it;
+ return it;
}
static gboolean
return res;
}
-typedef struct
+static GstIterator *
+gst_rtp_ssrc_demux_iterate_internal_links (GstPad * pad)
{
- GstIterator parent;
-
GstRtpSsrcDemux *demux;
- GstPad *pad;
+ GstPad *otherpad = NULL;
+ GstIterator *it;
GSList *current;
-} GstRtpSsrcDemuxIterator;
-
-static void
-_iterate_free (GstIterator * it)
-{
- GstRtpSsrcDemuxIterator *dit = (GstRtpSsrcDemuxIterator *) it;
-
- g_object_unref (dit->demux);
- g_object_unref (dit->pad);
-
- g_free (it);
-}
-static GstIteratorResult
-_iterate_next (GstIterator * it, gpointer * result)
-{
- GstRtpSsrcDemuxIterator *dit = (GstRtpSsrcDemuxIterator *) it;
- GSList *current;
- GstPad *res = NULL;
+ demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad));
- for (current = dit->current; current; current = g_slist_next (current)) {
+ GST_PAD_LOCK (demux);
+ for (current = demux->srcpads; current; current = g_slist_next (current)) {
GstRtpSsrcDemuxPad *dpad = (GstRtpSsrcDemuxPad *) current->data;
- if (dit->pad == dit->demux->rtp_sink) {
- res = dpad->rtp_pad;
+ if (pad == demux->rtp_sink) {
+ otherpad = dpad->rtp_pad;
break;
- } else if (dit->pad == dit->demux->rtcp_sink) {
- res = dpad->rtcp_pad;
- } else if (dit->pad == dpad->rtp_pad) {
- res = dit->demux->rtp_sink;
+ } else if (pad == demux->rtcp_sink) {
+ otherpad = dpad->rtcp_pad;
+ } else if (pad == dpad->rtp_pad) {
+ otherpad = demux->rtp_sink;
break;
- } else if (dit->pad == dpad->rtcp_pad) {
- res = dit->demux->rtcp_sink;
+ } else if (pad == dpad->rtcp_pad) {
+ otherpad = demux->rtcp_sink;
break;
}
}
-
- *result = res;
-
- dit->current = current;
-
- return res ? GST_ITERATOR_OK : GST_ITERATOR_DONE;
-}
-
-static GstIteratorItem
-_iterate_item (GstIterator * it, gpointer item)
-{
- GstPad *pad = (GstPad *) item;
- gst_object_ref (pad);
-
- return GST_ITERATOR_ITEM_PASS;
-}
-
-static void
-_iterate_resync (GstIterator * it)
-{
- GstRtpSsrcDemuxIterator *dit = (GstRtpSsrcDemuxIterator *) it;
-
- dit->current = dit->demux->srcpads;
-}
-
-static GstIterator *
-gst_rtp_ssrc_demux_iterate_internal_links (GstPad * pad)
-{
- GstRtpSsrcDemux *demux;
- GstRtpSsrcDemuxIterator *it;
-
- demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad));
-
- it = (GstRtpSsrcDemuxIterator *)
- gst_iterator_new (sizeof (GstRtpSsrcDemuxIterator),
- GST_TYPE_PAD,
- demux->padlock,
- &GST_ELEMENT_CAST (demux)->pads_cookie,
- _iterate_next, _iterate_item, _iterate_resync, _iterate_free);
-
- it->demux = gst_object_ref (demux);
- it->pad = gst_object_ref (pad);
- it->current = demux->srcpads;
+ it = gst_iterator_new_single (GST_TYPE_PAD, otherpad,
+ (GstCopyFunction) gst_object_ref, (GFreeFunc) gst_object_unref);
+ GST_PAD_UNLOCK (demux);
gst_object_unref (demux);
- return (GstIterator *) it;
+ return it;
}
static gboolean
/* no interval when we have less than 50 members */
if (stats->active_sources < 50)
return 0;
-
+
rtcp_min_time = (stats->min_interval) / 2.0;
/* Dedicate a fraction of the RTCP bandwidth to senders unless