mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
timelineobject: Add a method to add a GESAsset
+ Avoid to assume function arguments are correct before actually testing them in ges_timeline_object_add_track_object API: ges_timeline_object_add_asset
This commit is contained in:
parent
e47701b226
commit
7ecf33130a
3 changed files with 38 additions and 4 deletions
|
@ -336,6 +336,7 @@ ges_timeline_object_set_duration
|
||||||
ges_timeline_object_get_layer
|
ges_timeline_object_get_layer
|
||||||
ges_timeline_object_find_track_object
|
ges_timeline_object_find_track_object
|
||||||
ges_timeline_object_add_track_object
|
ges_timeline_object_add_track_object
|
||||||
|
ges_timeline_object_add_asset
|
||||||
ges_timeline_object_get_top_effects
|
ges_timeline_object_get_top_effects
|
||||||
ges_timeline_object_get_top_effect_position
|
ges_timeline_object_get_top_effect_position
|
||||||
ges_timeline_object_move_to_layer
|
ges_timeline_object_move_to_layer
|
||||||
|
|
|
@ -572,16 +572,19 @@ gboolean
|
||||||
ges_timeline_object_add_track_object (GESTimelineObject * object, GESTrackObject
|
ges_timeline_object_add_track_object (GESTimelineObject * object, GESTrackObject
|
||||||
* trobj)
|
* trobj)
|
||||||
{
|
{
|
||||||
ObjectMapping *mapping;
|
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
gboolean is_effect;
|
||||||
|
ObjectMapping *mapping;
|
||||||
guint max_prio, min_prio;
|
guint max_prio, min_prio;
|
||||||
GESTimelineObjectPrivate *priv = object->priv;
|
GESTimelineObjectClass *klass;
|
||||||
gboolean is_effect = GES_IS_TRACK_EFFECT (trobj);
|
GESTimelineObjectPrivate *priv;
|
||||||
GESTimelineObjectClass *klass = GES_TIMELINE_OBJECT_GET_CLASS (object);
|
|
||||||
|
|
||||||
g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), FALSE);
|
g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), FALSE);
|
||||||
g_return_val_if_fail (GES_IS_TRACK_OBJECT (trobj), FALSE);
|
g_return_val_if_fail (GES_IS_TRACK_OBJECT (trobj), FALSE);
|
||||||
|
|
||||||
|
priv = object->priv;
|
||||||
|
is_effect = GES_IS_TRACK_EFFECT (trobj);
|
||||||
|
|
||||||
GST_LOG ("Got a TrackObject : %p , setting the timeline object as its"
|
GST_LOG ("Got a TrackObject : %p , setting the timeline object as its"
|
||||||
"creator. Is a TrackEffect %i", trobj, is_effect);
|
"creator. Is a TrackEffect %i", trobj, is_effect);
|
||||||
|
|
||||||
|
@ -637,6 +640,7 @@ ges_timeline_object_add_track_object (GESTimelineObject * object, GESTrackObject
|
||||||
ges_track_object_set_inpoint (trobj, object->inpoint);
|
ges_track_object_set_inpoint (trobj, object->inpoint);
|
||||||
ges_track_object_set_max_duration (trobj, object->priv->maxduration);
|
ges_track_object_set_max_duration (trobj, object->priv->maxduration);
|
||||||
|
|
||||||
|
klass = GES_TIMELINE_OBJECT_GET_CLASS (object);
|
||||||
if (klass->track_object_added) {
|
if (klass->track_object_added) {
|
||||||
GST_DEBUG ("Calling track_object_added subclass method");
|
GST_DEBUG ("Calling track_object_added subclass method");
|
||||||
klass->track_object_added (object, trobj);
|
klass->track_object_added (object, trobj);
|
||||||
|
@ -1942,6 +1946,34 @@ ges_timeline_object_trim_start (GESTimelineObject * object, guint64 start)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ges_timeline_object_add_asset:
|
||||||
|
* @object: a #GESTimelineObject
|
||||||
|
* @asset: a #GESAsset with #GES_TYPE_TRACK_OBJECT as extractable_type
|
||||||
|
*
|
||||||
|
* Extracts a #GESTrackObject from @asset and adds it to the @object.
|
||||||
|
* Should only be called in order to add operations to a #GESTimelineObject,
|
||||||
|
* ni other cases TrackObject are added automatically when adding the
|
||||||
|
* #GESTimelineObject/#GESAsset to a layer.
|
||||||
|
*
|
||||||
|
* Takes a reference on @trobj.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE on success, %FALSE on failure.
|
||||||
|
*/
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
ges_timeline_object_add_asset (GESTimelineObject * object,
|
||||||
|
GESAsset * asset)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), FALSE);
|
||||||
|
g_return_val_if_fail (GES_IS_ASSET (asset), FALSE);
|
||||||
|
g_return_val_if_fail (g_type_is_a (ges_asset_get_extractable_type
|
||||||
|
(asset), GES_TYPE_TRACK_OBJECT), FALSE);
|
||||||
|
|
||||||
|
return ges_timeline_object_add_track_object (object,
|
||||||
|
GES_TRACK_OBJECT (ges_asset_extract (asset, NULL)));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_height (GESTimelineObject * object)
|
update_height (GESTimelineObject * object)
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ ges_timeline_object_create_track_objects (GESTimelineObject * object,
|
||||||
gboolean
|
gboolean
|
||||||
ges_timeline_object_release_track_object (GESTimelineObject * object,
|
ges_timeline_object_release_track_object (GESTimelineObject * object,
|
||||||
GESTrackObject * trackobject);
|
GESTrackObject * trackobject);
|
||||||
|
gboolean ges_timeline_object_add_asset (GESTimelineObject *object, GESAsset *asset);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_timeline_object_fill_track_object (GESTimelineObject * object,
|
ges_timeline_object_fill_track_object (GESTimelineObject * object,
|
||||||
|
|
Loading…
Reference in a new issue