summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--gst/rtp/gstrtpg711dec.c14
-rw-r--r--gst/rtp/gstrtpg711depay.c14
3 files changed, 33 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 3740b960..4bde7cd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-10-31 Zeeshan Ali <zeenix@gmail.com>
+
+ * gst/rtp/gstrtpg711dec.c: (gst_rtpg711dec_setcaps),
+ (gst_rtpg711dec_process):
+ * gst/rtp/gstrtpgsmenc.c:
+ Payloader now sets some default caps on the srcpad if caps on the sinkpad
+ are never set. This is important for the g711 to work with burger's rtpbin
+ element.
+
2005-10-28 Edgard Lima <edgard.lima@cin.ufpe.br>
* ext/speex/gstspeexenc.c: (gst_speexenc_chain),
diff --git a/gst/rtp/gstrtpg711dec.c b/gst/rtp/gstrtpg711dec.c
index a81de4b1..e39f7d5b 100644
--- a/gst/rtp/gstrtpg711dec.c
+++ b/gst/rtp/gstrtpg711dec.c
@@ -62,8 +62,8 @@ static GstStaticPadTemplate gst_rtpg711dec_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-mulaw, channels = (int) 1; "
- "audio/x-alaw, channels = (int) 1")
+ GST_STATIC_CAPS ("audio/x-mulaw, "
+ "channels = (int) 1; " "audio/x-alaw, " "channels = (int) 1")
);
static GstBuffer *gst_rtpg711dec_process (GstBaseRTPDepayload * depayload,
@@ -148,6 +148,7 @@ gst_rtpg711dec_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
static GstBuffer *
gst_rtpg711dec_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
{
+ GstCaps *srccaps;
GstBuffer *outbuf = NULL;
gint payload_len;
guint8 *payload;
@@ -157,6 +158,15 @@ gst_rtpg711dec_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
gst_rtpbuffer_get_marker (buf),
gst_rtpbuffer_get_timestamp (buf), gst_rtpbuffer_get_seq (buf));
+ srccaps = GST_PAD_CAPS (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload));
+ if (!srccaps) {
+ /* Set the default caps */
+ srccaps = gst_caps_new_simple ("audio/x-mulaw",
+ "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL);
+ gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps);
+ gst_caps_unref (srccaps);
+ }
+
payload_len = gst_rtpbuffer_get_payload_len (buf);
payload = gst_rtpbuffer_get_payload (buf);
diff --git a/gst/rtp/gstrtpg711depay.c b/gst/rtp/gstrtpg711depay.c
index a81de4b1..e39f7d5b 100644
--- a/gst/rtp/gstrtpg711depay.c
+++ b/gst/rtp/gstrtpg711depay.c
@@ -62,8 +62,8 @@ static GstStaticPadTemplate gst_rtpg711dec_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-mulaw, channels = (int) 1; "
- "audio/x-alaw, channels = (int) 1")
+ GST_STATIC_CAPS ("audio/x-mulaw, "
+ "channels = (int) 1; " "audio/x-alaw, " "channels = (int) 1")
);
static GstBuffer *gst_rtpg711dec_process (GstBaseRTPDepayload * depayload,
@@ -148,6 +148,7 @@ gst_rtpg711dec_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
static GstBuffer *
gst_rtpg711dec_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
{
+ GstCaps *srccaps;
GstBuffer *outbuf = NULL;
gint payload_len;
guint8 *payload;
@@ -157,6 +158,15 @@ gst_rtpg711dec_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
gst_rtpbuffer_get_marker (buf),
gst_rtpbuffer_get_timestamp (buf), gst_rtpbuffer_get_seq (buf));
+ srccaps = GST_PAD_CAPS (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload));
+ if (!srccaps) {
+ /* Set the default caps */
+ srccaps = gst_caps_new_simple ("audio/x-mulaw",
+ "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL);
+ gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps);
+ gst_caps_unref (srccaps);
+ }
+
payload_len = gst_rtpbuffer_get_payload_len (buf);
payload = gst_rtpbuffer_get_payload (buf);