summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorFlavio Oliveira <flavio.oliveira@indt.org.br>2005-09-02 20:21:17 +0000
committerFlavio Oliveira <flavio.oliveira@indt.org.br>2005-09-02 20:21:17 +0000
commit36634356e6bf464a8689657fe532265ea6870555 (patch)
tree6cbebcf971b256550bac4bbfea5e0b9884405047 /ext
parent741afd1f75ed86d96e2f1f1a7d19eb34340ff676 (diff)
downloadgst-plugins-bad-36634356e6bf464a8689657fe532265ea6870555.tar.gz
gst-plugins-bad-36634356e6bf464a8689657fe532265ea6870555.tar.bz2
gst-plugins-bad-36634356e6bf464a8689657fe532265ea6870555.zip
Ported GSM Encoder to GStreamer 0.9
Original commit message from CVS: Ported GSM Encoder to GStreamer 0.9
Diffstat (limited to 'ext')
-rw-r--r--ext/Makefile.am9
-rw-r--r--ext/gsm/Makefile.am16
-rw-r--r--ext/gsm/gstgsm.c3
-rw-r--r--ext/gsm/gstgsmenc.c33
4 files changed, 29 insertions, 32 deletions
diff --git a/ext/Makefile.am b/ext/Makefile.am
index b2a039eb..2219f3d3 100644
--- a/ext/Makefile.am
+++ b/ext/Makefile.am
@@ -76,11 +76,11 @@ endif
## FESTIVAL_DIR=
## endif
-# if USE_GSM
-# GSM_DIR=gsm
-# else
+if USE_GSM
+GSM_DIR=gsm
+else
GSM_DIR=
-# endif
+endif
# if USE_HERMES
# HERMES_DIR=hermes
@@ -261,6 +261,7 @@ DIST_SUBDIRS=\
amrnb \
faac \
faad \
+ gsm \
lame \
mad \
mpeg2dec \
diff --git a/ext/gsm/Makefile.am b/ext/gsm/Makefile.am
index a3779668..6782a242 100644
--- a/ext/gsm/Makefile.am
+++ b/ext/gsm/Makefile.am
@@ -1,15 +1,9 @@
-
plugin_LTLIBRARIES = libgstgsm.la
-libgstgsm_la_SOURCES = gstgsm.c gstgsmdec.c gstgsmenc.c
-libgstgsm_la_CFLAGS = $(GST_CFLAGS)
-libgstgsm_la_LIBADD = $(GSM_LIBS)
+libgstgsm_la_SOURCES = gstgsm.c gstgsmenc.c
+libgstgsm_la_CFLAGS = $(GST_CFLAGS) $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
+libgstgsm_la_LIBADD = $(GSM_LIBS) $(GST_PLUGINS_BASE_LIBS) \
+ -lgstaudio-@GST_MAJORMINOR@
libgstgsm_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-noinst_HEADERS = gstgsmenc.h gstgsmdec.h
-
-#check_PROGRAMS = test
-
-#test_CFLAGS = $(GSM_CFLAGS)
-#test_LDADD = $(GSM_LIBS) $(top_srcdir)/gst/libgst.la
-#test_SOURCES = test.c
+noinst_HEADERS = gstgsmenc.h
diff --git a/ext/gsm/gstgsm.c b/ext/gsm/gstgsm.c
index 1f536e2d..c629c236 100644
--- a/ext/gsm/gstgsm.c
+++ b/ext/gsm/gstgsm.c
@@ -29,10 +29,11 @@ plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "gsmenc", GST_RANK_NONE, GST_TYPE_GSMENC))
return FALSE;
+/*
if (!gst_element_register (plugin, "gsmdec", GST_RANK_PRIMARY,
GST_TYPE_GSMDEC))
return FALSE;
-
+*/
return TRUE;
}
diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c
index f15efffb..7911b47d 100644
--- a/ext/gsm/gstgsmenc.c
+++ b/ext/gsm/gstgsmenc.c
@@ -51,7 +51,7 @@ static void gst_gsmenc_base_init (gpointer g_class);
static void gst_gsmenc_class_init (GstGSMEnc * klass);
static void gst_gsmenc_init (GstGSMEnc * gsmenc);
-static void gst_gsmenc_chain (GstPad * pad, GstData * _data);
+static GstFlowReturn gst_gsmenc_chain (GstPad * pad, GstBuffer * buf);
static GstElementClass *parent_class = NULL;
static guint gst_gsmenc_signals[LAST_SIGNAL] = { 0 };
@@ -148,27 +148,28 @@ gst_gsmenc_init (GstGSMEnc * gsmenc)
gsmenc->next_ts = 0;
}
-static void
-gst_gsmenc_chain (GstPad * pad, GstData * _data)
+static GstFlowReturn
+gst_gsmenc_chain (GstPad * pad, GstBuffer * buf)
{
GstGSMEnc *gsmenc;
+/*
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (_data != NULL);
-
+*/
gsmenc = GST_GSMENC (GST_OBJECT_PARENT (pad));
- if (GST_IS_EVENT (_data)) {
- GstEvent *event = GST_EVENT (_data);
+ if (GST_IS_EVENT (buf)) {
+ GstEvent *event = GST_EVENT (buf);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:{
- gst_element_set_eos (GST_ELEMENT (gsmenc));
- gst_pad_push (gsmenc->srcpad, _data);
+ gst_pad_push_event (gsmenc->srcpad, gst_event_new_eos ());
+ gst_pad_push (gsmenc->srcpad, buf);
break;
}
- case GST_EVENT_DISCONTINUOUS:{
+ case GST_EVENT_NEWSEGMENT:{
/* drop the discontinuity */
break;
}
@@ -177,9 +178,8 @@ gst_gsmenc_chain (GstPad * pad, GstData * _data)
break;
}
}
- return;
- } else if (GST_IS_BUFFER (_data)) {
- GstBuffer *buf = GST_BUFFER (_data);
+ return GST_FLOW_OK;
+ } else if (GST_IS_BUFFER (buf)) {
gsm_signal *data;
guint size;
@@ -200,7 +200,7 @@ gst_gsmenc_chain (GstPad * pad, GstData * _data)
gsm_encode (gsmenc->state, gsmenc->buffer,
(gsm_byte *) GST_BUFFER_DATA (outbuf));
- gst_pad_push (gsmenc->srcpad, GST_DATA (outbuf));
+ gst_pad_push (gsmenc->srcpad, outbuf);
size -= (160 - gsmenc->bufsize);
data += (160 - gsmenc->bufsize);
@@ -217,7 +217,7 @@ gst_gsmenc_chain (GstPad * pad, GstData * _data)
gsm_encode (gsmenc->state, data, (gsm_byte *) GST_BUFFER_DATA (outbuf));
- gst_pad_push (gsmenc->srcpad, GST_DATA (outbuf));
+ gst_pad_push (gsmenc->srcpad, outbuf);
size -= 160;
data += 160;
@@ -229,7 +229,8 @@ gst_gsmenc_chain (GstPad * pad, GstData * _data)
gsmenc->bufsize += size;
}
- gst_buffer_unref (buf);
- return;
+ /*gst_buffer_unref (buf); */
+ return GST_FLOW_OK;
}
+ return GST_FLOW_OK;
}