mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 15:18:21 +00:00
tools: Add an option to disable mixing
+ Add a a GObject property so that the info is seralized https://bugzilla.gnome.org/show_bug.cgi?id=729382
This commit is contained in:
parent
cba79c09ac
commit
2dd59ab53a
2 changed files with 29 additions and 1 deletions
|
@ -83,6 +83,7 @@ enum
|
|||
ARG_RESTRICTION_CAPS,
|
||||
ARG_TYPE,
|
||||
ARG_DURATION,
|
||||
ARG_MIXING,
|
||||
ARG_LAST,
|
||||
TRACK_ELEMENT_ADDED,
|
||||
TRACK_ELEMENT_REMOVED,
|
||||
|
@ -386,6 +387,9 @@ ges_track_get_property (GObject * object, guint property_id,
|
|||
case ARG_RESTRICTION_CAPS:
|
||||
gst_value_set_caps (value, track->priv->restriction_caps);
|
||||
break;
|
||||
case ARG_MIXING:
|
||||
g_value_set_boolean (value, track->priv->mixing);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
}
|
||||
|
@ -407,6 +411,9 @@ ges_track_set_property (GObject * object, guint property_id,
|
|||
case ARG_RESTRICTION_CAPS:
|
||||
ges_track_set_restriction_caps (track, gst_value_get_caps (value));
|
||||
break;
|
||||
case ARG_MIXING:
|
||||
ges_track_set_mixing (track, g_value_get_boolean (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
}
|
||||
|
@ -471,6 +478,7 @@ ges_track_constructed (GObject * object)
|
|||
gnlobject = gst_element_factory_make ("gnloperation", "mixing-operation");
|
||||
if (!gst_bin_add (GST_BIN (gnlobject), mixer)) {
|
||||
GST_WARNING_OBJECT (self, "Could not add the mixer to our composition");
|
||||
gst_object_unref (gnlobject);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -562,6 +570,17 @@ ges_track_class_init (GESTrackClass * klass)
|
|||
g_object_class_install_property (object_class, ARG_TYPE,
|
||||
properties[ARG_TYPE]);
|
||||
|
||||
/**
|
||||
* GESTrack:mixing:
|
||||
*
|
||||
* Whether layer mixing is activated or not on the track.
|
||||
*/
|
||||
properties[ARG_MIXING] = g_param_spec_boolean ("mixing", "Mixing",
|
||||
"Whether layer mixing is activated on the track or not",
|
||||
TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
|
||||
g_object_class_install_property (object_class, ARG_MIXING,
|
||||
properties[ARG_MIXING]);
|
||||
|
||||
/**
|
||||
* GESTrack::track-element-added:
|
||||
* @object: the #GESTrack
|
||||
|
@ -759,7 +778,7 @@ ges_track_set_mixing (GESTrack * track, gboolean mixing)
|
|||
}
|
||||
|
||||
if (mixing) {
|
||||
// increase ref count to hold the object
|
||||
/* increase ref count to hold the object */
|
||||
gst_object_ref (track->priv->mixing_operation);
|
||||
if (!gst_bin_add (GST_BIN (track->priv->composition),
|
||||
track->priv->mixing_operation)) {
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
/* GLOBAL VARIABLE */
|
||||
static guint repeat = 0;
|
||||
static gboolean mute = FALSE;
|
||||
static gboolean disable_mixing = FALSE;
|
||||
static GESPipeline *pipeline = NULL;
|
||||
static gboolean seenerrors = FALSE;
|
||||
static gchar *save_path = NULL;
|
||||
|
@ -232,6 +233,9 @@ create_timeline (int nbargs, gchar ** argv, const gchar * proj_uri)
|
|||
|
||||
if (track_types & GES_TRACK_TYPE_AUDIO) {
|
||||
tracka = GES_TRACK (ges_audio_track_new ());
|
||||
if (disable_mixing)
|
||||
ges_track_set_mixing (tracka, FALSE);
|
||||
|
||||
if (!(ges_timeline_add_track (timeline, tracka)))
|
||||
goto build_failure;
|
||||
}
|
||||
|
@ -239,6 +243,9 @@ create_timeline (int nbargs, gchar ** argv, const gchar * proj_uri)
|
|||
if (track_types & GES_TRACK_TYPE_VIDEO) {
|
||||
trackv = GES_TRACK (ges_video_track_new ());
|
||||
|
||||
if (disable_mixing)
|
||||
ges_track_set_mixing (trackv, FALSE);
|
||||
|
||||
if (!(ges_timeline_add_track (timeline, trackv)))
|
||||
goto build_failure;
|
||||
}
|
||||
|
@ -691,6 +698,8 @@ main (int argc, gchar ** argv)
|
|||
"Defines the track types to be created"},
|
||||
{"mute", 0, 0, G_OPTION_ARG_NONE, &mute,
|
||||
"Mute playback output, which means that we use faksinks"},
|
||||
{"disable-mixing", 0, 0, G_OPTION_ARG_NONE, &disable_mixing,
|
||||
"Do not use mixing element in the tracks"},
|
||||
#ifdef HAVE_GST_VALIDATE
|
||||
{"set-scenario", 0, 0, G_OPTION_ARG_STRING, &scenario,
|
||||
"Specify a GstValidate scenario to run, 'none' means load gst-validate"
|
||||
|
|
Loading…
Reference in a new issue