mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
ges/ges-track-transition.c: C90 fixes
This commit is contained in:
parent
8db7c7a48b
commit
71df04a2f9
1 changed files with 49 additions and 52 deletions
|
@ -35,6 +35,10 @@ static void
|
||||||
ges_track_transition_update_vcontroller (GESTrackTransition * self,
|
ges_track_transition_update_vcontroller (GESTrackTransition * self,
|
||||||
GstElement * gnlobj)
|
GstElement * gnlobj)
|
||||||
{
|
{
|
||||||
|
GValue start_value = { 0, };
|
||||||
|
GValue end_value = { 0, };
|
||||||
|
guint64 duration;
|
||||||
|
|
||||||
GST_LOG ("updating controller");
|
GST_LOG ("updating controller");
|
||||||
|
|
||||||
if (!gnlobj)
|
if (!gnlobj)
|
||||||
|
@ -44,13 +48,9 @@ ges_track_transition_update_vcontroller (GESTrackTransition * self,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GST_LOG ("getting properties");
|
GST_LOG ("getting properties");
|
||||||
guint64 duration;
|
|
||||||
g_object_get (G_OBJECT (gnlobj), "duration", (guint64 *) & duration, NULL);
|
g_object_get (G_OBJECT (gnlobj), "duration", (guint64 *) & duration, NULL);
|
||||||
|
|
||||||
GST_INFO ("duration: %d\n", duration);
|
GST_INFO ("duration: %d\n", duration);
|
||||||
|
|
||||||
GValue start_value = { 0, };
|
|
||||||
GValue end_value = { 0, };
|
|
||||||
g_value_init (&start_value, G_TYPE_DOUBLE);
|
g_value_init (&start_value, G_TYPE_DOUBLE);
|
||||||
g_value_init (&end_value, G_TYPE_DOUBLE);
|
g_value_init (&end_value, G_TYPE_DOUBLE);
|
||||||
g_value_set_double (&start_value, self->vstart_value);
|
g_value_set_double (&start_value, self->vstart_value);
|
||||||
|
@ -73,6 +73,10 @@ static void
|
||||||
ges_track_transition_update_acontroller (GESTrackTransition * self,
|
ges_track_transition_update_acontroller (GESTrackTransition * self,
|
||||||
GstElement * gnlobj)
|
GstElement * gnlobj)
|
||||||
{
|
{
|
||||||
|
guint64 duration;
|
||||||
|
GValue zero = { 0, };
|
||||||
|
GValue one = { 0, };
|
||||||
|
|
||||||
GST_LOG ("updating controller: gnlobj (%p) acontroller(%p) bcontroller(%p)",
|
GST_LOG ("updating controller: gnlobj (%p) acontroller(%p) bcontroller(%p)",
|
||||||
gnlobj, self->a_acontroller, self->a_bcontroller);
|
gnlobj, self->a_acontroller, self->a_bcontroller);
|
||||||
|
|
||||||
|
@ -83,13 +87,9 @@ ges_track_transition_update_acontroller (GESTrackTransition * self,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GST_LOG ("getting properties");
|
GST_LOG ("getting properties");
|
||||||
guint64 duration;
|
|
||||||
g_object_get (G_OBJECT (gnlobj), "duration", (guint64 *) & duration, NULL);
|
g_object_get (G_OBJECT (gnlobj), "duration", (guint64 *) & duration, NULL);
|
||||||
|
|
||||||
GST_INFO ("duration: %lud\n", duration);
|
GST_INFO ("duration: %lud\n", duration);
|
||||||
|
|
||||||
GValue zero = { 0, };
|
|
||||||
GValue one = { 0, };
|
|
||||||
g_value_init (&zero, G_TYPE_DOUBLE);
|
g_value_init (&zero, G_TYPE_DOUBLE);
|
||||||
g_value_init (&one, G_TYPE_DOUBLE);
|
g_value_init (&one, G_TYPE_DOUBLE);
|
||||||
g_value_set_double (&zero, 0.0);
|
g_value_set_double (&zero, 0.0);
|
||||||
|
@ -244,22 +244,22 @@ link_element_to_mixer_with_volume (GstBin * bin, GstElement * element,
|
||||||
static GstElement *
|
static GstElement *
|
||||||
create_video_bin (GESTrackTransition * self)
|
create_video_bin (GESTrackTransition * self)
|
||||||
{
|
{
|
||||||
|
GstElement *topbin, *iconva, *iconvb, *oconv;
|
||||||
|
GObject *target = NULL;
|
||||||
|
const gchar *propname = NULL;
|
||||||
|
GstElement *mixer = NULL;
|
||||||
|
GstPad *sinka_target, *sinkb_target, *src_target, *sinka, *sinkb, *src;
|
||||||
|
GstController *controller;
|
||||||
|
GstInterpolationControlSource *control_source;
|
||||||
|
|
||||||
GST_LOG ("creating a video bin");
|
GST_LOG ("creating a video bin");
|
||||||
|
|
||||||
GstElement *topbin = gst_bin_new ("transition-bin");
|
topbin = gst_bin_new ("transition-bin");
|
||||||
GstElement *iconva = gst_element_factory_make ("ffmpegcolorspace",
|
iconva = gst_element_factory_make ("ffmpegcolorspace", "tr-csp-a");
|
||||||
"tr-csp-a");
|
iconvb = gst_element_factory_make ("ffmpegcolorspace", "tr-csp-b");
|
||||||
GstElement *iconvb = gst_element_factory_make ("ffmpegcolorspace",
|
oconv = gst_element_factory_make ("ffmpegcolorspace", "tr-csp-output");
|
||||||
"tr-csp-b");
|
|
||||||
GstElement *oconv = gst_element_factory_make ("ffmpegcolorspace",
|
|
||||||
"tr-csp-output");
|
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (topbin), iconva, iconvb, oconv, NULL);
|
gst_bin_add_many (GST_BIN (topbin), iconva, iconvb, oconv, NULL);
|
||||||
|
|
||||||
GObject *target = NULL;
|
|
||||||
gchar *propname = NULL;
|
|
||||||
GstElement *mixer = NULL;
|
|
||||||
|
|
||||||
mixer = gst_element_factory_make ("videomixer", NULL);
|
mixer = gst_element_factory_make ("videomixer", NULL);
|
||||||
g_object_set (G_OBJECT (mixer), "background", 1, NULL);
|
g_object_set (G_OBJECT (mixer), "background", 1, NULL);
|
||||||
gst_bin_add (GST_BIN (topbin), mixer);
|
gst_bin_add (GST_BIN (topbin), mixer);
|
||||||
|
@ -283,13 +283,13 @@ create_video_bin (GESTrackTransition * self)
|
||||||
|
|
||||||
gst_element_link (mixer, oconv);
|
gst_element_link (mixer, oconv);
|
||||||
|
|
||||||
GstPad *sinka_target = gst_element_get_static_pad (iconva, "sink");
|
sinka_target = gst_element_get_static_pad (iconva, "sink");
|
||||||
GstPad *sinkb_target = gst_element_get_static_pad (iconvb, "sink");
|
sinkb_target = gst_element_get_static_pad (iconvb, "sink");
|
||||||
GstPad *src_target = gst_element_get_static_pad (oconv, "src");
|
src_target = gst_element_get_static_pad (oconv, "src");
|
||||||
|
|
||||||
GstPad *sinka = gst_ghost_pad_new ("sinka", sinka_target);
|
sinka = gst_ghost_pad_new ("sinka", sinka_target);
|
||||||
GstPad *sinkb = gst_ghost_pad_new ("sinkb", sinkb_target);
|
sinkb = gst_ghost_pad_new ("sinkb", sinkb_target);
|
||||||
GstPad *src = gst_ghost_pad_new ("src", src_target);
|
src = gst_ghost_pad_new ("src", src_target);
|
||||||
|
|
||||||
gst_element_add_pad (topbin, src);
|
gst_element_add_pad (topbin, src);
|
||||||
gst_element_add_pad (topbin, sinka);
|
gst_element_add_pad (topbin, sinka);
|
||||||
|
@ -299,9 +299,8 @@ create_video_bin (GESTrackTransition * self)
|
||||||
|
|
||||||
g_object_set (target, propname, (gfloat) 0.0, NULL);
|
g_object_set (target, propname, (gfloat) 0.0, NULL);
|
||||||
|
|
||||||
GstController *controller;
|
|
||||||
controller = gst_object_control_properties (target, propname, NULL);
|
controller = gst_object_control_properties (target, propname, NULL);
|
||||||
GstInterpolationControlSource *control_source;
|
|
||||||
control_source = gst_interpolation_control_source_new ();
|
control_source = gst_interpolation_control_source_new ();
|
||||||
gst_controller_set_control_source (controller,
|
gst_controller_set_control_source (controller,
|
||||||
propname, GST_CONTROL_SOURCE (control_source));
|
propname, GST_CONTROL_SOURCE (control_source));
|
||||||
|
@ -321,22 +320,24 @@ create_video_bin (GESTrackTransition * self)
|
||||||
static GstElement *
|
static GstElement *
|
||||||
create_audio_bin (GESTrackTransition * self)
|
create_audio_bin (GESTrackTransition * self)
|
||||||
{
|
{
|
||||||
|
GstElement *topbin, *iconva, *iconvb, *oconv;
|
||||||
|
GObject *atarget, *btarget = NULL;
|
||||||
|
const gchar *propname = "volume";
|
||||||
|
GstElement *mixer = NULL;
|
||||||
|
GstPad *sinka_target, *sinkb_target, *src_target, *sinka, *sinkb, *src;
|
||||||
|
GstController *acontroller, *bcontroller;
|
||||||
|
GstInterpolationControlSource *acontrol_source, *bcontrol_source;
|
||||||
|
|
||||||
|
|
||||||
GST_LOG ("creating an audio bin");
|
GST_LOG ("creating an audio bin");
|
||||||
|
|
||||||
GstElement *topbin = gst_bin_new ("transition-bin");
|
topbin = gst_bin_new ("transition-bin");
|
||||||
GstElement *iconva = gst_element_factory_make ("audioconvert",
|
iconva = gst_element_factory_make ("audioconvert", "tr-aconv-a");
|
||||||
"tr-aconv-a");
|
iconvb = gst_element_factory_make ("audioconvert", "tr-aconv-b");
|
||||||
GstElement *iconvb = gst_element_factory_make ("audioconvert",
|
oconv = gst_element_factory_make ("audioconvert", "tr-aconv-output");
|
||||||
"tr-aconv-b");
|
|
||||||
GstElement *oconv = gst_element_factory_make ("audioconvert",
|
|
||||||
"tr-aconv-output");
|
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (topbin), iconva, iconvb, oconv, NULL);
|
gst_bin_add_many (GST_BIN (topbin), iconva, iconvb, oconv, NULL);
|
||||||
|
|
||||||
GObject *atarget, *btarget = NULL;
|
|
||||||
gchar *propname = "volume";
|
|
||||||
GstElement *mixer = NULL;
|
|
||||||
|
|
||||||
mixer = gst_element_factory_make ("adder", NULL);
|
mixer = gst_element_factory_make ("adder", NULL);
|
||||||
gst_bin_add (GST_BIN (topbin), mixer);
|
gst_bin_add (GST_BIN (topbin), mixer);
|
||||||
|
|
||||||
|
@ -347,13 +348,13 @@ create_audio_bin (GESTrackTransition * self)
|
||||||
|
|
||||||
gst_element_link (mixer, oconv);
|
gst_element_link (mixer, oconv);
|
||||||
|
|
||||||
GstPad *sinka_target = gst_element_get_static_pad (iconva, "sink");
|
sinka_target = gst_element_get_static_pad (iconva, "sink");
|
||||||
GstPad *sinkb_target = gst_element_get_static_pad (iconvb, "sink");
|
sinkb_target = gst_element_get_static_pad (iconvb, "sink");
|
||||||
GstPad *src_target = gst_element_get_static_pad (oconv, "src");
|
src_target = gst_element_get_static_pad (oconv, "src");
|
||||||
|
|
||||||
GstPad *sinka = gst_ghost_pad_new ("sinka", sinka_target);
|
sinka = gst_ghost_pad_new ("sinka", sinka_target);
|
||||||
GstPad *sinkb = gst_ghost_pad_new ("sinkb", sinkb_target);
|
sinkb = gst_ghost_pad_new ("sinkb", sinkb_target);
|
||||||
GstPad *src = gst_ghost_pad_new ("src", src_target);
|
src = gst_ghost_pad_new ("src", src_target);
|
||||||
|
|
||||||
gst_element_add_pad (topbin, src);
|
gst_element_add_pad (topbin, src);
|
||||||
gst_element_add_pad (topbin, sinka);
|
gst_element_add_pad (topbin, sinka);
|
||||||
|
@ -364,15 +365,11 @@ create_audio_bin (GESTrackTransition * self)
|
||||||
//g_object_set(atarget, propname, (gdouble) 0, NULL);
|
//g_object_set(atarget, propname, (gdouble) 0, NULL);
|
||||||
//g_object_set(btarget, propname, (gdouble) 0, NULL);
|
//g_object_set(btarget, propname, (gdouble) 0, NULL);
|
||||||
|
|
||||||
GstController *acontroller, *bcontroller;
|
|
||||||
|
|
||||||
acontroller = gst_object_control_properties (atarget, propname, NULL);
|
acontroller = gst_object_control_properties (atarget, propname, NULL);
|
||||||
bcontroller = gst_object_control_properties (btarget, propname, NULL);
|
bcontroller = gst_object_control_properties (btarget, propname, NULL);
|
||||||
|
|
||||||
g_assert (acontroller && bcontroller);
|
g_assert (acontroller && bcontroller);
|
||||||
|
|
||||||
GstInterpolationControlSource *acontrol_source, *bcontrol_source;
|
|
||||||
|
|
||||||
acontrol_source = gst_interpolation_control_source_new ();
|
acontrol_source = gst_interpolation_control_source_new ();
|
||||||
gst_controller_set_control_source (acontroller,
|
gst_controller_set_control_source (acontroller,
|
||||||
propname, GST_CONTROL_SOURCE (acontrol_source));
|
propname, GST_CONTROL_SOURCE (acontrol_source));
|
||||||
|
@ -458,11 +455,11 @@ ges_track_transition_init (GESTrackTransition * self)
|
||||||
self->a_bcontrol_source = NULL;
|
self->a_bcontrol_source = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
void
|
||||||
ges_track_transition_set_vtype (GESTrackTransition * self, gint vtype)
|
ges_track_transition_set_vtype (GESTrackTransition * self, gint vtype)
|
||||||
{
|
{
|
||||||
if ((vtype == VTYPE_CROSSFADE) && (self->vtype != VTYPE_CROSSFADE) ||
|
if (((vtype == VTYPE_CROSSFADE) && (self->vtype != VTYPE_CROSSFADE)) ||
|
||||||
(vtype != VTYPE_CROSSFADE) && (self->vtype = VTYPE_CROSSFADE)) {
|
((vtype != VTYPE_CROSSFADE) && (self->vtype = VTYPE_CROSSFADE))) {
|
||||||
GST_WARNING
|
GST_WARNING
|
||||||
("Changing between 'crossfade' and other types is not supported\n");
|
("Changing between 'crossfade' and other types is not supported\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue