From d3f6a95cff8c5eae59a6c90b2edcaea594aad10b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 29 Sep 2011 13:46:36 +0200 Subject: [PATCH] tests: update for new audio caps --- tests/check/elements/adder.c | 8 +- tests/check/elements/audioconvert.c | 397 ++++++++++---------- tests/check/elements/audiorate.c | 64 ++-- tests/check/elements/audioresample.c | 47 ++- tests/check/elements/audiotestsrc.c | 10 +- tests/check/elements/decodebin2.c | 4 +- tests/check/elements/encodebin.c | 4 +- tests/check/elements/gdpdepay.c | 21 +- tests/check/elements/gdppay.c | 20 +- tests/check/elements/playbin-compressed.c | 24 +- tests/check/elements/videorate.c | 188 ++++----- tests/check/elements/videotestsrc.c | 2 +- tests/check/elements/volume.c | 92 +++-- tests/check/libs/audio.c | 2 +- tests/check/libs/pbutils.c | 4 +- tests/check/libs/profile.c | 8 +- tests/check/pipelines/simple-launch-lines.c | 13 +- tests/check/pipelines/vorbisdec.c | 2 +- tests/check/pipelines/vorbisenc.c | 6 +- 19 files changed, 435 insertions(+), 481 deletions(-) diff --git a/tests/check/elements/adder.c b/tests/check/elements/adder.c index fa5c2564e4..6daa6c7c5a 100644 --- a/tests/check/elements/adder.c +++ b/tests/check/elements/adder.c @@ -788,12 +788,10 @@ GST_START_TEST (test_clip) event = gst_event_new_segment (&segment); gst_pad_send_event (sinkpad, event); -/*FIXME: caps = gst_caps_new_simple ("audio/x-raw-int", +/*FIXME: caps = gst_caps_new_simple ("audio/x-raw", + "format", G_TYPE_STRING, GST_AUDIO_NE (S16), "rate", G_TYPE_INT, 44100, - "channels", G_TYPE_INT, 2, - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + "channels", G_TYPE_INT, 2, NULL); */ /* should be clipped and ok */ diff --git a/tests/check/elements/audioconvert.c b/tests/check/elements/audioconvert.c index 5b7ab9d3e9..e849c4d05e 100644 --- a/tests/check/elements/audioconvert.c +++ b/tests/check/elements/audioconvert.c @@ -31,40 +31,17 @@ * get_peer, and then remove references in every test function */ static GstPad *mysrcpad, *mysinkpad; +#define FORMATS "{ F32LE, F32BE, F64LE, F64BE, " \ + "S32LE, S32BE, U32LE, U32BE, " \ + "S24LE, S24BE, U24LE, U24BE, " \ + "S16LE, S16BE, U16LE, U16BE, " \ + "S8, U8 } " + #define CONVERT_CAPS_TEMPLATE_STRING \ - "audio/x-raw-float, " \ + "audio/x-raw, " \ + "format = (string) "FORMATS", " \ "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, MAX ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) { 32, 64 };" \ - "audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, MAX ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) 32, " \ - "depth = (int) [ 1, 32 ], " \ - "signed = (boolean) { true, false }; " \ - "audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, MAX ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) 24, " \ - "depth = (int) [ 1, 24 ], " \ - "signed = (boolean) { true, false }; " \ - "audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, MAX ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) 16, " \ - "depth = (int) [ 1, 16 ], " \ - "signed = (boolean) { true, false }; " \ - "audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, MAX ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) 8, " \ - "depth = (int) [ 1, 8 ], " \ - "signed = (boolean) { true, false } " + "channels = (int) [ 1, MAX ]" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -119,20 +96,19 @@ cleanup_audioconvert (GstElement * audioconvert) /* returns a newly allocated caps */ static GstCaps * -get_int_caps (guint channels, const gchar * endianness, guint width, +get_int_caps (guint channels, gint endianness, guint width, guint depth, gboolean signedness) { GstCaps *caps; gchar *string; + GstAudioFormat fmt; - string = g_strdup_printf ("audio/x-raw-int, " + fmt = gst_audio_format_build_integer (signedness, endianness, width, depth); + + string = g_strdup_printf ("audio/x-raw, " + "format = (string) %s, " "rate = (int) 44100, " - "channels = (int) %d, " - "endianness = (int) %s, " - "width = (int) %d, " - "depth = (int) %d, " - "signed = (boolean) %s ", - channels, endianness, width, depth, signedness ? "true" : "false"); + "channels = (int) %d", gst_audio_format_to_string (fmt), channels); GST_DEBUG ("creating caps from %s", string); caps = gst_caps_from_string (string); g_free (string); @@ -143,16 +119,27 @@ get_int_caps (guint channels, const gchar * endianness, guint width, /* returns a newly allocated caps */ static GstCaps * -get_float_caps (guint channels, const gchar * endianness, guint width) +get_float_caps (guint channels, gint endianness, guint width) { GstCaps *caps; gchar *string; + const gchar *format; - string = g_strdup_printf ("audio/x-raw-float, " - "rate = (int) 44100, " - "channels = (int) %d, " - "endianness = (int) %s, " - "width = (int) %d ", channels, endianness, width); + if (endianness == G_LITTLE_ENDIAN) { + if (width == 32) + format = "F32LE"; + else + format = "F64LE"; + } else { + if (width == 32) + format = "F32BE"; + else + format = "F64BE"; + } + + string = g_strdup_printf ("audio/x-raw, " + "format = (string) %s, " + "rate = (int) 44100, " "channels = (int) %d", format, channels); GST_DEBUG ("creating caps from %s", string); caps = gst_caps_from_string (string); g_free (string); @@ -395,7 +382,7 @@ set_channel_positions (GstCaps * caps, int channels, * ones. Only implemented for channels between 1 and 6. */ static GstCaps * -get_float_mc_caps (guint channels, const gchar * endianness, guint width, +get_float_mc_caps (guint channels, gint endianness, guint width, gboolean mixed_up_layout) { GstCaps *caps = get_float_caps (channels, endianness, width); @@ -411,7 +398,7 @@ get_float_mc_caps (guint channels, const gchar * endianness, guint width, } static GstCaps * -get_int_mc_caps (guint channels, const gchar * endianness, guint width, +get_int_mc_caps (guint channels, gint endianness, guint width, guint depth, gboolean signedness, gboolean mixed_up_layout) { GstCaps *caps = get_int_caps (channels, endianness, width, depth, signedness); @@ -532,8 +519,8 @@ GST_START_TEST (test_int16) gint16 out[] = { 8064, 1024 }; RUN_CONVERSION ("int16 stereo to mono", - in, get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)); + in, get_int_caps (2, G_BYTE_ORDER, 16, 16, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE)); } /* mono to stereo */ { @@ -541,8 +528,8 @@ GST_START_TEST (test_int16) gint16 out[] = { 512, 512, 1024, 1024 }; RUN_CONVERSION ("int16 mono to stereo", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE)); + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_int_caps (2, G_BYTE_ORDER, 16, 16, TRUE)); } /* signed -> unsigned */ { @@ -550,11 +537,11 @@ GST_START_TEST (test_int16) guint16 out[] = { 32768, 1, 65535, 0 }; RUN_CONVERSION ("int16 signed to unsigned", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE)); + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE)); RUN_CONVERSION ("int16 unsigned to signed", - out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE), - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)); + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE), + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE)); } } @@ -569,8 +556,8 @@ GST_START_TEST (test_float32) gfloat out[] = { 0.29609375, 0.03125 }; RUN_CONVERSION ("float32 stereo to mono", - in, get_float_caps (2, "BYTE_ORDER", 32), - out, get_float_caps (1, "BYTE_ORDER", 32)); + in, get_float_caps (2, G_BYTE_ORDER, 32), + out, get_float_caps (1, G_BYTE_ORDER, 32)); } /* mono to stereo */ { @@ -578,8 +565,8 @@ GST_START_TEST (test_float32) gfloat out[] = { 0.015625, 0.015625, 0.03125, 0.03125 }; RUN_CONVERSION ("float32 mono to stereo", - in, get_float_caps (1, "BYTE_ORDER", 32), - out, get_float_caps (2, "BYTE_ORDER", 32)); + in, get_float_caps (1, G_BYTE_ORDER, 32), + out, get_float_caps (2, G_BYTE_ORDER, 32)); } } @@ -595,12 +582,12 @@ GST_START_TEST (test_int_conversion) gint16 out[] = { 0, 256, 512, 32512, -32512 }; RUN_CONVERSION ("int 8bit to 16bit signed", - in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE) + in, get_int_caps (1, G_BYTE_ORDER, 8, 8, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE) ); RUN_CONVERSION ("int 16bit signed to 8bit", - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE) + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + in, get_int_caps (1, G_BYTE_ORDER, 8, 8, TRUE) ); } /* 16 -> 8 signed */ @@ -609,8 +596,8 @@ GST_START_TEST (test_int_conversion) gint8 out[] = { 0, 0, 1, 1, 1, 2 }; RUN_CONVERSION ("16 bit to 8 signed", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE) + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 8, 8, TRUE) ); } /* 8 unsigned <-> 16 signed */ @@ -621,13 +608,13 @@ GST_START_TEST (test_int_conversion) GstCaps *incaps, *outcaps; /* exploded for easier valgrinding */ - incaps = get_int_caps (1, "BYTE_ORDER", 8, 8, FALSE); - outcaps = get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE); + incaps = get_int_caps (1, G_BYTE_ORDER, 8, 8, FALSE); + outcaps = get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE); GST_DEBUG ("incaps: %" GST_PTR_FORMAT, incaps); GST_DEBUG ("outcaps: %" GST_PTR_FORMAT, outcaps); RUN_CONVERSION ("8 unsigned to 16 signed", in, incaps, out, outcaps); RUN_CONVERSION ("16 signed to 8 unsigned", out, get_int_caps (1, - "BYTE_ORDER", 16, 16, TRUE), in, get_int_caps (1, "BYTE_ORDER", 8, + G_BYTE_ORDER, 16, 16, TRUE), in, get_int_caps (1, G_BYTE_ORDER, 8, 8, FALSE) ); } @@ -639,11 +626,11 @@ GST_START_TEST (test_int_conversion) /* out has the bytes in little-endian, so that's how they should be * interpreted during conversion */ - RUN_CONVERSION ("8 to 24 signed", in, get_int_caps (1, "BYTE_ORDER", 8, 8, - TRUE), out, get_int_caps (1, "LITTLE_ENDIAN", 24, 24, TRUE) + RUN_CONVERSION ("8 to 24 signed", in, get_int_caps (1, G_BYTE_ORDER, 8, 8, + TRUE), out, get_int_caps (1, G_LITTLE_ENDIAN, 24, 24, TRUE) ); - RUN_CONVERSION ("24 signed to 8", out, get_int_caps (1, "LITTLE_ENDIAN", 24, - 24, TRUE), in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE) + RUN_CONVERSION ("24 signed to 8", out, get_int_caps (1, G_LITTLE_ENDIAN, 24, + 24, TRUE), in, get_int_caps (1, G_BYTE_ORDER, 8, 8, TRUE) ); } @@ -652,12 +639,12 @@ GST_START_TEST (test_int_conversion) gint16 in[] = { 0, 128, -128 }; guint16 out[] = { 32768, 32896, 32640 }; RUN_CONVERSION ("16 signed to 16 unsigned", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE) + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE) ); RUN_CONVERSION ("16 unsigned to 16 signed", - out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE), - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE) + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE), + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE) ); } @@ -667,12 +654,12 @@ GST_START_TEST (test_int_conversion) gint16 in[] = { 0, 64 << 8, -64 << 8 }; gint16 out[] = { 0, 64, -64 }; RUN_CONVERSION ("16 signed to 8 in 16 signed", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 8, TRUE) + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 8, TRUE) ); RUN_CONVERSION ("8 in 16 signed to 16 signed", - out, get_int_caps (1, "BYTE_ORDER", 16, 8, TRUE), - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE) + out, get_int_caps (1, G_BYTE_ORDER, 16, 8, TRUE), + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE) ); } @@ -682,12 +669,12 @@ GST_START_TEST (test_int_conversion) guint16 in[] = { 1 << 15, (1 << 15) - (64 << 8), (1 << 15) + (64 << 8) }; guint16 out[] = { 1 << 7, (1 << 7) - 64, (1 << 7) + 64 }; RUN_CONVERSION ("16 unsigned to 8 in 16 unsigned", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE), - out, get_int_caps (1, "BYTE_ORDER", 16, 8, FALSE) + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 8, FALSE) ); RUN_CONVERSION ("8 in 16 unsigned to 16 unsigned", - out, get_int_caps (1, "BYTE_ORDER", 16, 8, FALSE), - in, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE) + out, get_int_caps (1, G_BYTE_ORDER, 16, 8, FALSE), + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE) ); } @@ -709,8 +696,8 @@ GST_START_TEST (test_int_conversion) -32 }; RUN_CONVERSION ("32 signed to 16 signed for rounding", - in, get_int_caps (1, "BYTE_ORDER", 32, 32, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE) + in, get_int_caps (1, G_BYTE_ORDER, 32, 32, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE) ); } @@ -732,8 +719,8 @@ GST_START_TEST (test_int_conversion) (1 << 15) - 32 }; RUN_CONVERSION ("32 signed to 16 unsigned for rounding", - in, get_int_caps (1, "BYTE_ORDER", 32, 32, TRUE), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE) + in, get_int_caps (1, G_BYTE_ORDER, 32, 32, TRUE), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, FALSE) ); } } @@ -761,11 +748,11 @@ GST_START_TEST (test_float_conversion) * not produce exactly the same as the input due to floating * point rounding errors etc. */ RUN_CONVERSION ("32 float le to 16 signed", - in_le, get_float_caps (1, "LITTLE_ENDIAN", 32), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)); + in_le, get_float_caps (1, G_LITTLE_ENDIAN, 32), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE)); RUN_CONVERSION ("32 float be to 16 signed", - in_be, get_float_caps (1, "BIG_ENDIAN", 32), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)); + in_be, get_float_caps (1, G_BIG_ENDIAN, 32), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE)); } { @@ -773,8 +760,8 @@ GST_START_TEST (test_float_conversion) gfloat out[] = { 0.0, -1.0, 0.5, -0.5 }; RUN_CONVERSION ("16 signed to 32 float", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_float_caps (1, "BYTE_ORDER", 32)); + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_float_caps (1, G_BYTE_ORDER, 32)); } /* 64 float <-> 16 signed */ @@ -796,11 +783,11 @@ GST_START_TEST (test_float_conversion) * not produce exactly the same as the input due to floating * point rounding errors etc. */ RUN_CONVERSION ("64 float LE to 16 signed", - in_le, get_float_caps (1, "LITTLE_ENDIAN", 64), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)); + in_le, get_float_caps (1, G_LITTLE_ENDIAN, 64), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE)); RUN_CONVERSION ("64 float BE to 16 signed", - in_be, get_float_caps (1, "BIG_ENDIAN", 64), - out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)); + in_be, get_float_caps (1, G_BIG_ENDIAN, 64), + out, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE)); } { gint16 in[] = { 0, -32768, 16384, -16384 }; @@ -811,8 +798,8 @@ GST_START_TEST (test_float_conversion) }; RUN_CONVERSION ("16 signed to 64 float", - in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE), - out, get_float_caps (1, "BYTE_ORDER", 64)); + in, get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE), + out, get_float_caps (1, G_BYTE_ORDER, 64)); } { gint32 in[] = { 0, (-1L << 31), (1L << 30), (-1L << 30) }; @@ -823,8 +810,8 @@ GST_START_TEST (test_float_conversion) }; RUN_CONVERSION ("32 signed to 64 float", - in, get_int_caps (1, "BYTE_ORDER", 32, 32, TRUE), - out, get_float_caps (1, "BYTE_ORDER", 64)); + in, get_int_caps (1, G_BYTE_ORDER, 32, 32, TRUE), + out, get_float_caps (1, G_BYTE_ORDER, 64)); } /* 64-bit float <-> 32-bit float */ @@ -833,12 +820,12 @@ GST_START_TEST (test_float_conversion) gfloat out[] = { 0.0, 1.0, -1.0, 0.5, -0.5 }; RUN_CONVERSION ("64 float to 32 float", - in, get_float_caps (1, "BYTE_ORDER", 64), - out, get_float_caps (1, "BYTE_ORDER", 32)); + in, get_float_caps (1, G_BYTE_ORDER, 64), + out, get_float_caps (1, G_BYTE_ORDER, 32)); RUN_CONVERSION ("32 float to 64 float", - out, get_float_caps (1, "BYTE_ORDER", 32), - in, get_float_caps (1, "BYTE_ORDER", 64)); + out, get_float_caps (1, G_BYTE_ORDER, 32), + in, get_float_caps (1, G_BYTE_ORDER, 64)); } /* 32-bit float little endian <-> big endian */ @@ -851,12 +838,12 @@ GST_START_TEST (test_float_conversion) }; RUN_CONVERSION ("32 float LE to BE", - le, get_float_caps (1, "LITTLE_ENDIAN", 32), - be, get_float_caps (1, "BIG_ENDIAN", 32)); + le, get_float_caps (1, G_LITTLE_ENDIAN, 32), + be, get_float_caps (1, G_BIG_ENDIAN, 32)); RUN_CONVERSION ("32 float BE to LE", - be, get_float_caps (1, "BIG_ENDIAN", 32), - le, get_float_caps (1, "LITTLE_ENDIAN", 32)); + be, get_float_caps (1, G_BIG_ENDIAN, 32), + le, get_float_caps (1, G_LITTLE_ENDIAN, 32)); } /* 64-bit float little endian <-> big endian */ @@ -871,12 +858,12 @@ GST_START_TEST (test_float_conversion) }; RUN_CONVERSION ("64 float LE to BE", - le, get_float_caps (1, "LITTLE_ENDIAN", 64), - be, get_float_caps (1, "BIG_ENDIAN", 64)); + le, get_float_caps (1, G_LITTLE_ENDIAN, 64), + be, get_float_caps (1, G_BIG_ENDIAN, 64)); RUN_CONVERSION ("64 float BE to LE", - be, get_float_caps (1, "BIG_ENDIAN", 64), - le, get_float_caps (1, "LITTLE_ENDIAN", 64)); + be, get_float_caps (1, G_BIG_ENDIAN, 64), + le, get_float_caps (1, G_LITTLE_ENDIAN, 64)); } } @@ -890,10 +877,10 @@ GST_START_TEST (test_multichannel_conversion) gfloat out[] = { 0.0, 0.0 }; RUN_CONVERSION ("3 channels to 1", in, get_float_mc_caps (3, - "BYTE_ORDER", 32, FALSE), out, get_float_caps (1, "BYTE_ORDER", + G_BYTE_ORDER, 32, FALSE), out, get_float_caps (1, G_BYTE_ORDER, 32)); RUN_CONVERSION ("1 channels to 3", out, get_float_caps (1, - "BYTE_ORDER", 32), in, get_float_mc_caps (3, "BYTE_ORDER", + G_BYTE_ORDER, 32), in, get_float_mc_caps (3, G_BYTE_ORDER, 32, TRUE)); } @@ -902,18 +889,18 @@ GST_START_TEST (test_multichannel_conversion) gint16 out[] = { 0, 0 }; RUN_CONVERSION ("3 channels to 1", in, get_int_mc_caps (3, - "BYTE_ORDER", 16, 16, TRUE, FALSE), out, get_int_caps (1, - "BYTE_ORDER", 16, 16, TRUE)); - RUN_CONVERSION ("1 channels to 3", out, get_int_caps (1, "BYTE_ORDER", 16, - 16, TRUE), in, get_int_mc_caps (3, "BYTE_ORDER", 16, 16, TRUE, + G_BYTE_ORDER, 16, 16, TRUE, FALSE), out, get_int_caps (1, + G_BYTE_ORDER, 16, 16, TRUE)); + RUN_CONVERSION ("1 channels to 3", out, get_int_caps (1, G_BYTE_ORDER, 16, + 16, TRUE), in, get_int_mc_caps (3, G_BYTE_ORDER, 16, 16, TRUE, TRUE)); } { gint16 in[] = { 1, 2 }; gint16 out[] = { 1, 1, 2, 2 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[1] = { GST_AUDIO_CHANNEL_POSITION_FRONT_MONO }; GstAudioChannelPosition out_layout[2] = @@ -931,8 +918,8 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 1, 2 }; gint16 out[] = { 1, 1, 2, 2 }; - GstCaps *in_caps = get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE); - GstCaps *out_caps = get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE); + GstCaps *in_caps = get_int_caps (1, G_BYTE_ORDER, 16, 16, TRUE); + GstCaps *out_caps = get_int_caps (2, G_BYTE_ORDER, 16, 16, TRUE); RUN_CONVERSION ("1 channels to 2 with standard layout and no positions set", in, gst_caps_copy (in_caps), out, gst_caps_copy (out_caps)); @@ -944,8 +931,8 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 1, 2 }; gint16 out[] = { 1, 0, 2, 0 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[1] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT }; GstAudioChannelPosition out_layout[2] = @@ -963,8 +950,8 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 2, 4 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT @@ -982,8 +969,8 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 2, 4 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT @@ -1001,8 +988,8 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 1, 3 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER @@ -1020,8 +1007,8 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 1, 3 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT @@ -1038,16 +1025,16 @@ GST_START_TEST (test_multichannel_conversion) { gint16 in[] = { 4, 5, 4, 2, 2, 1 }; gint16 out[] = { 3, 3 }; - GstCaps *in_caps = get_int_mc_caps (6, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE); + GstCaps *in_caps = get_int_mc_caps (6, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_caps (2, G_BYTE_ORDER, 16, 16, TRUE); RUN_CONVERSION ("5.1 to 2 channels", in, in_caps, out, out_caps); } { gint16 in[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gint16 out[] = { 0, 0 }; - GstCaps *in_caps = get_int_mc_caps (11, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (11, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[11] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, @@ -1102,8 +1089,8 @@ GST_START_TEST (test_channel_remapping) { gfloat in[] = { 0.0, 1.0, -0.5 }; gfloat out[] = { -0.5, 1.0, 0.0 }; - GstCaps *in_caps = get_float_mc_caps (3, "BYTE_ORDER", 32, FALSE); - GstCaps *out_caps = get_float_mc_caps (3, "BYTE_ORDER", 32, TRUE); + GstCaps *in_caps = get_float_mc_caps (3, G_BYTE_ORDER, 32, FALSE); + GstCaps *out_caps = get_float_mc_caps (3, G_BYTE_ORDER, 32, TRUE); RUN_CONVERSION ("3 channels layout remapping float", in, in_caps, out, out_caps); @@ -1113,8 +1100,8 @@ GST_START_TEST (test_channel_remapping) { guint16 in[] = { 0, 65535, 0x9999 }; guint16 out[] = { 0x9999, 65535, 0 }; - GstCaps *in_caps = get_int_mc_caps (3, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (3, "BYTE_ORDER", 16, 16, FALSE, TRUE); + GstCaps *in_caps = get_int_mc_caps (3, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (3, G_BYTE_ORDER, 16, 16, FALSE, TRUE); RUN_CONVERSION ("3 channels layout remapping int", in, in_caps, out, out_caps); @@ -1124,8 +1111,8 @@ GST_START_TEST (test_channel_remapping) { guint16 in[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; guint16 out[] = { 4, 0, 1, 6, 7, 2, 3, 5 }; - GstCaps *in_caps = get_int_mc_caps (8, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (8, "BYTE_ORDER", 16, 16, FALSE, TRUE); + GstCaps *in_caps = get_int_mc_caps (8, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (8, G_BYTE_ORDER, 16, 16, FALSE, TRUE); set_channel_positions (in_caps, 8, n8chan_pos_remap_in); set_channel_positions (out_caps, 8, n8chan_pos_remap_out); @@ -1139,8 +1126,8 @@ GST_START_TEST (test_channel_remapping) guint16 in[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; guint32 out[] = { 4 << 16, 0, 1 << 16, 6 << 16, 7 << 16, 2 << 16, 3 << 16, 5 << 16 }; - GstCaps *in_caps = get_int_mc_caps (8, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (8, "BYTE_ORDER", 32, 32, FALSE, TRUE); + GstCaps *in_caps = get_int_mc_caps (8, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (8, G_BYTE_ORDER, 32, 32, FALSE, TRUE); set_channel_positions (in_caps, 8, n8chan_pos_remap_in); set_channel_positions (out_caps, 8, n8chan_pos_remap_out); @@ -1148,8 +1135,8 @@ GST_START_TEST (test_channel_remapping) RUN_CONVERSION ("8 channels layout remapping int16 --> int32", in, in_caps, out, out_caps); - in_caps = get_int_mc_caps (8, "BYTE_ORDER", 16, 16, FALSE, FALSE); - out_caps = get_int_mc_caps (8, "BYTE_ORDER", 32, 32, FALSE, TRUE); + in_caps = get_int_mc_caps (8, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + out_caps = get_int_mc_caps (8, G_BYTE_ORDER, 32, 32, FALSE, TRUE); set_channel_positions (in_caps, 8, n8chan_pos_remap_in); set_channel_positions (out_caps, 8, n8chan_pos_remap_out); RUN_CONVERSION ("8 channels layout remapping int16 <-- int32", out, @@ -1160,8 +1147,8 @@ GST_START_TEST (test_channel_remapping) { gfloat in[] = { 100.0 / G_MAXINT16, 0.0, -100.0 / G_MAXINT16 }; gint16 out[] = { -100, 0, 100 }; - GstCaps *in_caps = get_float_mc_caps (3, "BYTE_ORDER", 32, TRUE); - GstCaps *out_caps = get_int_mc_caps (3, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_float_mc_caps (3, G_BYTE_ORDER, 32, TRUE); + GstCaps *out_caps = get_int_mc_caps (3, G_BYTE_ORDER, 16, 16, TRUE, FALSE); RUN_CONVERSION ("3 channels layout remapping float32 --> int16", in, in_caps, out, out_caps); @@ -1171,8 +1158,8 @@ GST_START_TEST (test_channel_remapping) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 1, 2, 2, 4 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_LFE @@ -1193,8 +1180,8 @@ GST_START_TEST (test_channel_remapping) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 2, 1, 4, 3 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT @@ -1215,8 +1202,8 @@ GST_START_TEST (test_channel_remapping) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 1, 1, 3, 3 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER @@ -1237,8 +1224,8 @@ GST_START_TEST (test_channel_remapping) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 0, 0, 0, 0 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[1] = { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT }; GstAudioChannelPosition out_layout[1] = @@ -1255,8 +1242,8 @@ GST_START_TEST (test_channel_remapping) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 1, 2, 3, 4 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[1] = { GST_AUDIO_CHANNEL_POSITION_FRONT_MONO }; GstAudioChannelPosition out_layout[1] = @@ -1273,8 +1260,8 @@ GST_START_TEST (test_channel_remapping) { gint16 in[] = { 1, 2, 3, 4 }; gint16 out[] = { 1, 2, 3, 4 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, TRUE, FALSE); GstAudioChannelPosition in_layout[1] = { GST_AUDIO_CHANNEL_POSITION_FRONT_MONO }; GstAudioChannelPosition out_layout[1] = @@ -1364,8 +1351,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 out[] = { 0x2000 }; guint8 in[] = { 0x20 }; - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 1, undefined_positions[1 - 1]); set_channel_positions (in_caps, 1, undefined_positions[1 - 1]); @@ -1378,8 +1365,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 out[] = { 0x8000, 0x2000 }; guint8 in[] = { 0x80, 0x20 }; - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 2, undefined_positions[2 - 1]); set_channel_positions (in_caps, 2, undefined_positions[2 - 1]); @@ -1392,8 +1379,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 out[] = { 0x0000, 0x2000, 0x8000, 0x2000, 0x0000, 0xff00 }; guint8 in[] = { 0x00, 0x20, 0x80, 0x20, 0x00, 0xff }; - GstCaps *out_caps = get_int_mc_caps (6, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *in_caps = get_int_mc_caps (6, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (6, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (6, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 6, undefined_positions[6 - 1]); set_channel_positions (in_caps, 6, undefined_positions[6 - 1]); @@ -1408,8 +1395,8 @@ GST_START_TEST (test_convert_undefined_multichannel) 0x0000, 0xff00, 0x0000 }; guint8 in[] = { 0x00, 0xff, 0x00, 0x20, 0x80, 0x20, 0x00, 0xff, 0x00 }; - GstCaps *out_caps = get_int_mc_caps (9, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *in_caps = get_int_mc_caps (9, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (9, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (9, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 9, undefined_positions[9 - 1]); set_channel_positions (in_caps, 9, undefined_positions[9 - 1]); @@ -1429,8 +1416,8 @@ GST_START_TEST (test_convert_undefined_multichannel) 0x20, 0x80, 0x20, 0x00 }; GstCaps *out_caps = - get_int_mc_caps (15, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *in_caps = get_int_mc_caps (15, "BYTE_ORDER", 8, 8, FALSE, FALSE); + get_int_mc_caps (15, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (15, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 15, undefined_positions[15 - 1]); set_channel_positions (in_caps, 15, undefined_positions[15 - 1]); @@ -1445,8 +1432,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0x2000 }; guint8 out[] = { 0x20 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 1, undefined_positions[1 - 1]); set_channel_positions (in_caps, 1, undefined_positions[1 - 1]); @@ -1459,8 +1446,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0x8000, 0x2000 }; guint8 out[] = { 0x80, 0x20 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 2, undefined_positions[2 - 1]); set_channel_positions (in_caps, 2, undefined_positions[2 - 1]); @@ -1473,8 +1460,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0x0000, 0x2000, 0x8000, 0x2000, 0x0000, 0xff00 }; guint8 out[] = { 0x00, 0x20, 0x80, 0x20, 0x00, 0xff }; - GstCaps *in_caps = get_int_mc_caps (6, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (6, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (6, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (6, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 6, undefined_positions[6 - 1]); set_channel_positions (in_caps, 6, undefined_positions[6 - 1]); @@ -1489,8 +1476,8 @@ GST_START_TEST (test_convert_undefined_multichannel) 0x0000, 0xff00, 0x0000 }; guint8 out[] = { 0x00, 0xff, 0x00, 0x20, 0x80, 0x20, 0x00, 0xff, 0x00 }; - GstCaps *in_caps = get_int_mc_caps (9, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (9, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (9, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (9, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 9, undefined_positions[9 - 1]); set_channel_positions (in_caps, 9, undefined_positions[9 - 1]); @@ -1509,8 +1496,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { 0x00, 0xff, 0x00, 0x20, 0x80, 0x20, 0x00, 0xff, 0x00, 0xff, 0x00, 0x20, 0x80, 0x20, 0x00 }; - GstCaps *in_caps = get_int_mc_caps (15, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (15, "BYTE_ORDER", 8, 8, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (15, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (15, G_BYTE_ORDER, 8, 8, FALSE, FALSE); set_channel_positions (out_caps, 15, undefined_positions[15 - 1]); set_channel_positions (in_caps, 15, undefined_positions[15 - 1]); @@ -1526,8 +1513,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0x2000 }; guint16 out[] = { 0x2000 }; - GstCaps *in_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (1, "BYTE_ORDER", 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (1, G_BYTE_ORDER, 16, 16, FALSE, FALSE); set_channel_positions (out_caps, 1, undefined_positions[1 - 1]); set_channel_positions (in_caps, 1, undefined_positions[1 - 1]); @@ -1540,8 +1527,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0x8000, 0x2000 }; guint16 out[] = { 0x8000, 0x2000 }; - GstCaps *in_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, FALSE, FALSE); set_channel_positions (out_caps, 2, undefined_positions[2 - 1]); set_channel_positions (in_caps, 2, undefined_positions[2 - 1]); @@ -1554,8 +1541,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0x0000, 0x2000, 0x8000, 0x2000, 0x0000, 0xff00 }; guint16 out[] = { 0x0000, 0x2000, 0x8000, 0x2000, 0x0000, 0xff00 }; - GstCaps *in_caps = get_int_mc_caps (6, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (6, "BYTE_ORDER", 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (6, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (6, G_BYTE_ORDER, 16, 16, FALSE, FALSE); set_channel_positions (out_caps, 6, undefined_positions[6 - 1]); set_channel_positions (in_caps, 6, undefined_positions[6 - 1]); @@ -1572,8 +1559,8 @@ GST_START_TEST (test_convert_undefined_multichannel) guint16 out[] = { 0x0000, 0xff00, 0x0000, 0x2000, 0x8000, 0x2000, 0x0000, 0xff00, 0x0000 }; - GstCaps *in_caps = get_int_mc_caps (9, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_int_mc_caps (9, "BYTE_ORDER", 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (9, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_int_mc_caps (9, G_BYTE_ORDER, 16, 16, FALSE, FALSE); set_channel_positions (out_caps, 9, undefined_positions[9 - 1]); set_channel_positions (in_caps, 9, undefined_positions[9 - 1]); @@ -1592,9 +1579,9 @@ GST_START_TEST (test_convert_undefined_multichannel) 0x0000, 0xff00, 0x0000, 0xff00, 0x0000, 0x2000, 0x8000, 0x2000, 0x0000 }; - GstCaps *in_caps = get_int_mc_caps (15, "BYTE_ORDER", 16, 16, FALSE, FALSE); + GstCaps *in_caps = get_int_mc_caps (15, G_BYTE_ORDER, 16, 16, FALSE, FALSE); GstCaps *out_caps = - get_int_mc_caps (15, "BYTE_ORDER", 16, 16, FALSE, FALSE); + get_int_mc_caps (15, G_BYTE_ORDER, 16, 16, FALSE, FALSE); set_channel_positions (out_caps, 15, undefined_positions[15 - 1]); set_channel_positions (in_caps, 15, undefined_positions[15 - 1]); @@ -1612,8 +1599,8 @@ GST_START_TEST (test_convert_undefined_multichannel) 0x0000, 0x8000, 0x0000 }; gfloat out[] = { -1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0, -1.0 }; - GstCaps *in_caps = get_int_mc_caps (9, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_float_mc_caps (9, "BYTE_ORDER", 32, FALSE); + GstCaps *in_caps = get_int_mc_caps (9, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_float_mc_caps (9, G_BYTE_ORDER, 32, FALSE); set_channel_positions (out_caps, 9, undefined_positions[9 - 1]); set_channel_positions (in_caps, 9, undefined_positions[9 - 1]); @@ -1632,8 +1619,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { -1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0, -1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0 }; - GstCaps *in_caps = get_int_mc_caps (15, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_float_mc_caps (15, "BYTE_ORDER", 32, FALSE); + GstCaps *in_caps = get_int_mc_caps (15, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_float_mc_caps (15, G_BYTE_ORDER, 32, FALSE); set_channel_positions (out_caps, 15, undefined_positions[15 - 1]); set_channel_positions (in_caps, 15, undefined_positions[15 - 1]); @@ -1650,8 +1637,8 @@ GST_START_TEST (test_convert_undefined_multichannel) 0x0000, 0x8000, 0x0000 }; gfloat out[] = { -1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0, -1.0 }; - GstCaps *in_caps = get_int_mc_caps (9, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_float_mc_caps (9, "BYTE_ORDER", 32, FALSE); + GstCaps *in_caps = get_int_mc_caps (9, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_float_mc_caps (9, G_BYTE_ORDER, 32, FALSE); //set_channel_positions (out_caps, 9, undefined_positions[9 - 1]); set_channel_positions (in_caps, 9, undefined_positions[9 - 1]); @@ -1671,8 +1658,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { -1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0, -1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0 }; - GstCaps *in_caps = get_int_mc_caps (15, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_float_mc_caps (15, "BYTE_ORDER", 32, FALSE); + GstCaps *in_caps = get_int_mc_caps (15, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_float_mc_caps (15, G_BYTE_ORDER, 32, FALSE); //set_channel_positions (out_caps, 9, undefined_positions[9 - 1]); set_channel_positions (in_caps, 15, undefined_positions[15 - 1]); @@ -1685,8 +1672,8 @@ GST_START_TEST (test_convert_undefined_multichannel) { guint16 in[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; gfloat out[] = { -1.0, -1.0 }; - GstCaps *in_caps = get_int_mc_caps (8, "BYTE_ORDER", 16, 16, FALSE, FALSE); - GstCaps *out_caps = get_float_mc_caps (2, "BYTE_ORDER", 32, FALSE); + GstCaps *in_caps = get_int_mc_caps (8, G_BYTE_ORDER, 16, 16, FALSE, FALSE); + GstCaps *out_caps = get_float_mc_caps (2, G_BYTE_ORDER, 32, FALSE); set_channel_positions (in_caps, 8, undefined_positions[8 - 1]); @@ -1710,8 +1697,8 @@ GST_START_TEST (test_convert_undefined_multichannel) }; gint16 in[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; gint16 out[] = { 0, 0 }; - GstCaps *in_caps = get_int_mc_caps (8, "BYTE_ORDER", 16, 16, TRUE, FALSE); - GstCaps *out_caps = get_int_mc_caps (2, "BYTE_ORDER", 16, 16, TRUE, FALSE); + GstCaps *in_caps = get_int_mc_caps (8, G_BYTE_ORDER, 16, 16, TRUE, FALSE); + GstCaps *out_caps = get_int_mc_caps (2, G_BYTE_ORDER, 16, 16, TRUE, FALSE); set_channel_positions (in_caps, 8, layout8ch); diff --git a/tests/check/elements/audiorate.c b/tests/check/elements/audiorate.c index 8974ba7408..dac54ec1a0 100644 --- a/tests/check/elements/audiorate.c +++ b/tests/check/elements/audiorate.c @@ -33,19 +33,14 @@ typedef GstElementClass TestInjectorClass; GType test_injector_get_type (void); G_DEFINE_TYPE (TestInjector, test_injector, GST_TYPE_ELEMENT); +#define FORMATS "{ "GST_AUDIO_NE(F32)", S8, S16LE, S16BE, " \ + "U16LE, U16NE, S32LE, S32BE, U32LE, U32BE }" + #define INJECTOR_CAPS \ - "audio/x-raw-float, " \ + "audio/x-raw, " \ + "format = (string) "FORMATS", " \ "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, 8 ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 32;" \ - "audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, 8 ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) { 8, 16, 32 }, " \ - "depth = (int) [ 1, 32 ], " \ - "signed = (boolean) { true, false }" + "channels = (int) [ 1, 8 ]" static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, @@ -178,8 +173,8 @@ got_buf (GstElement * fakesink, GstBuffer * buf, GstPad * pad, GList ** p_bufs) } static void -do_perfect_stream_test (guint rate, guint width, gdouble drop_probability, - gdouble inject_probability) +do_perfect_stream_test (guint rate, const gchar * format, + gdouble drop_probability, gdouble inject_probability) { GstElement *pipe, *src, *conv, *filter, *injector, *audiorate, *sink; GstMessage *msg; @@ -189,8 +184,8 @@ do_perfect_stream_test (guint rate, guint width, gdouble drop_probability, GstClockTime next_time = GST_CLOCK_TIME_NONE; guint64 next_offset = GST_BUFFER_OFFSET_NONE; - caps = gst_caps_new_simple ("audio/x-raw-int", "rate", G_TYPE_INT, - rate, "width", G_TYPE_INT, width, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "rate", G_TYPE_INT, + rate, "format", G_TYPE_STRING, format, NULL); GST_INFO ("-------- drop=%.0f%% caps = %" GST_PTR_FORMAT " ---------- ", drop_probability * 100.0, caps); @@ -301,8 +296,8 @@ GST_START_TEST (test_perfect_stream_drop0) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.0, 0.0); - do_perfect_stream_test (rates[i], 16, 0.0, 0.0); + do_perfect_stream_test (rates[i], "S8", 0.0, 0.0); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.0, 0.0); } } @@ -313,8 +308,8 @@ GST_START_TEST (test_perfect_stream_drop10) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.10, 0.0); - do_perfect_stream_test (rates[i], 16, 0.10, 0.0); + do_perfect_stream_test (rates[i], "S8", 0.10, 0.0); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.10, 0.0); } } @@ -325,8 +320,8 @@ GST_START_TEST (test_perfect_stream_drop50) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.50, 0.0); - do_perfect_stream_test (rates[i], 16, 0.50, 0.0); + do_perfect_stream_test (rates[i], "S8", 0.50, 0.0); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.50, 0.0); } } @@ -337,8 +332,8 @@ GST_START_TEST (test_perfect_stream_drop90) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.90, 0.0); - do_perfect_stream_test (rates[i], 16, 0.90, 0.0); + do_perfect_stream_test (rates[i], "S8", 0.90, 0.0); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.90, 0.0); } } @@ -349,8 +344,8 @@ GST_START_TEST (test_perfect_stream_inject10) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.0, 0.10); - do_perfect_stream_test (rates[i], 16, 0.0, 0.10); + do_perfect_stream_test (rates[i], "S8", 0.0, 0.10); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.0, 0.10); } } @@ -361,8 +356,8 @@ GST_START_TEST (test_perfect_stream_inject90) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.0, 0.90); - do_perfect_stream_test (rates[i], 16, 0.0, 0.90); + do_perfect_stream_test (rates[i], "S8", 0.0, 0.90); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.0, 0.90); } } @@ -373,8 +368,8 @@ GST_START_TEST (test_perfect_stream_drop45_inject25) guint i; for (i = 0; i < G_N_ELEMENTS (rates); ++i) { - do_perfect_stream_test (rates[i], 8, 0.45, 0.25); - do_perfect_stream_test (rates[i], 16, 0.45, 0.25); + do_perfect_stream_test (rates[i], "S8", 0.45, 0.25); + do_perfect_stream_test (rates[i], GST_AUDIO_NE (S16), 0.45, 0.25); } } @@ -385,13 +380,13 @@ GST_END_TEST; static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-raw-float,channels=1,rate=44100,width=32") + GST_STATIC_CAPS ("audio/x-raw,format=F32LE,channels=1,rate=44100") ); static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-raw-float,channels=1,rate=44100,width=32") + GST_STATIC_CAPS ("audio/x-raw,format=F32LE,channels=1,rate=44100") ); GST_START_TEST (test_large_discont) @@ -402,10 +397,9 @@ GST_START_TEST (test_large_discont) GstBuffer *buf; audiorate = gst_check_setup_element ("audiorate"); - caps = gst_caps_new_simple ("audio/x-raw-float", - "channels", G_TYPE_INT, 1, - "rate", G_TYPE_INT, 44100, "width", G_TYPE_INT, 32, - "endianness", G_TYPE_INT, G_BYTE_ORDER, NULL); + caps = gst_caps_new_simple ("audio/x-raw", + "format", G_TYPE_STRING, GST_AUDIO_NE (F32), + "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 44100, NULL); srcpad = gst_check_setup_src_pad (audiorate, &srctemplate, caps); sinkpad = gst_check_setup_sink_pad (audiorate, &sinktemplate, caps); diff --git a/tests/check/elements/audioresample.c b/tests/check/elements/audioresample.c index 36816033cd..f2748e096b 100644 --- a/tests/check/elements/audioresample.c +++ b/tests/check/elements/audioresample.c @@ -38,21 +38,25 @@ * get_peer, and then remove references in every test function */ static GstPad *mysrcpad, *mysinkpad; +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define FORMATS_F "{ F32LE, F64LE }" +#define FORMATS_I "{ S16LE, S32LE }" +#else +#define FORMATS_F "{ F32BE, F64BE }" +#define FORMATS_I "{ S16BE, S32BE }" +#endif + #define RESAMPLE_CAPS_FLOAT \ - "audio/x-raw-float, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS_F", " \ "channels = (int) [ 1, MAX ], " \ - "rate = (int) [ 1, MAX ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) { 32, 64 }" + "rate = (int) [ 1, MAX ]" #define RESAMPLE_CAPS_INT \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS_I", " \ "channels = (int) [ 1, MAX ], " \ - "rate = (int) [ 1, MAX ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) { 16, 32 }, " \ - "depth = (int) { 16, 32 }, " \ - "signed = (bool) TRUE" + "rate = (int) [ 1, MAX ]" #define RESAMPLE_CAPS_TEMPLATE_STRING \ RESAMPLE_CAPS_FLOAT " ; " \ @@ -435,13 +439,11 @@ GST_START_TEST (test_shutdown) g_object_set (cf2, "name", "capsfilter2", NULL); sink = gst_check_setup_element ("fakesink"); - caps = - gst_caps_new_simple ("audio/x-raw-int", "rate", G_TYPE_INT, 11025, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "rate", G_TYPE_INT, 11025, NULL); g_object_set (cf1, "caps", caps, NULL); gst_caps_unref (caps); - caps = - gst_caps_new_simple ("audio/x-raw-int", "rate", G_TYPE_INT, 48000, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "rate", G_TYPE_INT, 48000, NULL); g_object_set (cf2, "caps", caps, NULL); gst_caps_unref (caps); @@ -628,7 +630,7 @@ eos_message_cb (GstBus * bus, GstMessage * message, gpointer user_data) } static void -test_pipeline (gint width, gboolean fp, gint inrate, gint outrate, gint quality) +test_pipeline (const gchar * format, gint inrate, gint outrate, gint quality) { GstElement *pipeline; GstBus *bus; @@ -637,9 +639,8 @@ test_pipeline (gint width, gboolean fp, gint inrate, gint outrate, gint quality) pipe_str = g_strdup_printf - ("audiotestsrc num-buffers=10 ! audioconvert ! audio/x-raw-%s,rate=%d,width=%d,channels=2 ! audioresample quality=%d ! audio/x-raw-%s,rate=%d,width=%d ! identity check-imperfect-timestamp=TRUE ! fakesink", - (fp) ? "float" : "int", inrate, width, quality, (fp) ? "float" : "int", - outrate, width); + ("audiotestsrc num-buffers=10 ! audioconvert ! audio/x-raw,format=%s,rate=%d,channels=2 ! audioresample quality=%d ! audio/x-raw,format=%s,rate=%d ! identity check-imperfect-timestamp=TRUE ! fakesink", + format, inrate, quality, format, outrate); pipeline = gst_parse_launch (pipe_str, &error); fail_unless (pipeline != NULL, "Error parsing pipeline: %s", @@ -712,9 +713,8 @@ GST_START_TEST (test_preference_passthrough) gint rate = 0; pipeline = gst_parse_launch ("audiotestsrc num-buffers=1 name=src ! " - "audioresample ! audio/x-raw-int,channels=1,width=16,depth=16," - "endianness=BYTE_ORDER,signed=true,rate=8000 ! " - "fakesink can-activate-pull=false", &error); + "audioresample ! audio/x-raw,format=" GST_AUDIO_NE (S16) ",channels=1," + "rate=8000 ! fakesink can-activate-pull=false", &error); fail_unless (pipeline != NULL, "Error parsing pipeline: %s", error ? error->message : "(invalid error)"); @@ -872,7 +872,7 @@ GST_START_TEST (test_timestamp_drift) fail_unless (capsfilter1 != NULL); caps = gst_caps_from_string - ("audio/x-raw-float, channels=1, width=64, rate=16384"); + ("audio/x-raw, format=F64LE, channels=1, rate=16384"); g_object_set (G_OBJECT (capsfilter1), "caps", caps, NULL); gst_caps_unref (caps); @@ -887,8 +887,7 @@ GST_START_TEST (test_timestamp_drift) capsfilter2 = gst_element_factory_make ("capsfilter", "capsfilter2"); fail_unless (capsfilter2 != NULL); caps = - gst_caps_from_string - ("audio/x-raw-float, channels=1, width=64, rate=4096"); + gst_caps_from_string ("audio/x-raw, format=F64LE, channels=1, rate=4096"); g_object_set (G_OBJECT (capsfilter2), "caps", caps, NULL); gst_caps_unref (caps); diff --git a/tests/check/elements/audiotestsrc.c b/tests/check/elements/audiotestsrc.c index e83dceb828..0fecc5db16 100644 --- a/tests/check/elements/audiotestsrc.c +++ b/tests/check/elements/audiotestsrc.c @@ -23,6 +23,7 @@ #include #include +#include /* For ease of programming we use globals to keep refs for our floating * src and sink pads we create; otherwise we always have to do get_pad, @@ -31,13 +32,10 @@ static GstPad *mysinkpad; #define CAPS_TEMPLATE_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "format = (string) "GST_AUDIO_NE(S16)", " \ "channels = (int) 1, " \ - "rate = (int) [ 1, MAX ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 16, " \ - "depth = (int) 16, " \ - "signed = (bool) TRUE" + "rate = (int) [ 1, MAX ]" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, diff --git a/tests/check/elements/decodebin2.c b/tests/check/elements/decodebin2.c index 784c0e554b..b901ec58c3 100644 --- a/tests/check/elements/decodebin2.c +++ b/tests/check/elements/decodebin2.c @@ -489,7 +489,7 @@ gst_fake_h264_decoder_base_init (gpointer klass) GST_STATIC_CAPS ("video/x-h264, " "stream-format=(string) byte-stream")); static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-raw-yuv")); + GST_STATIC_CAPS ("video/x-raw")); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_pad_template (element_class, @@ -511,7 +511,7 @@ gst_fake_h264_decoder_sink_setcaps (GstPad * pad, GstCaps * caps) GstElement *self = GST_ELEMENT (gst_pad_get_parent (pad)); GstPad *otherpad = gst_element_get_static_pad (self, "src"); - caps = gst_caps_new_simple ("video/x-raw-yuv", NULL); + caps = gst_caps_new_simple ("video/x-raw", NULL); gst_pad_set_caps (otherpad, caps); gst_caps_unref (caps); diff --git a/tests/check/elements/encodebin.c b/tests/check/elements/encodebin.c index 77606cd3c7..2f84d2d208 100644 --- a/tests/check/elements/encodebin.c +++ b/tests/check/elements/encodebin.c @@ -261,7 +261,7 @@ GST_START_TEST (test_encodebin_sink_pads_dynamic) sinkpad = NULL; /* Check again with the 'request-pad' signal */ - sinkcaps = gst_caps_new_simple ("audio/x-raw-int", NULL); + sinkcaps = gst_caps_new_simple ("audio/x-raw", NULL); g_signal_emit_by_name (ebin, "request-pad", sinkcaps, &sinkpad); gst_caps_unref (sinkcaps); fail_unless (sinkpad != NULL); @@ -506,7 +506,7 @@ GST_START_TEST (test_encodebin_render_audio_only_static) /* Requesting a new pad should fail */ ASSERT_CRITICAL (gst_element_get_request_pad (ebin, "audio_0")); - sinkcaps = gst_caps_new_simple ("audio/x-raw-int", NULL); + sinkcaps = gst_caps_new_simple ("audio/x-raw", NULL); g_signal_emit_by_name (ebin, "request-pad", sinkcaps, &sinkpad); gst_caps_unref (sinkcaps); fail_if (sinkpad != NULL); diff --git a/tests/check/elements/gdpdepay.c b/tests/check/elements/gdpdepay.c index 6a1a9f1bd5..927cfbd147 100644 --- a/tests/check/elements/gdpdepay.c +++ b/tests/check/elements/gdpdepay.c @@ -30,24 +30,19 @@ * get_peer, and then remove references in every test function */ static GstPad *mysrcpad, *mysinkpad, *myshsinkpad; +#define FORMATS "{ S8, "GST_AUDIO_NE(S16)" }" + #define AUDIO_CAPS_TEMPLATE_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "format = (string) "FORMATS", " \ "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, 8 ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) {8, 16}, " \ - "depth = (int) {8, 16}, " \ - "signed = (boolean) true" + "channels = (int) [ 1, 8 ]" #define AUDIO_CAPS_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "format = (string) "GST_AUDIO_NE(S16)", " \ "rate = (int) 1000, " \ - "channels = (int) 2, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 16, " \ - "depth = (int) 16, " \ - "signed = (boolean) true" - + "channels = (int) 2" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, diff --git a/tests/check/elements/gdppay.c b/tests/check/elements/gdppay.c index 05391f1057..4c6ccf07fa 100644 --- a/tests/check/elements/gdppay.c +++ b/tests/check/elements/gdppay.c @@ -29,23 +29,19 @@ * get_peer, and then remove references in every test function */ static GstPad *mysrcpad, *myshsrcpad, *mysinkpad; +#define FORMATS "{ S8, "GST_AUDIO_NE(S16)" }" + #define AUDIO_CAPS_TEMPLATE_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "format = (string) "FORMATS", " \ "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, 8 ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) {8, 16}, " \ - "depth = (int) {8, 16}, " \ - "signed = (boolean) true" + "channels = (int) [ 1, 8 ]" #define AUDIO_CAPS_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "format = (string) "GST_AUDIO_NE(S16)", " \ "rate = (int) 1000, " \ - "channels = (int) 2, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 16, " \ - "depth = (int) 16, " \ - "signed = (boolean) true" + "channels = (int) 2" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", diff --git a/tests/check/elements/playbin-compressed.c b/tests/check/elements/playbin-compressed.c index d6fdf1b5e9..4a015f9191 100644 --- a/tests/check/elements/playbin-compressed.c +++ b/tests/check/elements/playbin-compressed.c @@ -274,7 +274,7 @@ gst_audio_codec_sink_base_init (gpointer klass) { static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-raw-int; audio/x-compressed") + GST_STATIC_CAPS ("audio/x-raw; audio/x-compressed") ); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -324,12 +324,12 @@ gst_audio_codec_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) s = gst_caps_get_structure (caps, 0); - if (gst_structure_has_name (s, "audio/x-raw-int")) { + if (gst_structure_has_name (s, "audio/x-raw")) { sink->raw = TRUE; } else if (gst_structure_has_name (s, "audio/x-compressed")) { sink->raw = FALSE; } else { - fail_unless (gst_structure_has_name (s, "audio/x-raw-int") + fail_unless (gst_structure_has_name (s, "audio/x-raw") || gst_structure_has_name (s, "audio/x-compressed")); return FALSE; } @@ -463,7 +463,7 @@ gst_codec_demuxer_base_init (gpointer klass) ); static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src_%d", GST_PAD_SRC, GST_PAD_SOMETIMES, - GST_STATIC_CAPS ("audio/x-raw-int; audio/x-compressed; " + GST_STATIC_CAPS ("audio/x-raw; audio/x-compressed; " "video/x-raw; video/x-compressed") ); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -586,12 +586,9 @@ gst_codec_demuxer_setup_pad (GstCodecDemuxer * demux, GstPad ** pad, } else if (g_str_equal (streaminfo, "compressed-video")) { caps = gst_caps_new_simple ("video/x-compressed", NULL); } else if (g_str_equal (streaminfo, "raw-audio")) { - caps = gst_caps_new_simple ("audio/x-raw-int", - "rate", G_TYPE_INT, 48000, - "channels", G_TYPE_INT, 2, - "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + caps = gst_caps_new_simple ("audio/x-raw", + "format", G_TYPE_STRING, "S16LE", + "rate", G_TYPE_INT, 48000, "channels", G_TYPE_INT, 2, NULL); } else { caps = gst_caps_new_simple ("audio/x-compressed", NULL); } @@ -1024,11 +1021,8 @@ GST_START_TEST (test_raw_single_audio_stream_manual_sink) playbin = create_playbin - ("caps:audio/x-raw-int," - " rate=(int)48000, " - " channels=(int)2, " - " endianness=(int)LITTLE_ENDIAN, " - " width=(int)16, " " depth=(int)16, " " signed=(bool)TRUE", TRUE); + ("caps:audio/x-raw," + " format=(string)S16LE, " " rate=(int)48000, " " channels=(int)2", TRUE); fail_unless_equals_int (gst_element_set_state (playbin, GST_STATE_READY), GST_STATE_CHANGE_SUCCESS); diff --git a/tests/check/elements/videorate.c b/tests/check/elements/videorate.c index 58a8ebccd8..f022b93d59 100644 --- a/tests/check/elements/videorate.c +++ b/tests/check/elements/videorate.c @@ -808,177 +808,177 @@ typedef struct static TestInfo caps_negotiation_tests[] = { { - .caps = "video/x-raw-yuv", + .caps = "video/x-raw", .drop_only = FALSE, - .expected_sink_caps = "video/x-raw-yuv", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]"}, + .expected_sink_caps = "video/x-raw", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]"}, { - .caps = "video/x-raw-yuv", + .caps = "video/x-raw", .drop_only = FALSE, .max_rate = 15, - .expected_sink_caps = "video/x-raw-yuv", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, 15]"}, + .expected_sink_caps = "video/x-raw", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, 15]"}, { - .caps = "video/x-raw-yuv", + .caps = "video/x-raw", .drop_only = TRUE, - .expected_sink_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]"}, + .expected_sink_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]"}, { - .caps = "video/x-raw-yuv", + .caps = "video/x-raw", .drop_only = TRUE, .max_rate = 15, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)[0/1, 15];" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, 15]"}, + "video/x-raw, framerate=(fraction)[0/1, 15];" + "video/x-raw, framerate=(fraction)[0/1, MAX]", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, 15]"}, { - .caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", + .caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", .drop_only = FALSE, - .expected_sink_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]"}, + .expected_sink_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]"}, { - .caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", + .caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", .drop_only = FALSE, .max_rate = 15, - .expected_sink_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, 15]"}, + .expected_sink_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, 15]"}, { - .caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", + .caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", .drop_only = TRUE, - .expected_sink_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]"}, + .expected_sink_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, MAX]"}, { - .caps = "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", + .caps = "video/x-raw, framerate=(fraction)[0/1, MAX]", .drop_only = TRUE, .max_rate = 15, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)[0/1, 15];" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", - .expected_src_caps = "video/x-raw-yuv, framerate=(fraction)[0/1, 15]"}, + "video/x-raw, framerate=(fraction)[0/1, 15];" + "video/x-raw, framerate=(fraction)[0/1, MAX]", + .expected_src_caps = "video/x-raw, framerate=(fraction)[0/1, 15]"}, { - .caps = "video/x-raw-yuv, framerate=15/1", + .caps = "video/x-raw, framerate=15/1", .drop_only = FALSE, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, MAX]", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]"}, + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, MAX]"}, { - .caps = "video/x-raw-yuv, framerate=15/1", + .caps = "video/x-raw, framerate=15/1", .drop_only = FALSE, .max_rate = 20, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]", + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, MAX]", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, 20/1]"}, + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, 20/1]"}, { - .caps = "video/x-raw-yuv, framerate=15/1", + .caps = "video/x-raw, framerate=15/1", .drop_only = TRUE, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[15/1, MAX];" - "video/x-raw-yuv, framerate=(fraction)0/1", + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[15/1, MAX];" + "video/x-raw, framerate=(fraction)0/1", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, 15/1]"}, + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, 15/1]"}, { - .caps = "video/x-raw-yuv, framerate=15/1", + .caps = "video/x-raw, framerate=15/1", .drop_only = TRUE, .max_rate = 20, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[15/1, MAX];" - "video/x-raw-yuv, framerate=(fraction)0/1", + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[15/1, MAX];" + "video/x-raw, framerate=(fraction)0/1", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, 15/1];"}, + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, 15/1];"}, { - .caps = "video/x-raw-yuv, framerate=[15/1, 30/1]", + .caps = "video/x-raw, framerate=[15/1, 30/1]", .drop_only = FALSE, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 30/1];" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX];", + "video/x-raw, framerate=(fraction)[15/1, 30/1];" + "video/x-raw, framerate=(fraction)[0/1, MAX];", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 30/1];" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX];"}, + "video/x-raw, framerate=(fraction)[15/1, 30/1];" + "video/x-raw, framerate=(fraction)[0/1, MAX];"}, { - .caps = "video/x-raw-yuv, framerate=[15/1, 30/1]", + .caps = "video/x-raw, framerate=[15/1, 30/1]", .drop_only = FALSE, .max_rate = 20, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 30/1];" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX];", + "video/x-raw, framerate=(fraction)[15/1, 30/1];" + "video/x-raw, framerate=(fraction)[0/1, MAX];", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 20/1];" - "video/x-raw-yuv, framerate=(fraction)[0/1, 20/1];"}, + "video/x-raw, framerate=(fraction)[15/1, 20/1];" + "video/x-raw, framerate=(fraction)[0/1, 20/1];"}, { - .caps = "video/x-raw-yuv, framerate=[15/1, 30/1]", + .caps = "video/x-raw, framerate=[15/1, 30/1]", .drop_only = TRUE, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 30/1];" - "video/x-raw-yuv, framerate=(fraction)[15/1, MAX];" - "video/x-raw-yuv, framerate=(fraction)0/1", + "video/x-raw, framerate=(fraction)[15/1, 30/1];" + "video/x-raw, framerate=(fraction)[15/1, MAX];" + "video/x-raw, framerate=(fraction)0/1", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 30/1];" - "video/x-raw-yuv, framerate=(fraction)[0/1, 30/1]"}, + "video/x-raw, framerate=(fraction)[15/1, 30/1];" + "video/x-raw, framerate=(fraction)[0/1, 30/1]"}, { - .caps = "video/x-raw-yuv, framerate=[15/1, 30/1]", + .caps = "video/x-raw, framerate=[15/1, 30/1]", .drop_only = TRUE, .max_rate = 20, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 20/1];" - "video/x-raw-yuv, framerate=(fraction)[15/1, 30/1];" - "video/x-raw-yuv, framerate=(fraction)[15/1, MAX];" - "video/x-raw-yuv, framerate=(fraction)0/1", + "video/x-raw, framerate=(fraction)[15/1, 20/1];" + "video/x-raw, framerate=(fraction)[15/1, 30/1];" + "video/x-raw, framerate=(fraction)[15/1, MAX];" + "video/x-raw, framerate=(fraction)0/1", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)[15/1, 20/1];" - "video/x-raw-yuv, framerate=(fraction)[0/1, 20/1]"}, + "video/x-raw, framerate=(fraction)[15/1, 20/1];" + "video/x-raw, framerate=(fraction)[0/1, 20/1]"}, { - .caps = "video/x-raw-yuv, framerate={15/1, 30/1}", + .caps = "video/x-raw, framerate={15/1, 30/1}", .drop_only = FALSE, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction){15/1, 30/1};" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX];", + "video/x-raw, framerate=(fraction){15/1, 30/1};" + "video/x-raw, framerate=(fraction)[0/1, MAX];", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction){15/1, 30/1};" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX]"}, + "video/x-raw, framerate=(fraction){15/1, 30/1};" + "video/x-raw, framerate=(fraction)[0/1, MAX]"}, { - .caps = "video/x-raw-yuv, framerate={15/1, 30/1}", + .caps = "video/x-raw, framerate={15/1, 30/1}", .drop_only = FALSE, .max_rate = 20, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction){15/1, 30/1};" - "video/x-raw-yuv, framerate=(fraction)[0/1, MAX];", + "video/x-raw, framerate=(fraction){15/1, 30/1};" + "video/x-raw, framerate=(fraction)[0/1, MAX];", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, 20/1];"}, + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, 20/1];"}, { - .caps = "video/x-raw-yuv, framerate={15/1, 30/1}", + .caps = "video/x-raw, framerate={15/1, 30/1}", .drop_only = TRUE, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction){15/1, 30/1};" - "video/x-raw-yuv, framerate=(fraction)[15/1, MAX];" - "video/x-raw-yuv, framerate=(fraction)0/1", + "video/x-raw, framerate=(fraction){15/1, 30/1};" + "video/x-raw, framerate=(fraction)[15/1, MAX];" + "video/x-raw, framerate=(fraction)0/1", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction){15/1, 30/1};" - "video/x-raw-yuv, framerate=(fraction)[0/1, 30/1];"}, + "video/x-raw, framerate=(fraction){15/1, 30/1};" + "video/x-raw, framerate=(fraction)[0/1, 30/1];"}, { - .caps = "video/x-raw-yuv, framerate={15/1, 30/1}", + .caps = "video/x-raw, framerate={15/1, 30/1}", .drop_only = TRUE, .max_rate = 20, .expected_sink_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction){15/1, 30/1};" - "video/x-raw-yuv, framerate=(fraction)[15/1, MAX];" - "video/x-raw-yuv, framerate=(fraction)0/1", + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction){15/1, 30/1};" + "video/x-raw, framerate=(fraction)[15/1, MAX];" + "video/x-raw, framerate=(fraction)0/1", .expected_src_caps = - "video/x-raw-yuv, framerate=(fraction)15/1;" - "video/x-raw-yuv, framerate=(fraction)[0/1, 20/1]"}, + "video/x-raw, framerate=(fraction)15/1;" + "video/x-raw, framerate=(fraction)[0/1, 20/1]"}, }; static GstCaps * diff --git a/tests/check/elements/videotestsrc.c b/tests/check/elements/videotestsrc.c index a1a0c688e5..06ea1b7093 100644 --- a/tests/check/elements/videotestsrc.c +++ b/tests/check/elements/videotestsrc.c @@ -40,7 +40,7 @@ static GstPad *mysinkpad; #define CAPS_TEMPLATE_STRING \ - "video/x-raw-yuv, " \ + "video/x-raw, " \ "format = (string) UYVY, " \ "width = (int) [ 1, MAX ], " \ "height = (int) [ 1, MAX ], " \ diff --git a/tests/check/elements/volume.c b/tests/check/elements/volume.c index 00bbee1948..e318d54eaf 100644 --- a/tests/check/elements/volume.c +++ b/tests/check/elements/volume.c @@ -32,79 +32,73 @@ * get_peer, and then remove references in every test function */ static GstPad *mysrcpad, *mysinkpad; +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define FORMATS1 "{ S8, S16LE, S24LE, S32LE, F32LE, F64LE }" +#define FORMATS2 "S8" +#define FORMATS3 "S16LE" +#define FORMATS4 "S24LE" +#define FORMATS5 "S32LE" +#define FORMATS6 "F32LE" +#define FORMATS7 "F64LE" +#define FORMATS8 "U16LE" +#else +#define FORMATS1 "{ S8, S16BE, S24BE, S32BE, F32BE, F64BE }" +#define FORMATS2 "S8" +#define FORMATS3 "S16BE" +#define FORMATS4 "S24BE" +#define FORMATS5 "S32BE" +#define FORMATS6 "F32BE" +#define FORMATS7 "F64BE" +#define FORMATS8 "U16BE" +#endif #define VOLUME_CAPS_TEMPLATE_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "format = (string) "FORMATS1", " \ "channels = (int) [ 1, MAX ], " \ - "rate = (int) [ 1, MAX ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) { 8, 16, 24, 32 }, " \ - "depth = (int) { 8, 16, 24, 32 }, " \ - "signed = (bool) TRUE; " \ - "audio/x-raw-float, " \ - "channels = (int) [ 1, MAX ], " \ - "rate = (int) [ 1, MAX ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) { 32, 64 }" \ + "rate = (int) [ 1, MAX ]" #define VOLUME_CAPS_STRING_S8 \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS2", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 8, " \ - "depth = (int) 8, " \ - "signed = (bool) TRUE" + "rate = (int) 44100" #define VOLUME_CAPS_STRING_S16 \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS3", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 16, " \ - "depth = (int) 16, " \ - "signed = (bool) TRUE" + "rate = (int) 44100" #define VOLUME_CAPS_STRING_S24 \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS4", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 24, " \ - "depth = (int) 24, " \ - "signed = (bool) TRUE" + "rate = (int) 44100" #define VOLUME_CAPS_STRING_S32 \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS5", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 32, " \ - "depth = (int) 32, " \ - "signed = (bool) TRUE" + "rate = (int) 44100" #define VOLUME_CAPS_STRING_F32 \ - "audio/x-raw-float, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS6", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 32" + "rate = (int) 44100" #define VOLUME_CAPS_STRING_F64 \ - "audio/x-raw-float, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS7", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 64" + "rate = (int) 44100" #define VOLUME_WRONG_CAPS_STRING \ - "audio/x-raw-int, " \ + "audio/x-raw, " \ + "formats = (string) "FORMATS8", " \ "channels = (int) 1, " \ - "rate = (int) 44100, " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) 16, " \ - "depth = (int) 16, " \ - "signed = (bool) FALSE" + "rate = (int) 44100" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", diff --git a/tests/check/libs/audio.c b/tests/check/libs/audio.c index ec764515a5..990f46dd88 100644 --- a/tests/check/libs/audio.c +++ b/tests/check/libs/audio.c @@ -71,7 +71,7 @@ GST_START_TEST (test_multichannel_checks) }; GstStructure *s; - s = gst_structure_new ("audio/x-raw-int", "channels", G_TYPE_INT, 2, NULL); + s = gst_structure_new ("audio/x-raw", "channels", G_TYPE_INT, 2, NULL); /* check if the audio channel position checks work */ fail_if (gst_audio_check_channel_positions (pos_2_mixed, 2)); diff --git a/tests/check/libs/pbutils.c b/tests/check/libs/pbutils.c index c31567fc4e..9f74ca1f56 100644 --- a/tests/check/libs/pbutils.c +++ b/tests/check/libs/pbutils.c @@ -380,8 +380,8 @@ static const gchar *caps_strings[] = { "video/x-ati-vcr, vcrversion=(int)99", "video/x-ati-vcr", /* raw audio */ - "audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2", - "audio/x-raw-float, rate=(int)22050, channels=(int)2, endianness=(int)1234, width=(int)32", + "audio/x-raw, format=(string)S16LE, rate=(int)44100, channels=(int)2", + "audio/x-raw, format=(string)F32,rate=(int)22050, channels=(int)2", /* raw video */ "video/x-raw, format=(string)RGB16, width=(int)320, height=(int)240, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1", "video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, framerate=(fraction)30/1", diff --git a/tests/check/libs/profile.c b/tests/check/libs/profile.c index 629b5cd3fa..a04096228e 100644 --- a/tests/check/libs/profile.c +++ b/tests/check/libs/profile.c @@ -110,7 +110,7 @@ GST_START_TEST (test_profile_input_caps) gst_encoding_profile_unref (sprof); /* One simple restriction */ - restriction = gst_caps_from_string ("audio/x-raw-int,channels=2,rate=44100"); + restriction = gst_caps_from_string ("audio/x-raw,channels=2,rate=44100"); test1 = gst_caps_from_string ("audio/x-vorbis,channels=2,rate=44100"); fail_if (restriction == NULL); @@ -230,7 +230,7 @@ create_saveload_target (const gchar * targetname) gst_encoding_target_add_profile (target, profile); caps = gst_caps_from_string ("audio/x-pony-song,pretty=True"); - caps2 = gst_caps_from_string ("audio/x-raw-int,channels=1,rate=44100"); + caps2 = gst_caps_from_string ("audio/x-raw,channels=1,rate=44100"); sprof = (GstEncodingProfile *) gst_encoding_audio_profile_new (caps, NULL, caps2, 1); @@ -364,7 +364,7 @@ test_individual_target (GstEncodingTarget * target) GST_DEBUG ("Checking the container profile has the audio/x-pony-song stream"); tmpcaps = gst_caps_from_string ("audio/x-pony-song,pretty=True"); - tmpcaps2 = gst_caps_from_string ("audio/x-raw-int,channels=1,rate=44100"); + tmpcaps2 = gst_caps_from_string ("audio/x-raw,channels=1,rate=44100"); sprof1 = (GstEncodingProfile *) gst_encoding_audio_profile_new (tmpcaps, NULL, tmpcaps2, 1); @@ -530,7 +530,7 @@ format=animal/x-pony\n\ parent=pony\n\ type=audio\n\ format=audio/x-pony-song,pretty=True\n\ -restriction=audio/x-raw-int,channels=1,rate=44100\n\ +restriction=audio/x-raw,channels=1,rate=44100\n\ presence=1\n\ \n\ [streamprofile-pony12]\n\ diff --git a/tests/check/pipelines/simple-launch-lines.c b/tests/check/pipelines/simple-launch-lines.c index a21cd62a6d..5c3218b8eb 100644 --- a/tests/check/pipelines/simple-launch-lines.c +++ b/tests/check/pipelines/simple-launch-lines.c @@ -112,9 +112,8 @@ GST_START_TEST (test_element_negotiation) * will apply those caps to the buffers. * see http://bugzilla.gnome.org/show_bug.cgi?id=315126 */ s = "fakesrc num-buffers=2 ! " - "audio/x-raw-int,width=16,depth=16,rate=22050,channels=1," - "signed=(boolean)true,endianness=1234 ! " - "audioconvert ! audio/x-raw-int,width=16,depth=16,rate=22050,channels=1 " + "audio/x-raw,format=S16LE,rate=22050,channels=1 ! " + "audioconvert ! audio/x-raw,format=S16LE,rate=22050,channels=1 " "! fakesink"; run_pipeline (setup_pipeline (s), s, GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), @@ -158,15 +157,15 @@ GST_START_TEST (test_basetransform_based) /* Check that audioresample can pick a samplerate to use from a * range that doesn't include the input */ s = "audiotestsrc num-buffers=2 ! " - "audio/x-raw-int,width=16,depth=16,rate=8000 ! " - "audioresample ! audio/x-raw-int,rate=[16000,48000] ! fakesink"; + "audio/x-raw,format=S16LE,rate=8000 ! " + "audioresample ! audio/x-raw,rate=[16000,48000] ! fakesink"; run_pipeline (setup_pipeline (s), s, GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), GST_MESSAGE_UNKNOWN); /* Check that audioconvert can pick a depth to use, given a width */ - s = "audiotestsrc num-buffers=30 ! audio/x-raw-int,width=16,depth=16 ! " - "audioconvert ! " "audio/x-raw-int,width=32 ! fakesink"; + s = "audiotestsrc num-buffers=30 ! audio/x-raw,format=S16LE ! " + "audioconvert ! " "audio/x-raw,format=S32LE ! fakesink"; run_pipeline (setup_pipeline (s), s, GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), GST_MESSAGE_UNKNOWN); diff --git a/tests/check/pipelines/vorbisdec.c b/tests/check/pipelines/vorbisdec.c index 751e79a82d..1df67410bf 100644 --- a/tests/check/pipelines/vorbisdec.c +++ b/tests/check/pipelines/vorbisdec.c @@ -55,7 +55,7 @@ GST_START_TEST (test_timestamps) GError *error = NULL; pipe_str = g_strdup_printf ("audiotestsrc num-buffers=100" - " ! audio/x-raw-int,rate=44100 ! audioconvert ! vorbisenc ! vorbisdec" + " ! audio/x-raw,rate=44100 ! audioconvert ! vorbisenc ! vorbisdec" " ! identity check-imperfect-timestamp=TRUE ! fakesink"); pipeline = gst_parse_launch (pipe_str, &error); diff --git a/tests/check/pipelines/vorbisenc.c b/tests/check/pipelines/vorbisenc.c index b079d638ba..a172479141 100644 --- a/tests/check/pipelines/vorbisenc.c +++ b/tests/check/pipelines/vorbisenc.c @@ -95,7 +95,7 @@ GST_START_TEST (test_granulepos_offset) GError *error = NULL; pipe_str = g_strdup_printf ("audiotestsrc timestamp-offset=%" G_GUINT64_FORMAT - " ! audio/x-raw-int,rate=44100" + " ! audio/x-raw,rate=44100" " ! audioconvert ! vorbisenc ! fakesink", TIMESTAMP_OFFSET); bin = gst_parse_launch (pipe_str, &error); @@ -187,7 +187,7 @@ GST_START_TEST (test_timestamps) GError *error = NULL; pipe_str = g_strdup_printf ("audiotestsrc" - " ! audio/x-raw-int,rate=44100 ! audioconvert ! vorbisenc ! fakesink"); + " ! audio/x-raw,rate=44100 ! audioconvert ! vorbisenc ! fakesink"); bin = gst_parse_launch (pipe_str, &error); fail_unless (bin != NULL, "Error parsing pipeline: %s", @@ -285,7 +285,7 @@ GST_START_TEST (test_discontinuity) guint drop_id; pipe_str = g_strdup_printf ("audiotestsrc samplesperbuffer=1024" - " ! audio/x-raw-int,rate=44100" " ! audioconvert ! vorbisenc ! fakesink"); + " ! audio/x-raw,rate=44100" " ! audioconvert ! vorbisenc ! fakesink"); bin = gst_parse_launch (pipe_str, &error); fail_unless (bin != NULL, "Error parsing pipeline: %s",