summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeeshan Ali <zeenix@gmail.com>2005-10-31 12:00:10 +0000
committerZeeshan Ali <zeenix@gmail.com>2005-10-31 12:00:10 +0000
commit6662f94650e100f28209830fd3b13b0ad7d6f1c9 (patch)
treef84771e48b1d7c676278c248bd7892d1d5bd1f69
parent758cd8fd1855f26d4e59ca1036e71d043aa9aaa1 (diff)
Payloader now sets some default caps on the srcpad if caps on the sinkpad are never set. This is important for the g7...
Original commit message from CVS: 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.
-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);