summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-01 16:26:36 -0300
committerJames Almer <jamrial@gmail.com>2017-11-01 16:52:05 -0300
commit4600b0619afc58b58de1a21d7a2c472e0d788282 (patch)
tree73b866d214b0214fae5e92fb524fe58f84a9fa8e /libavformat
parentbc98788dd262aacf017fb27d3e1de03f9009839f (diff)
parent61cec5adaacb358783c18aa07362f15824c1b274 (diff)
Merge commit '61cec5adaacb358783c18aa07362f15824c1b274'
* commit '61cec5adaacb358783c18aa07362f15824c1b274': tls: Hide backend implementation details from users Also includes ed434be106a4615e0419b3ac7664220741afda2d Changes were made to support schannel and securetransport. Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/Makefile9
-rw-r--r--libavformat/network.c12
-rw-r--r--libavformat/protocols.c5
-rw-r--r--libavformat/tls.h2
-rw-r--r--libavformat/tls_gnutls.c2
-rw-r--r--libavformat/tls_openssl.c2
-rw-r--r--libavformat/tls_schannel.c2
-rw-r--r--libavformat/tls_securetransport.c2
8 files changed, 18 insertions, 18 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 591a14b978..caebe5b146 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -586,10 +586,11 @@ OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o
OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o
OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o
OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o
-OBJS-$(CONFIG_TLS_GNUTLS_PROTOCOL) += tls_gnutls.o tls.o
-OBJS-$(CONFIG_TLS_OPENSSL_PROTOCOL) += tls_openssl.o tls.o
-OBJS-$(CONFIG_TLS_SCHANNEL_PROTOCOL) += tls_schannel.o tls.o
-OBJS-$(CONFIG_TLS_SECURETRANSPORT_PROTOCOL) += tls_securetransport.o tls.o
+TLS-OBJS-$(CONFIG_GNUTLS) += tls_gnutls.o
+TLS-OBJS-$(CONFIG_OPENSSL) += tls_openssl.o
+TLS-OBJS-$(CONFIG_SECURETRANSPORT) += tls_securetransport.o
+TLS-OBJS-$(CONFIG_SCHANNEL) += tls_schannel.o
+OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o $(TLS-OBJS-yes)
OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o
OBJS-$(CONFIG_UDPLITE_PROTOCOL) += udp.o
OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
diff --git a/libavformat/network.c b/libavformat/network.c
index b3987a4d11..6c3d9def3b 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -29,25 +29,29 @@
int ff_tls_init(void)
{
-#if CONFIG_TLS_OPENSSL_PROTOCOL
+#if CONFIG_TLS_PROTOCOL
+#if CONFIG_OPENSSL
int ret;
if ((ret = ff_openssl_init()) < 0)
return ret;
#endif
-#if CONFIG_TLS_GNUTLS_PROTOCOL
+#if CONFIG_GNUTLS
ff_gnutls_init();
#endif
+#endif
return 0;
}
void ff_tls_deinit(void)
{
-#if CONFIG_TLS_OPENSSL_PROTOCOL
+#if CONFIG_TLS_PROTOCOL
+#if CONFIG_OPENSSL
ff_openssl_deinit();
#endif
-#if CONFIG_TLS_GNUTLS_PROTOCOL
+#if CONFIG_GNUTLS
ff_gnutls_deinit();
#endif
+#endif
}
int ff_network_inited_globally;
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 8d3555ed52..669d74d5a8 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -56,10 +56,7 @@ extern const URLProtocol ff_srtp_protocol;
extern const URLProtocol ff_subfile_protocol;
extern const URLProtocol ff_tee_protocol;
extern const URLProtocol ff_tcp_protocol;
-extern const URLProtocol ff_tls_gnutls_protocol;
-extern const URLProtocol ff_tls_schannel_protocol;
-extern const URLProtocol ff_tls_securetransport_protocol;
-extern const URLProtocol ff_tls_openssl_protocol;
+extern const URLProtocol ff_tls_protocol;
extern const URLProtocol ff_udp_protocol;
extern const URLProtocol ff_udplite_protocol;
extern const URLProtocol ff_unix_protocol;
diff --git a/libavformat/tls.h b/libavformat/tls.h
index 0326ef7924..9c851bf132 100644
--- a/libavformat/tls.h
+++ b/libavformat/tls.h
@@ -26,8 +26,6 @@
#include "url.h"
#include "libavutil/opt.h"
-#define CONFIG_TLS_PROTOCOL (CONFIG_TLS_GNUTLS_PROTOCOL | CONFIG_TLS_OPENSSL_PROTOCOL | CONFIG_TLS_SECURETRANSPORT_PROTOCOL | CONFIG_TLS_SCHANNEL_PROTOCOL)
-
typedef struct TLSShared {
char *ca_file;
int verify;
diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 5ce6c3d448..7adb4eed56 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -260,7 +260,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_gnutls_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 38af8a21c0..3108a86f41 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -339,7 +339,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_openssl_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index 9f1c08806f..9a6e0c92e3 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -595,7 +595,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_schannel_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
diff --git a/libavformat/tls_securetransport.c b/libavformat/tls_securetransport.c
index bc8a32069e..9958931b0c 100644
--- a/libavformat/tls_securetransport.c
+++ b/libavformat/tls_securetransport.c
@@ -393,7 +393,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_securetransport_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,