Add parent to chain, chain_list, getrange and event functions.
/**
* 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;
GstProxyPad* gst_proxy_pad_get_internal (GstProxyPad *pad);
-gboolean gst_proxy_pad_event_default (GstPad *pad, GstEvent *event);
+gboolean gst_proxy_pad_event_default (GstPad *pad, GstObject *parent,
+ GstEvent *event);
gboolean gst_proxy_pad_query_default (GstPad *pad, GstObject *parent,
GstQuery *query);
GstIterator* gst_proxy_pad_iterate_internal_links_default (GstPad *pad, GstObject *parent);
-GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad, GstBuffer *buffer);
-GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad, GstBufferList *list);
-GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer);
+GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad, GstObject *parent,
+ GstBuffer *buffer);
+GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad, GstObject *parent,
+ GstBufferList *list);
+GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad, GstObject *parent,
+ guint64 offset, guint size,
+ GstBuffer **buffer);
void gst_proxy_pad_unlink_default (GstPad * pad);
#define GST_TYPE_GHOST_PAD (gst_ghost_pad_get_type ())
static void gst_pad_set_pad_template (GstPad * pad, GstPadTemplate * templ);
static gboolean gst_pad_activate_default (GstPad * pad);
static GstFlowReturn gst_pad_chain_list_default (GstPad * pad,
- GstBufferList * list);
+ GstObject * parent, GstBufferList * list);
static guint gst_pad_signals[LAST_SIGNAL] = { 0 };
}
static gboolean
-do_event_function (GstPad * pad, GstEvent * event,
+do_event_function (GstPad * pad, GstObject * parent, GstEvent * event,
GstPadEventFunction eventfunc, gboolean * caps_notify)
{
gboolean result = TRUE, call_event = TRUE;
if (call_event) {
GST_DEBUG_OBJECT (pad, "calling event function with event %p", event);
- result = eventfunc (pad, event);
+ result = eventfunc (pad, parent, event);
} else {
gst_event_unref (event);
}
gst_event_ref (event);
GST_OBJECT_UNLOCK (pad);
- res = do_event_function (pad, event, eventfunc, &caps_notify);
+ res = do_event_function (pad, parent, event, eventfunc, &caps_notify);
RELEASE_PARENT (parent);
/**
* gst_pad_event_default:
* @pad: a #GstPad to call the default event handler on.
+ * @parent: the parent of @pad or NULL
* @event: (transfer full): the #GstEvent to handle.
*
* Invokes the default event handler for the given pad.
* Returns: TRUE if the event was sent successfully.
*/
gboolean
-gst_pad_event_default (GstPad * pad, GstEvent * event)
+gst_pad_event_default (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean result, forward = TRUE;
no_func:
{
GST_DEBUG_OBJECT (pad, "had no query function");
+ RELEASE_PARENT (parent);
return FALSE;
}
query_failed:
gst_pad_chain_data_unchecked (GstPad * pad, GstPadProbeType type, void *data)
{
GstFlowReturn ret;
+ GstObject *parent;
gboolean needs_events;
GST_PAD_STREAM_LOCK (pad);
PROBE_PUSH (pad, type, data, probe_stopped);
+ parent = GST_OBJECT_PARENT (pad);
GST_OBJECT_UNLOCK (pad);
/* NOTE: we read the chainfunc unlocked.
"calling chainfunction &%s with buffer %" GST_PTR_FORMAT,
GST_DEBUG_FUNCPTR_NAME (chainfunc), GST_BUFFER (data));
- ret = chainfunc (pad, GST_BUFFER_CAST (data));
+ ret = chainfunc (pad, parent, GST_BUFFER_CAST (data));
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"called chainfunction &%s with buffer %p, returned %s",
"calling chainlistfunction &%s",
GST_DEBUG_FUNCPTR_NAME (chainlistfunc));
- ret = chainlistfunc (pad, GST_BUFFER_LIST_CAST (data));
+ ret = chainlistfunc (pad, parent, GST_BUFFER_LIST_CAST (data));
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"called chainlistfunction &%s, returned %s",
gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"pushing, but not chainhandler");
- GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
+ GST_ELEMENT_ERROR (parent, CORE, PAD, (NULL),
("push on pad %s:%s but it has no chainfunction",
GST_DEBUG_PAD_NAME (pad)));
GST_PAD_STREAM_UNLOCK (pad);
}
static GstFlowReturn
-gst_pad_chain_list_default (GstPad * pad, GstBufferList * list)
+gst_pad_chain_list_default (GstPad * pad, GstObject * parent,
+ GstBufferList * list)
{
guint i, len;
GstBuffer *buffer;
{
GstFlowReturn ret;
GstPadGetRangeFunction getrangefunc;
+ GstObject *parent;
GST_PAD_STREAM_LOCK (pad);
* skip calling the getrange function */
PROBE_PRE_PULL (pad, GST_PAD_PROBE_TYPE_PULL | GST_PAD_PROBE_TYPE_BLOCK,
*buffer, offset, size, probe_stopped, probed_data, GST_FLOW_OK);
+
+ ACQUIRE_PARENT (pad, parent, no_parent);
GST_OBJECT_UNLOCK (pad);
if (G_UNLIKELY ((getrangefunc = GST_PAD_GETRANGEFUNC (pad)) == NULL))
G_GUINT64_FORMAT ", size %u",
GST_DEBUG_FUNCPTR_NAME (getrangefunc), offset, size);
- ret = getrangefunc (pad, offset, size, buffer);
+ ret = getrangefunc (pad, parent, offset, size, buffer);
+
+ RELEASE_PARENT (parent);
if (G_UNLIKELY (ret != GST_FLOW_OK))
goto get_range_failed;
GST_PAD_STREAM_UNLOCK (pad);
return GST_FLOW_WRONG_STATE;
}
+no_parent:
+ {
+ GST_DEBUG_OBJECT (pad, "no parent");
+ GST_OBJECT_UNLOCK (pad);
+ GST_PAD_STREAM_UNLOCK (pad);
+ return GST_FLOW_WRONG_STATE;
+ }
no_function:
{
- GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
+ GST_ELEMENT_ERROR (parent, CORE, PAD, (NULL),
("getrange on pad %s:%s but it has no getrangefunction",
GST_DEBUG_PAD_NAME (pad)));
+ RELEASE_PARENT (parent);
GST_PAD_STREAM_UNLOCK (pad);
return GST_FLOW_NOT_SUPPORTED;
}
ACQUIRE_PARENT (pad, parent, no_parent);
GST_OBJECT_UNLOCK (pad);
- result = eventfunc (pad, event);
+ result = eventfunc (pad, parent, event);
RELEASE_PARENT (parent);
}
/**
* GstPadChainFunction:
* @pad: the sink #GstPad that performed the chain.
+ * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
+ * @parent is guaranteed to be not-NULL and remain valid during the
+ * execution of this function.
* @buffer: the #GstBuffer that is chained, not %NULL.
*
* A function that will be called on sinkpads when chaining buffers.
*
* Returns: #GST_FLOW_OK for success
*/
-typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer);
+typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstObject *parent,
+ GstBuffer *buffer);
/**
* GstPadChainListFunction:
* @pad: the sink #GstPad that performed the chain.
+ * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
+ * @parent is guaranteed to be not-NULL and remain valid during the
+ * execution of this function.
* @list: the #GstBufferList that is chained, not %NULL.
*
* A function that will be called on sinkpads when chaining buffer lists.
*
* Returns: #GST_FLOW_OK for success
*/
-typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstBufferList *list);
+typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstObject *parent,
+ GstBufferList *list);
/**
* GstPadGetRangeFunction:
* @pad: the src #GstPad to perform the getrange on.
+ * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
+ * @parent is guaranteed to be not-NULL and remain valid during the
+ * execution of this function.
* @offset: the offset of the range
* @length: the length of the range
* @buffer: a memory location to hold the result buffer, cannot be NULL.
* Returns: #GST_FLOW_OK for success and a valid buffer in @buffer. Any other
* return value leaves @buffer undefined.
*/
-typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset,
- guint length, GstBuffer **buffer);
+typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, GstObject *parent,
+ guint64 offset, guint length,
+ GstBuffer **buffer);
/**
* GstPadEventFunction:
* @pad: the #GstPad to handle the event.
+ * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
+ * @parent is guaranteed to be not-NULL and remain valid during the
+ * execution of this function.
* @event: the #GstEvent to handle.
*
* Function signature to handle an event for the pad.
*
* Returns: TRUE if the pad could handle the event.
*/
-typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
+typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstObject *parent,
+ GstEvent *event);
/* internal links */
GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
GstBuffer **buffer);
gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
-gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
+gboolean gst_pad_event_default (GstPad *pad, GstObject *parent,
+ GstEvent *event);
/* data passing functions on pad */
GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
GstEvent * event);
static void gst_base_parse_handle_tag (GstBaseParse * parse, GstEvent * event);
-static gboolean gst_base_parse_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_base_parse_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_base_parse_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static gboolean gst_base_parse_sink_event (GstPad * pad, GstEvent * event);
+static gboolean gst_base_parse_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_base_parse_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static GstFlowReturn gst_base_parse_chain (GstPad * pad, GstBuffer * buffer);
+static GstFlowReturn gst_base_parse_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
static void gst_base_parse_loop (GstPad * pad);
static gboolean gst_base_parse_check_frame (GstBaseParse * parse,
* Returns: TRUE if the event was handled.
*/
static gboolean
-gst_base_parse_sink_event (GstPad * pad, GstEvent * event)
+gst_base_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstBaseParse *parse;
GstBaseParseClass *bclass;
gboolean handled = FALSE;
gboolean ret = TRUE;
- parse = GST_BASE_PARSE (gst_pad_get_parent (pad));
+ parse = GST_BASE_PARSE (parent);
bclass = GST_BASE_PARSE_GET_CLASS (parse);
GST_DEBUG_OBJECT (parse, "handling event %d, %s", GST_EVENT_TYPE (event),
handled = gst_base_parse_sink_eventfunc (parse, event);
if (!handled)
- ret = gst_pad_event_default (pad, event);
+ ret = gst_pad_event_default (pad, parent, event);
}
- gst_object_unref (parse);
GST_DEBUG_OBJECT (parse, "event handled");
+
return ret;
}
* Returns: TRUE if the event was handled.
*/
static gboolean
-gst_base_parse_src_event (GstPad * pad, GstEvent * event)
+gst_base_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstBaseParse *parse;
GstBaseParseClass *bclass;
gboolean handled = FALSE;
gboolean ret = TRUE;
- parse = GST_BASE_PARSE (gst_pad_get_parent (pad));
+ parse = GST_BASE_PARSE (parent);
bclass = GST_BASE_PARSE_GET_CLASS (parse);
GST_DEBUG_OBJECT (parse, "event %d, %s", GST_EVENT_TYPE (event),
handled = bclass->src_event (parse, event);
if (!handled)
- ret = gst_pad_event_default (pad, event);
+ ret = gst_pad_event_default (pad, parent, event);
- gst_object_unref (parse);
return ret;
}
if (!avail)
break;
- if (gst_base_parse_chain (parse->sinkpad, NULL) != GST_FLOW_OK) {
+ if (gst_base_parse_chain (parse->sinkpad, GST_OBJECT_CAST (parse),
+ NULL) != GST_FLOW_OK) {
break;
}
}
static GstFlowReturn
-gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
+gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstBaseParseClass *bclass;
GstBaseParse *parse;
GstClockTime timestamp;
GstBaseParseFrame *frame;
- parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad));
+ parse = GST_BASE_PARSE (parent);
bclass = GST_BASE_PARSE_GET_CLASS (parse);
if (parse->priv->detecting) {
if (ret == GST_FLOW_OK && !parse->priv->flushing)
ret =
gst_base_parse_chain (GST_BASE_PARSE_SINK_PAD (parse),
- GST_BUFFER_CAST (l->data));
+ parent, GST_BUFFER_CAST (l->data));
else
gst_buffer_unref (GST_BUFFER_CAST (l->data));
}
static gboolean gst_base_sink_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static GstFlowReturn gst_base_sink_chain (GstPad * pad, GstBuffer * buffer);
-static GstFlowReturn gst_base_sink_chain_list (GstPad * pad,
+static GstFlowReturn gst_base_sink_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
+static GstFlowReturn gst_base_sink_chain_list (GstPad * pad, GstObject * parent,
GstBufferList * list);
static void gst_base_sink_loop (GstPad * pad);
static gboolean gst_base_sink_pad_activate (GstPad * pad);
static gboolean gst_base_sink_pad_activate_push (GstPad * pad, gboolean active);
static gboolean gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active);
-static gboolean gst_base_sink_event (GstPad * pad, GstEvent * event);
+static gboolean gst_base_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean default_sink_query (GstBaseSink * sink, GstQuery * query);
/* FIXME: Casting to GstClockEntry only works because the types
* are the same */
if (G_LIKELY (sink->priv->cached_clock_id != NULL
- && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->priv->
- cached_clock_id) == clock)) {
+ && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->
+ priv->cached_clock_id) == clock)) {
if (!gst_clock_single_shot_id_reinit (clock, sink->priv->cached_clock_id,
time)) {
gst_clock_id_unref (sink->priv->cached_clock_id);
}
static gboolean
-gst_base_sink_event (GstPad * pad, GstEvent * event)
+gst_base_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstBaseSink *basesink;
gboolean result = TRUE;
GstBaseSinkClass *bclass;
- basesink = GST_BASE_SINK (gst_pad_get_parent (pad));
- if (G_UNLIKELY (basesink == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
+ basesink = GST_BASE_SINK (parent);
bclass = GST_BASE_SINK_GET_CLASS (basesink);
GST_DEBUG_OBJECT (basesink, "received event %p %" GST_PTR_FORMAT, event,
break;
}
done:
- gst_object_unref (basesink);
-
return result;
/* ERRORS */
}
static GstFlowReturn
-gst_base_sink_chain (GstPad * pad, GstBuffer * buf)
+gst_base_sink_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
GstBaseSink *basesink;
- basesink = GST_BASE_SINK (GST_OBJECT_PARENT (pad));
+ basesink = GST_BASE_SINK (parent);
return gst_base_sink_chain_main (basesink, pad, _PR_IS_BUFFER, buf);
}
static GstFlowReturn
-gst_base_sink_chain_list (GstPad * pad, GstBufferList * list)
+gst_base_sink_chain_list (GstPad * pad, GstObject * parent,
+ GstBufferList * list)
{
GstBaseSink *basesink;
GstBaseSinkClass *bclass;
GstFlowReturn result;
- basesink = GST_BASE_SINK (GST_OBJECT_PARENT (pad));
+ basesink = GST_BASE_SINK (parent);
bclass = GST_BASE_SINK_GET_CLASS (basesink);
if (G_LIKELY (bclass->render_list)) {
static void
gst_base_sink_loop (GstPad * pad)
{
+ GstObject *parent;
GstBaseSink *basesink;
GstBuffer *buf = NULL;
GstFlowReturn result;
guint blocksize;
guint64 offset;
- basesink = GST_BASE_SINK (GST_OBJECT_PARENT (pad));
+ parent = GST_OBJECT_PARENT (pad);
+ basesink = GST_BASE_SINK (parent);
g_assert (basesink->pad_mode == GST_PAD_ACTIVATE_PULL);
gst_message_new_segment_done (GST_OBJECT_CAST (basesink),
basesink->segment.format, basesink->segment.position));
} else {
- gst_base_sink_event (pad, gst_event_new_eos ());
+ gst_base_sink_event (pad, parent, gst_event_new_eos ());
}
} else if (result == GST_FLOW_NOT_LINKED || result <= GST_FLOW_EOS) {
/* for fatal errors we post an error message, post the error
GST_ELEMENT_ERROR (basesink, STREAM, FAILED,
(_("Internal data stream error.")),
("stream stopped, reason %s", gst_flow_get_name (result)));
- gst_base_sink_event (pad, gst_event_new_eos ());
+ gst_base_sink_event (pad, parent, gst_event_new_eos ());
}
return;
}
const GValue * value, GParamSpec * pspec);
static void gst_base_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_base_src_event_handler (GstPad * pad, GstEvent * event);
+static gboolean gst_base_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_base_src_send_event (GstElement * elem, GstEvent * event);
static gboolean gst_base_src_default_event (GstBaseSrc * src, GstEvent * event);
GstStateChange transition);
static void gst_base_src_loop (GstPad * pad);
-static GstFlowReturn gst_base_src_pad_get_range (GstPad * pad, guint64 offset,
- guint length, GstBuffer ** buf);
+static GstFlowReturn gst_base_src_getrange (GstPad * pad, GstObject * parent,
+ guint64 offset, guint length, GstBuffer ** buf);
static GstFlowReturn gst_base_src_get_range (GstBaseSrc * src, guint64 offset,
guint length, GstBuffer ** buf);
static gboolean gst_base_src_seekable (GstBaseSrc * src);
/* Registering debug symbols for function pointers */
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_activate_push);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_activate_pull);
- GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_event_handler);
+ GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_event);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_query);
- GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_pad_get_range);
+ GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_getrange);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_fixate);
}
GST_DEBUG_OBJECT (basesrc, "setting functions on src pad");
gst_pad_set_activatepush_function (pad, gst_base_src_activate_push);
gst_pad_set_activatepull_function (pad, gst_base_src_activate_pull);
- gst_pad_set_event_function (pad, gst_base_src_event_handler);
+ gst_pad_set_event_function (pad, gst_base_src_event);
gst_pad_set_query_function (pad, gst_base_src_query);
- gst_pad_set_getrange_function (pad, gst_base_src_pad_get_range);
+ gst_pad_set_getrange_function (pad, gst_base_src_getrange);
/* hold pointer to pad */
basesrc->srcpad = pad;
}
static gboolean
-gst_base_src_event_handler (GstPad * pad, GstEvent * event)
+gst_base_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstBaseSrc *src;
GstBaseSrcClass *bclass;
gboolean result = FALSE;
- src = GST_BASE_SRC (gst_pad_get_parent (pad));
- if (G_UNLIKELY (src == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
+ src = GST_BASE_SRC (parent);
bclass = GST_BASE_SRC_GET_CLASS (src);
if (bclass->event) {
done:
gst_event_unref (event);
- gst_object_unref (src);
return result;
}
static GstFlowReturn
-gst_base_src_pad_get_range (GstPad * pad, guint64 offset, guint length,
- GstBuffer ** buf)
+gst_base_src_getrange (GstPad * pad, GstObject * parent, guint64 offset,
+ guint length, GstBuffer ** buf)
{
GstBaseSrc *src;
GstFlowReturn res;
- src = GST_BASE_SRC_CAST (gst_object_ref (GST_OBJECT_PARENT (pad)));
+ src = GST_BASE_SRC_CAST (parent);
GST_LIVE_LOCK (src);
if (G_UNLIKELY (src->priv->flushing))
done:
GST_LIVE_UNLOCK (src);
- gst_object_unref (src);
-
return res;
/* ERRORS */
static gboolean gst_base_transform_get_unit_size (GstBaseTransform * trans,
GstCaps * caps, gsize * size);
-static gboolean gst_base_transform_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_base_transform_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_base_transform_src_eventfunc (GstBaseTransform * trans,
GstEvent * event);
-static gboolean gst_base_transform_sink_event (GstPad * pad, GstEvent * event);
+static gboolean gst_base_transform_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_base_transform_sink_eventfunc (GstBaseTransform * trans,
GstEvent * event);
-static GstFlowReturn gst_base_transform_getrange (GstPad * pad, guint64 offset,
- guint length, GstBuffer ** buffer);
-static GstFlowReturn gst_base_transform_chain (GstPad * pad,
+static GstFlowReturn gst_base_transform_getrange (GstPad * pad,
+ GstObject * parent, guint64 offset, guint length, GstBuffer ** buffer);
+static GstFlowReturn gst_base_transform_chain (GstPad * pad, GstObject * parent,
GstBuffer * buffer);
static GstCaps *gst_base_transform_default_transform_caps (GstBaseTransform *
trans, GstPadDirection direction, GstCaps * caps, GstCaps * filter);
}
static gboolean
-gst_base_transform_sink_event (GstPad * pad, GstEvent * event)
+gst_base_transform_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
{
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gboolean ret = TRUE;
- trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
- if (G_UNLIKELY (trans == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ trans = GST_BASE_TRANSFORM (parent);
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->sink_event)
else
gst_event_unref (event);
- gst_object_unref (trans);
-
return ret;
}
}
static gboolean
-gst_base_transform_src_event (GstPad * pad, GstEvent * event)
+gst_base_transform_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
{
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gboolean ret = TRUE;
- trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
- if (G_UNLIKELY (trans == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
+ trans = GST_BASE_TRANSFORM (parent);
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->src_event)
else
gst_event_unref (event);
- gst_object_unref (trans);
-
return ret;
}
* end based on the transform_size result.
*/
static GstFlowReturn
-gst_base_transform_getrange (GstPad * pad, guint64 offset,
+gst_base_transform_getrange (GstPad * pad, GstObject * parent, guint64 offset,
guint length, GstBuffer ** buffer)
{
GstBaseTransform *trans;
GstFlowReturn ret;
GstBuffer *inbuf;
- trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
+ trans = GST_BASE_TRANSFORM (parent);
ret = gst_pad_pull_range (trans->sinkpad, offset, length, &inbuf);
if (G_UNLIKELY (ret != GST_FLOW_OK))
GST_BASE_TRANSFORM_UNLOCK (trans);
done:
- gst_object_unref (trans);
-
return ret;
/* ERRORS */
}
static GstFlowReturn
-gst_base_transform_chain (GstPad * pad, GstBuffer * buffer)
+gst_base_transform_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstBaseTransform *trans;
GstBaseTransformClass *klass;
GstClockTime timestamp, duration;
GstBuffer *outbuf = NULL;
- trans = GST_BASE_TRANSFORM (GST_OBJECT_PARENT (pad));
+ trans = GST_BASE_TRANSFORM (parent);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer);
static void gst_collect_pads_clear (GstCollectPads * pads,
GstCollectData * data);
-static GstFlowReturn gst_collect_pads_chain (GstPad * pad, GstBuffer * buffer);
-static gboolean gst_collect_pads_event (GstPad * pad, GstEvent * event);
+static GstFlowReturn gst_collect_pads_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
+static gboolean gst_collect_pads_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static void gst_collect_pads_finalize (GObject * object);
static void ref_data (GstCollectData * data);
static void unref_data (GstCollectData * data);
}
static gboolean
-gst_collect_pads_event (GstPad * pad, GstEvent * event)
+gst_collect_pads_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res;
GstCollectData *data;
case GST_EVENT_FLUSH_START:
{
/* forward event to unblock check_collected */
- gst_pad_event_default (pad, event);
+ gst_pad_event_default (pad, parent, event);
/* now unblock the chain function.
* no cond per pad, so they all unblock,
forward:
GST_DEBUG_OBJECT (pads, "forward unhandled event: %s",
GST_EVENT_TYPE_NAME (event));
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
done:
unref_data (data);
* collected
*/
static GstFlowReturn
-gst_collect_pads_chain (GstPad * pad, GstBuffer * buffer)
+gst_collect_pads_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstCollectData *data;
GstCollectPads *pads;
static void gst_collect_pads2_clear (GstCollectPads2 * pads,
GstCollectData2 * data);
-static GstFlowReturn gst_collect_pads2_chain (GstPad * pad, GstBuffer * buffer);
-static gboolean gst_collect_pads2_event (GstPad * pad, GstEvent * event);
+static GstFlowReturn gst_collect_pads2_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
+static gboolean gst_collect_pads2_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static void gst_collect_pads2_finalize (GObject * object);
static GstFlowReturn gst_collect_pads2_default_collected (GstCollectPads2 *
pads, gpointer user_data);
}
static gboolean
-gst_collect_pads2_event (GstPad * pad, GstEvent * event)
+gst_collect_pads2_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res = FALSE, need_unlock = FALSE;
GstCollectData2 *data;
if (event_func)
res = event_func (pads, data, event, event_user_data);
if (!res)
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
/* now unblock the chain function.
* no cond per pad, so they all unblock,
if (event_func)
res = event_func (pads, data, event, event_user_data);
if (!res)
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
if (need_unlock)
GST_COLLECT_PADS2_STREAM_UNLOCK (pads);
goto done;
* collected
*/
static GstFlowReturn
-gst_collect_pads2_chain (GstPad * pad, GstBuffer * buffer)
+gst_collect_pads2_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstCollectData2 *data;
GstCollectPads2 *pads;
/* helper functions */
GstFlowReturn
-gst_check_chain_func (GstPad * pad, GstBuffer * buffer)
+gst_check_chain_func (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
- GST_DEBUG ("chain_func: received buffer %p", buffer);
+ GST_DEBUG_OBJECT (pad, "chain_func: received buffer %p", buffer);
buffers = g_list_append (buffers, buffer);
g_mutex_lock (check_mutex);
void gst_check_init (int *argc, char **argv[]);
-GstFlowReturn gst_check_chain_func (GstPad * pad, GstBuffer * buffer);
+GstFlowReturn gst_check_chain_func (GstPad * pad, GstObject * parent, GstBuffer * buffer);
void gst_check_message_error (GstMessage * message, GstMessageType type,
GQuark domain, gint code);
GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
static void gst_funnel_release_pad (GstElement * element, GstPad * pad);
-static GstFlowReturn gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer);
-static gboolean gst_funnel_sink_event (GstPad * pad, GstEvent * event);
+static GstFlowReturn gst_funnel_sink_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
+static gboolean gst_funnel_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_funnel_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static gboolean gst_funnel_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_funnel_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static void
gst_funnel_dispose (GObject * object)
}
static GstFlowReturn
-gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer)
+gst_funnel_sink_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstFlowReturn res;
- GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
+ GstFunnel *funnel = GST_FUNNEL (parent);
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
GstEvent *event = NULL;
GstClockTime newts;
}
static gboolean
-gst_funnel_sink_event (GstPad * pad, GstEvent * event)
+gst_funnel_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
- GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
+ GstFunnel *funnel = GST_FUNNEL (parent);
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
gboolean forward = TRUE;
gboolean res = TRUE;
}
static gboolean
-gst_funnel_src_event (GstPad * pad, GstEvent * event)
+gst_funnel_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstElement *funnel;
GstIterator *iter;
gboolean done = FALSE;
GValue value = { 0, };
- funnel = GST_ELEMENT_CAST (GST_PAD_PARENT (pad));
+ funnel = GST_ELEMENT_CAST (parent);
iter = gst_element_iterate_sink_pads (funnel);
gst_segment_init (&segment, segment.format);
news = gst_event_new_segment (&segment);
- gst_pad_event_default (trans->sinkpad, news);
+ gst_pad_event_default (trans->sinkpad, GST_OBJECT_CAST (trans), news);
}
}
identity->prev_offset = identity->prev_offset_end = GST_BUFFER_OFFSET_NONE;
}
-
if (identity->single_segment && (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT)) {
/* eat up segments */
gst_event_unref (event);
static gint64 gst_selector_pad_get_running_time (GstSelectorPad * pad);
static void gst_selector_pad_reset (GstSelectorPad * pad);
-static gboolean gst_selector_pad_event (GstPad * pad, GstEvent * event);
+static gboolean gst_selector_pad_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_selector_pad_query (GstPad * pad, GstObject * parent,
GstQuery * query);
static GstIterator *gst_selector_pad_iterate_linked_pads (GstPad * pad,
GstObject * parent);
-static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstBuffer * buf);
+static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buf);
G_DEFINE_TYPE (GstSelectorPad, gst_selector_pad, GST_TYPE_PAD);
}
static gboolean
-gst_selector_pad_event (GstPad * pad, GstEvent * event)
+gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res = TRUE;
gboolean forward;
GstPad *prev_active_sinkpad;
GstPad *active_sinkpad;
- sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
+ sel = GST_INPUT_SELECTOR (parent);
selpad = GST_SELECTOR_PAD_CAST (pad);
GST_INPUT_SELECTOR_LOCK (sel);
static GstFlowReturn
-gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
+gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
GstInputSelector *sel;
GstFlowReturn res;
GstSegment *seg;
GstEvent *start_event = NULL;
- sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
+ sel = GST_INPUT_SELECTOR (parent);
selpad = GST_SELECTOR_PAD_CAST (pad);
seg = &selpad->segment;
static GstStateChangeReturn gst_input_selector_change_state (GstElement *
element, GstStateChange transition);
-static gboolean gst_input_selector_event (GstPad * pad, GstEvent * event);
+static gboolean gst_input_selector_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_input_selector_query (GstPad * pad, GstObject * parent,
GstQuery * query);
static gint64 gst_input_selector_block (GstInputSelector * self);
}
static gboolean
-gst_input_selector_event (GstPad * pad, GstEvent * event)
+gst_input_selector_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstInputSelector *sel;
gboolean result = FALSE;
GstPad *eventpad;
GList *pushed_pads = NULL;
- sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
+ sel = GST_INPUT_SELECTOR (parent);
/* Send upstream events to all sinkpads */
iter = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (sel));
* _ we push with a unique id (curid)
*/
static GstFlowReturn
-gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer)
+gst_multi_queue_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstSingleQueue *sq;
GstMultiQueue *mq;
}
static gboolean
-gst_multi_queue_sink_event (GstPad * pad, GstEvent * event)
+gst_multi_queue_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstSingleQueue *sq;
GstMultiQueue *mq;
GstEvent *sref = NULL;
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
- mq = (GstMultiQueue *) GST_PAD_PARENT (pad);
+ mq = (GstMultiQueue *) parent;
type = GST_EVENT_TYPE (event);
}
static gboolean
-gst_multi_queue_src_event (GstPad * pad, GstEvent * event)
+gst_multi_queue_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstSingleQueue *sq = gst_pad_get_element_private (pad);
GstPadTemplate * templ, const gchar * unused, const GstCaps * caps);
static void gst_output_selector_release_pad (GstElement * element,
GstPad * pad);
-static GstFlowReturn gst_output_selector_chain (GstPad * pad, GstBuffer * buf);
+static GstFlowReturn gst_output_selector_chain (GstPad * pad,
+ GstObject * parent, GstBuffer * buf);
static GstStateChangeReturn gst_output_selector_change_state (GstElement *
element, GstStateChange transition);
-static gboolean gst_output_selector_event (GstPad * pad, GstEvent * event);
+static gboolean gst_output_selector_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_output_selector_query (GstPad * pad, GstObject * parent,
GstQuery * query);
static void gst_output_selector_switch_pad_negotiation_mode (GstOutputSelector *
}
static GstFlowReturn
-gst_output_selector_chain (GstPad * pad, GstBuffer * buf)
+gst_output_selector_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
GstFlowReturn res;
GstOutputSelector *osel;
GstClockTime position, duration;
- osel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
+ osel = GST_OUTPUT_SELECTOR (parent);
/*
* The _switch function might push a buffer if 'resend-latest' is true.
}
static gboolean
-gst_output_selector_event (GstPad * pad, GstEvent * event)
+gst_output_selector_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res = TRUE;
GstOutputSelector *sel;
GstPad *active = NULL;
- sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
+ sel = GST_OUTPUT_SELECTOR (parent);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
switch (sel->pad_negotiation_mode) {
case GST_OUTPUT_SELECTOR_PAD_NEGOTIATION_MODE_ALL:
/* Send caps to all src pads */
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
case GST_OUTPUT_SELECTOR_PAD_NEGOTIATION_MODE_NONE:
gst_event_unref (event);
&sel->segment);
/* Send newsegment to all src pads */
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
}
case GST_EVENT_EOS:
/* Send eos to all src pads */
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
default:
{
static void gst_queue_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static GstFlowReturn gst_queue_chain (GstPad * pad, GstBuffer * buffer);
+static GstFlowReturn gst_queue_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
static GstFlowReturn gst_queue_push_one (GstQueue * queue);
static void gst_queue_loop (GstPad * pad);
-static gboolean gst_queue_handle_sink_event (GstPad * pad, GstEvent * event);
+static gboolean gst_queue_handle_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_queue_handle_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static gboolean gst_queue_handle_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_queue_handle_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_queue_handle_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
}
static gboolean
-gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
+gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstQueue *queue;
- queue = GST_QUEUE (GST_PAD_PARENT (pad));
+ queue = GST_QUEUE (parent);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
}
static GstFlowReturn
-gst_queue_chain (GstPad * pad, GstBuffer * buffer)
+gst_queue_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstQueue *queue;
GstClockTime duration, timestamp;
- queue = (GstQueue *) GST_OBJECT_PARENT (pad);
+ queue = GST_QUEUE_CAST (parent);
/* we have to lock the queue since we span threads */
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
}
static gboolean
-gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
+gst_queue_handle_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
+ GstQueue *queue = GST_QUEUE (parent);
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)",
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUEUE))
#define GST_IS_QUEUE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE))
+#define GST_QUEUE_CAST(obj) \
+ ((GstQueue *)(obj))
typedef struct _GstQueue GstQueue;
typedef struct _GstQueueSize GstQueueSize;
static void gst_queue2_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static GstFlowReturn gst_queue2_chain (GstPad * pad, GstBuffer * buffer);
+static GstFlowReturn gst_queue2_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
static GstFlowReturn gst_queue2_push_one (GstQueue2 * queue);
static void gst_queue2_loop (GstPad * pad);
-static gboolean gst_queue2_handle_sink_event (GstPad * pad, GstEvent * event);
+static gboolean gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_queue2_handle_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static gboolean gst_queue2_handle_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_queue2_handle_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_queue2_handle_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
static gboolean gst_queue2_handle_query (GstElement * element,
GstQuery * query);
-static GstFlowReturn gst_queue2_get_range (GstPad * pad, guint64 offset,
- guint length, GstBuffer ** buffer);
+static GstFlowReturn gst_queue2_get_range (GstPad * pad, GstObject * parent,
+ guint64 offset, guint length, GstBuffer ** buffer);
static gboolean gst_queue2_src_activate_pull (GstPad * pad, gboolean active);
static gboolean gst_queue2_src_activate_push (GstPad * pad, gboolean active);
}
static gboolean
-gst_queue2_handle_sink_event (GstPad * pad, GstEvent * event)
+gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
{
GstQueue2 *queue;
- queue = GST_QUEUE2 (GST_OBJECT_PARENT (pad));
+ queue = GST_QUEUE2 (parent);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
}
static GstFlowReturn
-gst_queue2_chain (GstPad * pad, GstBuffer * buffer)
+gst_queue2_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstQueue2 *queue;
- queue = GST_QUEUE2 (GST_OBJECT_PARENT (pad));
+ queue = GST_QUEUE2 (parent);
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "received buffer %p of size %"
G_GSIZE_FORMAT ", time %" GST_TIME_FORMAT ", duration %"
}
static gboolean
-gst_queue2_handle_src_event (GstPad * pad, GstEvent * event)
+gst_queue2_handle_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue2 *queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
+ GstQueue2 *queue = GST_QUEUE2 (parent);
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)",
}
static GstFlowReturn
-gst_queue2_get_range (GstPad * pad, guint64 offset, guint length,
- GstBuffer ** buffer)
+gst_queue2_get_range (GstPad * pad, GstObject * parent, guint64 offset,
+ guint length, GstBuffer ** buffer)
{
GstQueue2 *queue;
GstFlowReturn ret;
- queue = GST_QUEUE2_CAST (GST_PAD_PARENT (pad));
+ queue = GST_QUEUE2_CAST (parent);
length = (length == -1) ? DEFAULT_BUFFER_SIZE : length;
GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->srcresult, out_flushing);
GValue * value, GParamSpec * pspec);
static void gst_tee_dispose (GObject * object);
-static GstFlowReturn gst_tee_chain (GstPad * pad, GstBuffer * buffer);
-static GstFlowReturn gst_tee_chain_list (GstPad * pad, GstBufferList * list);
-static gboolean gst_tee_sink_event (GstPad * pad, GstEvent * event);
+static GstFlowReturn gst_tee_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
+static GstFlowReturn gst_tee_chain_list (GstPad * pad, GstObject * parent,
+ GstBufferList * list);
+static gboolean gst_tee_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_tee_sink_query (GstPad * pad, GstObject * parent,
GstQuery * query);
static gboolean gst_tee_sink_activate_push (GstPad * pad, gboolean active);
static gboolean gst_tee_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
static gboolean gst_tee_src_activate_pull (GstPad * pad, gboolean active);
-static GstFlowReturn gst_tee_src_get_range (GstPad * pad, guint64 offset,
- guint length, GstBuffer ** buf);
+static GstFlowReturn gst_tee_src_get_range (GstPad * pad, GstObject * parent,
+ guint64 offset, guint length, GstBuffer ** buf);
static void
gst_tee_dispose (GObject * object)
}
static gboolean
-gst_tee_sink_event (GstPad * pad, GstEvent * event)
+gst_tee_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res;
switch (GST_EVENT_TYPE (event)) {
default:
- res = gst_pad_event_default (pad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
}
}
static GstFlowReturn
-gst_tee_chain (GstPad * pad, GstBuffer * buffer)
+gst_tee_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstFlowReturn res;
GstTee *tee;
- tee = GST_TEE_CAST (GST_OBJECT_PARENT (pad));
+ tee = GST_TEE_CAST (parent);
GST_DEBUG_OBJECT (tee, "received buffer %p", buffer);
}
static GstFlowReturn
-gst_tee_chain_list (GstPad * pad, GstBufferList * list)
+gst_tee_chain_list (GstPad * pad, GstObject * parent, GstBufferList * list)
{
GstFlowReturn res;
GstTee *tee;
- tee = GST_TEE_CAST (GST_PAD_PARENT (pad));
+ tee = GST_TEE_CAST (parent);
GST_DEBUG_OBJECT (tee, "received list %p", list);
}
static GstFlowReturn
-gst_tee_src_get_range (GstPad * pad, guint64 offset, guint length,
- GstBuffer ** buf)
+gst_tee_src_get_range (GstPad * pad, GstObject * parent, guint64 offset,
+ guint length, GstBuffer ** buf)
{
GstTee *tee;
GstFlowReturn ret;
- tee = GST_TEE (GST_PAD_PARENT (pad));
+ tee = GST_TEE (parent);
ret = gst_pad_pull_range (tee->sinkpad, offset, length, buf);
#endif
static gboolean gst_type_find_element_src_event (GstPad * pad,
- GstEvent * event);
+ GstObject * parent, GstEvent * event);
static gboolean gst_type_find_handle_src_query (GstPad * pad,
GstObject * parent, GstQuery * query);
static gboolean gst_type_find_element_sink_event (GstPad * pad,
- GstEvent * event);
+ GstObject * parent, GstEvent * event);
static gboolean gst_type_find_element_setcaps (GstTypeFindElement * typefind,
GstCaps * caps);
static GstFlowReturn gst_type_find_element_chain (GstPad * sinkpad,
- GstBuffer * buffer);
+ GstObject * parent, GstBuffer * buffer);
static GstFlowReturn gst_type_find_element_getrange (GstPad * srcpad,
- guint64 offset, guint length, GstBuffer ** buffer);
+ GstObject * parent, guint64 offset, guint length, GstBuffer ** buffer);
static GstStateChangeReturn
gst_type_find_element_change_state (GstElement * element,
#endif
static gboolean
-gst_type_find_element_src_event (GstPad * pad, GstEvent * event)
+gst_type_find_element_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
{
- GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad));
+ GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (parent);
if (typefind->mode != MODE_NORMAL) {
/* need to do more? */
}
static gboolean
-gst_type_find_element_sink_event (GstPad * pad, GstEvent * event)
+gst_type_find_element_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
{
gboolean res = FALSE;
- GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad));
+ GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (parent);
GST_DEBUG_OBJECT (typefind, "got %s event in mode %d",
GST_EVENT_TYPE_NAME (event), typefind->mode);
}
static GstFlowReturn
-gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
+gst_type_find_element_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer)
{
GstTypeFindElement *typefind;
GstFlowReturn res = GST_FLOW_OK;
- typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad));
+ typefind = GST_TYPE_FIND_ELEMENT (parent);
GST_LOG_OBJECT (typefind, "handling buffer in mode %d", typefind->mode);
}
static GstFlowReturn
-gst_type_find_element_getrange (GstPad * srcpad,
+gst_type_find_element_getrange (GstPad * srcpad, GstObject * parent,
guint64 offset, guint length, GstBuffer ** buffer)
{
GstTypeFindElement *typefind;
GstFlowReturn ret;
- typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (srcpad));
+ typefind = GST_TYPE_FIND_ELEMENT (parent);
ret = gst_pad_pull_range (typefind->sink, offset, length, buffer);
static void gst_valve_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static GstFlowReturn gst_valve_chain (GstPad * pad, GstBuffer * buffer);
-static gboolean gst_valve_sink_event (GstPad * pad, GstEvent * event);
+static GstFlowReturn gst_valve_chain (GstPad * pad, GstObject * parent,
+ GstBuffer * buffer);
+static gboolean gst_valve_sink_event (GstPad * pad, GstObject * parent,
+ GstEvent * event);
static gboolean gst_valve_query (GstPad * pad, GstObject * parent,
GstQuery * query);
}
static GstFlowReturn
-gst_valve_chain (GstPad * pad, GstBuffer * buffer)
+gst_valve_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
- GstValve *valve = GST_VALVE (GST_OBJECT_PARENT (pad));
+ GstValve *valve = GST_VALVE (parent);
GstFlowReturn ret = GST_FLOW_OK;
if (g_atomic_int_get (&valve->drop)) {
static gboolean
-gst_valve_sink_event (GstPad * pad, GstEvent * event)
+gst_valve_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstValve *valve;
gboolean ret = TRUE;
- valve = GST_VALVE (GST_PAD_PARENT (pad));
+ valve = GST_VALVE (parent);
if (g_atomic_int_get (&valve->drop))
gst_event_unref (event);
GST_STATIC_CAPS_ANY);
static gboolean
-event_func (GstPad * pad, GstEvent * event)
+event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
have_eos = TRUE;
GST_STATIC_CAPS_ANY);
static gboolean
-event_func (GstPad * pad, GstEvent * event)
+event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
have_eos = TRUE;
GST_STATIC_CAPS_ANY);
static gboolean
-event_func (GstPad * pad, GstEvent * event)
+event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res = TRUE;
static gint alloccount = 0;
static GstFlowReturn
-chain_ok (GstPad * pad, GstBuffer * buffer)
+chain_ok (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
bufcount++;
GST_STATIC_CAPS_ANY);
static gboolean
-event_func (GstPad * pad, GstEvent * event)
+event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
have_eos = TRUE;
};
static GstFlowReturn
-mq_dummypad_chain (GstPad * sinkpad, GstBuffer * buf)
+mq_dummypad_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
{
guint32 cur_id;
struct PadData *pad_data;
}
static gboolean
-mq_dummypad_event (GstPad * sinkpad, GstEvent * event)
+mq_dummypad_event (GstPad * sinkpad, GstObject * parent, GstEvent * event)
{
struct PadData *pad_data;
}
static gboolean
-event_func (GstPad * pad, GstEvent * event)
+event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
GST_DEBUG ("%s event", gst_event_type_get_name (GST_EVENT_TYPE (event)));
events = g_list_append (events, event);
GST_END_TEST;
static GstFlowReturn
-_fake_chain (GstPad * pad, GstBuffer * buffer)
+_fake_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
gst_buffer_unref (buffer);
return GST_FLOW_OK;
}
static GstFlowReturn
-_fake_chain_error (GstPad * pad, GstBuffer * buffer)
+_fake_chain_error (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
gst_buffer_unref (buffer);
return GST_FLOW_ERROR;
gboolean buffer_allocated = FALSE;
static gboolean
-event_func (GstPad * pad, GstEvent * event)
+event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
event_received = TRUE;
gst_event_unref (event);
static GstCaps *event_caps = NULL;
static gboolean
-sticky_event (GstPad * pad, GstEvent * event)
+sticky_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstCaps *caps;
}
static GstFlowReturn
-result_sink_chain (GstPad * pad, GstBuffer * buffer)
+result_sink_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
TestTransData *data;