summaryrefslogtreecommitdiff
path: root/ext/gsm
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/gsm
parent741afd1f75ed86d96e2f1f1a7d19eb34340ff676 (diff)
Ported GSM Encoder to GStreamer 0.9
Original commit message from CVS: Ported GSM Encoder to GStreamer 0.9
Diffstat (limited to 'ext/gsm')
-rw-r--r--ext/gsm/Makefile.am16
-rw-r--r--ext/gsm/gstgsm.c3
-rw-r--r--ext/gsm/gstgsmenc.c33
3 files changed, 24 insertions, 28 deletions
diff --git a/ext/gsm/Makefile.am b/ext/gsm/Makefile.am
index a3779668e..6782a2420 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 1f536e2d3..c629c2360 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 f15efffb5..7911b47d8 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;
}