Skip to content

Commit ceeb4f4

Browse files
author
Roman Gaufman
committed
Bump to version 2018.08.28
1 parent 7f998f3 commit ceeb4f4

20 files changed

+330
-27
lines changed

BasicUsageEnvironment/include/BasicUsageEnvironment_version.hh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifndef _BASICUSAGEENVIRONMENT_VERSION_HH
55
#define _BASICUSAGEENVIRONMENT_VERSION_HH
66

7-
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2018.04.25"
8-
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1524614400
7+
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2018.08.28"
8+
#define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1535414400
99

1010
#endif

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ You will find various executables:
1515

1616
# Changes to Master
1717

18-
See modifications.patch to see exactly what was changed compared to vanilla.
19-
2018
### Buffer sizes
21-
2219
OutPacketBuffer::maxSize is increased to 2,000,000 bytes which makes live555 work better with buggy IP cameras.
2320

2421
### Force port re-use
25-
2622
Added -DALLOW_RTSP_SERVER_PORT_REUSE=1 to force reusing existing port (e.g. when restarting the proxy). Please ensure
2723
you never run multiple instances of the proxy on the same port!
24+
25+
### Quit on TCP Errors
26+
liveMedia/RTCP.cpp#422 is changed to exit(1); - this ensures that live555 does not flood the screen and/or log with:
27+
The remote endpoint is using a buggy implementation of RTP/RTCP-over-TCP. Please upgrade it!
28+
29+
### Add -d option
30+
See Proxyserver_check_interPacketGap_2017.01.26.patch - This allows specifying a number of seconds of inactivity
31+
before timing out the connection.

UsageEnvironment/include/UsageEnvironment_version.hh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifndef _USAGEENVIRONMENT_VERSION_HH
55
#define _USAGEENVIRONMENT_VERSION_HH
66

7-
#define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2018.04.25"
8-
#define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1524614400
7+
#define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2018.08.28"
8+
#define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1535414400
99

1010
#endif

config.linux-with-shared-libraries

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# At least one interface changes, or is removed => CURRENT += 1; REVISION = 0; AGE = 0
44
# One or more interfaces were added, but no existing interfaces were changed or removed => CURRENT += 1; REVISION = 0; AGE += 1
55

6-
libliveMedia_VERSION_CURRENT=62
7-
libliveMedia_VERSION_REVISION=5
8-
libliveMedia_VERSION_AGE=0
6+
libliveMedia_VERSION_CURRENT=63
7+
libliveMedia_VERSION_REVISION=3
8+
libliveMedia_VERSION_AGE=1
99
libliveMedia_LIB_SUFFIX=so.$(shell expr $(libliveMedia_VERSION_CURRENT) - $(libliveMedia_VERSION_AGE)).$(libliveMedia_VERSION_AGE).$(libliveMedia_VERSION_REVISION)
1010

1111
libBasicUsageEnvironment_VERSION_CURRENT=1
@@ -18,9 +18,9 @@ libUsageEnvironment_VERSION_REVISION=0
1818
libUsageEnvironment_VERSION_AGE=1
1919
libUsageEnvironment_LIB_SUFFIX=so.$(shell expr $(libUsageEnvironment_VERSION_CURRENT) - $(libUsageEnvironment_VERSION_AGE)).$(libUsageEnvironment_VERSION_AGE).$(libUsageEnvironment_VERSION_REVISION)
2020

21-
libgroupsock_VERSION_CURRENT=9
21+
libgroupsock_VERSION_CURRENT=10
2222
libgroupsock_VERSION_REVISION=1
23-
libgroupsock_VERSION_AGE=1
23+
libgroupsock_VERSION_AGE=2
2424
libgroupsock_LIB_SUFFIX=so.$(shell expr $(libgroupsock_VERSION_CURRENT) - $(libgroupsock_VERSION_AGE)).$(libgroupsock_VERSION_AGE).$(libgroupsock_VERSION_REVISION)
2525
#####
2626

groupsock/GroupsockHelper.cpp

+44-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ extern "C" int initializeWinsockIfNecessary();
2727
#include <stdarg.h>
2828
#include <time.h>
2929
#include <sys/time.h>
30+
#if !defined(_WIN32)
31+
#include <netinet/tcp.h>
32+
#endif
3033
#include <fcntl.h>
3134
#define initializeWinsockIfNecessary() 1
3235
#endif
@@ -217,8 +220,38 @@ Boolean makeSocketBlocking(int sock, unsigned writeTimeoutInMilliseconds) {
217220
return result;
218221
}
219222

223+
Boolean setSocketKeepAlive(int sock) {
224+
#if defined(__WIN32__) || defined(_WIN32)
225+
// How do we do this in Windows? For now, just make this a no-op in Windows:
226+
#else
227+
int const keepalive_enabled = 1;
228+
if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void*)&keepalive_enabled, sizeof keepalive_enabled) < 0) {
229+
return False;
230+
}
231+
232+
#ifdef TCP_KEEPIDLE
233+
int const keepalive_time = 180;
234+
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, (void*)&keepalive_time, sizeof keepalive_time) < 0) {
235+
return False;
236+
}
237+
#endif
238+
239+
int const keepalive_count = 5;
240+
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, (void*)&keepalive_count, sizeof keepalive_count) < 0) {
241+
return False;
242+
}
243+
244+
int const keepalive_interval = 20;
245+
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL, (void*)&keepalive_interval, sizeof keepalive_interval) < 0) {
246+
return False;
247+
}
248+
#endif
249+
250+
return True;
251+
}
252+
220253
int setupStreamSocket(UsageEnvironment& env,
221-
Port port, Boolean makeNonBlocking) {
254+
Port port, Boolean makeNonBlocking, Boolean setKeepAlive) {
222255
if (!initializeWinsockIfNecessary()) {
223256
socketErr(env, "Failed to initialize 'winsock': ");
224257
return -1;
@@ -284,6 +317,16 @@ int setupStreamSocket(UsageEnvironment& env,
284317
}
285318
}
286319

320+
// Set the keep alive mechanism for the TCP socket, to avoid "ghost sockets"
321+
// that remain after an interrupted communication.
322+
if (setKeepAlive) {
323+
if (!setSocketKeepAlive(newSocket)) {
324+
socketErr(env, "failed to set keep alive: ");
325+
closeSocket(newSocket);
326+
return -1;
327+
}
328+
}
329+
287330
return newSocket;
288331
}
289332

groupsock/include/GroupsockHelper.hh

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ along with this library; if not, write to the Free Software Foundation, Inc.,
2727

2828
int setupDatagramSocket(UsageEnvironment& env, Port port);
2929
int setupStreamSocket(UsageEnvironment& env,
30-
Port port, Boolean makeNonBlocking = True);
30+
Port port, Boolean makeNonBlocking = True, Boolean setKeepAlive = False);
3131

3232
int readSocket(UsageEnvironment& env,
3333
int socket, unsigned char* buffer, unsigned bufferSize,
@@ -59,6 +59,7 @@ unsigned increaseReceiveBufferTo(UsageEnvironment& env,
5959
Boolean makeSocketNonBlocking(int sock);
6060
Boolean makeSocketBlocking(int sock, unsigned writeTimeoutInMilliseconds = 0);
6161
// A "writeTimeoutInMilliseconds" value of 0 means: Don't timeout
62+
Boolean setSocketKeepAlive(int sock);
6263

6364
Boolean socketJoinGroup(UsageEnvironment& env, int socket,
6465
netAddressBits groupAddress);

groupsock/include/groupsock_version.hh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifndef _GROUPSOCK_VERSION_HH
55
#define _GROUPSOCK_VERSION_HH
66

7-
#define GROUPSOCK_LIBRARY_VERSION_STRING "2018.04.25"
8-
#define GROUPSOCK_LIBRARY_VERSION_INT 1524614400
7+
#define GROUPSOCK_LIBRARY_VERSION_STRING "2018.08.28"
8+
#define GROUPSOCK_LIBRARY_VERSION_INT 1535414400
99

1010
#endif

liveMedia/GenericMediaServer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int GenericMediaServer::setUpOurSocket(UsageEnvironment& env, Port& ourPort) {
149149
NoReuse dummy(env); // Don't use this socket if there's already a local server using it
150150
#endif
151151

152-
ourSocket = setupStreamSocket(env, ourPort);
152+
ourSocket = setupStreamSocket(env, ourPort, True, True);
153153
if (ourSocket < 0) break;
154154

155155
// Make sure we have a big send buffer:

liveMedia/Makefile.tail

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ MISC_SINK_OBJS = MediaSink.$(OBJ) FileSink.$(OBJ) BasicUDPSink.$(OBJ) AMRAudioFi
2727
MISC_FILTER_OBJS = uLawAudioFilter.$(OBJ)
2828
TRANSPORT_STREAM_TRICK_PLAY_OBJS = MPEG2IndexFromTransportStream.$(OBJ) MPEG2TransportStreamIndexFile.$(OBJ) MPEG2TransportStreamTrickModeFilter.$(OBJ)
2929

30-
RTP_SOURCE_OBJS = RTPSource.$(OBJ) MultiFramedRTPSource.$(OBJ) SimpleRTPSource.$(OBJ) H261VideoRTPSource.$(OBJ) H264VideoRTPSource.$(OBJ) H265VideoRTPSource.$(OBJ) QCELPAudioRTPSource.$(OBJ) AMRAudioRTPSource.$(OBJ) JPEGVideoRTPSource.$(OBJ) VorbisAudioRTPSource.$(OBJ) TheoraVideoRTPSource.$(OBJ) VP8VideoRTPSource.$(OBJ) VP9VideoRTPSource.$(OBJ)
30+
RTP_SOURCE_OBJS = RTPSource.$(OBJ) MultiFramedRTPSource.$(OBJ) SimpleRTPSource.$(OBJ) H261VideoRTPSource.$(OBJ) H264VideoRTPSource.$(OBJ) H265VideoRTPSource.$(OBJ) QCELPAudioRTPSource.$(OBJ) AMRAudioRTPSource.$(OBJ) JPEGVideoRTPSource.$(OBJ) VorbisAudioRTPSource.$(OBJ) TheoraVideoRTPSource.$(OBJ) VP8VideoRTPSource.$(OBJ) VP9VideoRTPSource.$(OBJ) RawVideoRTPSource.$(OBJ)
3131
RTP_SINK_OBJS = RTPSink.$(OBJ) MultiFramedRTPSink.$(OBJ) AudioRTPSink.$(OBJ) VideoRTPSink.$(OBJ) TextRTPSink.$(OBJ)
3232
RTP_INTERFACE_OBJS = RTPInterface.$(OBJ)
3333
RTP_OBJS = $(RTP_SOURCE_OBJS) $(RTP_SINK_OBJS) $(RTP_INTERFACE_OBJS)
@@ -98,6 +98,8 @@ VP8VideoRTPSource.$(CPP): include/VP8VideoRTPSource.hh
9898
include/VP8VideoRTPSource.hh: include/MultiFramedRTPSource.hh
9999
VP9VideoRTPSource.$(CPP): include/VP9VideoRTPSource.hh
100100
include/VP9VideoRTPSource.hh: include/MultiFramedRTPSource.hh
101+
RawVideoRTPSource.$(CPP): include/RawVideoRTPSource.hh
102+
include/RawVideoRTPSource.hh: include/MultiFramedRTPSource.hh
101103
ByteStreamFileSource.$(CPP): include/ByteStreamFileSource.hh include/InputFile.hh
102104
include/ByteStreamFileSource.hh: include/FramedFileSource.hh
103105
ByteStreamMultiFileSource.$(CPP): include/ByteStreamMultiFileSource.hh
@@ -383,7 +385,7 @@ ourMD5.$(CPP): include/ourMD5.hh
383385
Base64.$(CPP): include/Base64.hh
384386
Locale.$(CPP): include/Locale.hh
385387

386-
include/liveMedia.hh:: include/MPEG1or2AudioRTPSink.hh include/MP3ADURTPSink.hh include/MPEG1or2VideoRTPSink.hh include/MPEG4ESVideoRTPSink.hh include/BasicUDPSink.hh include/AMRAudioFileSink.hh include/H264VideoFileSink.hh include/H265VideoFileSink.hh include/OggFileSink.hh include/GSMAudioRTPSink.hh include/H263plusVideoRTPSink.hh include/H264VideoRTPSink.hh include/H265VideoRTPSink.hh include/DVVideoRTPSource.hh include/DVVideoRTPSink.hh include/DVVideoStreamFramer.hh include/H264VideoStreamFramer.hh include/H265VideoStreamFramer.hh include/H264VideoStreamDiscreteFramer.hh include/H265VideoStreamDiscreteFramer.hh include/JPEGVideoRTPSink.hh include/SimpleRTPSink.hh include/uLawAudioFilter.hh include/MPEG2IndexFromTransportStream.hh include/MPEG2TransportStreamTrickModeFilter.hh include/ByteStreamMultiFileSource.hh include/ByteStreamMemoryBufferSource.hh include/BasicUDPSource.hh include/SimpleRTPSource.hh include/MPEG1or2AudioRTPSource.hh include/MPEG4LATMAudioRTPSource.hh include/MPEG4LATMAudioRTPSink.hh include/MPEG4ESVideoRTPSource.hh include/MPEG4GenericRTPSource.hh include/MP3ADURTPSource.hh include/QCELPAudioRTPSource.hh include/AMRAudioRTPSource.hh include/JPEGVideoRTPSource.hh include/JPEGVideoSource.hh include/MPEG1or2VideoRTPSource.hh include/VorbisAudioRTPSource.hh include/TheoraVideoRTPSource.hh include/VP8VideoRTPSource.hh include/VP9VideoRTPSource.hh
388+
include/liveMedia.hh:: include/MPEG1or2AudioRTPSink.hh include/MP3ADURTPSink.hh include/MPEG1or2VideoRTPSink.hh include/MPEG4ESVideoRTPSink.hh include/BasicUDPSink.hh include/AMRAudioFileSink.hh include/H264VideoFileSink.hh include/H265VideoFileSink.hh include/OggFileSink.hh include/GSMAudioRTPSink.hh include/H263plusVideoRTPSink.hh include/H264VideoRTPSink.hh include/H265VideoRTPSink.hh include/DVVideoRTPSource.hh include/DVVideoRTPSink.hh include/DVVideoStreamFramer.hh include/H264VideoStreamFramer.hh include/H265VideoStreamFramer.hh include/H264VideoStreamDiscreteFramer.hh include/H265VideoStreamDiscreteFramer.hh include/JPEGVideoRTPSink.hh include/SimpleRTPSink.hh include/uLawAudioFilter.hh include/MPEG2IndexFromTransportStream.hh include/MPEG2TransportStreamTrickModeFilter.hh include/ByteStreamMultiFileSource.hh include/ByteStreamMemoryBufferSource.hh include/BasicUDPSource.hh include/SimpleRTPSource.hh include/MPEG1or2AudioRTPSource.hh include/MPEG4LATMAudioRTPSource.hh include/MPEG4LATMAudioRTPSink.hh include/MPEG4ESVideoRTPSource.hh include/MPEG4GenericRTPSource.hh include/MP3ADURTPSource.hh include/QCELPAudioRTPSource.hh include/AMRAudioRTPSource.hh include/JPEGVideoRTPSource.hh include/JPEGVideoSource.hh include/MPEG1or2VideoRTPSource.hh include/VorbisAudioRTPSource.hh include/TheoraVideoRTPSource.hh include/VP8VideoRTPSource.hh include/VP9VideoRTPSource.hh include/RawVideoRTPSource.hh
387389

388390
include/liveMedia.hh:: include/MPEG2TransportStreamFromPESSource.hh include/MPEG2TransportStreamFromESSource.hh include/MPEG2TransportStreamFramer.hh include/ADTSAudioFileSource.hh include/H261VideoRTPSource.hh include/H263plusVideoRTPSource.hh include/H264VideoRTPSource.hh include/H265VideoRTPSource.hh include/MP3FileSource.hh include/MP3ADU.hh include/MP3ADUinterleaving.hh include/MP3Transcoder.hh include/MPEG1or2DemuxedElementaryStream.hh include/MPEG1or2AudioStreamFramer.hh include/MPEG1or2VideoStreamDiscreteFramer.hh include/MPEG4VideoStreamDiscreteFramer.hh include/H263plusVideoStreamFramer.hh include/AC3AudioStreamFramer.hh include/AC3AudioRTPSource.hh include/AC3AudioRTPSink.hh include/VorbisAudioRTPSink.hh include/TheoraVideoRTPSink.hh include/VP8VideoRTPSink.hh include/VP9VideoRTPSink.hh include/MPEG4GenericRTPSink.hh include/DeviceSource.hh include/AudioInputDevice.hh include/WAVAudioFileSource.hh include/StreamReplicator.hh include/RTSPRegisterSender.hh
389391

liveMedia/MediaSession.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,9 @@ Boolean MediaSubsession::createSourceObjects(int useSpecialRTPoffset) {
12671267
} else if (strcmp(fCodecName, "THEORA") == 0) { // Theora video
12681268
fReadSource = fRTPSource
12691269
= TheoraVideoRTPSource::createNew(env(), fRTPSocket, fRTPPayloadFormat);
1270+
} else if (strcmp(fCodecName, "RAW") == 0) { // Uncompressed raw video (RFC 4175)
1271+
fReadSource = fRTPSource
1272+
= RawVideoRTPSource::createNew(env(), fRTPSocket, fRTPPayloadFormat, fRTPTimestampFrequency);
12701273
} else if (strcmp(fCodecName, "VP8") == 0) { // VP8 video
12711274
fReadSource = fRTPSource
12721275
= VP8VideoRTPSource::createNew(env(), fRTPSocket,

liveMedia/RTCP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void RTCPInstance::incomingReportHandler1() {
419419
envir() << "RTCPInstance error: Hit limit when reading incoming packet over TCP. (fNumBytesAlreadyRead ("
420420
<< fNumBytesAlreadyRead << ") >= maxRTCPPacketSize (" << maxRTCPPacketSize
421421
<< ")). The remote endpoint is using a buggy implementation of RTP/RTCP-over-TCP. Please upgrade it!\n";
422-
break;
422+
exit(1);
423423
}
424424

425425
unsigned numBytesRead;

liveMedia/RTSPServer.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ void RTSPServer::RTSPClientConnection::handleRequestBytes(int newBytesRead) {
699699
char cseq[RTSP_PARAM_STRING_MAX];
700700
char sessionIdStr[RTSP_PARAM_STRING_MAX];
701701
unsigned contentLength = 0;
702+
Boolean playAfterSetup = False;
702703
fLastCRLF[2] = '\0'; // temporarily, for parsing
703704
Boolean parseSucceeded = parseRTSPRequestString((char*)fRequestBuffer, fLastCRLF+2 - fRequestBuffer,
704705
cmdName, sizeof cmdName,
@@ -708,7 +709,13 @@ void RTSPServer::RTSPClientConnection::handleRequestBytes(int newBytesRead) {
708709
sessionIdStr, sizeof sessionIdStr,
709710
contentLength);
710711
fLastCRLF[2] = '\r'; // restore its value
711-
Boolean playAfterSetup = False;
712+
// Check first for a bogus "Content-Length" value that would cause a pointer wraparound:
713+
if (tmpPtr + 2 + contentLength < tmpPtr + 2) {
714+
#ifdef DEBUG
715+
fprintf(stderr, "parseRTSPRequestString() returned a bogus \"Content-Length:\" value: 0x%x (%d)\n", contentLength, (int)contentLength);
716+
#endif
717+
parseSucceeded = False;
718+
}
712719
if (parseSucceeded) {
713720
#ifdef DEBUG
714721
fprintf(stderr, "parseRTSPRequestString() succeeded, returning cmdName \"%s\", urlPreSuffix \"%s\", urlSuffix \"%s\", CSeq \"%s\", Content-Length %u, with %d bytes following the message.\n", cmdName, urlPreSuffix, urlSuffix, cseq, contentLength, ptr + newBytesRead - (tmpPtr + 2));

0 commit comments

Comments
 (0)