diff options
author | Flavio Oliveira <flavio.oliveira@indt.org.br> | 2005-09-21 20:33:42 +0000 |
---|---|---|
committer | Flavio Oliveira <flavio.oliveira@indt.org.br> | 2005-09-21 20:33:42 +0000 |
commit | 4b6bcfb3bfd2031f11dc444898d5a2664668e5e2 (patch) | |
tree | da043e896131fd0a30222213e58d9d1654a5ec4f /ext | |
parent | 2323f48f5f0db15bd12958358306c0fac19fd29c (diff) | |
download | gst-plugins-bad-4b6bcfb3bfd2031f11dc444898d5a2664668e5e2.tar.gz gst-plugins-bad-4b6bcfb3bfd2031f11dc444898d5a2664668e5e2.tar.bz2 gst-plugins-bad-4b6bcfb3bfd2031f11dc444898d5a2664668e5e2.zip |
Setting caps on the outgoing buffers.
Original commit message from CVS:
Setting caps on the outgoing buffers.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gsm/gstgsmenc.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c index 7911b47d..6a8f24ee 100644 --- a/ext/gsm/gstgsmenc.c +++ b/ext/gsm/gstgsmenc.c @@ -153,11 +153,6 @@ 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 (buf)) { @@ -182,6 +177,7 @@ gst_gsmenc_chain (GstPad * pad, GstBuffer * buf) } else if (GST_IS_BUFFER (buf)) { gsm_signal *data; guint size; + GstCaps *tempcaps = NULL; data = (gsm_signal *) GST_BUFFER_DATA (buf); size = GST_BUFFER_SIZE (buf) / sizeof (gsm_signal); @@ -200,6 +196,10 @@ gst_gsmenc_chain (GstPad * pad, GstBuffer * buf) gsm_encode (gsmenc->state, gsmenc->buffer, (gsm_byte *) GST_BUFFER_DATA (outbuf)); + tempcaps = gst_caps_new_simple ("audio/x-gsm", + "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); + + gst_buffer_set_caps (outbuf, tempcaps); gst_pad_push (gsmenc->srcpad, outbuf); size -= (160 - gsmenc->bufsize); @@ -217,6 +217,13 @@ gst_gsmenc_chain (GstPad * pad, GstBuffer * buf) gsm_encode (gsmenc->state, data, (gsm_byte *) GST_BUFFER_DATA (outbuf)); + /* I was wondering that gst_buffer_set_caps (outbuf, GST_PAD_CAPS (gsmenc->srcpad)); + * could work, but it doens't work */ + + tempcaps = gst_caps_new_simple ("audio/x-gsm", + "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); + + gst_buffer_set_caps (outbuf, tempcaps); gst_pad_push (gsmenc->srcpad, outbuf); size -= 160; |