rtpbasepayload: Let caps event also configure seqnum-offset

Previously the sequence number kept track of by GstRTPBasePayload would
only be set when going from READY to PAUSED state. This meant that a
downstream element that attempted to configure a basepayloader by
setting seqnum-offset e.g. in its sinkpad's caps template would have
trouble configuring the basepayloader. The reason was that the caps
event which arrives with the desired value for seqnum-offset did not
arrive at the basepayloader until caps negotiation took place,
significantly later than the transition from READY to PAUSED.

The result after this patch is that the default value for the
seqnum-offset property, or later set values for this property, will take
effect when going from READY to PAUSED like before. In addition the an
arriving caps event will also affect the basepayloaders configured
sequence number as the event arrives.
This commit is contained in:
Sebastian Rasmussen 2014-01-31 00:19:16 +01:00 committed by Wim Taymans
parent 638d069c91
commit d6dc1b6c46

View file

@ -823,6 +823,9 @@ gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload,
payload->seqnum_base = g_value_get_uint (value);
GST_LOG_OBJECT (payload, "using peer seqnum-offset %u",
payload->seqnum_base);
payload->priv->next_seqnum = payload->seqnum_base;
payload->seqnum = payload->seqnum_base;
payload->priv->seqnum_offset_random = FALSE;
} else {
/* FIXME, fixate_nearest_uint would be even better */
gst_structure_set (s, "seqnum-offset", G_TYPE_UINT, payload->seqnum_base,