2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gstprops.h: Header for properties subsystem
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #ifndef __GST_PROPS_H__
25 #define __GST_PROPS_H__
28 #include <parser.h> // NOTE: this is xml-config's fault
30 // Include compatability defines: if libxml hasn't already defined these,
31 // we have an old version 1.x
32 #ifndef xmlChildrenNode
33 #define xmlChildrenNode childs
34 #define xmlRootNode root
38 typedef struct _GstProps GstProps;
44 GST_PROPS_INT_RANGE_ID,
46 GST_PROPS_FLOAT_RANGE_ID,
50 GST_PROPS_LAST_ID = GST_PROPS_END_ID + 16,
53 #define GST_MAKE_FOURCC(a,b,c,d) ((a)|(b)<<8|(c)<<16|(d)<<24)
54 #define GST_STR_FOURCC(f) (((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))
56 #define GST_PROPS_LIST(a...) GST_PROPS_LIST_ID,##a,NULL
57 #define GST_PROPS_INT(a) GST_PROPS_INT_ID,(a)
58 #define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(a),(b)
59 #define GST_PROPS_FLOAT(a) GST_PROPS_FLOAT_ID,(a)
60 #define GST_PROPS_FLOAT_RANGE(a,b) GST_PROPS_FLOAT_RANGE_ID,(a),(b)
61 #define GST_PROPS_FOURCC(a) GST_PROPS_FOURCC_ID,(a)
62 #define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(a)
63 #define GST_PROPS_STRING(a) GST_PROPS_STRING_ID,(a)
70 GList *properties; /* real properties for this property */
73 /* initialize the subsystem */
74 void _gst_props_initialize (void);
76 GstProps* gst_props_new (const gchar *firstname, ...);
77 GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
79 void gst_props_unref (GstProps *props);
80 void gst_props_ref (GstProps *props);
81 void gst_props_destroy (GstProps *props);
83 GstProps* gst_props_copy (GstProps *props);
84 GstProps* gst_props_copy_on_write (GstProps *props);
86 GstProps* gst_props_merge (GstProps *props, GstProps *tomerge);
88 gboolean gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops);
90 GstProps* gst_props_set (GstProps *props, const gchar *name, ...);
92 gint gst_props_get_int (GstProps *props, const gchar *name);
93 gfloat gst_props_get_float (GstProps *props, const gchar *name);
94 gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name);
95 gboolean gst_props_get_boolean (GstProps *props, const gchar *name);
96 const gchar* gst_props_get_string (GstProps *props, const gchar *name);
98 xmlNodePtr gst_props_save_thyself (GstProps *props, xmlNodePtr parent);
99 GstProps* gst_props_load_thyself (xmlNodePtr parent);
101 #endif /* __GST_PROPS_H__ */