diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2012-07-17 12:02:42 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-07-17 13:53:33 +0300 |
commit | 6aedabc9b68cab7b65833415953e958ac2c77f80 (patch) | |
tree | 1f0a7e897f9dba9dab14c56f85b15df3cd80f1ed /libavformat | |
parent | 5417efbbf313781f5bac38daee95f62c671c5d63 (diff) | |
download | ffmpeg-streaming-6aedabc9b68cab7b65833415953e958ac2c77f80.zip ffmpeg-streaming-6aedabc9b68cab7b65833415953e958ac2c77f80.tar.gz |
RTMPS protocol support
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 1 | ||||
-rw-r--r-- | libavformat/allformats.c | 1 | ||||
-rw-r--r-- | libavformat/rtmp.h | 1 | ||||
-rw-r--r-- | libavformat/rtmpproto.c | 23 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
5 files changed, 27 insertions, 1 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index ae057f2..abde7d8 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -352,6 +352,7 @@ OBJS-$(CONFIG_MMST_PROTOCOL) += mmst.o mms.o asf.o OBJS-$(CONFIG_MD5_PROTOCOL) += md5proto.o OBJS-$(CONFIG_PIPE_PROTOCOL) += file.o OBJS-$(CONFIG_RTMP_PROTOCOL) += rtmpproto.o rtmppkt.o +OBJS-$(CONFIG_RTMPS_PROTOCOL) += rtmpproto.o rtmppkt.o OBJS-$(CONFIG_RTMPT_PROTOCOL) += rtmpproto.o rtmppkt.o OBJS-$(CONFIG_RTP_PROTOCOL) += rtpproto.o OBJS-$(CONFIG_SCTP_PROTOCOL) += sctp.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 34d8359..6ded203 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -258,6 +258,7 @@ void av_register_all(void) REGISTER_PROTOCOL (MD5, md5); REGISTER_PROTOCOL (PIPE, pipe); REGISTER_PROTOCOL (RTMP, rtmp); + REGISTER_PROTOCOL (RTMPS, rtmps); REGISTER_PROTOCOL (RTMPT, rtmpt); REGISTER_PROTOCOL (RTP, rtp); REGISTER_PROTOCOL (SCTP, sctp); diff --git a/libavformat/rtmp.h b/libavformat/rtmp.h index 45de73e..f9d9900 100644 --- a/libavformat/rtmp.h +++ b/libavformat/rtmp.h @@ -25,6 +25,7 @@ #include "avformat.h" #define RTMP_DEFAULT_PORT 1935 +#define RTMPS_DEFAULT_PORT 443 #define RTMP_HANDSHAKE_PACKET_SIZE 1536 diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index f8ec894..07af403 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -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); + } 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) @@ -1444,6 +1449,24 @@ URLProtocol ff_rtmp_protocol = { .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, diff --git a/libavformat/version.h b/libavformat/version.h index 9547bd0..a06a7e5 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/avutil.h" #define LIBAVFORMAT_VERSION_MAJOR 54 -#define LIBAVFORMAT_VERSION_MINOR 7 +#define LIBAVFORMAT_VERSION_MINOR 8 #define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |