+2008-03-22 Sebastian Dröge <slomo@circular-chaos.org>
+
+ * gst/gstminiobject.c: (gst_value_dup_mini_object),
+ (gst_param_spec_mini_object):
+ * gst/gstminiobject.h:
+ * win32/common/libgstreamer.def:
+ * docs/gst/gstreamer-sections.txt:
+ API: Add GST_IS_PARAM_SPEC_MINI_OBJECT, GST_PARAM_SPEC_MINI_OBJECT
+ GST_TYPE_PARAM_MINI_OBJECT and gst_value_dup_mini_object. Also move
+ GstParamSpecMiniObject into a public header for this.
+
+ This make GstMiniObject a bit more consistent with GObject and makes
+ it possible to extend the param specs.
+
+ gst_value_dup_mini_object is mainly useful for set_property methods.
+
+ Fixes bug #523798.
+
+ * tools/gst-inspect.c: (print_element_properties_info):
+ Print something useful for GstMiniObject properties and not just
+ "unknown type".
+
2008-03-21 Sebastian Dröge <slomo@circular-chaos.org>
* docs/gst/gstreamer-sections.txt:
gst_mini_object_unref
gst_mini_object_replace
+GST_IS_PARAM_SPEC_MINI_OBJECT
+GST_PARAM_SPEC_MINI_OBJECT
+GST_TYPE_PARAM_MINI_OBJECT
+GstParamSpecMiniObject
gst_param_spec_mini_object
+
gst_value_set_mini_object
gst_value_take_mini_object
gst_value_get_mini_object
+gst_value_dup_mini_object
<SUBSECTION Standard>
GstMiniObjectClass
<SUBSECTION Private>
gst_mini_object_get_type
gst_mini_object_flags_get_type
+gst_param_spec_mini_object_get_type
</SECTION>
return value->data[0].v_pointer;
}
-/* param spec */
+/**
+ * gst_value_dup_mini_object:
+ * @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type
+ *
+ * Get the contents of a %GST_TYPE_MINI_OBJECT derived #GValue,
+ * increasing its reference count.
+ *
+ * Returns: mini object contents of @value
+ *
+ * Since: 0.10.19
+ */
+GstMiniObject *
+gst_value_dup_mini_object (const GValue * value)
+{
+ g_return_val_if_fail (GST_VALUE_HOLDS_MINI_OBJECT (value), NULL);
-static GType gst_param_spec_mini_object_get_type (void);
+ return gst_mini_object_ref (value->data[0].v_pointer);
+}
-#define GST_TYPE_PARAM_SPEC_MINI_OBJECT (gst_param_spec_mini_object_get_type())
-#define GST_PARAM_SPEC_MINI_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_PARAM_SPEC_MINI_OBJECT, GstParamSpecMiniObject))
-typedef struct _GstParamSpecMiniObject GstParamSpecMiniObject;
-struct _GstParamSpecMiniObject
-{
- GParamSpec parent_instance;
-};
+/* param spec */
static void
param_mini_object_init (GParamSpec * pspec)
return p1 < p2 ? -1 : p1 > p2;
}
-static GType
+GType
gst_param_spec_mini_object_get_type (void)
{
static GType type;
g_return_val_if_fail (g_type_is_a (object_type, GST_TYPE_MINI_OBJECT), NULL);
- ospec = g_param_spec_internal (GST_TYPE_PARAM_SPEC_MINI_OBJECT,
+ ospec = g_param_spec_internal (GST_TYPE_PARAM_MINI_OBJECT,
name, nick, blurb, flags);
G_PARAM_SPEC (ospec)->value_type = object_type;
void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata);
/* GParamSpec */
+
+#define GST_TYPE_PARAM_MINI_OBJECT (gst_param_spec_mini_object_get_type())
+#define GST_IS_PARAM_SPEC_MINI_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), \
+ GST_TYPE_PARAM_MINI_OBJECT))
+#define GST_PARAM_SPEC_MINI_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), \
+ GST_TYPE_PARAM_MINI_OBJECT, \
+ GstParamSpecMiniObject))
+
+typedef struct _GstParamSpecMiniObject GstParamSpecMiniObject;
+
+/**
+ * GstParamSpecMiniObject:
+ * @parent_instance: private %GParamSpec portion
+ *
+ * A %GParamSpec derived structure that contains the meta data
+ * for %GstMiniObject properties.
+ */
+struct _GstParamSpecMiniObject
+{
+ GParamSpec parent_instance;
+};
+
+
+GType gst_param_spec_mini_object_get_type (void);
+
GParamSpec* gst_param_spec_mini_object (const char *name, const char *nick,
const char *blurb, GType object_type,
GParamFlags flags);
/* GValue stuff */
+
void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object);
void gst_value_take_mini_object (GValue *value, GstMiniObject *mini_object);
GstMiniObject* gst_value_get_mini_object (const GValue *value);
+GstMiniObject* gst_value_dup_mini_object (const GValue *value);
G_END_DECLS
gst_value_get_fraction_numerator (&value),
gst_value_get_fraction_denominator (&value));
+ } else if (GST_IS_PARAM_SPEC_MINI_OBJECT (param)) {
+ n_print ("%-23.23s MiniObject of type \"%s\"", "",
+ g_type_name (param->value_type));
} else {
n_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
g_type_name (param->value_type));
gst_param_spec_fraction
gst_param_spec_fraction_get_type
gst_param_spec_mini_object
+ gst_param_spec_mini_object_get_type
gst_parse_bin_from_description
gst_parse_error_get_type
gst_parse_error_quark
gst_value_can_union
gst_value_compare
gst_value_deserialize
+ gst_value_dup_mini_object
gst_value_fraction_multiply
gst_value_fraction_subtract
gst_value_get_caps