diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-08-07 09:30:55 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-08-07 19:15:34 +0300 |
commit | 84385bdd860885f5894f01b4d41ddd3b8490320d (patch) | |
tree | e89c89de2a4bdc6df5a7afe26e0335be798c93b6 /libs | |
parent | e243e152f06d376c429c40b017e3e1e13bc09af6 (diff) | |
download | gstreamer-84385bdd860885f5894f01b4d41ddd3b8490320d.tar.gz |
aggregator: Add optional GstStructure info parameter to "samples-selected" signal
Subclasses can use this to provide more information, for example
audioaggregator could provide the offset into the output buffer where
the next data is going to be filled.
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/805
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/590>
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstaggregator.c | 12 | ||||
-rw-r--r-- | libs/gst/base/gstaggregator.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index d7a6e3629a..7f99985ccb 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -2739,6 +2739,7 @@ gst_aggregator_class_init (GstAggregatorClass * klass) * @pts: The presentation timestamp of the next output buffer * @dts: The decoding timestamp of the next output buffer * @duration: The duration of the next output buffer + * @info: (nullable): a #GstStructure containing additional information * * Signals that the #GstAggregator subclass has selected the next set * of input samples it will aggregate. Handlers may call @@ -2748,9 +2749,10 @@ gst_aggregator_class_init (GstAggregatorClass * klass) */ gst_aggregator_signals[SIGNAL_SAMPLES_SELECTED] = g_signal_new ("samples-selected", G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE, 4, + G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE, 5, GST_TYPE_SEGMENT | G_SIGNAL_TYPE_STATIC_SCOPE, GST_TYPE_CLOCK_TIME, - GST_TYPE_CLOCK_TIME, GST_TYPE_CLOCK_TIME); + GST_TYPE_CLOCK_TIME, GST_TYPE_CLOCK_TIME, + GST_TYPE_STRUCTURE | G_SIGNAL_TYPE_STATIC_SCOPE); } static inline gpointer @@ -3615,6 +3617,7 @@ gst_aggregator_update_segment (GstAggregator * self, const GstSegment * segment) * @pts: The presentation timestamp of the next output buffer * @dts: The decoding timestamp of the next output buffer * @duration: The duration of the next output buffer + * @info: (nullable): a #GstStructure containing additional information * * Subclasses should call this when they have prepared the * buffers they will aggregate for each of their sink pads, but @@ -3629,13 +3632,14 @@ gst_aggregator_update_segment (GstAggregator * self, const GstSegment * segment) */ void gst_aggregator_selected_samples (GstAggregator * self, - GstClockTime pts, GstClockTime dts, GstClockTime duration) + GstClockTime pts, GstClockTime dts, GstClockTime duration, + GstStructure * info) { g_return_if_fail (GST_IS_AGGREGATOR (self)); if (self->priv->emit_signals) { g_signal_emit (self, gst_aggregator_signals[SIGNAL_SAMPLES_SELECTED], 0, - &GST_AGGREGATOR_PAD (self->srcpad)->segment, pts, dts, duration); + &GST_AGGREGATOR_PAD (self->srcpad)->segment, pts, dts, duration, info); } self->priv->selected_samples_called_or_warned = TRUE; diff --git a/libs/gst/base/gstaggregator.h b/libs/gst/base/gstaggregator.h index 5d870609d0..86fc70ff6d 100644 --- a/libs/gst/base/gstaggregator.h +++ b/libs/gst/base/gstaggregator.h @@ -421,7 +421,8 @@ GST_BASE_API void gst_aggregator_selected_samples (GstAggregator * self, GstClockTime pts, GstClockTime dts, - GstClockTime duration); + GstClockTime duration, + GstStructure * info); /** * GstAggregatorStartTimeSelection: |