1 /* GStreamer Editing Services 2 * Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk> 3 * 2009 Nokia Corporation 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef _GES_TRACK 22 #define _GES_TRACK 23 24 #include <glib-object.h> 25 #include <gst/gst.h> 26 #include <ges/ges-types.h> 27 #include <ges/ges-enums.h> 28 29 G_BEGIN_DECLS 30 31 #define GES_TYPE_TRACK ges_track_get_type() 32 #define GES_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TRACK, GESTrack)) 33 #define GES_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TRACK, GESTrackClass)) 34 #define GES_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TRACK)) 35 #define GES_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TRACK)) 36 #define GES_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK, GESTrackClass)) 37 38 typedef struct _GESTrackPrivate GESTrackPrivate; 39 40 /** 41 * GESCreateElementForGapFunc: 42 * @track: the #GESTrack 43 * 44 * A function that will be called to create the #GstElement that will be used 45 * as a source to fill the gaps in @track. 46 * 47 * Returns: A #GstElement (must be a source) that will be used to 48 * fill the gaps (periods of time in @track that containes no source). 49 */ 50 typedef GstElement* (*GESCreateElementForGapFunc) (GESTrack *track); 51 52 /** 53 * GESTrack: 54 * @type: a #GESTrackType indicting the basic type of the track. 55 */ 56 struct _GESTrack 57 { 58 GstBin parent; 59 60 /*< public >*/ 61 /* READ-ONLY */ 62 GESTrackType type; 63 64 /*< private >*/ 65 GESTrackPrivate* priv; 66 /* Padding for API extension */ 67 gpointer _ges_reserved[GES_PADDING]; 68 }; 69 70 /** 71 * GESTrackClass: 72 */ 73 struct _GESTrackClass 74 { 75 /*< private >*/ 76 GstBinClass parent_class; 77 78 GstElement * (*get_mixing_element) (GESTrack *track); 79 80 /* Padding for API extension */ 81 gpointer _ges_reserved[GES_PADDING]; 82 }; 83 84 GES_API 85 const GstCaps* ges_track_get_caps (GESTrack *track); 86 GES_API 87 GList* ges_track_get_elements (GESTrack *track); 88 GES_API 89 const GESTimeline* ges_track_get_timeline (GESTrack *track); 90 GES_API 91 gboolean ges_track_commit (GESTrack *track); 92 GES_API 93 void ges_track_set_timeline (GESTrack *track, GESTimeline *timeline); 94 GES_API 95 gboolean ges_track_add_element (GESTrack *track, GESTrackElement *object); 96 GES_API 97 gboolean ges_track_remove_element (GESTrack *track, GESTrackElement *object); 98 GES_API 99 void ges_track_set_create_element_for_gap_func (GESTrack *track, GESCreateElementForGapFunc func); 100 GES_API 101 void ges_track_set_mixing (GESTrack *track, gboolean mixing); 102 GES_API 103 gboolean ges_track_get_mixing (GESTrack *track); 104 GES_API 105 void ges_track_set_restriction_caps (GESTrack *track, const GstCaps *caps); 106 GES_API 107 void ges_track_update_restriction_caps (GESTrack *track, const GstCaps *caps); 108 109 /* standard methods */ 110 GES_API 111 GType ges_track_get_type (void); 112 GES_API 113 GESTrack* ges_track_new (GESTrackType type, GstCaps * caps); 114 115 G_END_DECLS 116 117 #endif /* _GES_TRACK */ 118