From 46db1dea11b600e08f95b304d0697acfacb1a55e Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sun, 7 Dec 2014 22:04:39 +0200 Subject: [PATCH] Reworked the RTSP debug callback to adapt dynamically any logging mode changes during SETUP. --- rtsp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rtsp.c b/rtsp.c index ed35b2e..f3364cb 100644 --- a/rtsp.c +++ b/rtsp.c @@ -167,6 +167,18 @@ bool cSatipRtsp::Setup(const char *uriP, int rtpPortP, int rtcpPortP) CURLcode res = CURLE_OK; cString transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpPortP, rtcpPortP); + // Verbose output + if (SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug2)) { + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_VERBOSE, 1L); + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_DEBUGFUNCTION, cSatipRtsp::DebugCallback); + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_DEBUGDATA, this); + } + else { + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_VERBOSE, 0L); + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_DEBUGFUNCTION, NULL); + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_DEBUGDATA, NULL); + } + // Setup media stream SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, uriP); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_TRANSPORT, *transport);