/**
* SECTION:gstchildproxy
+ * @title: GstChildProxy
* @short_description: Interface for multi child elements.
* @see_also: #GstBin
*
* together with gst_object_get_name(). If the interface is to be used with
* #GObjects, this methods needs to be overridden.
*
- * Returns: (transfer full): the child object or %NULL if not found. Unref
- * after usage.
+ * Returns: (transfer full) (nullable): the child object or %NULL if
+ * not found. Unref after usage.
*
* MT safe.
*/
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;
}
/**
*
* Fetches a child by its number.
*
- * Returns: (transfer full): the child object or %NULL if not found (index
- * too high). Unref after usage.
+ * Returns: (transfer full) (nullable): the child object or %NULL if
+ * not found (index too high). Unref after usage.
*
* MT safe.
*/
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;
}
/**
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;
}
/**
*
* MT safe.
*
- * Returns: TRUE if @target and @pspec could be found. FALSE otherwise. In that
+ * Returns: %TRUE if @target and @pspec could be found. %FALSE otherwise. In that
* case the values for @pspec and @target are not modified. Unref @target after
* usage. For plain GObjects @target is the same as @object.
*/
g_return_val_if_fail (GST_IS_CHILD_PROXY (object), FALSE);
g_return_val_if_fail (name != NULL, FALSE);
- obj = g_object_ref (object);
+ obj = G_OBJECT (g_object_ref (object));
current = names = g_strsplit (name, "::", -1);
/* find the owner of the property */
* gst_child_proxy_get_valist:
* @object: the object to query
* @first_property_name: name of the first property to get
- * @var_args: return location for the first property, followed optionally by more name/return location pairs, followed by NULL
+ * @var_args: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
*
* Gets properties of the parent object and its children.
*/
* gst_child_proxy_get:
* @object: the parent object
* @first_property_name: name of the first property to get
- * @...: return location for the first property, followed optionally by more name/return location pairs, followed by NULL
+ * @...: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
*
* Gets properties of the parent object and its children.
*/
* gst_child_proxy_set_valist:
* @object: the parent object
* @first_property_name: name of the first property to set
- * @var_args: value for the first property, followed optionally by more name/value pairs, followed by NULL
+ * @var_args: value for the first property, followed optionally by more name/value pairs, followed by %NULL
*
* Sets properties of the parent object and its children.
*/
* gst_child_proxy_set:
* @object: the parent object
* @first_property_name: name of the first property to set
- * @...: value for the first property, followed optionally by more name/value pairs, followed by NULL
+ * @...: value for the first property, followed optionally by more name/value pairs, followed by %NULL
*
* Sets properties of the parent object and its children.
*/