gst/rtp/gstrtpamrenc.*: Added payload_type and ssrc properties to the payloader.

Original commit message from CVS:
* gst/rtp/gstrtpamrenc.c: (gst_rtpamrenc_class_init),
(gst_rtpamrenc_init), (gst_rtpamrenc_chain),
(gst_rtpamrenc_set_property), (gst_rtpamrenc_get_property):
* gst/rtp/gstrtpamrenc.h:
Added payload_type and ssrc properties to the payloader.

* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_send), (gst_rtspsrc_open),
(gst_rtspsrc_close), (gst_rtspsrc_play):
Options need to be stripped and are in the Public header field.

* gst/rtsp/rtspurl.c: (rtsp_url_parse):
Fix url / parsing...
This commit is contained in:
Wim Taymans 2005-08-18 19:47:38 +00:00
parent dc2d99dc17
commit 519f58bb6b
7 changed files with 88 additions and 5 deletions

View file

@ -1,3 +1,19 @@
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/rtp/gstrtpamrenc.h:
Added payload_type and ssrc properties to the payloader.
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_send), (gst_rtspsrc_open),
(gst_rtspsrc_close), (gst_rtspsrc_play):
Options need to be stripped and are in the Public header field.
* gst/rtsp/rtspurl.c: (rtsp_url_parse):
Fix url / parsing...
2005-08-18 Wim Taymans <wim@fluendo.com>
* gst/rtp/Makefile.am:

View file

@ -38,11 +38,15 @@ enum
};
#define DEFAULT_MTU 1024
#define DEFAULT_PT 96
#define DEFAULT_SSRC 0
enum
{
PROP_0,
PROP_MTU
PROP_MTU,
PROP_PT,
PROP_SSRC
};
static GstStaticPadTemplate gst_rtpamrenc_sink_template =
@ -131,6 +135,14 @@ gst_rtpamrenc_class_init (GstRtpAMREncClass * klass)
g_param_spec_uint ("mtu", "MTU",
"Maximum size of one packet",
28, G_MAXUINT, DEFAULT_MTU, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
g_param_spec_uint ("pt", "payload type",
"The payload type of the packets",
0, 0x80, DEFAULT_PT, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
g_param_spec_uint ("ssrc", "SSRC",
"The SSRC of the packets",
0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
gstelement_class->change_state = gst_rtpamrenc_change_state;
}
@ -150,6 +162,8 @@ gst_rtpamrenc_init (GstRtpAMREnc * rtpamrenc)
gst_element_add_pad (GST_ELEMENT (rtpamrenc), rtpamrenc->sinkpad);
rtpamrenc->mtu = DEFAULT_MTU;
rtpamrenc->pt = DEFAULT_PT;
rtpamrenc->ssrc = DEFAULT_SSRC;
}
static GstFlowReturn
@ -176,6 +190,8 @@ gst_rtpamrenc_chain (GstPad * pad, GstBuffer * buffer)
/* FIXME, assert for now */
g_assert (GST_BUFFER_SIZE (outbuf) < rtpamrenc->mtu);
gst_rtpbuffer_set_payload_type (outbuf, rtpamrenc->pt);
gst_rtpbuffer_set_ssrc (outbuf, rtpamrenc->ssrc);
gst_rtpbuffer_set_seq (outbuf, rtpamrenc->seqnum++);
gst_rtpbuffer_set_timestamp (outbuf, timestamp * 8000 / GST_SECOND);
@ -222,6 +238,12 @@ gst_rtpamrenc_set_property (GObject * object, guint prop_id,
case PROP_MTU:
rtpamrenc->mtu = g_value_get_uint (value);
break;
case PROP_PT:
rtpamrenc->pt = g_value_get_uint (value);
break;
case PROP_SSRC:
rtpamrenc->ssrc = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -240,6 +262,12 @@ gst_rtpamrenc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_MTU:
g_value_set_uint (value, rtpamrenc->mtu);
break;
case PROP_PT:
g_value_set_uint (value, rtpamrenc->pt);
break;
case PROP_SSRC:
g_value_set_uint (value, rtpamrenc->ssrc);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;

View file

@ -47,6 +47,8 @@ struct _GstRtpAMREnc
GstPad *srcpad;
guint16 seqnum;
guint pt;
guint ssrc;
guint mtu;
};

View file

@ -38,11 +38,15 @@ enum
};
#define DEFAULT_MTU 1024
#define DEFAULT_PT 96
#define DEFAULT_SSRC 0
enum
{
PROP_0,
PROP_MTU
PROP_MTU,
PROP_PT,
PROP_SSRC
};
static GstStaticPadTemplate gst_rtpamrenc_sink_template =
@ -131,6 +135,14 @@ gst_rtpamrenc_class_init (GstRtpAMREncClass * klass)
g_param_spec_uint ("mtu", "MTU",
"Maximum size of one packet",
28, G_MAXUINT, DEFAULT_MTU, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
g_param_spec_uint ("pt", "payload type",
"The payload type of the packets",
0, 0x80, DEFAULT_PT, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
g_param_spec_uint ("ssrc", "SSRC",
"The SSRC of the packets",
0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
gstelement_class->change_state = gst_rtpamrenc_change_state;
}
@ -150,6 +162,8 @@ gst_rtpamrenc_init (GstRtpAMREnc * rtpamrenc)
gst_element_add_pad (GST_ELEMENT (rtpamrenc), rtpamrenc->sinkpad);
rtpamrenc->mtu = DEFAULT_MTU;
rtpamrenc->pt = DEFAULT_PT;
rtpamrenc->ssrc = DEFAULT_SSRC;
}
static GstFlowReturn
@ -176,6 +190,8 @@ gst_rtpamrenc_chain (GstPad * pad, GstBuffer * buffer)
/* FIXME, assert for now */
g_assert (GST_BUFFER_SIZE (outbuf) < rtpamrenc->mtu);
gst_rtpbuffer_set_payload_type (outbuf, rtpamrenc->pt);
gst_rtpbuffer_set_ssrc (outbuf, rtpamrenc->ssrc);
gst_rtpbuffer_set_seq (outbuf, rtpamrenc->seqnum++);
gst_rtpbuffer_set_timestamp (outbuf, timestamp * 8000 / GST_SECOND);
@ -222,6 +238,12 @@ gst_rtpamrenc_set_property (GObject * object, guint prop_id,
case PROP_MTU:
rtpamrenc->mtu = g_value_get_uint (value);
break;
case PROP_PT:
rtpamrenc->pt = g_value_get_uint (value);
break;
case PROP_SSRC:
rtpamrenc->ssrc = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -240,6 +262,12 @@ gst_rtpamrenc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_MTU:
g_value_set_uint (value, rtpamrenc->mtu);
break;
case PROP_PT:
g_value_set_uint (value, rtpamrenc->pt);
break;
case PROP_SSRC:
g_value_set_uint (value, rtpamrenc->ssrc);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;

View file

@ -47,6 +47,8 @@ struct _GstRtpAMREnc
GstPad *srcpad;
guint16 seqnum;
guint pt;
guint ssrc;
guint mtu;
};

View file

@ -581,7 +581,7 @@ gst_rtspsrc_open (GstRTSPSrc * src)
gchar **options;
gint i;
rtsp_message_get_header (&response, RTSP_HDR_ALLOW, &respoptions);
rtsp_message_get_header (&response, RTSP_HDR_PUBLIC, &respoptions);
if (!respoptions)
goto no_options;
@ -590,7 +590,13 @@ gst_rtspsrc_open (GstRTSPSrc * src)
i = 0;
while (options[i]) {
gint method = rtsp_find_method (options[i]);
gchar *stripped;
gint method;
stripped = g_strdup (options[i]);
stripped = g_strstrip (stripped);
method = rtsp_find_method (stripped);
g_free (stripped);
/* keep bitfield of supported methods */
if (method != -1)

View file

@ -17,6 +17,7 @@
* Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include <string.h>
#include "rtspurl.h"
@ -49,7 +50,7 @@ rtsp_url_parse (const gchar * urlstr, RTSPUrl ** url)
return RTSP_EINVAL;
}
slash = g_strrstr (p, "/");
slash = strstr (p, "/");
at = g_strrstr (p, "@");
if (at && slash && at > slash)