mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
encodebin: Add a audioconverter after the audio resampler.
This allows handling non-native-endianness conversion properly.
This commit is contained in:
parent
2fc70442a7
commit
4c68f3b597
1 changed files with 7 additions and 3 deletions
|
@ -1203,26 +1203,30 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
|
||||||
last = cspace;
|
last = cspace;
|
||||||
|
|
||||||
} else if (GST_IS_ENCODING_AUDIO_PROFILE (sprof)) {
|
} else if (GST_IS_ENCODING_AUDIO_PROFILE (sprof)) {
|
||||||
GstElement *aconv, *ares, *arate;
|
GstElement *aconv, *ares, *arate, *aconv2;
|
||||||
|
|
||||||
GST_LOG ("Adding conversion elements for audio stream");
|
GST_LOG ("Adding conversion elements for audio stream");
|
||||||
|
|
||||||
arate = gst_element_factory_make ("audiorate", NULL);
|
arate = gst_element_factory_make ("audiorate", NULL);
|
||||||
g_object_set (arate, "tolerance", (guint64) ebin->tolerance, NULL);
|
g_object_set (arate, "tolerance", (guint64) ebin->tolerance, NULL);
|
||||||
aconv = gst_element_factory_make ("audioconvert", NULL);
|
aconv = gst_element_factory_make ("audioconvert", NULL);
|
||||||
|
aconv2 = gst_element_factory_make ("audioconvert", NULL);
|
||||||
ares = gst_element_factory_make ("audioresample", NULL);
|
ares = gst_element_factory_make ("audioresample", NULL);
|
||||||
|
|
||||||
gst_bin_add_many ((GstBin *) ebin, arate, aconv, ares, NULL);
|
gst_bin_add_many ((GstBin *) ebin, arate, aconv, ares, aconv2, NULL);
|
||||||
tosync = g_list_append (tosync, arate);
|
tosync = g_list_append (tosync, arate);
|
||||||
tosync = g_list_append (tosync, aconv);
|
tosync = g_list_append (tosync, aconv);
|
||||||
tosync = g_list_append (tosync, ares);
|
tosync = g_list_append (tosync, ares);
|
||||||
|
tosync = g_list_append (tosync, aconv2);
|
||||||
if (!fast_element_link (arate, aconv) ||
|
if (!fast_element_link (arate, aconv) ||
|
||||||
!fast_element_link (aconv, ares) || !fast_element_link (ares, last))
|
!fast_element_link (aconv, ares) ||
|
||||||
|
!fast_element_link (ares, aconv2) || !fast_element_link (aconv2, last))
|
||||||
goto converter_link_failure;
|
goto converter_link_failure;
|
||||||
|
|
||||||
sgroup->converters = g_list_prepend (sgroup->converters, arate);
|
sgroup->converters = g_list_prepend (sgroup->converters, arate);
|
||||||
sgroup->converters = g_list_prepend (sgroup->converters, aconv);
|
sgroup->converters = g_list_prepend (sgroup->converters, aconv);
|
||||||
sgroup->converters = g_list_prepend (sgroup->converters, ares);
|
sgroup->converters = g_list_prepend (sgroup->converters, ares);
|
||||||
|
sgroup->converters = g_list_prepend (sgroup->converters, aconv2);
|
||||||
|
|
||||||
last = arate;
|
last = arate;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue