diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 8a9c9c1c8a..fa0d09d986 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -212,12 +212,16 @@ gst_rtsp_connection_create (const GstRTSPUrl * url, GstRTSPConnection ** conn) GstRTSPConnection *newconn; g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL); + g_return_val_if_fail (url != NULL, GST_RTSP_EINVAL); newconn = g_new0 (GstRTSPConnection, 1); newconn->cancellable = g_cancellable_new (); newconn->client = g_socket_client_new (); + if (url->transports & GST_RTSP_LOWER_TRANS_TLS) + g_socket_client_set_tls (newconn->client, TRUE); + newconn->url = gst_rtsp_url_copy (url); newconn->timer = g_timer_new (); newconn->timeout = 60; diff --git a/gst-libs/gst/rtsp/gstrtsptransport.c b/gst-libs/gst/rtsp/gstrtsptransport.c index a3e1e42595..e5d8f26f35 100644 --- a/gst-libs/gst/rtsp/gstrtsptransport.c +++ b/gst-libs/gst/rtsp/gstrtsptransport.c @@ -124,6 +124,7 @@ gst_rtsp_lower_trans_get_type (void) "udp-multicast"}, {GST_RTSP_LOWER_TRANS_TCP, "GST_RTSP_LOWER_TRANS_TCP", "tcp"}, {GST_RTSP_LOWER_TRANS_HTTP, "GST_RTSP_LOWER_TRANS_HTTP", "http"}, + {GST_RTSP_LOWER_TRANS_TLS, "GST_RTSP_LOWER_TRANS_TLS", "tls"}, {0, NULL, NULL}, }; diff --git a/gst-libs/gst/rtsp/gstrtsptransport.h b/gst-libs/gst/rtsp/gstrtsptransport.h index 2e53e9e813..014b9b95b2 100644 --- a/gst-libs/gst/rtsp/gstrtsptransport.h +++ b/gst-libs/gst/rtsp/gstrtsptransport.h @@ -83,6 +83,7 @@ typedef enum { * @GST_RTSP_LOWER_TRANS_UDP_MCAST: stream data over UDP multicast * @GST_RTSP_LOWER_TRANS_TCP: stream data over TCP * @GST_RTSP_LOWER_TRANS_HTTP: stream data tunneled over HTTP. + * @GST_RTSP_LOWER_TRANS_TLS: encrypt TCP and HTTP with TLS * * The different transport methods. */ @@ -91,7 +92,8 @@ typedef enum { GST_RTSP_LOWER_TRANS_UDP = (1 << 0), GST_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1), GST_RTSP_LOWER_TRANS_TCP = (1 << 2), - GST_RTSP_LOWER_TRANS_HTTP = (1 << 4) + GST_RTSP_LOWER_TRANS_HTTP = (1 << 4), + GST_RTSP_LOWER_TRANS_TLS = (1 << 5) } GstRTSPLowerTrans; #define GST_TYPE_RTSP_LOWER_TRANS (gst_rtsp_lower_trans_get_type()) diff --git a/gst-libs/gst/rtsp/gstrtspurl.c b/gst-libs/gst/rtsp/gstrtspurl.c index 3e97588b5a..654f2aa514 100644 --- a/gst-libs/gst/rtsp/gstrtspurl.c +++ b/gst-libs/gst/rtsp/gstrtspurl.c @@ -67,7 +67,16 @@ static const struct GST_RTSP_LOWER_TRANS_UDP_MCAST}, { "rtspu", GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST}, { "rtspt", GST_RTSP_LOWER_TRANS_TCP}, { - "rtsph", GST_RTSP_LOWER_TRANS_HTTP | GST_RTSP_LOWER_TRANS_TCP} + "rtsph", GST_RTSP_LOWER_TRANS_HTTP | GST_RTSP_LOWER_TRANS_TCP}, { + "rtsps", GST_RTSP_LOWER_TRANS_TCP | GST_RTSP_LOWER_TRANS_UDP | + GST_RTSP_LOWER_TRANS_UDP_MCAST | GST_RTSP_LOWER_TRANS_TLS}, { + "rtspsu", + GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | + GST_RTSP_LOWER_TRANS_TLS}, { + "rtspst", GST_RTSP_LOWER_TRANS_TCP | GST_RTSP_LOWER_TRANS_TLS}, { + "rtspsh", + GST_RTSP_LOWER_TRANS_HTTP | GST_RTSP_LOWER_TRANS_TCP | + GST_RTSP_LOWER_TRANS_TLS} }; /* format is rtsp[u]://[user:passwd@]host[:port]/abspath[?query] where host