rtsp_server 0.0.4-universal-java → 0.0.6-universal-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rtsp/server.rb +18 -9
- data/lib/rtsp/socat_streaming.rb +2 -2
- data/lib/rtsp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd2d5c99eddc854cd00f3ca817f21529050cbaf7
|
4
|
+
data.tar.gz: 58fee6187fa1e578745723518ea2e0374b063d07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 301618d21974506325f60cd897ef5517fe2fa246d23e730c372055b897d014155481739458a13fcc7d4ab874866d8d2e45378734656498acd7a7afdbb3967079
|
7
|
+
data.tar.gz: 1a7d5cf9fdd8d644132ea64aa2aa63d58ef26bbf9427a82f98f6b7190e85851d360864b0a8c0c64420a7663471f39145d51c4395e674dc3579d677d5c37fae45
|
data/lib/rtsp/server.rb
CHANGED
@@ -90,15 +90,22 @@ module RTSP
|
|
90
90
|
|
91
91
|
begin
|
92
92
|
request_str << io.read_nonblock(500)
|
93
|
-
rescue
|
94
|
-
return -1 if count > 50
|
93
|
+
rescue IO::WaitReadable
|
95
94
|
count += 1
|
96
|
-
sleep 0.
|
97
|
-
|
95
|
+
sleep 0.001
|
96
|
+
sleep 1 if count > 10
|
97
|
+
count = 0 unless request_str == ""
|
98
|
+
retry if count < 50
|
99
|
+
return -1 if request_str == ""
|
98
100
|
end
|
101
|
+
|
102
|
+
responses = []
|
99
103
|
|
100
|
-
|
101
|
-
|
104
|
+
request_str.split("\r\n\r\n").each do |r|
|
105
|
+
responses << process_request(r, io)
|
106
|
+
end
|
107
|
+
|
108
|
+
io.send(responses.join, 0)
|
102
109
|
end
|
103
110
|
|
104
111
|
# Process an RTSP request
|
@@ -229,8 +236,10 @@ module RTSP
|
|
229
236
|
RTSP::Server.log "Received TEARDOWN request from #{request.remote_host}"
|
230
237
|
sid = request.session[:session_id]
|
231
238
|
@stream_server.stop_streaming sid
|
239
|
+
response = []
|
240
|
+
response << "\r\n"
|
232
241
|
|
233
|
-
[
|
242
|
+
[response]
|
234
243
|
end
|
235
244
|
|
236
245
|
# Handles a pause request.
|
@@ -242,6 +251,7 @@ module RTSP
|
|
242
251
|
response = []
|
243
252
|
sid = request.session[:session_id]
|
244
253
|
response << "Session: #{sid}"
|
254
|
+
response << "\r\n"
|
245
255
|
@stream_server.disconnect sid
|
246
256
|
|
247
257
|
[response]
|
@@ -297,8 +307,7 @@ module RTSP
|
|
297
307
|
transport = request.transport.split(port_specifier)
|
298
308
|
transport[1] = port_specifier + transport[1]
|
299
309
|
else
|
300
|
-
|
301
|
-
transport = [request.transport + ';', "port=#{stream_port}-#{stream_port + 1}"]
|
310
|
+
transport = [request.transport + ';', "port=#{server_port}-#{server_port + 1}"]
|
302
311
|
end
|
303
312
|
|
304
313
|
if request.transport.include?("unicast")
|
data/lib/rtsp/socat_streaming.rb
CHANGED
@@ -128,7 +128,7 @@ module RTSP
|
|
128
128
|
#
|
129
129
|
# @param[Boolean] multicast True if the description is for a multicast stream.
|
130
130
|
# @param [Fixnum] stream_index Index of the stream type.
|
131
|
-
def description
|
131
|
+
def description(multicast=false, stream_index=1)
|
132
132
|
rtp_map = @rtp_map[stream_index - 1] || H264_RTP_MAP
|
133
133
|
fmtp = @fmtp[stream_index - 1] || H264_FMTP
|
134
134
|
|
@@ -143,7 +143,7 @@ a=type:broadcast\r
|
|
143
143
|
a=control:*\r
|
144
144
|
a=range:npt=0-\r
|
145
145
|
a=x-qt-text-nam:Session streamed by "Streaming Server"\r
|
146
|
-
a=x-qt-text-inf:
|
146
|
+
a=x-qt-text-inf:stream#{stream_index}#{multicast ? 'm' : ''}\r
|
147
147
|
m=video #{multicast ? @source_port[stream_index - 1] : 0} RTP/AVP 96\r
|
148
148
|
c=IN IP4 #{multicast ? "#{multicast_ip(stream_index)}/10" : "0.0.0.0"}\r
|
149
149
|
a=rtpmap:#{rtp_map}\r
|
data/lib/rtsp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rtsp_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: universal-java
|
6
6
|
authors:
|
7
7
|
- Steve Loveless, Mike Kirby
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parslet
|