diff --git a/inc/MulticastServerMediaSubsession.h b/inc/MulticastServerMediaSubsession.h index 9937d46..9e1dfce 100644 --- a/inc/MulticastServerMediaSubsession.h +++ b/inc/MulticastServerMediaSubsession.h @@ -9,6 +9,7 @@ #pragma once +#include #include "BaseServerMediaSubsession.h" // ----------------------------------------- @@ -34,7 +35,11 @@ class MulticastServerMediaSubsession : public BaseServerMediaSubsession, public , m_rtcpInstance) {} - virtual char const* sdpLines() ; +#if LIVEMEDIA_LIBRARY_VERSION_INT < 1610928000 + virtual char const* sdpLines(); +#else + virtual char const* sdpLines(int addressFamily); +#endif virtual char const* getAuxSDPLine(RTPSink* rtpSink,FramedSource* inputSource); RTPSink* createRtpSink(UsageEnvironment& env , struct in_addr destinationAddress @@ -43,9 +48,9 @@ class MulticastServerMediaSubsession : public BaseServerMediaSubsession, public , StreamReplicator* replicator); protected: - RTPSink* m_rtpSink; - RTCPInstance* m_rtcpInstance; - std::string m_SDPLines; + RTPSink* m_rtpSink; + RTCPInstance* m_rtcpInstance; + std::map m_SDPLines; }; diff --git a/src/MulticastServerMediaSubsession.cpp b/src/MulticastServerMediaSubsession.cpp index 43ce50b..75efa6f 100755 --- a/src/MulticastServerMediaSubsession.cpp +++ b/src/MulticastServerMediaSubsession.cpp @@ -58,19 +58,23 @@ RTPSink* MulticastServerMediaSubsession::createRtpSink(UsageEnvironment& env return m_rtpSink; } -char const* MulticastServerMediaSubsession::sdpLines() -{ - if (m_SDPLines.empty()) +#if LIVEMEDIA_LIBRARY_VERSION_INT < 1610928000 +char const* MulticastServerMediaSubsession::sdpLines() { + int addressFamily = 0; +#else +char const* MulticastServerMediaSubsession::sdpLines(int addressFamily) { +#endif + if (m_SDPLines[addressFamily].empty()) { // Ugly workaround to give SPS/PPS that are get from the RTPSink #if LIVEMEDIA_LIBRARY_VERSION_INT < 1610928000 - m_SDPLines.assign(PassiveServerMediaSubsession::sdpLines()); + m_SDPLines[addressFamily].assign(PassiveServerMediaSubsession::sdpLines()); #else - m_SDPLines.assign(PassiveServerMediaSubsession::sdpLines(AF_INET)); + m_SDPLines[addressFamily].assign(PassiveServerMediaSubsession::sdpLines(addressFamily)); #endif - m_SDPLines.append(getAuxSDPLine(m_rtpSink,NULL)); + m_SDPLines[addressFamily].append(getAuxSDPLine(m_rtpSink,NULL)); } - return m_SDPLines.c_str(); + return m_SDPLines[addressFamily].c_str(); } char const* MulticastServerMediaSubsession::getAuxSDPLine(RTPSink* rtpSink,FramedSource* inputSource)