Commit 485d25ae authored by Wim Taymans's avatar Wim Taymans

gst/rtsp/gstrtspsrc.c: More SDP parsing and caps setting.

Original commit message from CVS:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_parse_rtpmap),
(gst_rtspsrc_media_to_caps), (gst_rtspsrc_stream_setup_rtp),
(gst_rtspsrc_stream_configure_transport), (gst_rtspsrc_send),
(gst_rtspsrc_change_state):
More SDP parsing and caps setting.
Do NO_PREROLL differently.
add pads only after negotiated.

* gst/udp/gstudpsrc.c: (gst_udpsrc_class_init),
(gst_udpsrc_getcaps):
Implement the getcaps function.
parent a297069e
2005-09-21 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_parse_rtpmap),
(gst_rtspsrc_media_to_caps), (gst_rtspsrc_stream_setup_rtp),
(gst_rtspsrc_stream_configure_transport), (gst_rtspsrc_send),
(gst_rtspsrc_change_state):
More SDP parsing and caps setting.
Do NO_PREROLL differently.
add pads only after negotiated.
* gst/udp/gstudpsrc.c: (gst_udpsrc_class_init),
(gst_udpsrc_getcaps):
Implement the getcaps function.
2005-09-21 Wim Taymans <wim@fluendo.com> 2005-09-21 Wim Taymans <wim@fluendo.com>
* gst/rtp/gstrtpamrdec.c: (gst_rtpamrdec_sink_setcaps), * gst/rtp/gstrtpamrdec.c: (gst_rtpamrdec_sink_setcaps),
......
...@@ -448,8 +448,15 @@ gst_rtspsrc_media_to_caps (SDPMedia * media) ...@@ -448,8 +448,15 @@ gst_rtspsrc_media_to_caps (SDPMedia * media)
gchar **keyval; gchar **keyval;
keyval = g_strsplit (pairs[i], "=", 0); keyval = g_strsplit (pairs[i], "=", 0);
if (keyval[0] && keyval[1]) { if (keyval[0]) {
gst_structure_set (s, keyval[0], G_TYPE_STRING, keyval[1], NULL); gchar *val;
if (keyval[1])
val = keyval[1];
else
val = "1";
gst_structure_set (s, keyval[0], G_TYPE_STRING, val, NULL);
} }
g_strfreev (keyval); g_strfreev (keyval);
} }
...@@ -499,9 +506,6 @@ gst_rtspsrc_stream_setup_rtp (GstRTSPStream * stream, SDPMedia * media, ...@@ -499,9 +506,6 @@ gst_rtspsrc_stream_setup_rtp (GstRTSPStream * stream, SDPMedia * media,
g_object_get (G_OBJECT (stream->rtpsrc), "port", rtpport, NULL); g_object_get (G_OBJECT (stream->rtpsrc), "port", rtpport, NULL);
g_object_get (G_OBJECT (stream->rtcpsrc), "port", rtcpport, NULL); g_object_get (G_OBJECT (stream->rtcpsrc), "port", rtcpport, NULL);
gst_element_set_state (stream->rtpsrc, GST_STATE_READY);
gst_element_set_state (stream->rtcpsrc, GST_STATE_READY);
return TRUE; return TRUE;
/* ERRORS, FIXME, cleanup */ /* ERRORS, FIXME, cleanup */
...@@ -552,13 +556,6 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream, ...@@ -552,13 +556,6 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream,
stream->rtpdecrtp = gst_element_get_pad (stream->rtpdec, "sinkrtp"); stream->rtpdecrtp = gst_element_get_pad (stream->rtpdec, "sinkrtp");
stream->rtpdecrtcp = gst_element_get_pad (stream->rtpdec, "sinkrtcp"); stream->rtpdecrtcp = gst_element_get_pad (stream->rtpdec, "sinkrtcp");
/* FIXME, make sure it outputs the caps */
pad = gst_element_get_pad (stream->rtpdec, "srcrtp");
name = g_strdup_printf ("rtp_stream%d", stream->id);
gst_element_add_pad (GST_ELEMENT (src), gst_ghost_pad_new (name, pad));
g_free (name);
gst_object_unref (GST_OBJECT (pad));
if (transport->lower_transport == RTSP_LOWER_TRANS_TCP) { if (transport->lower_transport == RTSP_LOWER_TRANS_TCP) {
/* configure for interleaved delivery, nothing needs to be done /* configure for interleaved delivery, nothing needs to be done
* here, the loop function will call the chain functions of the * here, the loop function will call the chain functions of the
...@@ -574,6 +571,13 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream, ...@@ -574,6 +571,13 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream,
gst_pad_link (pad, stream->rtpdecrtcp); gst_pad_link (pad, stream->rtpdecrtcp);
gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad));
} }
pad = gst_element_get_pad (stream->rtpdec, "srcrtp");
name = g_strdup_printf ("rtp_stream%d", stream->id);
gst_element_add_pad (GST_ELEMENT (src), gst_ghost_pad_new (name, pad));
g_free (name);
gst_object_unref (GST_OBJECT (pad));
return TRUE; return TRUE;
no_element: no_element:
...@@ -1181,6 +1185,9 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition) ...@@ -1181,6 +1185,9 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
goto done; goto done;
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
ret = GST_STATE_CHANGE_NO_PREROLL;
break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
gst_rtspsrc_pause (rtspsrc); gst_rtspsrc_pause (rtspsrc);
break; break;
......
...@@ -93,6 +93,7 @@ static void gst_udpsrc_init (GstUDPSrc * udpsrc); ...@@ -93,6 +93,7 @@ static void gst_udpsrc_init (GstUDPSrc * udpsrc);
static void gst_udpsrc_uri_handler_init (gpointer g_iface, gpointer iface_data); static void gst_udpsrc_uri_handler_init (gpointer g_iface, gpointer iface_data);
static GstCaps *gst_udpsrc_getcaps (GstBaseSrc * src);
static GstFlowReturn gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf); static GstFlowReturn gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf);
static gboolean gst_udpsrc_start (GstBaseSrc * bsrc); static gboolean gst_udpsrc_start (GstBaseSrc * bsrc);
static gboolean gst_udpsrc_stop (GstBaseSrc * bsrc); static gboolean gst_udpsrc_stop (GstBaseSrc * bsrc);
...@@ -189,6 +190,7 @@ gst_udpsrc_class_init (GstUDPSrc * klass) ...@@ -189,6 +190,7 @@ gst_udpsrc_class_init (GstUDPSrc * klass)
gstbasesrc_class->start = gst_udpsrc_start; gstbasesrc_class->start = gst_udpsrc_start;
gstbasesrc_class->stop = gst_udpsrc_stop; gstbasesrc_class->stop = gst_udpsrc_stop;
gstbasesrc_class->unlock = gst_udpsrc_unlock; gstbasesrc_class->unlock = gst_udpsrc_unlock;
gstbasesrc_class->get_caps = gst_udpsrc_getcaps;
gstpushsrc_class->create = gst_udpsrc_create; gstpushsrc_class->create = gst_udpsrc_create;
...@@ -205,6 +207,19 @@ gst_udpsrc_init (GstUDPSrc * udpsrc) ...@@ -205,6 +207,19 @@ gst_udpsrc_init (GstUDPSrc * udpsrc)
udpsrc->uri = g_strdup (UDP_DEFAULT_URI); udpsrc->uri = g_strdup (UDP_DEFAULT_URI);
} }
static GstCaps *
gst_udpsrc_getcaps (GstBaseSrc * src)
{
GstUDPSrc *udpsrc;
udpsrc = GST_UDPSRC (src);
if (udpsrc->caps)
return gst_caps_ref (udpsrc->caps);
else
return gst_caps_new_any ();
}
static GstFlowReturn static GstFlowReturn
gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf) gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** 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