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)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
gst_caps_new (
|
|
|
|
"test_src",
|
2003-07-06 20:49:52 +00:00
|
|
|
"audio/x-mulaw",
|
2001-12-22 23:27:31 +00:00
|
|
|
gst_props_new (
|
2003-07-06 20:49:52 +00:00
|
|
|
"width", GST_PROPS_INT(8),
|
|
|
|
"depth", GST_PROPS_INT(8),
|
|
|
|
"signed", GST_PROPS_BOOLEAN(FALSE),
|
|
|
|
"rate", GST_PROPS_INT_RANGE (8000, 192000),
|
|
|
|
"channels", GST_PROPS_INT_RANGE (1, 2),
|
2001-12-22 23:27:31 +00:00
|
|
|
NULL));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps*
|
|
|
|
linear_factory (void)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
gst_caps_new (
|
|
|
|
"test_sink",
|
2003-07-06 20:49:52 +00:00
|
|
|
"audio/x-raw-int",
|
2001-12-22 23:27:31 +00:00
|
|
|
gst_props_new (
|
2003-07-06 20:49:52 +00:00
|
|
|
"width", GST_PROPS_INT(16),
|
|
|
|
"depth", GST_PROPS_INT(16),
|
|
|
|
"signed", GST_PROPS_BOOLEAN(TRUE),
|
|
|
|
"endianness", GST_PROPS_INT(G_BYTE_ORDER),
|
|
|
|
"rate", GST_PROPS_INT_RANGE (8000, 192000),
|
|
|
|
"channels", GST_PROPS_INT_RANGE (1, 2),
|
2001-12-22 23:27:31 +00:00
|
|
|
NULL));
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPadTemplate *mulawenc_src_template, *mulawenc_sink_template;
|
|
|
|
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 ();
|
|
|
|
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawenc_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
2001-12-22 23:27:31 +00:00
|
|
|
mulaw_caps, NULL);
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawenc_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
2001-12-22 23:27:31 +00:00
|
|
|
linear_caps, NULL);
|
|
|
|
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawdec_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
2001-12-22 23:27:31 +00:00
|
|
|
linear_caps, NULL);
|
2002-04-11 20:42:25 +00:00
|
|
|
mulawdec_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
2001-12-22 23:27:31 +00:00
|
|
|
mulaw_caps, NULL);
|
|
|
|
|
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",
|
|
|
|
GST_RANK_PRIMARY, GST_TYPE_MULAWENC))
|
|
|
|
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_COPYRIGHT,
|
|
|
|
GST_PACKAGE,
|
|
|
|
GST_ORIGIN
|
|
|
|
)
|