mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
ges: Make ges_clip_create_track_element(s) internal methods
+ Fix tests (we still need a round of modernisation, making use of assets where it makes sense) There is no reason to use those method outside of GES, so remove them, cleaning the API and making it easier for users. Removed APIs: ----------- * ges_clip_create_track_element * ges_clip_create_track_elements
This commit is contained in:
parent
e260de2fa6
commit
cae3aabbca
9 changed files with 148 additions and 107 deletions
|
@ -405,8 +405,6 @@ ges_clip_get_supported_formats
|
|||
ges_clip_split
|
||||
ges_clip_edit
|
||||
GES_CLIP_HEIGHT
|
||||
ges_clip_create_track_elements
|
||||
ges_clip_create_track_element
|
||||
ges_clip_fill_track_element
|
||||
<SUBSECTION Standard>
|
||||
GESClipPrivate
|
||||
|
|
|
@ -147,8 +147,6 @@ GType ges_clip_get_type (void);
|
|||
* TrackElement handling *
|
||||
****************************************************/
|
||||
GESTrackType ges_clip_get_supported_formats (GESClip *clip);
|
||||
GESTrackElement* ges_clip_create_track_element (GESClip *clip, GESTrackType type);
|
||||
GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType type);
|
||||
void ges_clip_set_supported_formats (GESClip *clip, GESTrackType supportedformats);
|
||||
gboolean ges_clip_add_asset (GESClip *clip, GESAsset *asset);
|
||||
gboolean ges_clip_fill_track_element (GESClip *clip, GESTrackElement *trackelement,
|
||||
|
|
|
@ -238,5 +238,7 @@ G_GNUC_INTERNAL void _ges_container_set_ignore_notifies (GESContainer *container
|
|||
void ges_clip_set_layer (GESClip *clip, GESTimelineLayer *layer);
|
||||
gboolean ges_clip_is_moving_from_layer (GESClip *clip);
|
||||
void ges_clip_set_moving_from_layer (GESClip *clip, gboolean is_moving);
|
||||
GESTrackElement* ges_clip_create_track_element (GESClip *clip, GESTrackType type);
|
||||
GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType type);
|
||||
|
||||
#endif /* __GES_INTERNAL_H__ */
|
||||
|
|
|
@ -37,15 +37,25 @@ GST_END_TEST;
|
|||
|
||||
GST_START_TEST (test_test_source_properties)
|
||||
{
|
||||
GESTrack *track;
|
||||
GESTrackElement *trackelement;
|
||||
GESClip *clip;
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GESTimelineLayer *layer;
|
||||
GESTrackElement *trackelement;
|
||||
|
||||
ges_init ();
|
||||
|
||||
track = ges_track_new (GES_TRACK_TYPE_AUDIO, gst_caps_ref (GST_CAPS_ANY));
|
||||
fail_unless (track != NULL);
|
||||
|
||||
layer = ges_timeline_layer_new ();
|
||||
fail_unless (layer != NULL);
|
||||
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (timeline != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
|
||||
clip = (GESClip *) ges_test_clip_new ();
|
||||
fail_unless (clip != NULL);
|
||||
|
||||
|
@ -57,13 +67,13 @@ GST_START_TEST (test_test_source_properties)
|
|||
assert_equals_uint64 (_DURATION (clip), 51);
|
||||
assert_equals_uint64 (_INPOINT (clip), 12);
|
||||
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (trackelement));
|
||||
ges_timeline_layer_add_clip (layer, GES_CLIP (clip));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (GES_TIMELINE_ELEMENT_PARENT (trackelement) ==
|
||||
GES_TIMELINE_ELEMENT (clip));
|
||||
|
||||
fail_unless (ges_track_element_set_track (trackelement, track));
|
||||
fail_unless (ges_track_element_get_track (trackelement) == track);
|
||||
|
||||
/* Check that trackelement has the same properties */
|
||||
assert_equals_uint64 (_START (trackelement), 42);
|
||||
|
@ -233,13 +243,15 @@ find_composition (GESTrack * track)
|
|||
}
|
||||
GST_START_TEST (test_gap_filling_basic)
|
||||
{
|
||||
GESTrack *track;
|
||||
GESTrackElement *trackelement, *trackelement1, *trackelement2;
|
||||
/*GESTimelineLayer *layer; */
|
||||
GESClip *clip, *clip1, *clip2;
|
||||
GstElement *gnlsrc, *gnlsrc1, *gap = NULL;
|
||||
GstElement *composition;
|
||||
GList *tmp;
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GstElement *composition;
|
||||
GESTimelineLayer *layer;
|
||||
GESClip *clip, *clip1, *clip2;
|
||||
|
||||
GstElement *gnlsrc, *gnlsrc1, *gap = NULL;
|
||||
GESTrackElement *trackelement, *trackelement1, *trackelement2;
|
||||
|
||||
ges_init ();
|
||||
|
||||
|
@ -249,6 +261,14 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
composition = find_composition (track);
|
||||
fail_unless (composition != NULL);
|
||||
|
||||
layer = ges_timeline_layer_new ();
|
||||
fail_unless (layer != NULL);
|
||||
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (timeline != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
|
||||
clip = GES_CLIP (ges_test_clip_new ());
|
||||
fail_unless (clip != NULL);
|
||||
|
||||
|
@ -257,13 +277,12 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
assert_equals_uint64 (_START (clip), 0);
|
||||
assert_equals_uint64 (_DURATION (clip), 5);
|
||||
|
||||
/* TODO Since the timeline is responsible for adding TrackElements to
|
||||
* Tracks, this test should be refactored */
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (trackelement));
|
||||
|
||||
fail_unless (ges_track_add_element (track, trackelement));
|
||||
ges_timeline_layer_add_clip (layer, GES_CLIP (clip));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_track_element_get_track (trackelement) == track);
|
||||
|
||||
gnlsrc = ges_track_element_get_gnlobject (trackelement);
|
||||
fail_unless (gnlsrc != NULL);
|
||||
|
||||
|
@ -281,11 +300,11 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
assert_equals_uint64 (_START (clip1), 15);
|
||||
assert_equals_uint64 (_DURATION (clip1), 5);
|
||||
|
||||
trackelement1 = ges_clip_create_track_element (clip1, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip1),
|
||||
GES_TIMELINE_ELEMENT (trackelement1));
|
||||
fail_unless (ges_track_add_element (track, trackelement1));
|
||||
ges_timeline_layer_add_clip (layer, GES_CLIP (clip1));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip1)), 1);
|
||||
trackelement1 = GES_CONTAINER_CHILDREN (clip1)->data;
|
||||
fail_unless (trackelement1 != NULL);
|
||||
fail_unless (ges_track_element_get_track (trackelement1) == track);
|
||||
gnlsrc1 = ges_track_element_get_gnlobject (trackelement1);
|
||||
fail_unless (gnlsrc1 != NULL);
|
||||
|
||||
|
@ -309,16 +328,16 @@ GST_START_TEST (test_gap_filling_basic)
|
|||
clip2 = GES_CLIP (ges_test_clip_new ());
|
||||
fail_unless (clip2 != NULL);
|
||||
g_object_set (clip2, "start", (guint64) 35, "duration", (guint64) 5, NULL);
|
||||
trackelement2 = ges_clip_create_track_element (clip2, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip2),
|
||||
GES_TIMELINE_ELEMENT (trackelement2));
|
||||
fail_unless (ges_track_add_element (track, trackelement2));
|
||||
ges_timeline_layer_add_clip (layer, GES_CLIP (clip2));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip2)), 1);
|
||||
trackelement2 = GES_CONTAINER_CHILDREN (clip2)->data;
|
||||
fail_unless (trackelement2 != NULL);
|
||||
fail_unless (ges_track_element_get_track (trackelement2) == track);
|
||||
assert_equals_uint64 (_START (trackelement2), 35);
|
||||
assert_equals_uint64 (_DURATION (trackelement2), 5);
|
||||
assert_equals_int (g_list_length (GST_BIN_CHILDREN (composition)), 5);
|
||||
|
||||
gst_object_unref (track);
|
||||
gst_object_unref (timeline);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
|
|
@ -37,14 +37,23 @@ GST_END_TEST;
|
|||
|
||||
GST_START_TEST (test_overlay_properties)
|
||||
{
|
||||
GESTrack *track;
|
||||
GESTrackElement *trackelement;
|
||||
GESClip *clip;
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GESTimelineLayer *layer;
|
||||
GESTrackElement *trackelement;
|
||||
|
||||
ges_init ();
|
||||
|
||||
track = ges_track_new (GES_TRACK_TYPE_VIDEO, gst_caps_ref (GST_CAPS_ANY));
|
||||
fail_unless (track != NULL);
|
||||
layer = ges_timeline_layer_new ();
|
||||
fail_unless (layer != NULL);
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (timeline != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
ASSERT_OBJECT_REFCOUNT (timeline, "timeline", 1);
|
||||
|
||||
clip = (GESClip *) ges_text_overlay_clip_new ();
|
||||
fail_unless (clip != NULL);
|
||||
|
@ -56,10 +65,13 @@ GST_START_TEST (test_overlay_properties)
|
|||
assert_equals_uint64 (_DURATION (clip), 51);
|
||||
assert_equals_uint64 (_INPOINT (clip), 12);
|
||||
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (trackelement));
|
||||
ges_timeline_layer_add_clip (layer, GES_CLIP (clip));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_track_element_set_track (trackelement, track));
|
||||
fail_unless (GES_TIMELINE_ELEMENT_PARENT (trackelement) ==
|
||||
GES_TIMELINE_ELEMENT (clip));
|
||||
fail_unless (ges_track_element_get_track (trackelement) == track);
|
||||
|
||||
/* Check that trackelement has the same properties */
|
||||
assert_equals_uint64 (_START (trackelement), 42);
|
||||
|
|
|
@ -54,27 +54,28 @@ create_custom_clip (void)
|
|||
|
||||
GST_START_TEST (test_basic_timeline_edition)
|
||||
{
|
||||
GESAsset *asset;
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GESTimelineLayer *layer;
|
||||
GESTrackElement *trackelement, *trackelement1, *trackelement2;
|
||||
GESClip *clip, *clip1, *clip2;
|
||||
|
||||
ges_init ();
|
||||
|
||||
track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
|
||||
track = ges_track_audio_raw_new ();
|
||||
fail_unless (track != NULL);
|
||||
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (timeline != NULL);
|
||||
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
|
||||
clip = create_custom_clip ();
|
||||
clip1 = create_custom_clip ();
|
||||
clip2 = create_custom_clip ();
|
||||
layer = ges_timeline_layer_new ();
|
||||
fail_unless (layer != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
|
||||
|
||||
fail_unless (clip && clip1 && clip2);
|
||||
asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
|
||||
fail_unless (GES_IS_ASSET (asset));
|
||||
|
||||
/**
|
||||
* Our timeline
|
||||
|
@ -83,33 +84,24 @@ GST_START_TEST (test_basic_timeline_edition)
|
|||
* | clip | | clip1 | | clip2 |
|
||||
* time 0------- 10 --------20 50---------60
|
||||
*/
|
||||
g_object_set (clip, "start", (guint64) 0, "duration", (guint64) 10,
|
||||
"in-point", (guint64) 0, NULL);
|
||||
g_object_set (clip1, "start", (guint64) 10, "duration", (guint64) 10,
|
||||
"in-point", (guint64) 0, NULL);
|
||||
g_object_set (clip2, "start", (guint64) 50, "duration", (guint64) 60,
|
||||
"in-point", (guint64) 0, NULL);
|
||||
clip = ges_timeline_layer_add_asset (layer, asset, 0, 0, 10, 1,
|
||||
GES_TRACK_TYPE_UNKNOWN);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (GES_IS_TRACK_ELEMENT (trackelement));
|
||||
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_container_add (GES_CONTAINER (clip),
|
||||
GES_TIMELINE_ELEMENT (trackelement)));
|
||||
fail_unless (ges_track_add_element (track, trackelement));
|
||||
assert_equals_uint64 (_DURATION (trackelement), 10);
|
||||
clip1 = ges_timeline_layer_add_asset (layer, asset, 10, 0, 10, 1,
|
||||
GES_TRACK_TYPE_UNKNOWN);
|
||||
trackelement1 = GES_CONTAINER_CHILDREN (clip1)->data;
|
||||
fail_unless (GES_IS_TRACK_ELEMENT (trackelement1));
|
||||
|
||||
trackelement1 = ges_clip_create_track_element (clip1, track->type);
|
||||
fail_unless (trackelement1 != NULL);
|
||||
fail_unless (ges_container_add (GES_CONTAINER (clip1),
|
||||
GES_TIMELINE_ELEMENT (trackelement1)));
|
||||
fail_unless (ges_track_add_element (track, trackelement1));
|
||||
assert_equals_uint64 (_DURATION (trackelement1), 10);
|
||||
clip2 = ges_timeline_layer_add_asset (layer, asset, 50, 0, 60, 1,
|
||||
GES_TRACK_TYPE_UNKNOWN);
|
||||
trackelement2 = GES_CONTAINER_CHILDREN (clip2)->data;
|
||||
fail_unless (GES_IS_TRACK_ELEMENT (trackelement2));
|
||||
|
||||
trackelement2 = ges_clip_create_track_element (clip2, track->type);
|
||||
fail_unless (ges_container_add (GES_CONTAINER (clip2),
|
||||
GES_TIMELINE_ELEMENT (trackelement2)));
|
||||
fail_unless (trackelement2 != NULL);
|
||||
fail_unless (ges_track_add_element (track, trackelement2));
|
||||
assert_equals_uint64 (_DURATION (trackelement2), 60);
|
||||
CHECK_OBJECT_PROPS (trackelement, 0, 0, 10);
|
||||
CHECK_OBJECT_PROPS (trackelement1, 10, 0, 10);
|
||||
CHECK_OBJECT_PROPS (trackelement2, 50, 0, 60);
|
||||
|
||||
/**
|
||||
* Simple rippling clip to: 10
|
||||
|
@ -246,9 +238,6 @@ GST_START_TEST (test_basic_timeline_edition)
|
|||
CHECK_OBJECT_PROPS (trackelement2, 62, 0, 60);
|
||||
|
||||
gst_object_unref (timeline);
|
||||
gst_object_unref (clip);
|
||||
gst_object_unref (clip1);
|
||||
gst_object_unref (clip2);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
|
|
@ -37,17 +37,25 @@ GST_END_TEST;
|
|||
|
||||
GST_START_TEST (test_title_source_properties)
|
||||
{
|
||||
GESTrack *track;
|
||||
GESTrackElement *trackelement;
|
||||
GESClip *clip;
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GESTimelineLayer *layer;
|
||||
GESTrackElement *trackelement;
|
||||
|
||||
ges_init ();
|
||||
|
||||
track = ges_track_video_raw_new ();
|
||||
fail_unless (track != NULL);
|
||||
layer = ges_timeline_layer_new ();
|
||||
fail_unless (layer != NULL);
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (timeline != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
ASSERT_OBJECT_REFCOUNT (timeline, "timeline", 1);
|
||||
|
||||
clip = (GESClip *)
|
||||
ges_title_clip_new ();
|
||||
clip = (GESClip *) ges_title_clip_new ();
|
||||
fail_unless (clip != NULL);
|
||||
|
||||
/* Set some properties */
|
||||
|
@ -57,10 +65,13 @@ GST_START_TEST (test_title_source_properties)
|
|||
assert_equals_uint64 (_DURATION (clip), 51);
|
||||
assert_equals_uint64 (_INPOINT (clip), 12);
|
||||
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (trackelement));
|
||||
ges_timeline_layer_add_clip (layer, GES_CLIP (clip));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_track_element_set_track (trackelement, track));
|
||||
fail_unless (GES_TIMELINE_ELEMENT_PARENT (trackelement) ==
|
||||
GES_TIMELINE_ELEMENT (clip));
|
||||
fail_unless (ges_track_element_get_track (trackelement) == track);
|
||||
|
||||
/* Check that trackelement has the same properties */
|
||||
assert_equals_uint64 (_START (trackelement), 42);
|
||||
|
|
|
@ -27,14 +27,23 @@
|
|||
|
||||
GST_START_TEST (test_transition_basic)
|
||||
{
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GESTimelineLayer *layer;
|
||||
GESTransitionClip *tr1, *tr2;
|
||||
GESTrackElement *trackelement;
|
||||
GESTrack *track;
|
||||
|
||||
ges_init ();
|
||||
|
||||
track = ges_track_video_raw_new ();
|
||||
fail_unless (track != 0);
|
||||
layer = ges_timeline_layer_new ();
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (track != NULL);
|
||||
fail_unless (layer != NULL);
|
||||
fail_unless (timeline != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
ASSERT_OBJECT_REFCOUNT (timeline, "timeline", 1);
|
||||
|
||||
tr1 = ges_transition_clip_new (GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
|
||||
fail_unless (tr1 != 0);
|
||||
|
@ -45,37 +54,40 @@ GST_START_TEST (test_transition_basic)
|
|||
fail_unless (tr2->vtype == 1);
|
||||
|
||||
/* Make sure track element is created and vtype is set */
|
||||
trackelement = ges_clip_create_track_element (GES_CLIP (tr2), track->type);
|
||||
ges_container_add (GES_CONTAINER (tr2), GES_TIMELINE_ELEMENT (trackelement));
|
||||
|
||||
fail_unless (ges_timeline_layer_add_clip (layer, GES_CLIP (tr2)));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (tr2)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (tr2)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_video_transition_get_transition_type
|
||||
(GES_VIDEO_TRANSITION (trackelement)) == 1);
|
||||
|
||||
fail_unless (ges_container_remove (GES_CONTAINER (tr2),
|
||||
GES_TIMELINE_ELEMENT (trackelement)) == TRUE);
|
||||
|
||||
gst_object_unref (track);
|
||||
gst_object_unref (tr1);
|
||||
gst_object_unref (tr2);
|
||||
gst_object_unref (timeline);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
GST_START_TEST (test_transition_properties)
|
||||
{
|
||||
GESTrack *track;
|
||||
GESTrackElement *trackelement;
|
||||
GESClip *clip;
|
||||
GESTrack *track;
|
||||
GESTimeline *timeline;
|
||||
GESTimelineLayer *layer;
|
||||
GESTrackElement *trackelement;
|
||||
|
||||
ges_init ();
|
||||
|
||||
clip =
|
||||
GES_CLIP (ges_transition_clip_new
|
||||
clip = GES_CLIP (ges_transition_clip_new
|
||||
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE));
|
||||
|
||||
track = ges_track_video_raw_new ();
|
||||
layer = ges_timeline_layer_new ();
|
||||
timeline = ges_timeline_new ();
|
||||
fail_unless (track != NULL);
|
||||
fail_unless (layer != NULL);
|
||||
fail_unless (timeline != NULL);
|
||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||
fail_unless (ges_timeline_add_track (timeline, track));
|
||||
ASSERT_OBJECT_REFCOUNT (timeline, "timeline", 1);
|
||||
|
||||
/* Set some properties */
|
||||
g_object_set (clip, "start", (guint64) 42, "duration", (guint64) 51,
|
||||
|
@ -85,10 +97,10 @@ GST_START_TEST (test_transition_properties)
|
|||
assert_equals_uint64 (_DURATION (clip), 51);
|
||||
assert_equals_uint64 (_INPOINT (clip), 12);
|
||||
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (trackelement));
|
||||
fail_unless (ges_timeline_layer_add_clip (layer, GES_CLIP (clip)));
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_track_element_set_track (trackelement, track));
|
||||
|
||||
/* Check that trackelement has the same properties */
|
||||
assert_equals_uint64 (_START (trackelement), 42);
|
||||
|
@ -132,17 +144,17 @@ GST_START_TEST (test_transition_properties)
|
|||
assert_equals_int (ges_video_transition_get_transition_type
|
||||
(GES_VIDEO_TRANSITION (trackelement)), 1);
|
||||
|
||||
GST_DEBUG ("Releasing track element");
|
||||
ges_container_remove (GES_CONTAINER (clip),
|
||||
GES_TIMELINE_ELEMENT (trackelement));
|
||||
GST_DEBUG ("Removing clip from layer");
|
||||
gst_object_ref (clip); /* We do not want it to be destroyed */
|
||||
ges_timeline_layer_remove_clip (layer, clip);
|
||||
|
||||
g_object_set (clip, "vtype", 1, NULL);
|
||||
|
||||
GST_DEBUG ("creating track element");
|
||||
trackelement = ges_clip_create_track_element (clip, track->type);
|
||||
ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (trackelement));
|
||||
GST_DEBUG ("Read it to the layer");
|
||||
fail_unless (ges_timeline_layer_add_clip (layer, GES_CLIP (clip)));
|
||||
g_object_unref (clip);
|
||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
|
||||
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
|
||||
fail_unless (trackelement != NULL);
|
||||
fail_unless (ges_track_element_set_track (trackelement, track));
|
||||
|
||||
/* The new track element should have taken the previously set transition
|
||||
* type (in this case 1) */
|
||||
|
@ -151,10 +163,9 @@ GST_START_TEST (test_transition_properties)
|
|||
(GES_VIDEO_TRANSITION (trackelement)), 1);
|
||||
assert_equals_int (GES_TRANSITION_CLIP (clip)->vtype, 1);
|
||||
|
||||
ges_container_remove (GES_CONTAINER (clip),
|
||||
GES_TIMELINE_ELEMENT (trackelement));
|
||||
gst_object_unref (clip);
|
||||
gst_object_unref (track);
|
||||
gst_object_unref (timeline);
|
||||
fail_if (G_IS_OBJECT (track));
|
||||
fail_if (G_IS_OBJECT (clip));
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
|
|
@ -46,6 +46,7 @@ asset_created_cb (GObject * source, GAsyncResult * res, gpointer udata)
|
|||
GError *error = NULL;
|
||||
|
||||
asset = ges_asset_request_finish (res, &error);
|
||||
ASSERT_OBJECT_REFCOUNT (asset, "1 for us one for the cache", 2);
|
||||
fail_unless (error == NULL);
|
||||
fail_if (asset == NULL);
|
||||
fail_if (g_strcmp0 (ges_asset_get_id (asset), av_uri));
|
||||
|
|
Loading…
Reference in a new issue