summaryrefslogtreecommitdiff
path: root/include/gst/gstchildproxy.h
blob: deb8f21dcdadd11b08921c7889a90009cf892f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/* GStreamer
 * Copyright (C) 2005 Stefan Kost <ensonic@users.sf.net>
 *
 * gstchildproxy.h: interface header for multi child elements
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef __GST_CHILD_PROXY_H__
#define __GST_CHILD_PROXY_H__

#include <glib-object.h>
#include <gst/gst.h>

G_BEGIN_DECLS


#define GST_TYPE_CHILD_PROXY               (gst_child_proxy_get_type ())
#define GST_CHILD_PROXY(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CHILD_PROXY, GstChildProxy))
#define GST_IS_CHILD_PROXY(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CHILD_PROXY))
#define GST_CHILD_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_CHILD_PROXY, GstChildProxyInterface))

/**
 * GstChildProxy:
 *
 * Opaque #GstChildProxy data structure.
 */
typedef struct _GstChildProxy GstChildProxy;    /* dummy object */
typedef struct _GstChildProxyInterface GstChildProxyInterface;

/**
 * GstChildProxyInterface:
 * @parent: parent interface type.
 *
 * #GstChildProxy interface.
 */
struct _GstChildProxyInterface
{
  GTypeInterface parent;

  /* methods */

  /**
   * GstChildProxyInterface.get_child_by_name:
   * @parent: the #GstChildProxy
   * @name: the name of the child to fetch
   *
   * Fetch a child object by name
   *
   * Returns: (transfer full) (nullable): the child object
   */
  GObject * (*get_child_by_name)  (GstChildProxy * parent, const gchar * name);

  /**
   * GstChildProxyInterface.get_child_by_index:
   * @parent: the #GstChildProxy
   * @index: the index of the child to fetch
   *
   * Fetch a child object by index
   *
   * Returns: (transfer full) (nullable): the child object
   */
  GObject * (*get_child_by_index) (GstChildProxy * parent, guint index);

  /**
   * GstChildProxyInterface.get_children_count:
   * @parent: the #GstChildProxy
   *
   * Get the number of children in @parent
   *
   * Returns: the number of children
   */
  guint     (*get_children_count) (GstChildProxy * parent);

  /*< private >*/
  /* signals */

  /**
   * GstChildProxyInterface.child_added:
   * @parent: the #GstChildProxy
   * @child: the child object
   * @name: the name of the child object
   *
   * Called when @child is added to @parent
   */
  void      (*child_added)        (GstChildProxy * parent, GObject * child, const gchar * name);

  /**
   * GstChildProxyInterface.child_removed:
   * @parent: the #GstChildProxy
   * @child: the child object
   * @name: the name of the child object
   *
   * Called when @child is removed from @parent
   */
  void      (*child_removed)      (GstChildProxy * parent, GObject * child, const gchar * name);

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

GST_API
GType     gst_child_proxy_get_type (void);

GST_API
GObject * gst_child_proxy_get_child_by_name  (GstChildProxy * parent, const gchar * name);

GST_API
guint     gst_child_proxy_get_children_count (GstChildProxy * parent);

GST_API
GObject * gst_child_proxy_get_child_by_index (GstChildProxy * parent, guint index);

GST_API
gboolean  gst_child_proxy_lookup             (GstChildProxy *object, const gchar *name,
                                              GObject **target, GParamSpec **pspec);
GST_API
void      gst_child_proxy_get_property       (GstChildProxy * object, const gchar *name,
                                              GValue *value);
GST_API
void      gst_child_proxy_get_valist         (GstChildProxy * object,
                                              const gchar * first_property_name,
                                              va_list var_args);
GST_API
void      gst_child_proxy_get                (GstChildProxy * object,
                                              const gchar * first_property_name,
                                              ...) G_GNUC_NULL_TERMINATED;
GST_API
void      gst_child_proxy_set_property       (GstChildProxy * object, const gchar *name,
                                              const GValue *value);

GST_API
void      gst_child_proxy_set_valist         (GstChildProxy* object,
                                              const gchar * first_property_name,
                                              va_list var_args);
GST_API
void      gst_child_proxy_set                (GstChildProxy * object,
                                              const gchar * first_property_name,
                                              ...) G_GNUC_NULL_TERMINATED;
GST_API
void      gst_child_proxy_child_added        (GstChildProxy * parent, GObject * child,
                                              const gchar *name);
GST_API
void      gst_child_proxy_child_removed      (GstChildProxy * parent, GObject * child,
                                              const gchar *name);

G_END_DECLS

#endif /* __GST_CHILD_PROXY_H__ */