mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
TimelineObject: Implement _release_track_object()
This commit is contained in:
parent
b10743ef9a
commit
246599e2f6
2 changed files with 45 additions and 4 deletions
|
@ -17,9 +17,9 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "ges-timeline-object.h"
|
||||
#include "ges.h"
|
||||
#include "ges-internal.h"
|
||||
|
||||
/**
|
||||
* GESTimelineObject
|
||||
|
@ -117,6 +117,9 @@ ges_timeline_object_create_track_object (GESTimelineObject * object,
|
|||
GST_DEBUG
|
||||
("Got a TrackObject : %p , setting the timeline object as its creator");
|
||||
ges_track_object_set_timeline_object (res, object);
|
||||
|
||||
GST_DEBUG ("Adding TrackObject to the list of controlled track objects");
|
||||
object->trackobjects = g_list_append (object->trackobjects, res);
|
||||
}
|
||||
|
||||
GST_DEBUG ("Returning res:%p", res);
|
||||
|
@ -124,6 +127,26 @@ ges_timeline_object_create_track_object (GESTimelineObject * object,
|
|||
return res;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ges_timeline_object_release_track_object (GESTimelineObject * object,
|
||||
GESTrackObject * trobj)
|
||||
{
|
||||
GST_DEBUG ("object:%p, trackobject:%p", object, trobj);
|
||||
|
||||
if (!(g_list_find (object->trackobjects, trobj))) {
|
||||
GST_WARNING ("TrackObject isn't controlled by this object");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* FIXME : Do we need to tell the subclasses ? If so, add a new virtual-method */
|
||||
|
||||
object->trackobjects = g_list_remove (object->trackobjects, trobj);
|
||||
|
||||
ges_track_object_set_timeline_object (trobj, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
ges_timeline_object_set_layer (GESTimelineObject * object,
|
||||
GESTimelineLayer * layer)
|
||||
|
@ -156,3 +179,12 @@ ges_timeline_object_fill_track_object (GESTimelineObject * object,
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ges_timeline_object_fill_track_object_func (GESTimelineObject * object,
|
||||
GESTrackObject * trackobj, GstElement * gnlobj)
|
||||
{
|
||||
GST_WARNING ("No 'fill_track_object' implementation !");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -43,11 +43,17 @@ G_BEGIN_DECLS
|
|||
#define GES_TIMELINE_OBJECT_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
|
||||
|
||||
typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
|
||||
GESTrackObject * trobject,
|
||||
GstElement * gnlobj);
|
||||
|
||||
struct _GESTimelineObject {
|
||||
GObject parent;
|
||||
|
||||
GESTimelineLayer * layer; /* The layer where this object is being used */
|
||||
|
||||
GList *trackobjects; /* A list of TrackObject controlled by this TimelineObject */
|
||||
|
||||
/* start, inpoint, duration and fullduration are in nanoseconds */
|
||||
guint64 start; /* position (in time) of the object in the layer */
|
||||
guint64 inpoint; /* in-point */
|
||||
|
@ -62,9 +68,8 @@ struct _GESTimelineObjectClass {
|
|||
|
||||
GESTrackObject* (*create_track_object) (GESTimelineObject * object,
|
||||
GESTrack * track);
|
||||
gboolean (*fill_track_object) (GESTimelineObject * object,
|
||||
GESTrackObject * trobject,
|
||||
GstElement * gnlobj);
|
||||
/* FIXME : might need a release_track_object */
|
||||
FillTrackObjectFunc fill_track_object;
|
||||
};
|
||||
|
||||
GType ges_timeline_object_get_type (void);
|
||||
|
@ -79,6 +84,10 @@ GESTrackObject *
|
|||
ges_timeline_object_create_track_object (GESTimelineObject * object,
|
||||
GESTrack * track);
|
||||
|
||||
gboolean
|
||||
ges_timeline_object_release_track_object (GESTimelineObject * object,
|
||||
GESTrackObject * trackobject);
|
||||
|
||||
gboolean
|
||||
ges_timeline_object_fill_track_object (GESTimelineObject * object,
|
||||
GESTrackObject * trackobj,
|
||||
|
|
Loading…
Reference in a new issue