diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2012-07-17 12:02:43 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-07-17 14:02:55 +0300 |
commit | 86991ce2dde3358025be134b4c7939923cd81542 (patch) | |
tree | 49a253885707c133bd95fa8a893630326187a5c5 /libavformat/rtmpproto.c | |
parent | 6aedabc9b68cab7b65833415953e958ac2c77f80 (diff) | |
download | ffmpeg-86991ce2dde3358025be134b4c7939923cd81542.tar.gz |
RTMPTS protocol support
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r-- | libavformat/rtmpproto.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 07af403f50..5c40eb5517 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1111,6 +1111,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) char *old_app; uint8_t buf[2048]; int port; + AVDictionary *opts = NULL; int ret; rt->is_input = !(flags & AVIO_FLAG_WRITE); @@ -1118,7 +1119,10 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port, path, sizeof(path), s->filename); - if (!strcmp(proto, "rtmpt")) { + if (!strcmp(proto, "rtmpt") || !strcmp(proto, "rtmpts")) { + if (!strcmp(proto, "rtmpts")) + av_dict_set(&opts, "ffrtmphttp_tls", "1", 1); + /* open the http tunneling connection */ ff_url_join(buf, sizeof(buf), "ffrtmphttp", NULL, hostname, port, NULL); } else if (!strcmp(proto, "rtmps")) { @@ -1134,7 +1138,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) } if ((ret = ffurl_open(&rt->stream, buf, AVIO_FLAG_READ_WRITE, - &s->interrupt_callback, NULL)) < 0) { + &s->interrupt_callback, &opts)) < 0) { av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf); goto fail; } @@ -1266,6 +1270,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) return 0; fail: + av_dict_free(&opts); rtmp_close(s); return ret; } @@ -1484,3 +1489,21 @@ URLProtocol ff_rtmpt_protocol = { .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &rtmpt_class, }; + +static const AVClass rtmpts_class = { + .class_name = "rtmpts", + .item_name = av_default_item_name, + .option = rtmp_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +URLProtocol ff_rtmpts_protocol = { + .name = "rtmpts", + .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 = &rtmpts_class, +}; |