mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
timelineobject: Implement the GESExtractable interface
This commit is contained in:
parent
107b4ad0c6
commit
b5c21da0d8
2 changed files with 37 additions and 2 deletions
|
@ -78,8 +78,12 @@ static gboolean ges_timeline_object_set_priority_internal (GESTimelineObject *
|
|||
static GESTimelineObject *ges_timeline_object_copy (GESTimelineObject * object,
|
||||
gboolean * deep);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GESTimelineObject, ges_timeline_object,
|
||||
G_TYPE_INITIALLY_UNOWNED);
|
||||
static void ges_extractable_interface_init (GESExtractableInterface * iface);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GESTimelineObject, ges_timeline_object,
|
||||
G_TYPE_INITIALLY_UNOWNED,
|
||||
G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE,
|
||||
ges_extractable_interface_init));
|
||||
|
||||
/* Mapping of relationship between a TimelineObject and the TrackObjects
|
||||
* it controls
|
||||
|
@ -136,6 +140,8 @@ struct _GESTimelineObjectPrivate
|
|||
|
||||
/* The formats supported by this TimelineObject */
|
||||
GESTrackType supportedformats;
|
||||
|
||||
GESAsset *asset;
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -408,6 +414,34 @@ ges_timeline_object_init (GESTimelineObject * self)
|
|||
self->priv->maxduration = G_MAXUINT64;
|
||||
}
|
||||
|
||||
static void
|
||||
extractable_set_asset (GESExtractable * extractable, GESAsset * asset)
|
||||
{
|
||||
GES_TIMELINE_OBJECT (extractable)->asset = asset;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_register_metas (GESExtractableInterface * iface, GObjectClass * class,
|
||||
GESAsset * asset)
|
||||
{
|
||||
GESMetaContainer *container = GES_META_CONTAINER (asset);
|
||||
GParamSpecEnum *pspec =
|
||||
(GParamSpecEnum *) g_object_class_find_property (class,
|
||||
"supported-formats");
|
||||
|
||||
ges_meta_container_set_uint (container,
|
||||
GES_META_TIMELINE_OBJECT_SUPPORTED_FORMATS, pspec->default_value);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
ges_extractable_interface_init (GESExtractableInterface * iface)
|
||||
{
|
||||
iface->set_asset = extractable_set_asset;
|
||||
iface->register_metas = _register_metas;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_object_create_track_object:
|
||||
* @object: The origin #GESTimelineObject
|
||||
|
|
|
@ -172,6 +172,7 @@ struct _GESTimelineObject {
|
|||
guint32 height; /* the span of priorities this object needs */
|
||||
|
||||
guint64 fullduration; /* Full usable duration of the object (-1: no duration) */
|
||||
GESAsset *asset;
|
||||
|
||||
/*< private >*/
|
||||
GESTimelineObjectPrivate *priv;
|
||||
|
|
Loading…
Reference in a new issue