Commit 0d3299c6 authored by Wim Taymans's avatar Wim Taymans
Browse files

Add function to perform a query on the peer of a pad.

Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gstpad.c: (gst_pad_peer_query):
* gst/gstpad.h:
Add function to perform a query on the peer of a pad.
API: gst_pad_peer_query()
parent 33f966fe
2007-09-11 Wim Taymans <wim.taymans@gmail.com>
* docs/gst/gstreamer-sections.txt:
* gst/gstpad.c: (gst_pad_peer_query):
* gst/gstpad.h:
Add function to perform a query on the peer of a pad.
API: gst_pad_peer_query()
2007-09-11 Stefan Kost <ensonic@users.sf.net>
* tests/check/gst/gstsystemclock.c:
......
......@@ -1284,6 +1284,7 @@ gst_pad_send_event
gst_pad_event_default
gst_pad_query
gst_pad_peer_query
gst_pad_query_default
gst_pad_query_position
gst_pad_query_duration
......
......@@ -3064,6 +3064,56 @@ no_func:
}
}
/**
* gst_pad_peer_query:
* @pad: a #GstPad to invoke the peer query on.
* @query: the #GstQuery to perform.
*
* Performs gst_pad_query() on the peer of @pad.
*
* The caller is responsible for both the allocation and deallocation of
* the query structure.
*
* Returns: TRUE if the query could be performed. This function returns %FALSE
* if @pad has no peer.
*
* Since: 0.10.15
*/
gboolean
gst_pad_peer_query (GstPad * pad, GstQuery * query)
{
GstPad *peerpad;
gboolean result;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
GST_OBJECT_LOCK (pad);
GST_DEBUG_OBJECT (pad, "peer query");
peerpad = GST_PAD_PEER (pad);
if (G_UNLIKELY (peerpad == NULL))
goto no_peer;
gst_object_ref (peerpad);
GST_OBJECT_UNLOCK (pad);
result = gst_pad_query (peerpad, query);
gst_object_unref (peerpad);
return result;
/* ERRORS */
no_peer:
{
GST_WARNING_OBJECT (pad, "pad has no peer");
GST_OBJECT_UNLOCK (pad);
return FALSE;
}
}
/**
* gst_pad_query_default:
* @pad: a #GstPad to call the default query handler on.
......
......@@ -864,6 +864,7 @@ G_CONST_RETURN GstQueryType*
gst_pad_get_query_types_default (GstPad *pad);
gboolean gst_pad_query (GstPad *pad, GstQuery *query);
gboolean gst_pad_peer_query (GstPad *pad, GstQuery *query);
void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
gboolean gst_pad_query_default (GstPad *pad, GstQuery *query);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment