gst/rtsp/URLS: Add example H264 rtsp url.

Original commit message from CVS:
* gst/rtsp/URLS:
Add example H264 rtsp url.
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_media_to_caps),
(gst_rtspsrc_handle_message), (gst_rtspsrc_change_state):
Don't convert values to lowercase or we might mess up base64 encoded
properties.
This commit is contained in:
Wim Taymans 2007-02-16 12:32:01 +00:00
parent dc325990e0
commit 7fd025043d
3 changed files with 38 additions and 20 deletions

View file

@ -1,3 +1,13 @@
2007-02-16 Wim Taymans <wim@fluendo.com>
* gst/rtsp/URLS:
Add example H264 rtsp url.
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_media_to_caps),
(gst_rtspsrc_handle_message), (gst_rtspsrc_change_state):
Don't convert values to lowercase or we might mess up base64 encoded
properties.
2007-02-16 Wim Taymans <wim@fluendo.com> 2007-02-16 Wim Taymans <wim@fluendo.com>
* gst/rtp/README: * gst/rtp/README:

View file

@ -13,6 +13,7 @@ ASF (audio/video):
MP4V-ES/mpeg4-generic(ACC): MP4V-ES/mpeg4-generic(ACC):
rtsp://vod.nwec.jp/quicktime/505.mov rtsp://vod.nwec.jp/quicktime/505.mov
rtsp://203.140.68.241:554/hirakataeizou9.mp4 rtsp://203.140.68.241:554/hirakataeizou9.mp4
rtsp://kmdi.utoronto.ca:555/osconf/2004_may9.1.mp4
REAL: REAL:
rtsp://213.254.239.61/farm/*/encoder/tagesschau/live1high.rm rtsp://213.254.239.61/farm/*/encoder/tagesschau/live1high.rm

View file

@ -610,7 +610,7 @@ gst_rtspsrc_media_to_caps (gint pt, SDPMedia * media)
gchar *name = NULL; gchar *name = NULL;
gint rate = -1; gint rate = -1;
gchar *params = NULL; gchar *params = NULL;
gchar *tmp1, *tmp2; gchar *tmp;
GstStructure *s; GstStructure *s;
/* dynamic payloads need rtpmap */ /* dynamic payloads need rtpmap */
@ -636,25 +636,27 @@ gst_rtspsrc_media_to_caps (gint pt, SDPMedia * media)
goto no_rtpmap; goto no_rtpmap;
} }
tmp1 = g_ascii_strdown (media->media, -1); tmp = g_ascii_strdown (media->media, -1);
caps = gst_caps_new_simple ("application/x-unknown", caps = gst_caps_new_simple ("application/x-unknown",
"media", G_TYPE_STRING, tmp1, "payload", G_TYPE_INT, pt, NULL); "media", G_TYPE_STRING, tmp, "payload", G_TYPE_INT, pt, NULL);
g_free (tmp1); g_free (tmp);
s = gst_caps_get_structure (caps, 0); s = gst_caps_get_structure (caps, 0);
if (rate != -1) if (rate != -1)
gst_structure_set (s, "clock-rate", G_TYPE_INT, rate, NULL); gst_structure_set (s, "clock-rate", G_TYPE_INT, rate, NULL);
/* encoding name must be upper case */
if (name != NULL) { if (name != NULL) {
tmp1 = g_ascii_strup (name, -1); tmp = g_ascii_strup (name, -1);
gst_structure_set (s, "encoding-name", G_TYPE_STRING, tmp1, NULL); gst_structure_set (s, "encoding-name", G_TYPE_STRING, tmp, NULL);
g_free (tmp1); g_free (tmp);
} }
/* params must be lower case */
if (params != NULL) { if (params != NULL) {
tmp1 = g_ascii_strdown (params, -1); tmp = g_ascii_strdown (params, -1);
gst_structure_set (s, "encoding-params", G_TYPE_STRING, tmp1, NULL); gst_structure_set (s, "encoding-params", G_TYPE_STRING, tmp, NULL);
g_free (tmp1); g_free (tmp);
} }
/* parse optional fmtp: field */ /* parse optional fmtp: field */
@ -687,13 +689,11 @@ gst_rtspsrc_media_to_caps (gint pt, SDPMedia * media)
/* simple <param>;.. is translated into <param>=1;... */ /* simple <param>;.. is translated into <param>=1;... */
val = "1"; val = "1";
} }
/* strip the key of spaces */ /* strip the key of spaces, convert key to lowercase but not the value. */
key = g_strstrip (pairs[i]); key = g_strstrip (pairs[i]);
tmp1 = g_ascii_strdown (key, -1); tmp = g_ascii_strdown (key, -1);
tmp2 = g_ascii_strdown (val, -1); gst_structure_set (s, tmp, G_TYPE_STRING, val, NULL);
gst_structure_set (s, tmp1, G_TYPE_STRING, tmp2, NULL); g_free (tmp);
g_free (tmp1);
g_free (tmp2);
} }
g_strfreev (pairs); g_strfreev (pairs);
} }
@ -2422,11 +2422,19 @@ gst_rtspsrc_handle_message (GstBin * bin, GstMessage * message)
gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_RECONNECT); gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_RECONNECT);
return; return;
} }
}
/* Fallthrough */
default:
GST_BIN_CLASS (parent_class)->handle_message (bin, message); GST_BIN_CLASS (parent_class)->handle_message (bin, message);
break; break;
}
case GST_MESSAGE_ERROR:
{
GST_BIN_CLASS (parent_class)->handle_message (bin, message);
break;
}
default:
{
GST_BIN_CLASS (parent_class)->handle_message (bin, message);
break;
}
} }
} }
@ -2448,7 +2456,6 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
break; break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
rtsp_connection_flush (rtspsrc->connection, FALSE); rtsp_connection_flush (rtspsrc->connection, FALSE);
/* copy configuerd protocols */
gst_rtspsrc_play (rtspsrc); gst_rtspsrc_play (rtspsrc);
break; break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED: