mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
ges: add a timeline_object copy function
This commit is contained in:
parent
aec7879467
commit
5f30a86214
1 changed files with 37 additions and 0 deletions
|
@ -72,6 +72,9 @@ static gboolean ges_timeline_object_set_duration_internal (GESTimelineObject *
|
|||
static gboolean ges_timeline_object_set_priority_internal (GESTimelineObject *
|
||||
object, guint32 priority);
|
||||
|
||||
static GESTimelineObject *ges_timeline_object_copy (GESTimelineObject * object,
|
||||
gboolean * deep);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GESTimelineObject, ges_timeline_object,
|
||||
G_TYPE_INITIALLY_UNOWNED);
|
||||
|
||||
|
@ -1191,6 +1194,40 @@ ges_timeline_object_set_top_effect_priority (GESTimelineObject * object,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* TODO implement the deep parameter, and make it public */
|
||||
static GESTimelineObject *
|
||||
ges_timeline_object_copy (GESTimelineObject * object, gboolean * deep)
|
||||
{
|
||||
GESTimelineObject *ret = NULL;
|
||||
GParameter *params;
|
||||
GParamSpec **specs;
|
||||
guint n, n_specs, n_params;
|
||||
|
||||
g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), NULL);
|
||||
|
||||
specs =
|
||||
g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &n_specs);
|
||||
params = g_new0 (GParameter, n_specs);
|
||||
n_params = 0;
|
||||
|
||||
for (n = 0; n < n_specs; ++n) {
|
||||
if (strcmp (specs[n]->name, "parent") &&
|
||||
(specs[n]->flags & G_PARAM_READWRITE) == G_PARAM_READWRITE) {
|
||||
params[n_params].name = g_intern_string (specs[n]->name);
|
||||
g_value_init (¶ms[n_params].value, specs[n]->value_type);
|
||||
g_object_get_property (G_OBJECT (object), specs[n]->name,
|
||||
¶ms[n_params].value);
|
||||
++n_params;
|
||||
}
|
||||
}
|
||||
|
||||
ret = g_object_newv (G_TYPE_FROM_INSTANCE (object), n_params, params);
|
||||
g_free (specs);
|
||||
g_free (params);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
update_height (GESTimelineObject * object)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue