diff --git a/rtsp.c b/rtsp.c index fdf22aa..e437d6b 100644 --- a/rtsp.c +++ b/rtsp.c @@ -15,6 +15,7 @@ cSatipRtsp::cSatipRtsp(cSatipTunerIf &tunerP) : tunerM(tunerP), + modeM(cmUnicast), handleM(NULL), headerListM(NULL) { @@ -191,10 +192,22 @@ bool cSatipRtsp::Setup(const char *uriP, int rtpPortP, int rtcpPortP) bool result = false; if (handleM && !isempty(uriP)) { + cString transport; long rc = 0; cTimeMs processing(0); CURLcode res = CURLE_OK; - cString transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpPortP, rtcpPortP); + + switch (modeM) { + case cmMulticast: + // RTP/AVP;multicast;destination=;port=-;ttl= + transport = cString::sprintf("RTP/AVP;multicast;port=%d-%d", rtpPortP, rtcpPortP); + break; + default: + case cmUnicast: + // RTP/AVP;unicast;client_port=- + transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpPortP, rtcpPortP); + break; + } // Setup media stream SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, uriP); diff --git a/rtsp.h b/rtsp.h index 659c644..1d1be4d 100644 --- a/rtsp.h +++ b/rtsp.h @@ -26,8 +26,10 @@ private: enum { eConnectTimeoutMs = 1500, // in milliseconds }; + enum eCommunicationMode { cmUnicast, cmMulticast }; cSatipTunerIf &tunerM; + eCommunicationMode modeM; CURL *handleM; struct curl_slist *headerListM;