Skip to content

Commit

Permalink
current live555 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Jan 10, 2024
1 parent 025a3b5 commit 4d7b9a0
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
5 changes: 2 additions & 3 deletions .github/scripts/Linux/install_others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ install_gpujpeg() {(
install_live555() {(
git clone https://github.com/xanview/live555/
cd live555
git checkout 35c375
./genMakefiles linux-64bit
make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -DXLOCALE_NOT_USED"
./genMakefiles linux-with-shared-libraries
make -j "$(nproc)"
sudo make install
)}

Expand Down
3 changes: 1 addition & 2 deletions .github/scripts/Windows/build_live555.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ cd /c
rm -rf live555
git clone https://github.com/xanview/live555/
cd live555
git checkout 35c375
./genMakefiles mingw

# ensure binutils ld is used (not lld)
pacman -Sy --noconfirm binutils
PATH=/usr/bin:$PATH

make -j "$(nproc)"
make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -DNO_GETIFADDRS -DNO_OPENSSL"
pacman -Rs --noconfirm binutils

6 changes: 3 additions & 3 deletions .github/scripts/macOS/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ install_ndi() {
install_live555() {
git clone https://github.com/xanview/live555/
cd live555
git checkout 35c375
./genMakefiles macosx
make -j "$(sysctl -n hw.ncpu)" install
./genMakefiles macosx-no-openssl
make -j "$(sysctl -n hw.ncpu)" install \
CPLUSPLUS_COMPILER="c++ -std=c++11"
cd ..
}

Expand Down
12 changes: 2 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,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]
)
Expand All @@ -1396,15 +1396,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 <liveMedia.hh>
#include <liveMedia_version.hh>
]], [[
#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
Expand Down
24 changes: 11 additions & 13 deletions src/rtsp/BasicRTSPOnlySubsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ BasicRTSPOnlySubsession::~BasicRTSPOnlySubsession() {
delete Vdestination;
}

char const* BasicRTSPOnlySubsession::sdpLines() {
char const* BasicRTSPOnlySubsession::sdpLines(int addressFamily) {
(void) addressFamily;
if (fSDPLines == NULL) {
setSDPLines();
}
Expand All @@ -99,7 +100,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 = "";

Expand Down Expand Up @@ -131,7 +132,7 @@ void BasicRTSPOnlySubsession::setSDPLines() {
if (avType == audio || avType == av) {
unsigned estBitrate = 384;
char const* mediaType = "audio";
AddressString ipAddressStr(fServerAddressForSDP);
AddressString ipAddressStr(0);
uint8_t rtpPayloadType;

if (audio_sample_rate == 8000 && audio_channels == 1) { //NOW NOT COMPUTING 1 BPS BECAUSE RESAMPLER FORCES TO 2 BPS...
Expand Down Expand Up @@ -181,10 +182,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) {
Expand All @@ -196,11 +198,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);
Expand All @@ -214,11 +214,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);
Expand Down
18 changes: 15 additions & 3 deletions src/rtsp/BasicRTSPOnlySubsession.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include <ServerMediaSession.hh>
#endif

#include <liveMedia_version.hh>

#include "rtsp/rtsp_utils.h"
#include "audio/types.h"
#include "module.h"
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit 4d7b9a0

Please sign in to comment.