aggregator: add method to update srcpad segment

This commit is contained in:
Mathieu Duponchelle 2019-12-05 13:44:33 +01:00
parent 020eb2c346
commit 88999d3b0e
2 changed files with 26 additions and 0 deletions

View file

@ -3460,3 +3460,26 @@ gst_aggregator_simple_get_next_time (GstAggregator * self)
return next_time;
}
/**
* gst_aggregator_update_segment:
*
* Subclasses should use this to update the segment on their
* source pad, instead of directly pushing new segment events
* downstream.
*
* Since: 1.18
*/
void
gst_aggregator_update_segment (GstAggregator * self, GstSegment * segment)
{
g_return_if_fail (GST_IS_AGGREGATOR (self));
g_return_if_fail (segment != NULL);
GST_INFO_OBJECT (self, "Updating srcpad segment: %" GST_PTR_FORMAT, segment);
GST_OBJECT_LOCK (self);
GST_AGGREGATOR_PAD (self->srcpad)->segment = *segment;
self->priv->send_segment = TRUE;
GST_OBJECT_UNLOCK (self);
}

View file

@ -385,6 +385,9 @@ void gst_aggregator_get_allocator (GstAggregator
GST_BASE_API
GstClockTime gst_aggregator_simple_get_next_time (GstAggregator * self);
GST_BASE_API
void gst_aggregator_update_segment (GstAggregator * self,
GstSegment * segment);
G_END_DECLS