Commit 6662f946 authored by Zeeshan Ali's avatar Zeeshan Ali
Browse files

Payloader now sets some default caps on the srcpad if caps on the sinkpad are...

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.
parent 758cd8fd
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),
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment