RTMPS protocol support
[ffmpeg.git] / libavformat / rtmpproto.c
index f8ec894..07af403 100644 (file)
@@ -1121,6 +1121,11 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
     if (!strcmp(proto, "rtmpt")) {
         /* open the http tunneling connection */
         ff_url_join(buf, sizeof(buf), "ffrtmphttp", NULL, hostname, port, NULL);
     if (!strcmp(proto, "rtmpt")) {
         /* open the http tunneling connection */
         ff_url_join(buf, sizeof(buf), "ffrtmphttp", NULL, hostname, port, NULL);
+    } else if (!strcmp(proto, "rtmps")) {
+        /* open the tls connection */
+        if (port < 0)
+            port = RTMPS_DEFAULT_PORT;
+        ff_url_join(buf, sizeof(buf), "tls", NULL, hostname, port, NULL);
     } else {
         /* open the tcp connection */
         if (port < 0)
     } else {
         /* open the tcp connection */
         if (port < 0)
@@ -1444,6 +1449,24 @@ URLProtocol ff_rtmp_protocol = {
     .priv_data_class= &rtmp_class,
 };
 
     .priv_data_class= &rtmp_class,
 };
 
+static const AVClass rtmps_class = {
+    .class_name = "rtmps",
+    .item_name  = av_default_item_name,
+    .option     = rtmp_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
+URLProtocol ff_rtmps_protocol = {
+    .name            = "rtmps",
+    .url_open        = rtmp_open,
+    .url_read        = rtmp_read,
+    .url_write       = rtmp_write,
+    .url_close       = rtmp_close,
+    .priv_data_size  = sizeof(RTMPContext),
+    .flags           = URL_PROTOCOL_FLAG_NETWORK,
+    .priv_data_class = &rtmps_class,
+};
+
 static const AVClass rtmpt_class = {
     .class_name = "rtmpt",
     .item_name  = av_default_item_name,
 static const AVClass rtmpt_class = {
     .class_name = "rtmpt",
     .item_name  = av_default_item_name,