2007-04-25 Wim Taymans <wim@fluendo.com>
+ reviewed by: <delete if not using a buddy>
+
+ * 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.
+
+2007-04-25 Wim Taymans <wim@fluendo.com>
+
* gst/rtpmanager/gstrtpjitterbuffer.c:
(gst_rtp_jitter_buffer_change_state):
Report NO_PREROLL when going to PAUSED.
LAST_SIGNAL
};
+#define DEFAULT_LATENCY_MS 200
+
enum
{
- PROP_0
+ PROP_0,
+ PROP_LATENCY
};
/* helper objects */
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);
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
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;
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;
enum
{
- ARG_0,
- ARG_LATENCY,
- ARG_DROP_ON_LATENCY
+ PROP_0,
+ PROP_LATENCY,
+ PROP_DROP_ON_LATENCY
};
struct _GstRTPJitterBufferPrivate
/* clock rate and rtp timestamp offset */
gint32 clock_rate;
- guint64 clock_base;
+ gint64 clock_base;
/* when we are shutting down */
GstFlowReturn srcresult;
gobject_class->set_property = gst_rtp_jitter_buffer_set_property;
gobject_class->get_property = gst_rtp_jitter_buffer_get_property;
- g_object_class_install_property (gobject_class, ARG_LATENCY,
+ 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));
- g_object_class_install_property (gobject_class, ARG_DROP_ON_LATENCY,
+ g_object_class_install_property (gobject_class, PROP_DROP_ON_LATENCY,
g_param_spec_boolean ("drop_on_latency",
"Drop buffers when maximum latency is reached",
"Tells the jitterbuffer to never exceed the given latency in size",
value = gst_structure_get_value (caps_struct, "clock-base");
if (value && G_VALUE_HOLDS_UINT (value)) {
priv->clock_base = g_value_get_uint (value);
- GST_DEBUG_OBJECT (jitterbuffer, "got clock-base %d", priv->clock_base);
+ GST_DEBUG_OBJECT (jitterbuffer, "got clock-base %" G_GINT64_FORMAT,
+ priv->clock_base);
} else
priv->clock_base = -1;
* of the currently popped packet */
rtp_time = gst_rtp_buffer_get_timestamp (outbuf);
- GST_DEBUG_OBJECT (jitterbuffer, "rtp_time %u, base %u", rtp_time,
- priv->clock_base);
+ GST_DEBUG_OBJECT (jitterbuffer, "rtp_time %u, base %" G_GINT64_FORMAT,
+ rtp_time, priv->clock_base);
/* if no clock_base was given, take first ts as base */
if (priv->clock_base == -1)
/* bring timestamp to gst time */
timestamp = gst_util_uint64_scale (GST_SECOND, rtp_time, priv->clock_rate);
- GST_DEBUG_OBJECT (jitterbuffer, "timestamp %" GST_TIME_FORMAT,
- GST_TIME_ARGS (timestamp));
+ GST_DEBUG_OBJECT (jitterbuffer, "rtptime %u, timestamp %" GST_TIME_FORMAT,
+ rtp_time, GST_TIME_ARGS (timestamp));
/* bring to running time */
running_time = gst_segment_to_running_time (&priv->segment, GST_FORMAT_TIME,
GstRTPJitterBuffer *jitterbuffer = GST_RTP_JITTER_BUFFER (object);
switch (prop_id) {
- case ARG_LATENCY:
+ case PROP_LATENCY:
{
guint new_latency, old_latency;
}
break;
}
- case ARG_DROP_ON_LATENCY:
+ case PROP_DROP_ON_LATENCY:
{
jitterbuffer->priv->drop_on_latency = g_value_get_boolean (value);
break;
GstRTPJitterBuffer *jitterbuffer = GST_RTP_JITTER_BUFFER (object);
switch (prop_id) {
- case ARG_LATENCY:
+ case PROP_LATENCY:
g_value_set_uint (value, jitterbuffer->priv->latency_ms);
break;
- case ARG_DROP_ON_LATENCY:
+ case PROP_DROP_ON_LATENCY:
g_value_set_boolean (value, jitterbuffer->priv->drop_on_latency);
break;
default: