From 3dac9e1c518c029c7d33d025634af0d995854d00 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 27 Mar 2021 23:42:44 +0800 Subject: [PATCH] =?UTF-8?q?srtp=E5=86=85=E9=83=A8=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/SrtpSession.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webrtc/SrtpSession.cpp b/webrtc/SrtpSession.cpp index 580c190b..a970fd7c 100644 --- a/webrtc/SrtpSession.cpp +++ b/webrtc/SrtpSession.cpp @@ -5,6 +5,7 @@ #include // std::memset(), std::memcpy() #include "logger.h" #include "Util/util.h" +#include "Util/logger.h" using namespace toolkit; namespace RTC @@ -60,6 +61,23 @@ namespace RTC srtp_err_status_t err = srtp_init(); +#if 0 + srtp_install_log_handler([](srtp_log_level_t level, + const char *msg, + void *data) { + printf("%s\n", msg); + }, nullptr); + srtp_set_debug_module("srtp", 1); + srtp_set_debug_module("hmac sha-1", 1); + srtp_set_debug_module("aes icm", 1); + srtp_set_debug_module("alloc", 1); + srtp_set_debug_module("stat test", 1); + srtp_set_debug_module("cipher", 1); + srtp_set_debug_module("auth func", 1); + srtp_set_debug_module("crypto kernel", 1); + srtp_list_debug_modules(); +#endif + if (DepLibSRTP::IsError(err)) { MS_THROW_ERROR("srtp_init() failed: %s", DepLibSRTP::GetErrorString(err)); }