2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2001-12-22 23:27:31 +00:00
|
|
|
#include "alaw-encode.h"
|
|
|
|
#include "alaw-decode.h"
|
|
|
|
|
|
|
|
static GstCaps*
|
|
|
|
alaw_factory (void)
|
|
|
|
{
|
2003-12-22 01:47:09 +00:00
|
|
|
return gst_caps_new_simple ("audio/x-alaw",
|
|
|
|
"rate", GST_TYPE_INT_RANGE, 8000, 192000,
|
|
|
|
"channels", GST_TYPE_INT_RANGE, 1, 2,
|
|
|
|
NULL);
|
2001-12-22 23:27:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps*
|
|
|
|
linear_factory (void)
|
|
|
|
{
|
2003-12-22 01:47:09 +00:00
|
|
|
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);
|
2001-12-22 23:27:31 +00:00
|
|
|
}
|
|
|
|
|
2003-11-16 22:02:22 +00:00
|
|
|
GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
|
2001-12-22 23:27:31 +00:00
|
|
|
GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
|
|
|
|
|
|
|
|
static gboolean
|
2003-11-02 18:13:24 +00:00
|
|
|
plugin_init (GstPlugin *plugin)
|
2001-12-22 23:27:31 +00:00
|
|
|
{
|
|
|
|
GstCaps* alaw_caps, *linear_caps;
|
|
|
|
|
|
|
|
alaw_caps = alaw_factory ();
|
|
|
|
linear_caps = linear_factory ();
|
2003-11-16 22:02:22 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
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);
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
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);
|
2003-11-16 22:02:22 +00:00
|
|
|
|
2003-11-02 18:13:24 +00:00
|
|
|
if (!gst_element_register (plugin, "alawenc",
|
|
|
|
GST_RANK_NONE, GST_TYPE_ALAWENC) ||
|
|
|
|
!gst_element_register (plugin, "alawdec",
|
|
|
|
GST_RANK_PRIMARY, GST_TYPE_ALAWENC))
|
|
|
|
return FALSE;
|
2001-12-22 23:27:31 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-11-02 18:13:24 +00:00
|
|
|
GST_PLUGIN_DEFINE (
|
2001-12-22 23:27:31 +00:00
|
|
|
GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"alaw",
|
2003-11-02 18:13:24 +00:00
|
|
|
"ALaw audio conversion routines",
|
|
|
|
plugin_init,
|
|
|
|
VERSION,
|
|
|
|
GST_LICENSE,
|
|
|
|
GST_PACKAGE,
|
|
|
|
GST_ORIGIN
|
|
|
|
)
|