summaryrefslogtreecommitdiffstats
path: root/gst/law/alaw.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/law/alaw.c')
-rw-r--r--gst/law/alaw.c73
1 files changed, 31 insertions, 42 deletions
diff --git a/gst/law/alaw.c b/gst/law/alaw.c
index 495d0582..3525848d 100644
--- a/gst/law/alaw.c
+++ b/gst/law/alaw.c
@@ -23,54 +23,43 @@
#include "alaw-encode.h"
#include "alaw-decode.h"
-static GstCaps *
-alaw_factory (void)
-{
- return gst_caps_new_simple ("audio/x-alaw",
- "rate", GST_TYPE_INT_RANGE, 8000, 192000,
- "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
-}
+GstStaticPadTemplate alaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/x-raw-int, "
+ "rate = (int) [ 8000, 192000 ], "
+ "channels = (int) [ 1, 2 ], "
+ "endianness = (int) BYTE_ORDER, "
+ "width = (int) 16, " "width = (int) 16, " "signed = (boolean) True")
+ );
-static GstCaps *
-linear_factory (void)
-{
- return gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "rate", GST_TYPE_INT_RANGE, 8000, 192000,
- "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
-}
+GstStaticPadTemplate alaw_dec_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/x-alaw, "
+ "rate = [ 8000 , 192000 ], " "channels = [ 1 , 2 ]")
+ );
+
+GstStaticPadTemplate alaw_enc_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/x-raw-int, "
+ "rate = (int) [ 8000, 192000 ], "
+ "channels = (int) [ 1, 2 ], "
+ "endianness = (int) BYTE_ORDER, "
+ "width = (int) 16, " "width = (int) 16, " "signed = (boolean) True")
+ );
-GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
-GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
+GstStaticPadTemplate alaw_enc_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/x-alaw, "
+ "rate = [ 8000 , 192000 ], " "channels = [ 1 , 2 ]")
+ );
static gboolean
plugin_init (GstPlugin * plugin)
{
- GstCaps *alaw_caps, *linear_caps;
-
- alaw_caps = alaw_factory ();
- linear_caps = linear_factory ();
-
- gst_caps_ref (alaw_caps);
- gst_caps_ref (linear_caps);
- alawenc_src_template =
- gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, alaw_caps);
- alawenc_sink_template =
- gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, linear_caps);
-
- gst_caps_ref (alaw_caps);
- gst_caps_ref (linear_caps);
- alawdec_src_template =
- gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, linear_caps);
- alawdec_sink_template =
- gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, alaw_caps);
-
- gst_caps_unref (alaw_caps);
- gst_caps_unref (linear_caps);
-
if (!gst_element_register (plugin, "alawenc",
GST_RANK_NONE, GST_TYPE_ALAW_ENC) ||
!gst_element_register (plugin, "alawdec",