mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
GesTrackObject: add the ges_track_object_get_child_property method
test: Test this new method design: change the design file to fit the implementation
This commit is contained in:
parent
d9c07a4ed4
commit
3f4a4a7134
5 changed files with 40 additions and 2 deletions
|
@ -162,7 +162,7 @@ C. Keyframes
|
|||
*/
|
||||
void ges_track_object_get_child_property (GESTrackObject *object,
|
||||
const gchar *property_name,
|
||||
GValue * value);
|
||||
gpointer value);
|
||||
|
||||
/**
|
||||
* ges_track_object_get_material:
|
||||
|
|
|
@ -84,6 +84,7 @@ ges_track_object_get_duration
|
|||
ges_track_object_get_priority
|
||||
ges_track_object_is_active
|
||||
ges_track_object_set_child_property
|
||||
ges_track_object_get_child_property
|
||||
<SUBSECTION Standard>
|
||||
GES_TRACK_OBJECT_DURATION
|
||||
GES_TRACK_OBJECT_INPOINT
|
||||
|
|
|
@ -952,3 +952,34 @@ ges_track_object_set_child_property (GESTrackObject * object,
|
|||
GST_DEBUG ("The child properties haven't been set on %p", object);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_object_get_child_property:
|
||||
* @object: The origin #GESTrackObject
|
||||
* @property_name: The name of the property
|
||||
* @value: return location for the property value
|
||||
*
|
||||
* Gets a property of a child of @object.
|
||||
*/
|
||||
void
|
||||
ges_track_object_get_child_property (GESTrackObject * object,
|
||||
const gchar * property_name, gpointer value)
|
||||
{
|
||||
GESTrackObjectPrivate *priv = object->priv;
|
||||
|
||||
if (priv->properties_hashtable) {
|
||||
GstElement *element;
|
||||
gchar **prop_name;
|
||||
|
||||
element = g_hash_table_lookup (priv->properties_hashtable, property_name);
|
||||
if (element) {
|
||||
prop_name = g_strsplit (property_name, "-", 2);
|
||||
g_object_get (G_OBJECT (element), prop_name[1], value, NULL);
|
||||
g_strfreev (prop_name);
|
||||
} else {
|
||||
GST_ERROR ("The %s property doesn't exist", property_name);
|
||||
}
|
||||
} else {
|
||||
GST_DEBUG ("The child properties haven't been set on %p", object);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,5 +162,8 @@ gboolean ges_track_object_is_active (GESTrackObject * object);
|
|||
|
||||
void ges_track_object_set_child_property (GESTrackObject * object,
|
||||
const gchar * property_name, GValue * value);
|
||||
void ges_track_object_get_child_property (GESTrackObject *object,
|
||||
const gchar *property_name,
|
||||
gpointer value);
|
||||
G_END_DECLS
|
||||
#endif /* _GES_TRACK_OBJECT */
|
||||
|
|
|
@ -321,6 +321,7 @@ GST_START_TEST (test_track_effect_set_properties)
|
|||
GESTimelineEffect *tl_effect;
|
||||
GESTrackEffect *tck_effect;
|
||||
GValue value = { 0 };
|
||||
guint val;
|
||||
|
||||
ges_init ();
|
||||
|
||||
|
@ -347,9 +348,11 @@ GST_START_TEST (test_track_effect_set_properties)
|
|||
|
||||
g_value_init (&value, G_TYPE_UINT);
|
||||
g_value_set_uint (&value, 17);
|
||||
|
||||
ges_track_object_set_child_property (GES_TRACK_OBJECT (tck_effect),
|
||||
"GstAgingTV-scratch-lines", &value);
|
||||
ges_track_object_get_child_property (GES_TRACK_OBJECT (tck_effect),
|
||||
"GstAgingTV-scratch-lines", &val);
|
||||
fail_unless (val == 17);
|
||||
|
||||
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) tl_effect);
|
||||
|
||||
|
|
Loading…
Reference in a new issue