From 46e13bca06a97256d0a0944c9f7c9fe80ce6447a Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Wed, 14 May 2025 13:54:55 -0400 Subject: [PATCH] tests: opus: Update channel support and add to meson Part-of: --- .../tests/check/elements/opus.c | 21 +++++++------------ .../gst-plugins-base/tests/check/meson.build | 1 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/subprojects/gst-plugins-base/tests/check/elements/opus.c b/subprojects/gst-plugins-base/tests/check/elements/opus.c index 3215496af9..24e705bb7c 100644 --- a/subprojects/gst-plugins-base/tests/check/elements/opus.c +++ b/subprojects/gst-plugins-base/tests/check/elements/opus.c @@ -26,15 +26,10 @@ #include #include - -#if G_BYTE_ORDER == G_BIG_ENDIAN -#define AFORMAT "S16BE" -#else -#define AFORMAT "S16LE" -#endif +#include #define AUDIO_CAPS_STRING "audio/x-raw, " \ - "format = (string) " AFORMAT ", "\ + "format = (string) " GST_AUDIO_NE (S16) ", "\ "layout = (string) interleaved, " \ "rate = (int) 48000, " \ "channels = (int) 1 " @@ -385,19 +380,19 @@ GST_START_TEST (test_opusdec_getcaps) { /* default result */ run_getcaps_check_from_strings (NULL, NULL, - "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,8]"); + "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,255]"); /* A single supported rate downstream - should accept any upstream anyway */ run_getcaps_check_from_strings (NULL, "audio/x-raw, rate=(int)8000", - "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,8]"); + "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,255]"); /* Two supported rates (fields as a array, not as a single int) */ run_getcaps_check_from_strings (NULL, "audio/x-raw, rate=(int){24000, 8000}", - "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,8]"); + "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,255]"); /* One supported and one unsupported rate */ run_getcaps_check_from_strings (NULL, "audio/x-raw, rate=(int){24000, 1000}", - "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,8]"); + "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)[1,255]"); /* Unsupported rate */ run_getcaps_check_from_strings (NULL, "audio/x-raw, rate=(int)1000", "EMPTY"); @@ -415,12 +410,12 @@ GST_START_TEST (test_opusdec_getcaps) /* Formats not acceptable */ run_getcaps_check_from_strings ("audio/x-opus, rate=(int)1000", NULL, "EMPTY"); - run_getcaps_check_from_strings ("audio/x-opus, channels=(int)200", NULL, + run_getcaps_check_from_strings ("audio/x-opus, channels=(int)300", NULL, "EMPTY"); /* Should restrict the result of the caps query to the selected rate/channels */ run_getcaps_check_from_strings ("audio/x-opus, rate=(int)8000", NULL, - "audio/x-opus, rate=(int)8000, channels=(int)[1,8]"); + "audio/x-opus, rate=(int)8000, channels=(int)[1,255]"); run_getcaps_check_from_strings ("audio/x-opus, channels=(int)2", NULL, "audio/x-opus, rate=(int){48000, 24000, 16000, 12000, 8000}, channels=(int)2"); } diff --git a/subprojects/gst-plugins-base/tests/check/meson.build b/subprojects/gst-plugins-base/tests/check/meson.build index 0b8ad09afb..542e3fffef 100644 --- a/subprojects/gst-plugins-base/tests/check/meson.build +++ b/subprojects/gst-plugins-base/tests/check/meson.build @@ -42,6 +42,7 @@ base_tests = [ [ 'elements/audioresample.c', get_option('audioresample').disabled()], [ 'elements/compositor.c', get_option('compositor').disabled()], [ 'elements/decodebin.c', get_option('playback').disabled()], + [ 'elements/opus.c', not opus_dep.found() ], [ 'elements/overlaycomposition.c', get_option('overlaycomposition').disabled()], [ 'elements/playbin.c', get_option('playback').disabled()], [ 'elements/playsink.c', get_option('playback').disabled()],