/**
* gst_proxy_pad_event_default:
* @pad: a #GstPad to push the event to.
+ * @parent: the parent of @pad or NULL
* @event: (transfer full): the #GstEvent to send to the pad.
*
* Invoke the default event of the proxy pad.
* Since: 0.10.36
*/
gboolean
-gst_proxy_pad_event_default (GstPad * pad, GstEvent * event)
+gst_proxy_pad_event_default (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res;
GstPad *internal;
/**
* gst_proxy_pad_chain_default:
* @pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
+ * @parent: the parent of @pad or NULL
* @buffer: (transfer full): the #GstBuffer to send, return GST_FLOW_ERROR
* if not.
*
* Since: 0.10.36
*/
GstFlowReturn
-gst_proxy_pad_chain_default (GstPad * pad, GstBuffer * buffer)
+gst_proxy_pad_chain_default (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer)
{
GstFlowReturn res;
GstPad *internal;
/**
* gst_proxy_pad_chain_list_default:
* @pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
+ * @parent: the parent of @pad or NULL
* @list: (transfer full): the #GstBufferList to send, return GST_FLOW_ERROR
* if not.
*
* Since: 0.10.36
*/
GstFlowReturn
-gst_proxy_pad_chain_list_default (GstPad * pad, GstBufferList * list)
+gst_proxy_pad_chain_list_default (GstPad * pad, GstObject * parent,
+ GstBufferList * list)
{
GstFlowReturn res;
GstPad *internal;
* Since: 0.10.36
*/
GstFlowReturn
-gst_proxy_pad_getrange_default (GstPad * pad, guint64 offset, guint size,
- GstBuffer ** buffer)
+gst_proxy_pad_getrange_default (GstPad * pad, GstObject * parent,
+ guint64 offset, guint size, GstBuffer ** buffer)
{
GstFlowReturn res;
GstPad *internal;
static void gst_ghost_pad_dispose (GObject * object);
-/**
- * gst_ghost_pad_internal_activate_push_default:
- * @pad: the #GstPad to activate or deactivate.
- * @active: whether the pad should be active or not.
- *
- * Invoke the default activate push function of a proxy pad that is
- * owned by a ghost pad.
- *
- * Returns: %TRUE if the operation was successful.
- *
- * Since: 0.10.36
- */
-gboolean
-gst_ghost_pad_internal_activate_push_default (GstPad * pad, gboolean active)
+static gboolean
+gst_ghost_pad_internal_activate_push_default (GstPad * pad, GstObject * parent,
+ gboolean active)
{
gboolean ret;
GstPad *other;
- g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
-
GST_LOG_OBJECT (pad, "%sactivate push on %s:%s, we're ok",
(active ? "" : "de"), GST_DEBUG_PAD_NAME (pad));
/* in both cases (SRC and SINK) we activate just the internal pad. The targets
* will be activated later (or already in case of a ghost sinkpad). */
other = GST_PROXY_PAD_INTERNAL (pad);
- ret = gst_pad_activate_push (other, active);
+ ret = gst_pad_activate_mode (other, GST_PAD_MODE_PUSH, active);
return ret;
}
-/**
- * gst_ghost_pad_internal_activate_pull_default:
- * @pad: the #GstPad to activate or deactivate.
- * @active: whether the pad should be active or not.
- *
- * Invoke the default activate pull function of a proxy pad that is
- * owned by a ghost pad.
- *
- * Returns: %TRUE if the operation was successful.
- *
- * Since: 0.10.36
- */
-gboolean
-gst_ghost_pad_internal_activate_pull_default (GstPad * pad, gboolean active)
+static gboolean
+gst_ghost_pad_internal_activate_pull_default (GstPad * pad, GstObject * parent,
+ gboolean active)
{
gboolean ret;
GstPad *other;
- g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
-
GST_LOG_OBJECT (pad, "%sactivate pull on %s:%s", (active ? "" : "de"),
GST_DEBUG_PAD_NAME (pad));
* further upstream */
GST_LOG_OBJECT (pad, "pad is src, activate internal");
other = GST_PROXY_PAD_INTERNAL (pad);
- ret = gst_pad_activate_pull (other, active);
+ ret = gst_pad_activate_mode (other, GST_PAD_MODE_PULL, active);
} else if (G_LIKELY ((other = gst_pad_get_peer (pad)))) {
/* We are SINK, the ghostpad is SRC, we propagate the activation upstream
* since we hold a pointer to the upstream peer. */
GST_LOG_OBJECT (pad, "activating peer");
- ret = gst_pad_activate_pull (other, active);
+ ret = gst_pad_activate_mode (other, GST_PAD_MODE_PULL, active);
gst_object_unref (other);
} else {
/* this is failure, we can't activate pull if there is no peer */
}
/**
- * gst_ghost_pad_activate_push_default:
+ * gst_ghost_pad_internal_activate_mode_default:
* @pad: the #GstPad to activate or deactivate.
+ * @parent: the parent of @pad or NULL
+ * @mode: the requested activation mode
* @active: whether the pad should be active or not.
*
- * Invoke the default activate push function of a ghost pad.
+ * Invoke the default activate mode function of a proxy pad that is
+ * owned by a ghost pad.
*
* Returns: %TRUE if the operation was successful.
- *
- * Since: 0.10.36
*/
gboolean
-gst_ghost_pad_activate_push_default (GstPad * pad, gboolean active)
+gst_ghost_pad_internal_activate_mode_default (GstPad * pad, GstObject * parent,
+ GstPadMode mode, gboolean active)
+{
+ gboolean res;
+
+ g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
+
+ switch (mode) {
+ case GST_PAD_MODE_PULL:
+ res = gst_ghost_pad_internal_activate_pull_default (pad, parent, active);
+ break;
+ case GST_PAD_MODE_PUSH:
+ res = gst_ghost_pad_internal_activate_push_default (pad, parent, active);
+ break;
+ default:
+ GST_LOG_OBJECT (pad, "unknown activation mode %d", mode);
+ res = FALSE;
+ break;
+ }
+ return res;
+}
+
+static gboolean
+gst_ghost_pad_activate_push_default (GstPad * pad, GstObject * parent,
+ gboolean active)
{
gboolean ret;
GstPad *other;
/* just activate the internal pad */
other = GST_PROXY_PAD_INTERNAL (pad);
- ret = gst_pad_activate_push (other, active);
+ ret = gst_pad_activate_mode (other, GST_PAD_MODE_PUSH, active);
return ret;
}
-/**
- * gst_ghost_pad_activate_pull_default:
- * @pad: the #GstPad to activate or deactivate.
- * @active: whether the pad should be active or not.
- *
- * Invoke the default activate pull function of a ghost pad.
- *
- * Returns: %TRUE if the operation was successful.
- *
- * Since: 0.10.36
- */
-gboolean
-gst_ghost_pad_activate_pull_default (GstPad * pad, gboolean active)
+static gboolean
+gst_ghost_pad_activate_pull_default (GstPad * pad, GstObject * parent,
+ gboolean active)
{
gboolean ret;
GstPad *other;
- g_return_val_if_fail (GST_IS_GHOST_PAD (pad), FALSE);
-
GST_LOG_OBJECT (pad, "%sactivate pull on %s:%s", (active ? "" : "de"),
GST_DEBUG_PAD_NAME (pad));
* upstream */
GST_LOG_OBJECT (pad, "pad is src, activate internal");
other = GST_PROXY_PAD_INTERNAL (pad);
- ret = gst_pad_activate_pull (other, active);
+ ret = gst_pad_activate_mode (other, GST_PAD_MODE_PULL, active);
} else if (G_LIKELY ((other = gst_pad_get_peer (pad)))) {
/* We are SINK and activated by the internal pad, propagate activation
* upstream because we hold a ref to the upstream peer */
GST_LOG_OBJECT (pad, "activating peer");
- ret = gst_pad_activate_pull (other, active);
+ ret = gst_pad_activate_mode (other, GST_PAD_MODE_PULL, active);
gst_object_unref (other);
} else {
/* no peer, we fail */
}
/**
+ * gst_ghost_pad_activate_mode_default:
+ * @pad: the #GstPad to activate or deactivate.
+ * @parent: the parent of @pad or NULL
+ * @mode: the requested activation mode
+ * @active: whether the pad should be active or not.
+ *
+ * Invoke the default activate mode function of a ghost pad.
+ *
+ * Returns: %TRUE if the operation was successful.
+ */
+gboolean
+gst_ghost_pad_activate_mode_default (GstPad * pad, GstObject * parent,
+ GstPadMode mode, gboolean active)
+{
+ gboolean res;
+
+ g_return_val_if_fail (GST_IS_GHOST_PAD (pad), FALSE);
+
+ switch (mode) {
+ case GST_PAD_MODE_PULL:
+ res = gst_ghost_pad_activate_pull_default (pad, parent, active);
+ break;
+ case GST_PAD_MODE_PUSH:
+ res = gst_ghost_pad_activate_push_default (pad, parent, active);
+ break;
+ default:
+ GST_LOG_OBJECT (pad, "unknown activation mode %d", mode);
+ res = FALSE;
+ break;
+ }
+ return res;
+}
+
+/**
* gst_ghost_pad_link_default:
* @pad: the #GstPad to link.
* @peer: the #GstPad peer
GST_GHOST_PAD_PRIVATE (pad) = G_TYPE_INSTANCE_GET_PRIVATE (pad,
GST_TYPE_GHOST_PAD, GstGhostPadPrivate);
- gst_pad_set_activatepull_function (GST_PAD_CAST (pad),
- gst_ghost_pad_activate_pull_default);
- gst_pad_set_activatepush_function (GST_PAD_CAST (pad),
- gst_ghost_pad_activate_push_default);
+ gst_pad_set_activatemode_function (GST_PAD_CAST (pad),
+ gst_ghost_pad_activate_mode_default);
}
static void
GST_OBJECT_LOCK (pad);
internal = GST_PROXY_PAD_INTERNAL (pad);
- gst_pad_set_activatepull_function (internal, NULL);
- gst_pad_set_activatepush_function (internal, NULL);
+ gst_pad_set_activatemode_function (internal, NULL);
/* disposes of the internal pad, since the ghostpad is the only possible object
* that has a refcount on the internal pad. */
GST_PROXY_PAD_INTERNAL (internal) = pad;
/* special activation functions for the internal pad */
- gst_pad_set_activatepull_function (internal,
- gst_ghost_pad_internal_activate_pull_default);
- gst_pad_set_activatepush_function (internal,
- gst_ghost_pad_internal_activate_push_default);
+ gst_pad_set_activatemode_function (internal,
+ gst_ghost_pad_internal_activate_mode_default);
GST_OBJECT_UNLOCK (pad);
*
* Will ref the target.
*
- * Returns: (transfer full): a new #GstPad, or NULL in case of an error.
+ * Returns: (transfer floating): a new #GstPad, or NULL in case of an error.
*/
GstPad *
gst_ghost_pad_new (const gchar * name, GstPad * target)