rtppayload: notify of first timestamp/seqnum

Notify of the first timestamp/seqnum pushed out by the payloader.

Fixes #612264
This commit is contained in:
Wim Taymans 2010-09-06 13:14:00 +02:00
parent 91ee8507ef
commit 9fd1c48267

View file

@ -46,6 +46,7 @@ struct _GstBaseRTPPayloadPrivate
gboolean ssrc_random; gboolean ssrc_random;
guint16 next_seqnum; guint16 next_seqnum;
gboolean perfect_rtptime; gboolean perfect_rtptime;
gint notified_first_timestamp;
gint64 prop_max_ptime; gint64 prop_max_ptime;
gint64 caps_max_ptime; gint64 caps_max_ptime;
@ -809,6 +810,12 @@ gst_basertppayload_prepare_push (GstBaseRTPPayload * payload,
GST_BUFFER_SIZE (GST_BUFFER (obj)), payload->seqnum, data.rtptime, GST_BUFFER_SIZE (GST_BUFFER (obj)), payload->seqnum, data.rtptime,
GST_TIME_ARGS (data.timestamp)); GST_TIME_ARGS (data.timestamp));
if (g_atomic_int_compare_and_exchange (&payload->priv->
notified_first_timestamp, 1, 0)) {
g_object_notify (G_OBJECT (payload), "timestamp");
g_object_notify (G_OBJECT (payload), "seqnum");
}
return GST_FLOW_OK; return GST_FLOW_OK;
/* ERRORS */ /* ERRORS */
@ -1023,6 +1030,7 @@ gst_basertppayload_change_state (GstElement * element,
else else
basertppayload->ts_base = basertppayload->ts_offset; basertppayload->ts_base = basertppayload->ts_offset;
basertppayload->timestamp = basertppayload->ts_base; basertppayload->timestamp = basertppayload->ts_base;
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
break; break;
default: default:
break; break;
@ -1031,6 +1039,9 @@ gst_basertppayload_change_state (GstElement * element,
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
break;
case GST_STATE_CHANGE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
default: default: