2004-07-22 David Schleef <ds@schleef.org>
+ * gst/gststructure.c: (gst_structure_id_empty_new),
+ (gst_structure_empty_new): Set type field correctly.
+ * gst/gststructure.h: Check type field correctly.
+ * testsuite/caps/Makefile.am:
+ * testsuite/caps/structure.c: (test1), (main): Add a very small
+ test for structures.
+
+2004-07-22 David Schleef <ds@schleef.org>
+
* docs/random/ds/0.9-suggested-changes: more comments
* tools/gst-launch.c: (idle_func): Fix hard-to-translate string.
g_return_val_if_fail (quark != 0, NULL);
structure = g_new0 (GstStructure, 1);
+ structure->type = gst_structure_get_type ();
structure->name = quark;
structure->fields = g_array_new (FALSE, TRUE, sizeof (GstStructureField));
g_return_val_if_fail (name != NULL, NULL);
structure = g_new0 (GstStructure, 1);
+ structure->type = gst_structure_get_type ();
structure->name = g_quark_from_string (name);
structure->fields = g_array_new (FALSE, TRUE, sizeof (GstStructureField));
G_BEGIN_DECLS
#define GST_TYPE_STRUCTURE (gst_structure_get_type ())
-#define GST_STRUCTURE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GST_TYPE_STRUCTURE, GstStructure))
-#define GST_IS_STRUCTURE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GST_TYPE_STRUCTURE))
+#define GST_STRUCTURE(object) ((GstStructure *)(object))
+#define GST_IS_STRUCTURE(object) ((object) && (GST_STRUCTURE(object)->type == GST_TYPE_STRUCTURE))
typedef struct _GstStructure GstStructure;
subtract \
sets \
simplify \
- random
+ random \
+ structure
EXTRA_DIST = caps_strings
--- /dev/null
+
+#include <gst/gst.h>
+
+
+void
+test1 (void)
+{
+ GstStructure *structure;
+
+ g_print ("type is %d\n", (int) gst_structure_get_type ());
+
+ structure = gst_structure_empty_new ("moo");
+ g_assert (structure != NULL);
+ g_assert (GST_IS_STRUCTURE (structure));
+}
+
+int
+main (int argc, char *argv[])
+{
+ gst_init (&argc, &argv);
+
+ test1 ();
+
+ return 0;
+}
subtract \
sets \
simplify \
- random
+ random \
+ structure
EXTRA_DIST = caps_strings
--- /dev/null
+
+#include <gst/gst.h>
+
+
+void
+test1 (void)
+{
+ GstStructure *structure;
+
+ g_print ("type is %d\n", (int) gst_structure_get_type ());
+
+ structure = gst_structure_empty_new ("moo");
+ g_assert (structure != NULL);
+ g_assert (GST_IS_STRUCTURE (structure));
+}
+
+int
+main (int argc, char *argv[])
+{
+ gst_init (&argc, &argv);
+
+ test1 ();
+
+ return 0;
+}