mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
don't require parent element to proxy
This commit is contained in:
parent
1fcd85308a
commit
a641b0ce39
1 changed files with 0 additions and 29 deletions
|
@ -2731,7 +2731,6 @@ query_accept_caps_func (GstPad * pad, QueryAcceptCapsData * data)
|
||||||
gboolean
|
gboolean
|
||||||
gst_pad_proxy_query_accept_caps (GstPad * pad, GstQuery * query)
|
gst_pad_proxy_query_accept_caps (GstPad * pad, GstQuery * query)
|
||||||
{
|
{
|
||||||
GstElement *element;
|
|
||||||
QueryAcceptCapsData data;
|
QueryAcceptCapsData data;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||||
|
@ -2741,28 +2740,14 @@ gst_pad_proxy_query_accept_caps (GstPad * pad, GstQuery * query)
|
||||||
GST_CAT_DEBUG (GST_CAT_PADS, "proxying accept caps query for %s:%s",
|
GST_CAT_DEBUG (GST_CAT_PADS, "proxying accept caps query for %s:%s",
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
|
|
||||||
element = gst_pad_get_parent_element (pad);
|
|
||||||
if (element == NULL)
|
|
||||||
goto no_parent;
|
|
||||||
|
|
||||||
data.query = query;
|
data.query = query;
|
||||||
/* value to hold the return, by default it holds TRUE */
|
/* value to hold the return, by default it holds TRUE */
|
||||||
data.ret = TRUE;
|
data.ret = TRUE;
|
||||||
|
|
||||||
gst_pad_forward (pad, (GstPadForwardFunction) query_accept_caps_func, &data);
|
gst_pad_forward (pad, (GstPadForwardFunction) query_accept_caps_func, &data);
|
||||||
|
|
||||||
gst_object_unref (element);
|
|
||||||
|
|
||||||
gst_query_set_accept_caps_result (query, data.ret);
|
gst_query_set_accept_caps_result (query, data.ret);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* ERRORS */
|
|
||||||
no_parent:
|
|
||||||
{
|
|
||||||
GST_DEBUG_OBJECT (pad, "no parent");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -2810,7 +2795,6 @@ query_caps_func (GstPad * pad, QueryCapsData * data)
|
||||||
gboolean
|
gboolean
|
||||||
gst_pad_proxy_query_caps (GstPad * pad, GstQuery * query)
|
gst_pad_proxy_query_caps (GstPad * pad, GstQuery * query)
|
||||||
{
|
{
|
||||||
GstElement *element;
|
|
||||||
GstCaps *intersected;
|
GstCaps *intersected;
|
||||||
QueryCapsData data;
|
QueryCapsData data;
|
||||||
|
|
||||||
|
@ -2821,18 +2805,12 @@ gst_pad_proxy_query_caps (GstPad * pad, GstQuery * query)
|
||||||
GST_CAT_DEBUG (GST_CAT_PADS, "proxying caps query for %s:%s",
|
GST_CAT_DEBUG (GST_CAT_PADS, "proxying caps query for %s:%s",
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
|
|
||||||
element = gst_pad_get_parent_element (pad);
|
|
||||||
if (element == NULL)
|
|
||||||
goto no_parent;
|
|
||||||
|
|
||||||
data.query = query;
|
data.query = query;
|
||||||
/* value to hold the return, by default it holds ANY */
|
/* value to hold the return, by default it holds ANY */
|
||||||
data.ret = gst_caps_new_any ();
|
data.ret = gst_caps_new_any ();
|
||||||
|
|
||||||
gst_pad_forward (pad, (GstPadForwardFunction) query_caps_func, &data);
|
gst_pad_forward (pad, (GstPadForwardFunction) query_caps_func, &data);
|
||||||
|
|
||||||
gst_object_unref (element);
|
|
||||||
|
|
||||||
if (data.ret) {
|
if (data.ret) {
|
||||||
intersected =
|
intersected =
|
||||||
gst_caps_intersect (data.ret, gst_pad_get_pad_template_caps (pad));
|
gst_caps_intersect (data.ret, gst_pad_get_pad_template_caps (pad));
|
||||||
|
@ -2844,13 +2822,6 @@ gst_pad_proxy_query_caps (GstPad * pad, GstQuery * query)
|
||||||
gst_caps_unref (intersected);
|
gst_caps_unref (intersected);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* ERRORS */
|
|
||||||
no_parent:
|
|
||||||
{
|
|
||||||
GST_DEBUG_OBJECT (pad, "no parent");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue