forked from rgaufman/live555
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodifications.patch
More file actions
136 lines (129 loc) · 5.43 KB
/
modifications.patch
File metadata and controls
136 lines (129 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
diff -rupN live-orig/README.md live-new/README.md
--- live-orig/README.md 1970-01-01 01:00:00.000000000 +0100
+++ live-new/README.md 2015-05-22 21:42:28.000000000 +0100
@@ -0,0 +1,39 @@
+# Build Instructions
+
+For example:
+
+```bash
+./genMakefiles linux
+make -j4
+```
+
+Replace "linux" with your platform, e.g. avr32-linux, cygwin, freebsd, iphoneos, linux, linux-64bit, macosx, openbsd, solaris-64bit, etc (see config.PLATFORM files)
+
+You will find various executables:
+
+ * ./testProgs - contain various programs such as testRTSPClient to receive an RTSP stream
+ * ./proxyServer/live555ProxyServer - a great RTSP proxy server
+ * ./mediaServer/live555MediaServer - an RTSP media server for serving static files over RTSP
+
+# Changes to Master
+
+See modifications.patch to see exactly what was changed compared to vanilla.
+
+### Buffer sizes
+
+increaseReceiveBufferTo is increased to 2,000,000 bytes (same as VLC default) and
+OutPacketBuffer::maxSize is increased 10 fold to 1000000 in the ProxyServer. These
+2 changes make live555 work a hell of a lot better out of box.
+
+### -p option for proxyServer - allows specifying a listening port on the command line
+
+This was rejected from the mailing list, but often RTSPProxy fails to run on
+more than a few cameras with bad corruption, frames seeking back and forth and
+many other adverse side effects. Being able to run multiple instances listening
+on different ports is crucial.
+
+### Force port re-use
+
+When restarting live555ProxyServer, you are often greeted with a "Port Already in Use"
+error and forced to wait for the port to time out. Adding
+"define ALLOW_RTSP_SERVER_PORT_REUSE" to liveMedia/RTSPServer.cpp prevents this.
diff -rupN live-orig/liveMedia/MultiFramedRTPSource.cpp live-new/liveMedia/MultiFramedRTPSource.cpp
--- live-orig/liveMedia/MultiFramedRTPSource.cpp 2015-05-12 07:50:20.000000000 +0100
+++ live-new/liveMedia/MultiFramedRTPSource.cpp 2015-05-22 21:33:47.000000000 +0100
@@ -73,7 +73,7 @@ MultiFramedRTPSource
fReorderingBuffer = new ReorderingPacketBuffer(packetFactory);
// Try to use a big receive buffer for RTP:
- increaseReceiveBufferTo(env, RTPgs->socketNum(), 50*1024);
+ increaseReceiveBufferTo(env, RTPgs->socketNum(), 2000000);
}
void MultiFramedRTPSource::reset() {
diff -rupN live-orig/liveMedia/RTSPServer.cpp live-new/liveMedia/RTSPServer.cpp
--- live-orig/liveMedia/RTSPServer.cpp 2015-05-12 07:50:20.000000000 +0100
+++ live-new/liveMedia/RTSPServer.cpp 2015-05-22 21:33:47.000000000 +0100
@@ -25,6 +25,8 @@ along with this library; if not, write t
#include "Base64.hh"
#include <GroupsockHelper.hh>
+#define ALLOW_RTSP_SERVER_PORT_REUSE
+
////////// RTSPServer implementation //////////
RTSPServer*
diff -rupN live-orig/proxyServer/live555ProxyServer.cpp live-new/proxyServer/live555ProxyServer.cpp
--- live-orig/proxyServer/live555ProxyServer.cpp 2015-05-12 07:50:20.000000000 +0100
+++ live-new/proxyServer/live555ProxyServer.cpp 2015-05-22 21:33:47.000000000 +0100
@@ -29,6 +29,7 @@ UserAuthenticationDatabase* authDBForREG
int verbosityLevel = 0;
Boolean streamRTPOverTCP = False;
portNumBits tunnelOverHTTPPortNum = 0;
+portNumBits rtspServerPortNum = 554;
char* username = NULL;
char* password = NULL;
Boolean proxyREGISTERRequests = False;
@@ -47,6 +48,7 @@ void usage() {
*env << "Usage: " << progName
<< " [-v|-V]"
<< " [-t|-T <http-port>]"
+ << " [-p <rtsp-port>]"
<< " [-u <username> <password>]"
<< " [-R] [-U <username-for-REGISTER> <password-for-REGISTER>]"
<< " <rtsp-url-1> ... <rtsp-url-n>\n";
@@ -56,7 +58,7 @@ void usage() {
int main(int argc, char** argv) {
// Increase the maximum size of video frames that we can 'proxy' without truncation.
// (Such frames are unreasonably large; the back-end servers should really not be sending frames this large!)
- OutPacketBuffer::maxSize = 100000; // bytes
+ OutPacketBuffer::maxSize = 1000000; // bytes
// Begin by setting up our usage environment:
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
@@ -108,6 +110,22 @@ int main(int argc, char** argv) {
break;
}
+ case 'p': {
+ // set port
+ if (argc > 3 && argv[2][0] != '-') {
+ // The next argument is the RTSP server port number:
+ if (sscanf(argv[2], "%hu", &rtspServerPortNum) == 1
+ && rtspServerPortNum > 0) {
+ ++argv; --argc;
+ break;
+ }
+ }
+
+ // If we get here, the option was specified incorrectly:
+ usage();
+ break;
+ }
+
case 'u': { // specify a username and password (to be used if the 'back end' (i.e., proxied) stream requires authentication)
if (argc < 4) usage(); // there's no argv[3] (for the "password")
username = argv[2];
@@ -167,16 +185,10 @@ int main(int argc, char** argv) {
// Repeat this line with each <username>, <password> that you wish to allow access to the server.
#endif
- // Create the RTSP server. Try first with the default port number (554),
- // and then with the alternative port number (8554):
+ // Create the RTSP server with a specified port or the 554 default port
RTSPServer* rtspServer;
- portNumBits rtspServerPortNum = 554;
rtspServer = createRTSPServer(rtspServerPortNum);
if (rtspServer == NULL) {
- rtspServerPortNum = 8554;
- rtspServer = createRTSPServer(rtspServerPortNum);
- }
- if (rtspServer == NULL) {
*env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";
exit(1);
}