mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
childproxy: gracefully handle methods being NULL
Do this for all method invoke functions for consistency. https://bugzilla.gnome.org/show_bug.cgi?id=750154
This commit is contained in:
parent
d06dca135d
commit
db1d99db76
1 changed files with 24 additions and 5 deletions
|
@ -117,10 +117,16 @@ gst_child_proxy_default_get_child_by_name (GstChildProxy * parent,
|
|||
GObject *
|
||||
gst_child_proxy_get_child_by_name (GstChildProxy * parent, const gchar * name)
|
||||
{
|
||||
GstChildProxyInterface *iface;
|
||||
|
||||
g_return_val_if_fail (GST_IS_CHILD_PROXY (parent), 0);
|
||||
|
||||
return (GST_CHILD_PROXY_GET_INTERFACE (parent)->get_child_by_name (parent,
|
||||
name));
|
||||
iface = GST_CHILD_PROXY_GET_INTERFACE (parent);
|
||||
|
||||
if (iface->get_child_by_name != NULL)
|
||||
return iface->get_child_by_name (parent, name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,10 +144,16 @@ gst_child_proxy_get_child_by_name (GstChildProxy * parent, const gchar * name)
|
|||
GObject *
|
||||
gst_child_proxy_get_child_by_index (GstChildProxy * parent, guint index)
|
||||
{
|
||||
GstChildProxyInterface *iface;
|
||||
|
||||
g_return_val_if_fail (GST_IS_CHILD_PROXY (parent), NULL);
|
||||
|
||||
return (GST_CHILD_PROXY_GET_INTERFACE (parent)->get_child_by_index (parent,
|
||||
index));
|
||||
iface = GST_CHILD_PROXY_GET_INTERFACE (parent);
|
||||
|
||||
if (iface->get_child_by_index != NULL)
|
||||
return iface->get_child_by_index (parent, index);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,9 +169,16 @@ gst_child_proxy_get_child_by_index (GstChildProxy * parent, guint index)
|
|||
guint
|
||||
gst_child_proxy_get_children_count (GstChildProxy * parent)
|
||||
{
|
||||
GstChildProxyInterface *iface;
|
||||
|
||||
g_return_val_if_fail (GST_IS_CHILD_PROXY (parent), 0);
|
||||
|
||||
return (GST_CHILD_PROXY_GET_INTERFACE (parent)->get_children_count (parent));
|
||||
iface = GST_CHILD_PROXY_GET_INTERFACE (parent);
|
||||
|
||||
if (iface->get_children_count != NULL)
|
||||
return iface->get_children_count (parent);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue