mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
API: Add GST_IS_PARAM_SPEC_MINI_OBJECT, GST_PARAM_SPEC_MINI_OBJECT
Original commit message from CVS: * 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".
This commit is contained in:
parent
520791d270
commit
7fe1bca96a
6 changed files with 83 additions and 13 deletions
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
||||||
|
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>
|
2008-03-21 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* docs/gst/gstreamer-sections.txt:
|
* docs/gst/gstreamer-sections.txt:
|
||||||
|
|
|
@ -1099,10 +1099,16 @@ gst_mini_object_ref
|
||||||
gst_mini_object_unref
|
gst_mini_object_unref
|
||||||
gst_mini_object_replace
|
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_param_spec_mini_object
|
||||||
|
|
||||||
gst_value_set_mini_object
|
gst_value_set_mini_object
|
||||||
gst_value_take_mini_object
|
gst_value_take_mini_object
|
||||||
gst_value_get_mini_object
|
gst_value_get_mini_object
|
||||||
|
gst_value_dup_mini_object
|
||||||
|
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GstMiniObjectClass
|
GstMiniObjectClass
|
||||||
|
@ -1117,6 +1123,7 @@ GST_MINI_OBJECT_CAST
|
||||||
<SUBSECTION Private>
|
<SUBSECTION Private>
|
||||||
gst_mini_object_get_type
|
gst_mini_object_get_type
|
||||||
gst_mini_object_flags_get_type
|
gst_mini_object_flags_get_type
|
||||||
|
gst_param_spec_mini_object_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -521,18 +521,27 @@ gst_value_get_mini_object (const GValue * value)
|
||||||
return value->data[0].v_pointer;
|
return value->data[0].v_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* param spec */
|
/**
|
||||||
|
* gst_value_dup_mini_object:
|
||||||
static GType gst_param_spec_mini_object_get_type (void);
|
* @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type
|
||||||
|
*
|
||||||
#define GST_TYPE_PARAM_SPEC_MINI_OBJECT (gst_param_spec_mini_object_get_type())
|
* Get the contents of a %GST_TYPE_MINI_OBJECT derived #GValue,
|
||||||
#define GST_PARAM_SPEC_MINI_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_PARAM_SPEC_MINI_OBJECT, GstParamSpecMiniObject))
|
* increasing its reference count.
|
||||||
|
*
|
||||||
typedef struct _GstParamSpecMiniObject GstParamSpecMiniObject;
|
* Returns: mini object contents of @value
|
||||||
struct _GstParamSpecMiniObject
|
*
|
||||||
|
* Since: 0.10.19
|
||||||
|
*/
|
||||||
|
GstMiniObject *
|
||||||
|
gst_value_dup_mini_object (const GValue * value)
|
||||||
{
|
{
|
||||||
GParamSpec parent_instance;
|
g_return_val_if_fail (GST_VALUE_HOLDS_MINI_OBJECT (value), NULL);
|
||||||
};
|
|
||||||
|
return gst_mini_object_ref (value->data[0].v_pointer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* param spec */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
param_mini_object_init (GParamSpec * pspec)
|
param_mini_object_init (GParamSpec * pspec)
|
||||||
|
@ -576,7 +585,7 @@ param_mini_object_values_cmp (GParamSpec * pspec,
|
||||||
return p1 < p2 ? -1 : p1 > p2;
|
return p1 < p2 ? -1 : p1 > p2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GType
|
GType
|
||||||
gst_param_spec_mini_object_get_type (void)
|
gst_param_spec_mini_object_get_type (void)
|
||||||
{
|
{
|
||||||
static GType type;
|
static GType type;
|
||||||
|
@ -619,7 +628,7 @@ gst_param_spec_mini_object (const char *name, const char *nick,
|
||||||
|
|
||||||
g_return_val_if_fail (g_type_is_a (object_type, GST_TYPE_MINI_OBJECT), NULL);
|
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);
|
name, nick, blurb, flags);
|
||||||
G_PARAM_SPEC (ospec)->value_type = object_type;
|
G_PARAM_SPEC (ospec)->value_type = object_type;
|
||||||
|
|
||||||
|
|
|
@ -172,14 +172,41 @@ void gst_mini_object_unref (GstMiniObject *mini_object);
|
||||||
void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata);
|
void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata);
|
||||||
|
|
||||||
/* GParamSpec */
|
/* 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,
|
GParamSpec* gst_param_spec_mini_object (const char *name, const char *nick,
|
||||||
const char *blurb, GType object_type,
|
const char *blurb, GType object_type,
|
||||||
GParamFlags flags);
|
GParamFlags flags);
|
||||||
|
|
||||||
/* GValue stuff */
|
/* GValue stuff */
|
||||||
|
|
||||||
void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object);
|
void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object);
|
||||||
void gst_value_take_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_get_mini_object (const GValue *value);
|
||||||
|
GstMiniObject* gst_value_dup_mini_object (const GValue *value);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -559,6 +559,9 @@ print_element_properties_info (GstElement * element)
|
||||||
gst_value_get_fraction_numerator (&value),
|
gst_value_get_fraction_numerator (&value),
|
||||||
gst_value_get_fraction_denominator (&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 {
|
} else {
|
||||||
n_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
|
n_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
|
||||||
g_type_name (param->value_type));
|
g_type_name (param->value_type));
|
||||||
|
|
|
@ -600,6 +600,7 @@ EXPORTS
|
||||||
gst_param_spec_fraction
|
gst_param_spec_fraction
|
||||||
gst_param_spec_fraction_get_type
|
gst_param_spec_fraction_get_type
|
||||||
gst_param_spec_mini_object
|
gst_param_spec_mini_object
|
||||||
|
gst_param_spec_mini_object_get_type
|
||||||
gst_parse_bin_from_description
|
gst_parse_bin_from_description
|
||||||
gst_parse_error_get_type
|
gst_parse_error_get_type
|
||||||
gst_parse_error_quark
|
gst_parse_error_quark
|
||||||
|
@ -926,6 +927,7 @@ EXPORTS
|
||||||
gst_value_can_union
|
gst_value_can_union
|
||||||
gst_value_compare
|
gst_value_compare
|
||||||
gst_value_deserialize
|
gst_value_deserialize
|
||||||
|
gst_value_dup_mini_object
|
||||||
gst_value_fraction_multiply
|
gst_value_fraction_multiply
|
||||||
gst_value_fraction_subtract
|
gst_value_fraction_subtract
|
||||||
gst_value_get_caps
|
gst_value_get_caps
|
||||||
|
|
Loading…
Reference in a new issue