realrtsp: add more headers

Parse the ETag from the describe method and pass the sessionid as the value for
the If-Match header is subsequent setup calls.
Fixes support for more RealMedia RTSP streams.
This commit is contained in:
Wim Taymans 2009-03-25 16:39:06 +01:00
parent 73eb3377d3
commit 1731c58b9b
2 changed files with 17 additions and 0 deletions

View file

@ -127,6 +127,8 @@ rtsp_ext_real_before_send (GstRTSPExtension * ext, GstRTSPMessage * request)
"Linux_2.4_6.0.9.1235_play32_RN01_EN_586");
gst_rtsp_message_add_header (request, GST_RTSP_HDR_MAX_ASM_WIDTH, "1");
gst_rtsp_message_add_header (request, GST_RTSP_HDR_LANGUAGE, "en-US");
gst_rtsp_message_add_header (request, GST_RTSP_HDR_REQUIRE,
"com.real.retain-entity-for-setup");
break;
}
case GST_RTSP_SETUP:
@ -136,6 +138,7 @@ rtsp_ext_real_before_send (GstRTSPExtension * ext, GstRTSPMessage * request)
g_strdup_printf ("%s, sd=%s", ctx->challenge2, ctx->checksum);
gst_rtsp_message_add_header (request, GST_RTSP_HDR_REAL_CHALLENGE2,
value);
gst_rtsp_message_add_header (request, GST_RTSP_HDR_IF_MATCH, ctx->etag);
g_free (value);
}
break;
@ -169,6 +172,19 @@ rtsp_ext_real_after_send (GstRTSPExtension * ext, GstRTSPMessage * req,
ctx->checksum, challenge1);
break;
}
case GST_RTSP_DESCRIBE:
{
gchar *etag = NULL;
guint len;
gst_rtsp_message_get_header (resp, GST_RTSP_HDR_ETAG, &etag, 0);
if (etag) {
len = sizeof (ctx->etag);
strncpy (ctx->etag, etag, len);
ctx->etag[len - 1] = '\0';
}
break;
}
default:
break;
}

View file

@ -64,6 +64,7 @@ struct _GstRTSPReal {
gchar checksum[34];
gchar challenge2[64];
gchar etag[64];
gboolean isreal;
guint n_streams;