diff --git a/.github/scripts/install-common-deps.sh b/.github/scripts/install-common-deps.sh index e347fb56f..e378f6666 100755 --- a/.github/scripts/install-common-deps.sh +++ b/.github/scripts/install-common-deps.sh @@ -76,26 +76,22 @@ install_juice() { } download_build_live555() {( + git clone --depth 1 https://github.com/xanview/live555/ + cd live555 + if is_win; then - target=mingw + ./genMakefiles mingw PATH=/usr/bin:$PATH # ensure binutils ld is used (not lld) pacman -Sy --noconfirm binutils - elif [ "$(uname -s)" = Linux ]; then - export CXXFLAGS="-DXLOCALE_NOT_USED -fPIC" - target=linux - else - target=macosx - fi - - git clone https://github.com/xanview/live555/ - cd live555 - git checkout 35c375 - ./genMakefiles "$target" - - make -j "$(nproc)" - if is_win; then + make -j "$(nproc)" CXX="c++ -DNO_GETIFADDRS -DNO_OPENSSL" pacman -Rs --noconfirm binutils + elif [ "$(uname -s)" = Linux ]; then + ./genMakefiles linux-with-shared-libraries + make -j "$(nproc)" + else + ./genMakefiles macosx-no-openssl + make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -std=c++11" fi )} diff --git a/configure.ac b/configure.ac index 378ff6d75..d82ddfcff 100644 --- a/configure.ac +++ b/configure.ac @@ -1517,7 +1517,7 @@ livemedia_prefix=/usr AC_ARG_ENABLE(rtsp_server, [ --enable-rtsp-server enables RTSP server support (default is auto)] -[ Requires: live555 (<= 2015)], +[ Requires: live555], [rtsp_server_req=$enableval], [rtsp_server_req=$build_default] ) @@ -1533,15 +1533,7 @@ if test $rtsp_server_req != no; then RTSP_SERVER_FLAGS="-I$livemedia_prefix/include/groupsock -I$livemedia_prefix/include/liveMedia -I$livemedia_prefix/include/BasicUsageEnvironment -I$livemedia_prefix/include/UsageEnvironment" SAVED_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $RTSP_SERVER_FLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - #if LIVEMEDIA_LIBRARY_VERSION_INT > 1438905600 - #error "Unsuppored live555 version (too new)" - #endif - ]] - )], FOUND_LIVE_H=yes, [echo "liveMedia (live555 library) headers not found or wrong version (< 2015 needed)"; FOUND_LIVE_H=no]) + AC_CHECK_HEADER(liveMedia.hh, FOUND_LIVE_H=yes, FOUND_LIVE_H=no) CPPFLAGS=$SAVED_CPPFLAGS AC_LANG_POP(C++) if test $FOUND_LIVE_H = yes diff --git a/src/rtsp/BasicRTSPOnlySubsession.cpp b/src/rtsp/BasicRTSPOnlySubsession.cpp index 80789e7b6..ee706e245 100644 --- a/src/rtsp/BasicRTSPOnlySubsession.cpp +++ b/src/rtsp/BasicRTSPOnlySubsession.cpp @@ -87,7 +87,8 @@ BasicRTSPOnlySubsession::~BasicRTSPOnlySubsession() { delete Vdestination; } -char const* BasicRTSPOnlySubsession::sdpLines() { +char const* BasicRTSPOnlySubsession::sdpLines(int addressFamily) { + (void) addressFamily; if (fSDPLines == NULL) { setSDPLines(); } @@ -101,7 +102,7 @@ void BasicRTSPOnlySubsession::setSDPLines() { unsigned estBitrate = 5000; char const* mediaType = "video"; uint8_t rtpPayloadType = 96; - AddressString ipAddressStr(fServerAddressForSDP); + AddressString ipAddressStr(0); char* rtpmapLine = strdup("a=rtpmap:96 H264/90000\n"); //char const* auxSDPLine = ""; @@ -133,7 +134,7 @@ void BasicRTSPOnlySubsession::setSDPLines() { if (avType == audio || avType == av) { unsigned estBitrate = 384; char const* mediaType = "audio"; - AddressString ipAddressStr(fServerAddressForSDP); + AddressString ipAddressStr(0); char rtpmapLine[STR_LEN]; //char const* auxSDPLine = ""; @@ -167,10 +168,11 @@ void BasicRTSPOnlySubsession::setSDPLines() { } void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */, - netAddressBits clientAddress, Port const& clientRTPPort, + struct sockaddr_storage const &clientAddress, Port const& clientRTPPort, Port const& clientRTCPPort, int /* tcpSocketNum */, unsigned char /* rtpChannelId */, unsigned char /* rtcpChannelId */, - netAddressBits& destinationAddress, uint8_t& /*destinationTTL*/, + TLSState * /* tlsState */, + struct sockaddr_storage& /*destinationAddress*/, uint8_t& /*destinationTTL*/, Boolean& /* isMulticast */, Port& serverRTPPort, Port& serverRTCPPort, void*& /* streamToken */) { if (avType == video || avType == av) { @@ -182,11 +184,9 @@ void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */ if (fSDPLines == NULL) { setSDPLines(); } - if (destinationAddress == 0) { - destinationAddress = clientAddress; - } struct in_addr destinationAddr; - destinationAddr.s_addr = destinationAddress; + destinationAddr.s_addr = + ((const sockaddr_in *) &clientAddress)->sin_addr.s_addr; delete Vdestination; Vdestination = new Destinations(destinationAddr, clientRTPPort, clientRTCPPort); @@ -200,11 +200,9 @@ void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */ if (fSDPLines == NULL) { setSDPLines(); } - if (destinationAddress == 0) { - destinationAddress = clientAddress; - } struct in_addr destinationAddr; - destinationAddr.s_addr = destinationAddress; + destinationAddr.s_addr = + ((const sockaddr_in *) &clientAddress)->sin_addr.s_addr; delete Adestination; Adestination = new Destinations(destinationAddr, clientRTPPort, clientRTCPPort); diff --git a/src/rtsp/BasicRTSPOnlySubsession.hh b/src/rtsp/BasicRTSPOnlySubsession.hh index f68484013..c6cee5edf 100644 --- a/src/rtsp/BasicRTSPOnlySubsession.hh +++ b/src/rtsp/BasicRTSPOnlySubsession.hh @@ -48,6 +48,8 @@ #include #endif +#include + #include "rtsp/rtsp_utils.h" #include "audio/types.h" #include "module.h" @@ -102,16 +104,17 @@ protected: virtual ~BasicRTSPOnlySubsession(); - virtual char const* sdpLines(); + virtual char const* sdpLines(int addressFamily); virtual void getStreamParameters(unsigned clientSessionId, - netAddressBits clientAddress, + struct sockaddr_storage const &clientAddress, Port const& clientRTPPort, Port const& clientRTCPPort, int tcpSocketNum, unsigned char rtpChannelId, unsigned char rtcpChannelId, - netAddressBits& destinationAddress, + TLSState *tlsState, + struct sockaddr_storage &destinationAddress, uint8_t& destinationTTL, Boolean& isMulticast, Port& serverRTPPort, @@ -127,6 +130,15 @@ protected: virtual void deleteStream(unsigned clientSessionId, void*& streamToken); +#if LIVEMEDIA_LIBRARY_VERSION_INT >= 1701302400 // 2023.11.30 + void getRTPSinkandRTCP(void*, RTPSink*&, RTCPInstance*&) override {} +#else + void getRTPSinkandRTCP(void *, const RTPSink *&, + const RTCPInstance *&) override + { + } +#endif + protected: char* fSDPLines;