From bfb8b8fd8da14aa00348a8ba1d8cd11fc29aba1b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 25 Apr 2007 15:48:46 +0000 Subject: gst/rtpmanager/gstrtpbin.*: Make default jitterbuffer latency configurable. Original commit message from CVS: reviewed by: * gst/rtpmanager/gstrtpbin.c: (create_stream), (gst_rtp_bin_class_init), (gst_rtp_bin_set_property), (gst_rtp_bin_get_property): * gst/rtpmanager/gstrtpbin.h: Make default jitterbuffer latency configurable. * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_rtp_jitter_buffer_class_init), (gst_jitter_buffer_sink_parse_caps), (gst_rtp_jitter_buffer_loop), (gst_rtp_jitter_buffer_set_property), (gst_rtp_jitter_buffer_get_property): Debuging cleanups. --- gst/rtpmanager/gstrtpbin.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gst/rtpmanager/gstrtpbin.c') diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index 215dbc73..eb827392 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -116,9 +116,12 @@ enum LAST_SIGNAL }; +#define DEFAULT_LATENCY_MS 200 + enum { - PROP_0 + PROP_0, + PROP_LATENCY }; /* helper objects */ @@ -357,6 +360,9 @@ create_stream (GstRTPBinSession * session, guint32 ssrc) g_signal_connect (buffer, "request-pt-map", (GCallback) pt_map_requested, session); + /* configure latency */ + g_object_set (buffer, "latency", session->bin->latency, NULL); + gst_bin_add (GST_BIN_CAST (session->bin), buffer); gst_element_set_state (buffer, GST_STATE_PLAYING); gst_bin_add (GST_BIN_CAST (session->bin), demux); @@ -448,6 +454,11 @@ gst_rtp_bin_class_init (GstRTPBinClass * klass) gobject_class->set_property = gst_rtp_bin_set_property; gobject_class->get_property = gst_rtp_bin_get_property; + g_object_class_install_property (gobject_class, PROP_LATENCY, + g_param_spec_uint ("latency", "Buffer latency in ms", + "Amount of ms to buffer", 0, G_MAXUINT, DEFAULT_LATENCY_MS, + G_PARAM_READWRITE)); + /** * GstRTPBin::request-pt-map: * @rtpbin: the object which received the signal @@ -501,6 +512,9 @@ gst_rtp_bin_set_property (GObject * object, guint prop_id, rtpbin = GST_RTP_BIN (object); switch (prop_id) { + case PROP_LATENCY: + rtpbin->latency = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -516,6 +530,9 @@ gst_rtp_bin_get_property (GObject * object, guint prop_id, rtpbin = GST_RTP_BIN (object); switch (prop_id) { + case PROP_LATENCY: + g_value_set_uint (value, rtpbin->latency); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; -- cgit v1.2.1