tests: Switch to GST_AUDIO_NE()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8984>
This commit is contained in:
Doug Nazar 2025-05-14 14:42:19 -04:00
parent a8e11cec9a
commit a332a411b7
4 changed files with 8 additions and 23 deletions

View File

@ -39,11 +39,8 @@
* get_peer, and then remove references in every test function */
static GstPad *mysrcpad, *mysinkpad;
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define FORMATS "{ F32LE, F64LE, S16LE, S32LE }"
#else
#define FORMATS "{ F32BE, F64BE, S16BE, S32BE }"
#endif
#define FORMATS "{ " GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (F64) ", " \
GST_AUDIO_NE (S16) ", " GST_AUDIO_NE (S32) " }"
#define RESAMPLE_CAPS \
"audio/x-raw, " \

View File

@ -24,6 +24,7 @@
#include <gst/gst.h>
#include <gst/check/gstcheck.h>
#include <gst/audio/audio.h>
static gboolean have_eos = FALSE;
@ -130,13 +131,8 @@ GST_START_TEST (test_pipeline)
cfilter = gst_element_factory_make ("capsfilter", NULL);
fail_unless (cfilter != NULL);
#if G_BYTE_ORDER == G_BIG_ENDIAN
caps = gst_caps_new_simple ("audio/x-raw",
"format", G_TYPE_STRING, "F64BE", NULL);
#else
caps = gst_caps_new_simple ("audio/x-raw",
"format", G_TYPE_STRING, "F64LE", NULL);
#endif
"format", G_TYPE_STRING, GST_AUDIO_NE (F64), NULL);
g_object_set (G_OBJECT (cfilter), "caps", caps, NULL);
gst_caps_unref (caps);

View File

@ -23,18 +23,13 @@
#include <unistd.h>
#include <gst/check/gstcheck.h>
#include <gst/audio/audio.h>
/* 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,
* get_peer, and then remove references in every test function */
static GstPad *mysrcpad, *mysinkpad;
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define AUDIO_FORMAT "S16BE"
#else
#define AUDIO_FORMAT "S16LE"
#endif
guint8 test_frame[] = {
0x77, 0x76, 0x70, 0x6B, /* "wvpk" */
0x2E, 0x00, 0x00, 0x00, /* ckSize */
@ -58,7 +53,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, "
"format = (string) " AUDIO_FORMAT ", "
"format = (string) " GST_AUDIO_NE (S16) ", "
"layout = (string) interleaved, "
"channels = (int) 1, " "rate = (int) 44100")
);

View File

@ -23,6 +23,7 @@
#include <unistd.h>
#include <gst/check/gstcheck.h>
#include <gst/audio/audio.h>
/* 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,
@ -30,11 +31,7 @@
static GstPad *mysrcpad, *mysinkpad;
static GstBus *bus;
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define AUDIO_FORMAT "S32BE"
#else
#define AUDIO_FORMAT "S32LE"
#endif
#define AUDIO_FORMAT GST_AUDIO_NE (S32)
#define RAW_CAPS_STRING "audio/x-raw, " \
"format = (string) " AUDIO_FORMAT ", " \