mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
timeline: Add a method to get the timeline duration
+ Bind it in python API: ges_timeline_get_duration
This commit is contained in:
parent
9ee94b3d40
commit
ce8afba367
4 changed files with 25 additions and 0 deletions
|
@ -911,6 +911,12 @@
|
|||
(return-type "gboolean")
|
||||
)
|
||||
|
||||
(define-method get_duration
|
||||
(of-object "GESTimeline")
|
||||
(c-name "ges_timeline_get_duration")
|
||||
(return-type "guint64")
|
||||
)
|
||||
|
||||
|
||||
|
||||
;; From ges-timeline-layer.h
|
||||
|
|
|
@ -266,6 +266,7 @@ ges_timeline_is_updating
|
|||
ges_timeline_get_tracks
|
||||
ges_timeline_get_layers
|
||||
ges_timeline_get_track_for_pad
|
||||
ges_timeline_get_duration
|
||||
<SUBSECTION Standard>
|
||||
GESTimelinePrivate
|
||||
GESTimelineClass
|
||||
|
|
|
@ -2397,3 +2397,19 @@ ges_timeline_enable_update (GESTimeline * timeline, gboolean enabled)
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_get_duration
|
||||
* @timeline: a #GESTimeline
|
||||
*
|
||||
* Get the current duration of @timeline
|
||||
*
|
||||
* Returns: The current duration of @timeline
|
||||
*/
|
||||
GstClockTime
|
||||
ges_timeline_get_duration (GESTimeline * timeline)
|
||||
{
|
||||
g_return_val_if_fail (GES_IS_TIMELINE (timeline), GST_CLOCK_TIME_NONE);
|
||||
|
||||
return timeline->priv->duration;
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ GList *ges_timeline_get_tracks (GESTimeline *timeline);
|
|||
gboolean ges_timeline_enable_update(GESTimeline * timeline, gboolean enabled);
|
||||
gboolean ges_timeline_is_updating (GESTimeline * timeline);
|
||||
|
||||
GstClockTime ges_timeline_get_duration (GESTimeline *timeline);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GES_TIMELINE */
|
||||
|
|
Loading…
Reference in a new issue