| 1 |
SCENARIOS |
| 2 |
|
| 3 |
* Adding a TimelineObject to a TimelineLayer |
| 4 |
-------------------------------------------- |
| 5 |
|
| 6 |
* Create a Timeline |
| 7 |
|
| 8 |
* Create a Track |
| 9 |
|
| 10 |
* Add the track to the Timeline (==> ges_timeline_add_track (track);) |
| 11 |
The Timeline adds the Track to itself (i.e. gst_bin_add()) |
| 12 |
'track-added' is emitted |
| 13 |
|
| 14 |
* Create a TimelineLayer |
| 15 |
|
| 16 |
* Add the TimelineLayer to the Timeline (ges_timeline_add_layer (layer);) |
| 17 |
The Timeline takes a reference on the layer and stores it |
| 18 |
The Timeline tells the TimelineLayer that it now belongs to the given Timeline (weak reference) |
| 19 |
==> ges_timeline_layer_set_timeline (); |
| 20 |
'layer-added' is emitted |
| 21 |
|
| 22 |
* Create a TimelineObject |
| 23 |
|
| 24 |
* Add the TimelineObject to the TimelineLayer (ges_timeline_layer_add_object (object);) |
| 25 |
The TimelineLayer takes a reference on the TimelineObject and stores it |
| 26 |
The timelineLayer tells the TimelineObject that it now belongs to the given layer (weak reference) |
| 27 |
==> ges_timeline_object_set_layer (); |
| 28 |
'object-added' is emitted by TimelineLayer |
| 29 |
The Timeline requests a new TrackObject from the new TimelineObject for each Track |
| 30 |
==> ges_timeline_object_create_track_object (track) |
| 31 |
The TimelineObject calls the 'create_track_object' virtual method with the given track |
| 32 |
Example implementation |
| 33 |
Create a GESTrackSource |
| 34 |
(GESTimelineObject is a constructor property of track objects) |
| 35 |
A GESTrackObject CAN NOT EXIST WITHOUT A GESTimelineObject ! |
| 36 |
The Timeline adds the newly created TrackObject to the Track |
| 37 |
==> ges_track_add_object (track, trackobject); |
| 38 |
Set the track on the TrackObject |
| 39 |
==> ges_track_object_set_track (track) |
| 40 |
The GESTrackObject can create the NleObject |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
Methods |
| 45 |
------- |
| 46 |
|
| 47 |
[ GESTimeline ] |
| 48 |
|
| 49 |
* gboolean |
| 50 |
ges_timeline_add_track (GESTimeline * timeline, GESTrack * track); |
| 51 |
|
| 52 |
* The Timeline adds the track to itself (gst_bin_add ()) # reference implicitely taken |
| 53 |
* The Timeline adds the track to its list of tracked tracks |
| 54 |
* The Timeline sets the Timeline on the track |
| 55 |
=> ges_track_set_timeline (GESTrack * track, GESTimeline * timeline); |
| 56 |
Just sets the timeline field of the track. |
| 57 |
* emits 'track-added' |
| 58 |
|
| 59 |
|
| 60 |
* gboolean |
| 61 |
ges_timeline_add_layer (GESTimeline * timeline, GESTimelineLayer * layer); |
| 62 |
|
| 63 |
* The Timeline takes a reference on the layer and stores it |
| 64 |
* The Timeline tells the Layer that it now belongs to the given Timeline |
| 65 |
=> ges_timeline_layer_set_timeline (GESTimelineLayer * layer, GESTimeline * timeline); |
| 66 |
Just sets the timeline field of the layer. |
| 67 |
* Connect to the layer's 'object-added' signal |
| 68 |
* emits 'layer-added' |
| 69 |
|
| 70 |
|
| 71 |
* GESTimeline's |
| 72 |
callback for GESTimelineLayer::object-added (GESTimelineLayer * layer, GESTimelineObject * object); |
| 73 |
|
| 74 |
* For each GESTrack in the Timeline: |
| 75 |
* The timeline requests a new TrackObject for the new TimelineObject for each Track |
| 76 |
trackobj = ges_timeline_object_create_track_object (timelineobj, track); |
| 77 |
* The timeline adds the newly created TrackObject to the track |
| 78 |
ges_track_add_object (track, trackobj); |
| 79 |
|
| 80 |
[ GESTimelineLayer ] |
| 81 |
|
| 82 |
* gboolean |
| 83 |
ges_timeline_layer_add_object (GESTimelineLayer * layer, GESTimelineObject * object); |
| 84 |
|
| 85 |
* The TimelineLayer takes a reference on the TimelineObject and stores it |
| 86 |
* The TimelineLayer tells the TimelineObject it now belongs to the given Layer |
| 87 |
=> ges_timeline_object_set_layer (GESTimelineObject * object, GESTimelineLayer * layer); |
| 88 |
Just sets the layer field of the timeline object. |
| 89 |
* emits 'object-added' |
| 90 |
|
| 91 |
|
| 92 |
[ GESTimelineObject ] |
| 93 |
|
| 94 |
* GESTrackObject * |
| 95 |
ges_timeline_object_create_track_object (GESTimelineObject * object, GESTrack * track); |
| 96 |
|
| 97 |
* The TimelineObject calls the 'create_track_object' virtual method |
| 98 |
* The TimelineObject sets the TimelineObject on the new TrackObject |
| 99 |
=> ges_track_object_set_timeline_object (track_object, timeline_object); |
| 100 |
Just sets the timeline-object field of the TrackObject |
| 101 |
* Return the newly created GESTrackObject |
| 102 |
|
| 103 |
|
| 104 |
* Virtual-method for GESTimelineObject::create_track_object (GESTimelineObject * object, GESTrack * track); |
| 105 |
|
| 106 |
* Create a track object of the proper type |
| 107 |
Ex (for a source) : |
| 108 |
return ges_track_source_new(); |
| 109 |
|
| 110 |
* gboolean |
| 111 |
ges_timeline_object_fill_track_object (GESTimelineObject *tlo, GESTrackObject *tro, GstElement *nleobj); |
| 112 |
|
| 113 |
* up to the implementation :) |
| 114 |
|
| 115 |
|
| 116 |
[ GESTrack ] |
| 117 |
|
| 118 |
* gboolean |
| 119 |
ges_track_add_object (GESTrack * track, GESTrackObject * object); |
| 120 |
|
| 121 |
* Set the track on the track_object |
| 122 |
ges_track_object_set_track (object, track); |
| 123 |
* Add the NleObject of the TrackObject to the composition |
| 124 |
gst_bin_add (track->composition, object->nleobject); |
| 125 |
|
| 126 |
|
| 127 |
[ GESTrackObject ] |
| 128 |
|
| 129 |
* gboolean |
| 130 |
ges_track_object_set_track (GESTrackObject * object, GESTrack * track); |
| 131 |
|
| 132 |
* Set the track field of the TrackObject |
| 133 |
* if no NleObject is available yet: |
| 134 |
* Call the 'create_gnl_object' virtual method |
| 135 |
|
| 136 |
|
| 137 |
* Virtual-method for GESTrackObject::create_gnl_object |
| 138 |
|
| 139 |
* Create a NleObject of the proper type |
| 140 |
Ex : nleobject = gst_element_factory_make("nlesource", NULL); |
| 141 |
* Ask the TimelineObject to fill in the NleObject |
| 142 |
=> ges_timeline_object_fill_track_object (GESTimelineObject * tlo, GESTrackObject * tro, GstElement * nleobj); |
| 143 |
|