1 /* GStreamer Editing Services
2 * Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
3 * 2009 Nokia Corporation
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.
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.
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.
22 * SECTION:gessourceclip
23 * @title: GESSourceClip
24 * @short_description: Base Class for sources of a GESLayer
30 #include "ges-internal.h"
32 #include "ges-source-clip.h"
33 #include "ges-source.h"
36 struct _GESSourceClipPrivate
47 G_DEFINE_TYPE_WITH_PRIVATE (GESSourceClip, ges_source_clip, GES_TYPE_CLIP);
50 _set_start (GESTimelineElement * element, GstClockTime start)
52 GESTimelineElement *toplevel =
53 ges_timeline_element_get_toplevel_parent (element);
55 gst_object_unref (toplevel);
57 && !ELEMENT_FLAG_IS_SET (element, GES_TIMELINE_ELEMENT_SET_SIMPLE)
58 && !ELEMENT_FLAG_IS_SET (toplevel, GES_TIMELINE_ELEMENT_SET_SIMPLE)) {
59 ges_timeline_move_object_simple (element->timeline, element, NULL,
60 GES_EDGE_NONE, start);
65 GES_TIMELINE_ELEMENT_CLASS (ges_source_clip_parent_class)->set_start
70 _set_duration (GESTimelineElement * element, GstClockTime duration)
72 GESTimelineElement *toplevel =
73 ges_timeline_element_get_toplevel_parent (element);
75 gst_object_unref (toplevel);
77 && !ELEMENT_FLAG_IS_SET (element, GES_TIMELINE_ELEMENT_SET_SIMPLE)
78 && !ELEMENT_FLAG_IS_SET (toplevel, GES_TIMELINE_ELEMENT_SET_SIMPLE)) {
79 return !timeline_trim_object (element->timeline, element,
80 GES_TIMELINE_ELEMENT_LAYER_PRIORITY (element), NULL, GES_EDGE_END,
81 element->start + duration);
85 GES_TIMELINE_ELEMENT_CLASS (ges_source_clip_parent_class)->set_duration
90 ges_source_clip_get_property (GObject * object, guint property_id,
91 GValue * value, GParamSpec * pspec)
93 switch (property_id) {
95 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
100 ges_source_clip_set_property (GObject * object, guint property_id,
101 const GValue * value, GParamSpec * pspec)
103 switch (property_id) {
105 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
110 ges_source_clip_finalize (GObject * object)
112 G_OBJECT_CLASS (ges_source_clip_parent_class)->finalize (object);
116 ges_source_clip_class_init (GESSourceClipClass * klass)
118 GObjectClass *object_class = G_OBJECT_CLASS (klass);
119 GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass);
121 object_class->get_property = ges_source_clip_get_property;
122 object_class->set_property = ges_source_clip_set_property;
123 object_class->finalize = ges_source_clip_finalize;
125 element_class->set_start = _set_start;
126 element_class->set_duration = _set_duration;
130 ges_source_clip_init (GESSourceClip * self)
132 self->priv = ges_source_clip_get_instance_private (self);