law: 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:41:10 -04:00
parent 39cb7b38e7
commit ebaf87cd17
3 changed files with 2 additions and 20 deletions

View File

@ -51,17 +51,11 @@ enum
PROP_0 PROP_0
}; };
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define INT_FORMAT "S16LE"
#else
#define INT_FORMAT "S16BE"
#endif
GstStaticPadTemplate mulaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src", GstStaticPadTemplate mulaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, " GST_STATIC_CAPS ("audio/x-raw, "
"format = (string) " INT_FORMAT ", " "format = (string) " GST_AUDIO_NE (S16) ", "
"layout = (string) interleaved, " "layout = (string) interleaved, "
"rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]") "rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]")
); );

View File

@ -35,17 +35,11 @@
extern GstStaticPadTemplate mulaw_enc_src_factory; extern GstStaticPadTemplate mulaw_enc_src_factory;
extern GstStaticPadTemplate mulaw_enc_sink_factory; extern GstStaticPadTemplate mulaw_enc_sink_factory;
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define INT_FORMAT "S16LE"
#else
#define INT_FORMAT "S16BE"
#endif
GstStaticPadTemplate mulaw_enc_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GstStaticPadTemplate mulaw_enc_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK, GST_PAD_SINK,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, " GST_STATIC_CAPS ("audio/x-raw, "
"format = (string) " INT_FORMAT ", " "format = (string) " GST_AUDIO_NE (S16) ", "
"layout = (string) interleaved, " "layout = (string) interleaved, "
"rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]") "rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]")
); );

View File

@ -22,12 +22,6 @@
#include "mulaw-encode.h" #include "mulaw-encode.h"
#include "mulaw-decode.h" #include "mulaw-decode.h"
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define INT_FORMAT "S16LE"
#else
#define INT_FORMAT "S16BE"
#endif
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
{ {