diff options
author | Marvin Scholz <epirat07@gmail.com> | 2025-06-24 21:21:44 +0200 |
---|---|---|
committer | Marvin Scholz <epirat07@gmail.com> | 2025-07-07 01:45:07 +0200 |
commit | ba9817df9df5911ceb2edff37d9ec970c29329e2 (patch) | |
tree | a177d54450f0324a820bc52e119650ffeffb7ce6 | |
parent | d9eb63724ed5a65d36257185118986de0a5be46d (diff) | |
download | ffmpeg-ba9817df9df5911ceb2edff37d9ec970c29329e2.tar.gz |
avformat/tls: move common client options into their own define
Used in a future commit to not duplicate options.
-rw-r--r-- | libavformat/tls.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libavformat/tls.h b/libavformat/tls.h index 83d6b1ab6e..3644b64fe2 100644 --- a/libavformat/tls.h +++ b/libavformat/tls.h @@ -78,19 +78,23 @@ typedef struct TLSShared { } TLSShared; #define TLS_OPTFL (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM) -#define TLS_COMMON_OPTIONS(pstruct, options_field) \ + +#define FF_TLS_CLIENT_OPTIONS(pstruct, options_field) \ {"ca_file", "Certificate Authority database file", offsetof(pstruct, options_field . ca_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ {"cafile", "Certificate Authority database file", offsetof(pstruct, options_field . ca_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ {"tls_verify", "Verify the peer certificate", offsetof(pstruct, options_field . verify), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = TLS_OPTFL }, \ {"cert_file", "Certificate file", offsetof(pstruct, options_field . cert_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ {"key_file", "Private key file", offsetof(pstruct, options_field . key_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ - {"cert_pem", "Certificate PEM string", offsetof(pstruct, options_field . cert_buf), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ - {"key_pem", "Private key PEM string", offsetof(pstruct, options_field . key_buf), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ + {"verifyhost", "Verify against a specific hostname", offsetof(pstruct, options_field . host), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL } + +#define TLS_COMMON_OPTIONS(pstruct, options_field) \ {"listen", "Listen for incoming connections", offsetof(pstruct, options_field . listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = TLS_OPTFL }, \ - {"verifyhost", "Verify against a specific hostname", offsetof(pstruct, options_field . host), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ {"http_proxy", "Set proxy to tunnel through", offsetof(pstruct, options_field . http_proxy), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ {"use_external_udp", "Use external UDP from muxer or demuxer", offsetof(pstruct, options_field . use_external_udp), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 1, .flags = TLS_OPTFL }, \ - {"mtu", "Maximum Transmission Unit", offsetof(pstruct, options_field . mtu), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = TLS_OPTFL } + {"mtu", "Maximum Transmission Unit", offsetof(pstruct, options_field . mtu), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = TLS_OPTFL}, \ + {"cert_buf", "The optional certificate buffer for DTLS", offsetof(pstruct, options_field . cert_buf), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL}, \ + {"key_buf", "The optional private key buffer for DTLS", offsetof(pstruct, options_field . key_buf), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL}, \ + FF_TLS_CLIENT_OPTIONS(pstruct, options_field) int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AVDictionary **options); |