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 "mulaw-encode.h"
|
|
|
|
#include "mulaw-decode.h"
|
|
|
|
|
|
|
|
static GstCaps*
|
|
|
|
mulaw_factory (void)
|
|
|
|
{
|
2003-12-22 01:47:09 +00:00
|
|
|
return gst_caps_new_simple ("audio/x-mulaw",
|
|
|
|
"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 *mulawenc_src_template, *mulawenc_sink_template;
|
2001-12-22 23:27:31 +00:00
|
|
|
GstPadTemplate *mulawdec_src_template, *mulawdec_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* mulaw_caps, *linear_caps;
|
|
|
|
|
|
|
|
mulaw_caps = mulaw_factory ();
|
|
|
|
linear_caps = linear_factory ();
|
2003-11-16 22:02:22 +00:00
|
|
|
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawenc_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
2003-12-22 01:47:09 +00:00
|
|
|
mulaw_caps);
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawenc_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
2003-12-22 01:47:09 +00:00
|
|
|
linear_caps);
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawdec_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
2003-12-22 01:47:09 +00:00
|
|
|
linear_caps);
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawdec_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
2003-12-22 01:47:09 +00:00
|
|
|
mulaw_caps);
|
2003-11-16 22:02:22 +00:00
|
|
|
|
2003-11-02 18:13:24 +00:00
|
|
|
if (!gst_element_register (plugin, "mulawenc",
|
|
|
|
GST_RANK_NONE, GST_TYPE_MULAWENC) ||
|
|
|
|
!gst_element_register (plugin, "mulawdec",
|
2004-02-24 23:44:48 +00:00
|
|
|
GST_RANK_PRIMARY, GST_TYPE_MULAWDEC))
|
2003-11-02 18:13:24 +00:00
|
|
|
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,
|
|
|
|
"mulaw",
|
2003-11-02 18:13:24 +00:00
|
|
|
"MuLaw audio conversion routines",
|
|
|
|
plugin_init,
|
|
|
|
VERSION,
|
|
|
|
GST_LICENSE,
|
|
|
|
GST_PACKAGE,
|
|
|
|
GST_ORIGIN
|
|
|
|
)
|