static void ges_uri_clip_class_init (GESUriClipClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GESClipClass *timobj_class = GES_CLIP_CLASS (klass); GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass); g_type_class_add_private (klass, sizeof (GESUriClipPrivate)); object_class->get_property = ges_uri_clip_get_property; object_class->set_property = ges_uri_clip_set_property; object_class->finalize = ges_uri_clip_finalize; /** * GESUriClip:uri: * * The location of the file/resource to use. */ g_object_class_install_property (object_class, PROP_URI, g_param_spec_string ("uri", "URI", "uri of the resource", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * GESUriClip:mute: * * Whether the sound will be played or not. */ g_object_class_install_property (object_class, PROP_MUTE, g_param_spec_boolean ("mute", "Mute", "Mute audio track", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); /** * GESUriClip:is-image: * * Whether this filesource represents a still image or not. This must be set * before create_track_elements is called. */ g_object_class_install_property (object_class, PROP_IS_IMAGE, g_param_spec_boolean ("is-image", "Is still image", "Whether the clip represents a still image or not", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); /* Redefine the supported formats property so the default value is UNKNOWN * and not AUDIO | VIDEO */ g_object_class_install_property (object_class, PROP_SUPPORTED_FORMATS, g_param_spec_flags ("supported-formats", "Supported formats", "Formats supported by the file", GES_TYPE_TRACK_TYPE, GES_TRACK_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); element_class->set_max_duration = filesource_set_max_duration; timobj_class->create_track_elements = ges_uri_clip_create_track_elements; timobj_class->create_track_element = ges_uri_clip_create_track_element; timobj_class->need_fill_track = FALSE; }
gboolean uri_clip_set_max_duration (GESTimelineElement * element, GstClockTime maxduration) { if (_DURATION (element) == GST_CLOCK_TIME_NONE || _DURATION (element) == 0) /* If we don't have a valid duration, use the max duration */ _set_duration0 (element, maxduration - _INPOINT (element)); return GES_TIMELINE_ELEMENT_CLASS (parent_class)->set_max_duration (element, maxduration); }
static gboolean _lookup_child (GESTimelineElement * self, const gchar * prop_name, GObject ** child, GParamSpec ** pspec) { GList *tmp; for (tmp = GES_CONTAINER_CHILDREN (self); tmp; tmp = tmp->next) _ges_container_add_child_properties (GES_CONTAINER (self), tmp->data); return GES_TIMELINE_ELEMENT_CLASS (ges_container_parent_class)->lookup_child (self, prop_name, child, pspec); }
static void ges_container_class_init (GESContainerClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass); GST_DEBUG_CATEGORY_INIT (ges_container_debug, "gescontainer", GST_DEBUG_FG_YELLOW, "ges container"); g_type_class_add_private (klass, sizeof (GESContainerPrivate)); object_class->get_property = _get_property; object_class->set_property = _set_property; object_class->dispose = _dispose; object_class->finalize = _finalize; /** * GESContainer:height: * * The span of priorities which this container occupies. */ properties[PROP_HEIGHT] = g_param_spec_uint ("height", "Height", "The span of priorities this container occupies", 0, G_MAXUINT, 1, G_PARAM_READABLE); g_object_class_install_property (object_class, PROP_HEIGHT, properties[PROP_HEIGHT]); /** * GESContainer::child-added: * @container: the #GESContainer * @element: the #GESTimelineElement that was added. * * Will be emitted after a child was added to @container. * Usually you should connect with #g_signal_connect_after * as in the first emission stage, the signal emission might * get stopped internally. */ ges_container_signals[CHILD_ADDED_SIGNAL] = g_signal_new ("child-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESContainerClass, child_added), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT); /** * GESContainer::child-removed: * @container: the #GESContainer * @element: the #GESTimelineElement that was removed. * * Will be emitted after a child was removed from @container. */ ges_container_signals[CHILD_REMOVED_SIGNAL] = g_signal_new ("child-removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESContainerClass, child_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT); element_class->set_start = _set_start; element_class->set_duration = _set_duration; element_class->set_inpoint = _set_inpoint; element_class->list_children_properties = _list_children_properties; element_class->lookup_child = _lookup_child; element_class->get_track_types = _get_track_types; element_class->paste = _paste; element_class->deep_copy = _deep_copy; /* No default implementations */ klass->remove_child = NULL; klass->add_child = NULL; klass->ungroup = NULL; klass->group = NULL; klass->grouping_priority = 0; klass->edit = NULL; }
static void ges_track_element_class_init (GESTrackElementClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass); g_type_class_add_private (klass, sizeof (GESTrackElementPrivate)); object_class->get_property = ges_track_element_get_property; object_class->set_property = ges_track_element_set_property; object_class->dispose = ges_track_element_dispose; object_class->finalize = ges_track_element_finalize; /** * GESTrackElement:active: * * Whether the object should be taken into account in the #GESTrack output. * If #FALSE, then its contents will not be used in the resulting track. */ properties[PROP_ACTIVE] = g_param_spec_boolean ("active", "Active", "Use object in output", TRUE, G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_ACTIVE, properties[PROP_ACTIVE]); properties[PROP_TRACK_TYPE] = g_param_spec_flags ("track-type", "Track Type", "The track type of the object", GES_TYPE_TRACK_TYPE, GES_TRACK_TYPE_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_TRACK_TYPE, properties[PROP_TRACK_TYPE]); properties[PROP_TRACK] = g_param_spec_object ("track", "Track", "The track the object is in", GES_TYPE_TRACK, G_PARAM_READABLE); g_object_class_install_property (object_class, PROP_TRACK, properties[PROP_TRACK]); /** * GESTrackElement::deep-notify: * @track_element: a #GESTrackElement * @prop_object: the object that originated the signal * @prop: the property that changed * * The deep notify signal is used to be notified of property changes of all * the childs of @track_element */ ges_track_element_signals[DEEP_NOTIFY] = g_signal_new ("deep-notify", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 2, GST_TYPE_ELEMENT, G_TYPE_PARAM); element_class->set_start = _set_start; element_class->set_duration = _set_duration; element_class->set_inpoint = _set_inpoint; element_class->set_priority = _set_priority; element_class->deep_copy = ges_track_element_copy_properties; klass->create_gnl_object = ges_track_element_create_gnl_object_func; klass->list_children_properties = default_list_children_properties; }