summaryrefslogtreecommitdiffstats
path: root/gst/law/alaw.c
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2008-12-13 15:34:01 +0000
committerEdward Hervey <bilboed@bilboed.com>2008-12-13 15:34:01 +0000
commit5ad613d9b97d412d657d64a25ec2ab34e964a532 (patch)
tree5fd3e37d77851d3bfca5594aeb757af04cf0f756 /gst/law/alaw.c
parent57d97b4cbf02f143905ab4898da04810ebdf4a2b (diff)
Switch to using GstStaticPadTemplate.
Original commit message from CVS: * ext/flac/gstflacdec.c: (gst_flac_dec_base_init), (gst_flac_dec_init): * gst/law/alaw-decode.c: (gst_alaw_dec_base_init), (gst_alaw_dec_init): * gst/law/alaw-encode.c: (gst_alaw_enc_base_init), (gst_alaw_enc_init): * gst/law/alaw.c: (plugin_init): * gst/law/mulaw-decode.c: (gst_mulawdec_base_init), (gst_mulawdec_init): * gst/law/mulaw-encode.c: (gst_mulawenc_base_init), (gst_mulawenc_init): * gst/law/mulaw.c: (plugin_init): Switch to using GstStaticPadTemplate. * gst/udp/gstudpnetutils.c: (gst_udp_get_addr): Don't forget to free the addrinfo structure. * gst/wavparse/gstwavparse.c: (gst_wavparse_reset), (gst_wavparse_sink_activate): Don't forget to unref the GstAdapter.
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",