1 /* GStreamer 2 * Copyright (C) 2005 Stefan Kost <ensonic@users.sf.net> 3 * 4 * gstchildproxy.h: interface header for multi child elements 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GST_CHILD_PROXY_H__ 23 #define __GST_CHILD_PROXY_H__ 24 25 #include <glib-object.h> 26 #include <gst/gst.h> 27 28 G_BEGIN_DECLS 29 30 31 #define GST_TYPE_CHILD_PROXY (gst_child_proxy_get_type ()) 32 #define GST_CHILD_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CHILD_PROXY, GstChildProxy)) 33 #define GST_IS_CHILD_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CHILD_PROXY)) 34 #define GST_CHILD_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_CHILD_PROXY, GstChildProxyInterface)) 35 36 /** 37 * GstChildProxy: 38 * 39 * Opaque #GstChildProxy data structure. 40 */ 41 typedef struct _GstChildProxy GstChildProxy; /* dummy object */ 42 typedef struct _GstChildProxyInterface GstChildProxyInterface; 43 44 /** 45 * GstChildProxyInterface: 46 * @parent: parent interface type. 47 * 48 * #GstChildProxy interface. 49 */ 50 struct _GstChildProxyInterface 51 { 52 GTypeInterface parent; 53 54 /* methods */ 55 56 /** 57 * GstChildProxyInterface.get_child_by_name: 58 * @parent: the #GstChildProxy 59 * @name: the name of the child to fetch 60 * 61 * Fetch a child object by name 62 * 63 * Returns: (transfer full) (nullable): the child object 64 */ 65 GObject * (*get_child_by_name) (GstChildProxy * parent, const gchar * name); 66 67 /** 68 * GstChildProxyInterface.get_child_by_index: 69 * @parent: the #GstChildProxy 70 * @index: the index of the child to fetch 71 * 72 * Fetch a child object by index 73 * 74 * Returns: (transfer full) (nullable): the child object 75 */ 76 GObject * (*get_child_by_index) (GstChildProxy * parent, guint index); 77 78 /** 79 * GstChildProxyInterface.get_children_count: 80 * @parent: the #GstChildProxy 81 * 82 * Get the number of children in @parent 83 * 84 * Returns: the number of children 85 */ 86 guint (*get_children_count) (GstChildProxy * parent); 87 88 /*< private >*/ 89 /* signals */ 90 91 /** 92 * GstChildProxyInterface.child_added: 93 * @parent: the #GstChildProxy 94 * @child: the child object 95 * @name: the name of the child object 96 * 97 * Called when @child is added to @parent 98 */ 99 void (*child_added) (GstChildProxy * parent, GObject * child, const gchar * name); 100 101 /** 102 * GstChildProxyInterface.child_removed: 103 * @parent: the #GstChildProxy 104 * @child: the child object 105 * @name: the name of the child object 106 * 107 * Called when @child is removed from @parent 108 */ 109 void (*child_removed) (GstChildProxy * parent, GObject * child, const gchar * name); 110 111 /*< private >*/ 112 gpointer _gst_reserved[GST_PADDING]; 113 }; 114 115 GST_API 116 GType gst_child_proxy_get_type (void); 117 118 GST_API 119 GObject * gst_child_proxy_get_child_by_name (GstChildProxy * parent, const gchar * name); 120 121 GST_API 122 guint gst_child_proxy_get_children_count (GstChildProxy * parent); 123 124 GST_API 125 GObject * gst_child_proxy_get_child_by_index (GstChildProxy * parent, guint index); 126 127 GST_API 128 gboolean gst_child_proxy_lookup (GstChildProxy *object, const gchar *name, 129 GObject **target, GParamSpec **pspec); 130 GST_API 131 void gst_child_proxy_get_property (GstChildProxy * object, const gchar *name, 132 GValue *value); 133 GST_API 134 void gst_child_proxy_get_valist (GstChildProxy * object, 135 const gchar * first_property_name, 136 va_list var_args); 137 GST_API 138 void gst_child_proxy_get (GstChildProxy * object, 139 const gchar * first_property_name, 140 ...) G_GNUC_NULL_TERMINATED; 141 GST_API 142 void gst_child_proxy_set_property (GstChildProxy * object, const gchar *name, 143 const GValue *value); 144 145 GST_API 146 void gst_child_proxy_set_valist (GstChildProxy* object, 147 const gchar * first_property_name, 148 va_list var_args); 149 GST_API 150 void gst_child_proxy_set (GstChildProxy * object, 151 const gchar * first_property_name, 152 ...) G_GNUC_NULL_TERMINATED; 153 GST_API 154 void gst_child_proxy_child_added (GstChildProxy * parent, GObject * child, 155 const gchar *name); 156 GST_API 157 void gst_child_proxy_child_removed (GstChildProxy * parent, GObject * child, 158 const gchar *name); 159 160 G_END_DECLS 161 162 #endif /* __GST_CHILD_PROXY_H__ */ 163