gst/rtsp/gstrtpdec.*: Add dummy latency property to be backwards compat with rtpbin.
Original commit message from CVS:
* gst/rtsp/gstrtpdec.c: (gst_rtp_dec_class_init),
(gst_rtp_dec_init), (gst_rtp_dec_set_property),
(gst_rtp_dec_get_property):
* gst/rtsp/gstrtpdec.h:
Add dummy latency property to be backwards compat with rtpbin.
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_class_init),
(gst_rtspsrc_set_property), (gst_rtspsrc_get_property),
(gst_rtspsrc_stream_configure_transport),
(gst_rtspsrc_parse_rtpinfo):
* gst/rtsp/gstrtspsrc.h:
Add latency property and configure in the session manager.
Don't set invalid clock-base and seqnum-base on caps, some servers
sometimes don't send them.
diff --git a/gst/rtsp/gstrtpdec.c b/gst/rtsp/gstrtpdec.c
index a133999..3352b05 100644
--- a/gst/rtsp/gstrtpdec.c
+++ b/gst/rtsp/gstrtpdec.c
@@ -80,9 +80,12 @@
LAST_SIGNAL
};
+#define DEFAULT_LATENCY_MS 200
+
enum
{
PROP_0,
+ PROP_LATENCY
};
static GstStaticPadTemplate gst_rtp_dec_recv_rtp_sink_template =
@@ -266,6 +269,11 @@
gobject_class->set_property = gst_rtp_dec_set_property;
gobject_class->get_property = gst_rtp_dec_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));
+
/**
* GstRTPDec::request-pt-map:
* @rtpdec: the object which received the signal
@@ -294,6 +302,7 @@
gst_rtp_dec_init (GstRTPDec * rtpdec, GstRTPDecClass * klass)
{
rtpdec->provided_clock = gst_system_clock_obtain ();
+ rtpdec->latency = DEFAULT_LATENCY_MS;
}
static void
@@ -584,7 +593,11 @@
src = GST_RTP_DEC (object);
switch (prop_id) {
+ case PROP_LATENCY:
+ src->latency = g_value_get_uint (value);
+ break;
default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -598,7 +611,11 @@
src = GST_RTP_DEC (object);
switch (prop_id) {
+ case PROP_LATENCY:
+ g_value_set_uint (value, src->latency);
+ break;
default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}