forked from aleksandrm8/live555
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodifications.patch
189 lines (183 loc) · 8 KB
/
modifications.patch
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
diff --exclude=.gitignore --exclude=.git -rupN live/README.md live555/README.md
--- live/README.md 1970-01-01 01:00:00.000000000 +0100
+++ live555/README.md 2014-04-09 07:58:41.000000000 +0100
@@ -0,0 +1,33 @@
+# 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 5 fold to 500000 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.
diff --exclude=.gitignore --exclude=.git -rupN live/liveMedia/MultiFramedRTPSource.cpp live555/liveMedia/MultiFramedRTPSource.cpp
--- live/liveMedia/MultiFramedRTPSource.cpp 2014-03-25 21:30:30.000000000 +0000
+++ live555/liveMedia/MultiFramedRTPSource.cpp 2014-04-09 08:00:05.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 --exclude=.gitignore --exclude=.git -rupN live/modifications.patch live555/modifications.patch
--- live/modifications.patch 1970-01-01 01:00:00.000000000 +0100
+++ live555/modifications.patch 2014-04-09 08:06:18.000000000 +0100
@@ -0,0 +1,49 @@
+diff --exclude=.gitignore --exclude=.git -rupN live/README.md live555/README.md
+--- live/README.md 1970-01-01 01:00:00.000000000 +0100
++++ live555/README.md 2014-04-09 07:58:41.000000000 +0100
+@@ -0,0 +1,33 @@
++# 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 5 fold to 500000 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.
+diff --exclude=.gitignore --exclude=.git -rupN live/liveMedia/MultiFramedRTPSource.cpp live555/liveMedia/MultiFramedRTPSource.cpp
+--- live/liveMedia/MultiFramedRTPSource.cpp 2014-03-25 21:30:30.000000000 +0000
++++ live555/liveMedia/MultiFramedRTPSource.cpp 2014-04-09 08:00:05.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 --exclude=.gitignore --exclude=.git -rupN live/proxyServer/live555ProxyServer.cpp live555/proxyServer/live555ProxyServer.cpp
--- live/proxyServer/live555ProxyServer.cpp 2014-03-25 21:30:30.000000000 +0000
+++ live555/proxyServer/live555ProxyServer.cpp 2014-04-09 08:00:58.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 = 500000; // bytes
// Begin by setting up our usage environment:
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
@@ -95,7 +97,7 @@ int main(int argc, char** argv) {
case 'T': {
// stream RTP and RTCP over a HTTP connection
if (argc > 3 && argv[2][0] != '-') {
- // The next argument is the HTTP server port number:
+ // The next argument is the HTTP server port number:
if (sscanf(argv[2], "%hu", &tunnelOverHTTPPortNum) == 1
&& tunnelOverHTTPPortNum > 0) {
++argv; --argc;
@@ -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];
@@ -140,7 +158,7 @@ int main(int argc, char** argv) {
++argv; --argc;
}
- if (argc < 2 && !proxyREGISTERRequests) usage(); // there must be at least one "rtsp://" URL at the end
+ if (argc < 2 && !proxyREGISTERRequests) usage(); // there must be at least one "rtsp://" URL at the end
// Make sure that the remaining arguments appear to be "rtsp://" URLs:
int i;
for (i = 1; i < argc; ++i) {
@@ -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);
}