mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
audiosource: Add audioconvert and audioresample before the volume element
https://bugzilla.gnome.org/show_bug.cgi?id=709777
This commit is contained in:
parent
fb6aabfe4d
commit
d77f260f9e
1 changed files with 7 additions and 3 deletions
|
@ -67,11 +67,11 @@ _sync_element_to_layer_property_float (GESTrackElement * trksrc,
|
||||||
static GstElement *
|
static GstElement *
|
||||||
ges_audio_source_create_element (GESTrackElement * trksrc)
|
ges_audio_source_create_element (GESTrackElement * trksrc)
|
||||||
{
|
{
|
||||||
|
GstElement *volume, *vbin;
|
||||||
GstElement *topbin;
|
GstElement *topbin;
|
||||||
GstElement *sub_element;
|
GstElement *sub_element;
|
||||||
GESAudioSourceClass *source_class = GES_AUDIO_SOURCE_GET_CLASS (trksrc);
|
GESAudioSourceClass *source_class = GES_AUDIO_SOURCE_GET_CLASS (trksrc);
|
||||||
const gchar *props[] = { "volume", "mute", NULL };
|
const gchar *props[] = { "volume", "mute", NULL };
|
||||||
GstElement *volume;
|
|
||||||
|
|
||||||
if (!source_class->create_source)
|
if (!source_class->create_source)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -79,8 +79,12 @@ ges_audio_source_create_element (GESTrackElement * trksrc)
|
||||||
sub_element = source_class->create_source (trksrc);
|
sub_element = source_class->create_source (trksrc);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (trksrc, "Creating a bin sub_element ! volume");
|
GST_DEBUG_OBJECT (trksrc, "Creating a bin sub_element ! volume");
|
||||||
volume = gst_element_factory_make ("volume", NULL);
|
vbin =
|
||||||
topbin = ges_source_create_topbin ("audiosrcbin", sub_element, volume, NULL);
|
gst_parse_bin_from_description
|
||||||
|
("audioconvert ! audioresample ! volume name=v", TRUE, NULL);
|
||||||
|
topbin = ges_source_create_topbin ("audiosrcbin", sub_element, vbin, NULL);
|
||||||
|
volume = gst_bin_get_by_name (GST_BIN (vbin), "v");
|
||||||
|
|
||||||
_sync_element_to_layer_property_float (trksrc, volume, GES_META_VOLUME,
|
_sync_element_to_layer_property_float (trksrc, volume, GES_META_VOLUME,
|
||||||
"volume");
|
"volume");
|
||||||
ges_track_element_add_children_props (trksrc, volume, NULL, NULL, props);
|
ges_track_element_add_children_props (trksrc, volume, NULL, NULL, props);
|
||||||
|
|
Loading…
Reference in a new issue