2005-08-18 Wim Taymans <wim@fluendo.com>
+ * gst/rtp/gstrtpamrdec.c: (gst_rtpamrdec_init),
+ (gst_rtpamrdec_chain):
+ Fix up amr depayloader a bit.
+
+ * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_send), (gst_rtspsrc_open),
+ (gst_rtspsrc_close), (gst_rtspsrc_play):
+ Look for options result in Public and Allow header fields..
+ spec says Allow but some servers return Public...
+
+2005-08-18 Wim Taymans <wim@fluendo.com>
+
* gst/rtp/gstrtpamrenc.c: (gst_rtpamrenc_class_init),
(gst_rtpamrenc_init), (gst_rtpamrenc_chain),
(gst_rtpamrenc_set_property), (gst_rtpamrenc_get_property):
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/mpeg")
+ GST_STATIC_CAPS ("audio/x-amr-nb")
);
static GstStaticPadTemplate gst_rtpamrdec_sink_template =
static void
gst_rtpamrdec_init (GstRtpAMRDec * rtpamrdec)
{
+ GstCaps *caps;
+
rtpamrdec->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_rtpamrdec_src_template), "src");
gst_element_add_pad (GST_ELEMENT (rtpamrdec), rtpamrdec->srcpad);
+ caps = gst_caps_new_simple ("audio/x-amr-nb",
+ "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL);
+
+ gst_pad_set_caps (rtpamrdec->srcpad, caps);
+
rtpamrdec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_rtpamrdec_sink_template), "sink");
{
gint payload_len;
guint8 *payload;
- guint16 frag_offset;
guint32 timestamp;
payload_len = gst_rtpbuffer_get_payload_len (buf);
payload = gst_rtpbuffer_get_payload (buf);
- frag_offset = (payload[2] << 8) | payload[3];
-
/* strip off header */
- payload_len -= 4;
- payload += 4;
+ payload_len -= 2;
+ payload += 2;
timestamp = gst_rtpbuffer_get_timestamp (buf);
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
+ gst_buffer_set_caps (outbuf, GST_PAD_CAPS (rtpamrdec->srcpad));
+
GST_DEBUG ("gst_rtpamrdec_chain: pushing buffer of size %d",
GST_BUFFER_SIZE (outbuf));
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/mpeg")
+ GST_STATIC_CAPS ("audio/x-amr-nb")
);
static GstStaticPadTemplate gst_rtpamrdec_sink_template =
static void
gst_rtpamrdec_init (GstRtpAMRDec * rtpamrdec)
{
+ GstCaps *caps;
+
rtpamrdec->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_rtpamrdec_src_template), "src");
gst_element_add_pad (GST_ELEMENT (rtpamrdec), rtpamrdec->srcpad);
+ caps = gst_caps_new_simple ("audio/x-amr-nb",
+ "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL);
+
+ gst_pad_set_caps (rtpamrdec->srcpad, caps);
+
rtpamrdec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_rtpamrdec_sink_template), "sink");
{
gint payload_len;
guint8 *payload;
- guint16 frag_offset;
guint32 timestamp;
payload_len = gst_rtpbuffer_get_payload_len (buf);
payload = gst_rtpbuffer_get_payload (buf);
- frag_offset = (payload[2] << 8) | payload[3];
-
/* strip off header */
- payload_len -= 4;
- payload += 4;
+ payload_len -= 2;
+ payload += 2;
timestamp = gst_rtpbuffer_get_timestamp (buf);
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
+ gst_buffer_set_caps (outbuf, GST_PAD_CAPS (rtpamrdec->srcpad));
+
GST_DEBUG ("gst_rtpamrdec_chain: pushing buffer of size %d",
GST_BUFFER_SIZE (outbuf));
gchar **options;
gint i;
- rtsp_message_get_header (&response, RTSP_HDR_PUBLIC, &respoptions);
- if (!respoptions)
- goto no_options;
+ /* Try Allow Header first */
+ rtsp_message_get_header (&response, RTSP_HDR_ALLOW, &respoptions);
+ if (!respoptions) {
+ /* Then maybe Public Header... */
+ rtsp_message_get_header (&response, RTSP_HDR_PUBLIC, &respoptions);
+ if (!respoptions) {
+ goto no_options;
+ }
+ }
/* parse options */
options = g_strsplit (respoptions, ",", 0);