mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 02:03:54 +00:00
check whether setting vtype property actually succeeds
This commit is contained in:
parent
33449efcd7
commit
770a16f5ce
3 changed files with 24 additions and 12 deletions
|
@ -59,11 +59,21 @@ ges_timeline_transition_update_vtype_internal (GESTimelineObject * self,
|
||||||
GESVideoTransitionType value)
|
GESVideoTransitionType value)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
GESTimelineTransition *trself = (GESTimelineTransition *) self;
|
||||||
|
GESVideoTransitionType old;
|
||||||
|
old = trself->vtype;
|
||||||
|
|
||||||
for (tmp = self->trackobjects; tmp; tmp = g_list_next (tmp))
|
for (tmp = self->trackobjects; tmp; tmp = g_list_next (tmp)) {
|
||||||
if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data))
|
GESTrackVideoTransition *obj;
|
||||||
ges_track_video_transition_set_type ((GESTrackVideoTransition *)
|
if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) {
|
||||||
tmp->data, value);
|
obj = (GESTrackVideoTransition *) tmp->data;
|
||||||
|
if (!ges_track_video_transition_set_type (obj, value))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trself->vtype = value;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -73,7 +83,7 @@ ges_timeline_transition_get_property (GObject * object,
|
||||||
GESTimelineTransition *self = GES_TIMELINE_TRANSITION (object);
|
GESTimelineTransition *self = GES_TIMELINE_TRANSITION (object);
|
||||||
switch (property_id) {
|
switch (property_id) {
|
||||||
case PROP_VTYPE:
|
case PROP_VTYPE:
|
||||||
self->vtype = g_value_get_enum (value);
|
g_value_set_enum (value, self->vtype);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
@ -85,12 +95,11 @@ ges_timeline_transition_set_property (GObject * object, guint property_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GESTimelineObject *self = GES_TIMELINE_OBJECT (object);
|
GESTimelineObject *self = GES_TIMELINE_OBJECT (object);
|
||||||
GESTimelineTransition *trself = GES_TIMELINE_TRANSITION (object);
|
|
||||||
|
|
||||||
switch (property_id) {
|
switch (property_id) {
|
||||||
case PROP_VTYPE:
|
case PROP_VTYPE:
|
||||||
trself->vtype = g_value_get_enum (value);
|
ges_timeline_transition_update_vtype_internal (self,
|
||||||
ges_timeline_transition_update_vtype_internal (self, trself->vtype);
|
g_value_get_enum (value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
|
|
@ -309,7 +309,7 @@ ges_track_video_transition_duration_changed (GESTrackObject * object,
|
||||||
GST_LOG ("done updating controller");
|
GST_LOG ("done updating controller");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_track_video_transition_set_type (GESTrackVideoTransition * self,
|
ges_track_video_transition_set_type (GESTrackVideoTransition * self,
|
||||||
GESVideoTransitionType type)
|
GESVideoTransitionType type)
|
||||||
{
|
{
|
||||||
|
@ -320,12 +320,13 @@ ges_track_video_transition_set_type (GESTrackVideoTransition * self,
|
||||||
(self->type == GES_VIDEO_TRANSITION_TYPE_CROSSFADE))) {
|
(self->type == GES_VIDEO_TRANSITION_TYPE_CROSSFADE))) {
|
||||||
GST_WARNING
|
GST_WARNING
|
||||||
("Changing between 'crossfade' and other types is not supported");
|
("Changing between 'crossfade' and other types is not supported");
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->type = type;
|
self->type = type;
|
||||||
if (self->smpte && (type != GES_VIDEO_TRANSITION_TYPE_CROSSFADE))
|
if (self->smpte && (type != GES_VIDEO_TRANSITION_TYPE_CROSSFADE))
|
||||||
g_object_set (self->smpte, "type", (gint) type, NULL);
|
g_object_set (self->smpte, "type", (gint) type, NULL);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GESTrackVideoTransition *
|
GESTrackVideoTransition *
|
||||||
|
|
|
@ -86,8 +86,10 @@ struct _GESTrackVideoTransitionClass {
|
||||||
|
|
||||||
GType ges_track_video_transition_get_type (void);
|
GType ges_track_video_transition_get_type (void);
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
ges_track_video_transition_set_type (GESTrackVideoTransition * self, GESVideoTransitionType type);
|
ges_track_video_transition_set_type (GESTrackVideoTransition * self,
|
||||||
|
GESVideoTransitionType type);
|
||||||
|
;
|
||||||
|
|
||||||
GESTrackVideoTransition* ges_track_video_transition_new (void);
|
GESTrackVideoTransition* ges_track_video_transition_new (void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue