mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 00:28:21 +00:00
tests: fix wavenc test on big endian
wavenc only accepts little-endian PCM, but most of our elements such as audiotestsrc only produce or process audio in native endianness, so we need to plug a converter before wavenc on big endian systems.
This commit is contained in:
parent
747e63f4e7
commit
834e58be9e
1 changed files with 14 additions and 3 deletions
|
@ -54,7 +54,7 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data)
|
|||
|
||||
/*
|
||||
* gst-launch \
|
||||
* audiotestsrc freq=440 num-buffers=100 ! interleave name=i ! wavenc ! filesink location=/tmp/mc.wav \
|
||||
* audiotestsrc freq=440 num-buffers=100 ! interleave name=i ! audioconvert ! wavenc ! filesink location=/tmp/mc.wav \
|
||||
* audiotestsrc freq=880 num-buffers=100 ! i.
|
||||
* ...
|
||||
*
|
||||
|
@ -65,7 +65,7 @@ static void
|
|||
make_n_channel_wav (const gint channels, const GValueArray * arr)
|
||||
{
|
||||
GstElement *pipeline;
|
||||
GstElement **audiotestsrc, *interleave, *wavenc, *fakesink;
|
||||
GstElement **audiotestsrc, *interleave, *wavenc, *conv, *fakesink;
|
||||
GstBus *bus;
|
||||
GMainLoop *loop;
|
||||
guint i;
|
||||
|
@ -81,10 +81,21 @@ make_n_channel_wav (const gint channels, const GValueArray * arr)
|
|||
g_object_set (interleave, "channel-positions", arr, NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), interleave);
|
||||
|
||||
if (G_BYTE_ORDER == G_BIG_ENDIAN) {
|
||||
/* we're not here to test orc; audioconvert misbehaves on ppc32 */
|
||||
g_setenv ("ORC_CODE", "backup", 1);
|
||||
conv = gst_element_factory_make ("audioconvert", NULL);
|
||||
} else {
|
||||
conv = gst_element_factory_make ("identity", NULL);
|
||||
}
|
||||
fail_unless (conv != NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), conv);
|
||||
fail_unless (gst_element_link (interleave, conv));
|
||||
|
||||
wavenc = gst_element_factory_make ("wavenc", NULL);
|
||||
fail_unless (wavenc != NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), wavenc);
|
||||
fail_unless (gst_element_link (interleave, wavenc));
|
||||
fail_unless (gst_element_link (conv, wavenc));
|
||||
|
||||
fakesink = gst_element_factory_make ("fakesink", NULL);
|
||||
fail_unless (fakesink != NULL);
|
||||
|
|
Loading…
Reference in a new issue