summaryrefslogtreecommitdiff
path: root/ext/gsm/gstgsmenc.c
diff options
context:
space:
mode:
authorZeeshan Ali <zeenix@gmail.com>2001-12-29 12:38:55 +0000
committerZeeshan Ali <zeenix@gmail.com>2001-12-29 12:38:55 +0000
commitc7bb41195ead44f67ce7753e3e1e750c1975c948 (patch)
tree19896bf0f8e1f32e68a8971c90348578e77fbc0d /ext/gsm/gstgsmenc.c
parent42cc21cd97016d4aa8ecc6d8c80b0dbd8780f975 (diff)
downloadgstreamer-plugins-bad-c7bb41195ead44f67ce7753e3e1e750c1975c948.tar.gz
omega: you agreed on starting rate from 1000, which is really neeeded for Apps like mine(zchat)
Original commit message from CVS: omega: you agreed on starting rate from 1000, which is really neeeded for Apps like mine(zchat)
Diffstat (limited to 'ext/gsm/gstgsmenc.c')
-rw-r--r--ext/gsm/gstgsmenc.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c
index 73058a666..b5ad0bcec 100644
--- a/ext/gsm/gstgsmenc.c
+++ b/ext/gsm/gstgsmenc.c
@@ -46,6 +46,17 @@ enum {
/* FILL ME */
};
+GST_PADTEMPLATE_FACTORY (src_factory,
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_CAPS_NEW (
+ "gsm_enc",
+ "audio/x-gsm",
+ "rate", GST_PROPS_INT_RANGE (1000, 48000)
+ )
+);
+
static void gst_gsmenc_class_init (GstGSMEnc *klass);
static void gst_gsmenc_init (GstGSMEnc *gsmenc);
@@ -121,7 +132,6 @@ gst_gsmenc_newcaps (GstPad *pad, GstCaps *caps)
gsmenc = GST_GSMENC (gst_pad_get_parent (pad));
gsmenc->rate = gst_caps_get_int (caps, "rate");
-
gst_pad_set_caps (gsmenc->srcpad, GST_CAPS_NEW (
"gsm_gsm",
"audio/x-gsm",
@@ -142,6 +152,15 @@ gst_gsmenc_chain (GstPad *pad, GstBuffer *buf)
gsmenc = GST_GSMENC (GST_OBJECT_PARENT (pad));
+ if (!GST_PAD_CAPS (gsmenc->srcpad)) {
+ gst_pad_set_caps (gsmenc->srcpad,
+ GST_CAPS_NEW (
+ "gsm_enc",
+ "audio/x-gsm",
+ "rate", GST_PROPS_INT (gsmenc->rate)
+ ));
+ }
+
data = (gsm_signal*) GST_BUFFER_DATA (buf);
size = GST_BUFFER_SIZE (buf) / sizeof (gsm_signal);