]> git.sesse.net Git - ffmpeg/commitdiff
avformat/rtmpproto: Only include RTMP protocols that are enabled
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 29 Jan 2021 00:53:04 +0000 (01:53 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 2 Feb 2021 22:53:29 +0000 (23:53 +0100)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/rtmpproto.c

index d9741bc622cdf74dd45c4d02d324259d1d9a54b3..5a540e32404e2152561d4ca526138b8574dcde0b 100644 (file)
@@ -3119,7 +3119,8 @@ static const AVOption rtmp_options[] = {
     { NULL },
 };
 
-#define RTMP_PROTOCOL(flavor)                    \
+#define RTMP_PROTOCOL_0(flavor)
+#define RTMP_PROTOCOL_1(flavor)                  \
 static const AVClass flavor##_class = {          \
     .class_name = #flavor,                       \
     .item_name  = av_default_item_name,          \
@@ -3139,11 +3140,16 @@ const URLProtocol ff_##flavor##_protocol = {     \
     .flags          = URL_PROTOCOL_FLAG_NETWORK, \
     .priv_data_class= &flavor##_class,           \
 };
-
-
-RTMP_PROTOCOL(rtmp)
-RTMP_PROTOCOL(rtmpe)
-RTMP_PROTOCOL(rtmps)
-RTMP_PROTOCOL(rtmpt)
-RTMP_PROTOCOL(rtmpte)
-RTMP_PROTOCOL(rtmpts)
+#define RTMP_PROTOCOL_2(flavor, enabled)         \
+    RTMP_PROTOCOL_ ## enabled(flavor)
+#define RTMP_PROTOCOL_3(flavor, config)          \
+    RTMP_PROTOCOL_2(flavor, config)
+#define RTMP_PROTOCOL(flavor, uppercase)         \
+    RTMP_PROTOCOL_3(flavor, CONFIG_ ## uppercase ## _PROTOCOL)
+
+RTMP_PROTOCOL(rtmp,   RTMP)
+RTMP_PROTOCOL(rtmpe,  RTMPE)
+RTMP_PROTOCOL(rtmps,  RTMPS)
+RTMP_PROTOCOL(rtmpt,  RTMPT)
+RTMP_PROTOCOL(rtmpte, RTMPTE)
+RTMP_PROTOCOL(rtmpts, RTMPTS)