fix doc build fix autogen
[platform/upstream/gstreamer.git] / gst / gststructure.h
1 /* GStreamer
2  * Copyright (C) <2003> David A. Schleef <ds@schleef.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GST_STRUCTURE_H__
21 #define __GST_STRUCTURE_H__
22
23 #include <gst/gstconfig.h>
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 typedef struct _GstStructure GstStructure;
29
30 typedef gboolean (*GstStructureForeachFunc) (GQuark field_id, GValue *value,
31     gpointer user_data);
32
33 struct _GstStructure {
34   GType type;
35
36   GQuark name;
37
38   GArray *fields;
39 };
40
41 #define GST_TYPE_STRUCTURE (gst_structure_get_type())
42
43 GType gst_structure_get_type(void);
44 void _gst_structure_initialize(void);
45
46 GstStructure *gst_structure_empty_new(const gchar *name);
47 GstStructure *gst_structure_id_empty_new(GQuark quark);
48 GstStructure *gst_structure_new(const gchar *name,
49     const gchar *firstfield, ...);
50 GstStructure *gst_structure_new_valist(const gchar *name,
51     const gchar *firstfield, va_list varargs);
52 GstStructure *gst_structure_copy(GstStructure *structure);
53 void gst_structure_free(GstStructure *structure);
54
55 G_CONST_RETURN gchar *gst_structure_get_name(const GstStructure *structure);
56 void gst_structure_set_name(GstStructure *structure, const gchar *name);
57
58 void gst_structure_id_set_value(GstStructure *structure, GQuark field,
59     const GValue *value);
60 void gst_structure_set_value(GstStructure *structure, const gchar *field,
61     const GValue *value);
62 void gst_structure_set(GstStructure *structure, const gchar *field, ...);
63 void gst_structure_set_valist(GstStructure *structure, const gchar *field,
64     va_list varargs);
65 G_CONST_RETURN GValue *gst_structure_id_get_value(const GstStructure *structure,
66     GQuark field);
67 G_CONST_RETURN GValue *gst_structure_get_value(const GstStructure *structure,
68     const gchar *field);
69 void gst_structure_remove_field(GstStructure *structure, const gchar *field);
70 void gst_structure_remove_all_fields(GstStructure *structure);
71
72 GType gst_structure_get_field_type(const GstStructure *structure,
73     const gchar *field);
74 gboolean gst_structure_foreach (GstStructure *structure,
75     GstStructureForeachFunc func, gpointer user_data);
76 gint gst_structure_n_fields(const GstStructure *structure);
77 gboolean gst_structure_has_field(const GstStructure *structure, const gchar *field);
78 gboolean gst_structure_has_field_typed(const GstStructure *structure,
79     const gchar *field, GType type);
80
81 /* utility functions */
82
83 gboolean gst_structure_get_boolean(const GstStructure *structure, const gchar *field,
84     gboolean *value);
85 gboolean gst_structure_get_int(const GstStructure *structure, const gchar *field,
86     gint *value);
87 gboolean gst_structure_get_fourcc(const GstStructure *structure, const gchar *field,
88     guint32 *value);
89 gboolean gst_structure_get_double(const GstStructure *structure, const gchar *field,
90     gdouble *value);
91 G_CONST_RETURN gchar *gst_structure_get_string(const GstStructure *structure,
92     const gchar *field);
93
94 gchar * gst_structure_to_string(const GstStructure *structure);
95 GstStructure * gst_structure_from_string (const gchar *string, gchar **end);
96
97
98 G_END_DECLS
99
100 #endif
101