Allows subclasses to prevent buffers from being queued.
https://bugzilla.gnome.org/show_bug.cgi?id=781928
{
GstFlowReturn flow_return;
GstClockTime buf_pts;
{
GstFlowReturn flow_return;
GstClockTime buf_pts;
+ GstAggregatorPadClass *klass = GST_AGGREGATOR_PAD_GET_CLASS (aggpad);
GST_DEBUG_OBJECT (aggpad, "Start chaining a buffer %" GST_PTR_FORMAT, buffer);
GST_DEBUG_OBJECT (aggpad, "Start chaining a buffer %" GST_PTR_FORMAT, buffer);
if (flow_return != GST_FLOW_OK)
goto flushing;
if (flow_return != GST_FLOW_OK)
goto flushing;
+ if (klass->skip_buffer && klass->skip_buffer (aggpad, self, buffer))
+ goto skipped;
+
PAD_UNLOCK (aggpad);
buf_pts = GST_BUFFER_PTS (buffer);
PAD_UNLOCK (aggpad);
buf_pts = GST_BUFFER_PTS (buffer);
gst_buffer_unref (buffer);
return flow_return;
gst_buffer_unref (buffer);
return flow_return;
+
+skipped:
+ PAD_UNLOCK (aggpad);
+
+ GST_DEBUG_OBJECT (aggpad, "Skipped buffer %" GST_PTR_FORMAT, buffer);
+ gst_buffer_unref (buffer);
+
+ return GST_FLOW_OK;
/**
* GstAggregatorPadClass:
/**
* GstAggregatorPadClass:
- * @flush: Optional
- * Called when the pad has received a flush stop, this is the place
- * to flush any information specific to the pad, it allows for individual
- * pads to be flushed while others might not be.
+ * @flush: Optional
+ * Called when the pad has received a flush stop, this is the place
+ * to flush any information specific to the pad, it allows for individual
+ * pads to be flushed while others might not be.
+ * @skip_buffer: Optional
+ * Called before input buffers are queued in the pad, return %TRUE
+ * if the buffer should be skipped.
*
*/
struct _GstAggregatorPadClass
{
GstPadClass parent_class;
*
*/
struct _GstAggregatorPadClass
{
GstPadClass parent_class;
- GstFlowReturn (*flush) (GstAggregatorPad * aggpad, GstAggregator * aggregator);
+ GstFlowReturn (*flush) (GstAggregatorPad * aggpad, GstAggregator * aggregator);
+ gboolean (*skip_buffer) (GstAggregatorPad * aggpad, GstAggregator * aggregator, GstBuffer * buffer);
/*< private >*/
gpointer _gst_reserved[GST_PADDING_LARGE];
/*< private >*/
gpointer _gst_reserved[GST_PADDING_LARGE];