diff --git a/torchvision/csrc/io/decoder/decoder.cpp b/torchvision/csrc/io/decoder/decoder.cpp index 1d4150ccfdb..75070343d00 100644 --- a/torchvision/csrc/io/decoder/decoder.cpp +++ b/torchvision/csrc/io/decoder/decoder.cpp @@ -316,6 +316,12 @@ bool Decoder::init( av_dict_set_int(&options, "analyzeduration", params_.timeoutMs * 1000, 0); av_dict_set_int(&options, "stimeout", params_.timeoutMs * 1000, 0); av_dict_set_int(&options, "rw_timeout", params_.timeoutMs * 1000, 0); + if (!params_.tlsCertFile.empty()) { + av_dict_set(&options, "cert_file", params_.tlsCertFile.data(), 0); + } + if (!params_.tlsKeyFile.empty()) { + av_dict_set(&options, "key_file", params_.tlsCertFile.data(), 0); + } } interrupted_ = false; diff --git a/torchvision/csrc/io/decoder/defs.h b/torchvision/csrc/io/decoder/defs.h index 7523969fd58..b828934bdf0 100644 --- a/torchvision/csrc/io/decoder/defs.h +++ b/torchvision/csrc/io/decoder/defs.h @@ -202,6 +202,9 @@ struct DecoderParameters { size_t cacheTimeoutMs{1000}; // timeout on bytes writing bool enforceCacheSize{false}; // drop output frames if cache is full bool mergeAudioMessages{false}; // combine collocated audio messages together + + std::string tlsCertFile; + std::string tlsKeyFile; }; struct DecoderHeader {