- * 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.
- *
- * Returns: TRUE if the event was handled.
- *
- * Since: 0.10.36
- */
-gboolean
-gst_proxy_pad_event_default (GstPad * pad, GstObject * parent, GstEvent * event)
-{
- gboolean res;
- GstPad *internal;
-
- g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
- g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
-
- internal = GST_PROXY_PAD_INTERNAL (pad);
- res = gst_pad_push_event (internal, event);
-
- return res;
-}
-
-static gboolean
-gst_proxy_pad_query_caps (GstPad * pad, GstQuery * query)
-{
- gboolean res;
- GstPad *target;
- GstCaps *result;
- GstPadTemplate *templ;
-
- g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
-
- templ = GST_PAD_PAD_TEMPLATE (pad);
- target = gst_proxy_pad_get_target (pad);
- if (target) {
- /* if we have a real target, proxy the call */
- res = gst_pad_query (target, query);
-
- GST_DEBUG_OBJECT (pad, "get caps of target %s:%s : %" GST_PTR_FORMAT,
- GST_DEBUG_PAD_NAME (target), query);
-
- gst_object_unref (target);
-
- /* filter against the template */
- if (templ && res) {
- GstCaps *filt, *tmp;
-
- filt = GST_PAD_TEMPLATE_CAPS (templ);
- if (filt) {
- gst_query_parse_caps_result (query, &result);
- tmp = gst_caps_intersect_full (result, filt, GST_CAPS_INTERSECT_FIRST);
- gst_query_set_caps_result (query, tmp);
- GST_DEBUG_OBJECT (pad,
- "filtered against template gives %" GST_PTR_FORMAT, tmp);
- gst_caps_unref (tmp);
- }
- }
- } else {
- GstCaps *filter;
-
- res = TRUE;
-
- gst_query_parse_caps (query, &filter);
-
- /* else, if we have a template, use its caps. */
- if (templ) {
- result = GST_PAD_TEMPLATE_CAPS (templ);
- GST_DEBUG_OBJECT (pad,
- "using pad template %p with caps %p %" GST_PTR_FORMAT, templ, result,
- result);
-
- if (filter) {
- GstCaps *intersection;
-
- GST_DEBUG_OBJECT (pad, "intersect with filter");
- intersection =
- gst_caps_intersect_full (filter, result, GST_CAPS_INTERSECT_FIRST);
- gst_query_set_caps_result (query, intersection);
- gst_caps_unref (intersection);
- } else {
- gst_query_set_caps_result (query, result);
- }
- goto done;
- }
-
- /* If there's a filter, return that */
- if (filter != NULL) {
- GST_DEBUG_OBJECT (pad, "return filter");
- gst_query_set_caps_result (query, filter);
- goto done;
- }
-
- /* last resort, any caps */
- GST_DEBUG_OBJECT (pad, "pad has no template, returning ANY");
- result = gst_caps_new_any ();
- gst_query_set_caps_result (query, result);
- gst_caps_unref (result);
- }
-
-done:
- return res;
-}
-
-/**
- * gst_proxy_pad_query_default:
- * @pad: a #GstPad to invoke the default query on.
- * @parent: the parent of @pad or NULL
- * @query: (transfer none): the #GstQuery to perform.
- *
- * Invoke the default query function of the proxy pad.
- *
- * Returns: TRUE if the query could be performed.
- *
- * Since: 0.10.36
- */
-gboolean
-gst_proxy_pad_query_default (GstPad * pad, GstObject * parent, GstQuery * query)
-{
- gboolean res;
- GstPad *target;
-
- g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
- g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
-
-
- switch (GST_QUERY_TYPE (query)) {
- case GST_QUERY_ACCEPT_CAPS:
- {
- target = gst_proxy_pad_get_target (pad);
- if (target) {
- res = gst_pad_query (target, query);
- gst_object_unref (target);
- } else {
- GST_DEBUG_OBJECT (pad, "no target");
- /* We don't have a target, we return TRUE and we assume that any future
- * target will be able to deal with any configured caps. */
- res = TRUE;
- }
- break;
- }
- case GST_QUERY_CAPS:
- {
- res = gst_proxy_pad_query_caps (pad, query);
- break;
- }
- default:
- {
- target = gst_proxy_pad_get_target (pad);
- if (target) {
- res = gst_pad_query (target, query);
- gst_object_unref (target);
- } else {
- GST_DEBUG_OBJECT (pad, "no target pad");
- res = FALSE;
- }
- break;
- }
- }
- return res;
-}
-
-/**
- * gst_proyx_pad_iterate_internal_links_default: