summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2015-02-21 20:13:04 +0100
committerMark Nauwelaerts <mnauw@users.sourceforge.net>2015-03-07 20:18:43 +0100
commitb9411dab75ecaa306a25d5ec9dfc6dff3ee7df79 (patch)
treefc233da93f32fd7b63d3fc96602e521bf46c6b3a
parent8ec7272d99e9b7cafcfff178f45e1203d73d38dc (diff)
flowcombiner: add a gst_flow_combiner_update_pad_flow() method
https://bugzilla.gnome.org/show_bug.cgi?id=744572 API: gst_flow_combiner_update_pad_flow()
-rw-r--r--libs/gst/base/gstflowcombiner.c28
-rw-r--r--libs/gst/base/gstflowcombiner.h3
2 files changed, 31 insertions, 0 deletions
diff --git a/libs/gst/base/gstflowcombiner.c b/libs/gst/base/gstflowcombiner.c
index 435c51400..9dd5123bc 100644
--- a/libs/gst/base/gstflowcombiner.c
+++ b/libs/gst/base/gstflowcombiner.c
@@ -253,6 +253,34 @@ gst_flow_combiner_update_flow (GstFlowCombiner * combiner, GstFlowReturn fret)
}
/**
+ * gst_flow_combiner_update_pad_flow:
+ * @combiner: the #GstFlowCombiner
+ * @pad: the #GstPad whose #GstFlowReturn to update
+ * @fret: the latest #GstFlowReturn received for a pad in this #GstFlowCombiner
+ *
+ * Sets the provided pad's last flow return to provided value and computes
+ * the combined flow return for the pads in it.
+ *
+ * The #GstFlowReturn parameter should be the last flow return update for a pad
+ * in this #GstFlowCombiner. It will use this value to be able to shortcut some
+ * combinations and avoid looking over all pads again. e.g. The last combined
+ * return is the same as the latest obtained #GstFlowReturn.
+ *
+ * Returns: The combined #GstFlowReturn
+ * Since: 1.6
+ */
+GstFlowReturn
+gst_flow_combiner_update_pad_flow (GstFlowCombiner * combiner, GstPad * pad,
+ GstFlowReturn fret)
+{
+ g_return_val_if_fail (pad != NULL, GST_FLOW_ERROR);
+
+ GST_PAD_LAST_FLOW_RETURN (pad) = fret;
+
+ return gst_flow_combiner_update_flow (combiner, fret);
+}
+
+/**
* gst_flow_combiner_add_pad:
* @combiner: the #GstFlowCombiner
* @pad: (transfer none): the #GstPad that is being added
diff --git a/libs/gst/base/gstflowcombiner.h b/libs/gst/base/gstflowcombiner.h
index f31d65de4..79e4bed1c 100644
--- a/libs/gst/base/gstflowcombiner.h
+++ b/libs/gst/base/gstflowcombiner.h
@@ -47,6 +47,9 @@ void gst_flow_combiner_free (GstFlowCombiner * combiner);
GstFlowReturn gst_flow_combiner_update_flow (GstFlowCombiner * combiner, GstFlowReturn fret);
+GstFlowReturn gst_flow_combiner_update_pad_flow (GstFlowCombiner * combiner, GstPad * pad,
+ GstFlowReturn fret);
+
void gst_flow_combiner_add_pad (GstFlowCombiner * combiner, GstPad * pad);
void gst_flow_combiner_remove_pad (GstFlowCombiner * combiner, GstPad * pad);