rtsp_server 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2e47197e6b28f0761ec7faf33a18d9924aa26b5
4
- data.tar.gz: d5aeeffafe5493aa17087b045a79dbcdb6a7c47a
3
+ metadata.gz: df5443ff82faa1499e38e8d5f5a09c8255d3ebe7
4
+ data.tar.gz: 8c317116787c5e0222389b8ba73b97fba4413ffb
5
5
  SHA512:
6
- metadata.gz: b3192fd082fe4f2c6372a468b309800bc1baf5a702cf1179f40f53a611babb76bfbea34f69b1fc3ec7dd1a7042ae3e171d7fef194f4386e04b90e9545bb8756d
7
- data.tar.gz: 05c443abd96199f29b577489063c54670baf81932e985223738d3159d521e5b958371adf0acdc2ee9e11ab0983ff900ad30ec41eb0bd86a9d340063d8ef1ef92
6
+ metadata.gz: e4435667c4132eae51e487d709720628ede839b7dbafa9d00575654144d1a0e4b33a535f9e1bb40b6202b48bf2a9b85c09ff0de6a2447721d569611c8d70bec0
7
+ data.tar.gz: 7c7c300939245e32ea545df524dd846e7674718d26de522abf315d18d802b34ac28f46fa0138e8a3fd3c21ac419bfaa3b39569aeb20cefce0ccfa87933888cf1
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 Errno::EAGAIN
94
- return -1 if count > 50
93
+ rescue IO::WaitReadable
95
94
  count += 1
96
- sleep 0.01
97
- retry
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
- response = process_request(request_str, io)
101
- io.send(response, 0)
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]
@@ -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 multicast=false, stream_index=1
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:stream1#{multicast ? 'm' : ''}\r
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
@@ -1,4 +1,4 @@
1
1
  module RTSP
2
2
  # rtsp version
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
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
4
+ version: 0.0.5
5
5
  platform: ruby
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: 2013-12-20 00:00:00.000000000 Z
12
+ date: 2014-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parslet
@@ -194,48 +194,48 @@ extra_rdoc_files:
194
194
  - LICENSE.rdoc
195
195
  - README.rdoc
196
196
  files:
197
- - lib/rtsp.rb
197
+ - .gemtest
198
+ - ChangeLog.rdoc
199
+ - Gemfile
200
+ - LICENSE.rdoc
201
+ - README.rdoc
202
+ - Rakefile
203
+ - bin/rtsp_client
204
+ - features/client_changes_state.feature
205
+ - features/client_requests.feature
206
+ - features/control_streams_as_client.feature
207
+ - features/step_definitions/client_changes_state_steps.rb
208
+ - features/step_definitions/client_requests_steps.rb
209
+ - features/step_definitions/control_streams_as_client_steps.rb
210
+ - features/support/env.rb
211
+ - features/support/hooks.rb
198
212
  - lib/ext/logger.rb
199
- - lib/rtsp/error.rb
200
- - lib/rtsp/socat_streaming.rb
201
- - lib/rtsp/transport_parser.rb
202
- - lib/rtsp/message.rb
203
- - lib/rtsp/stream_server.rb
204
- - lib/rtsp/helpers.rb
205
- - lib/rtsp/global.rb
206
- - lib/rtsp/server.rb
213
+ - lib/rtsp.rb
207
214
  - lib/rtsp/client.rb
208
215
  - lib/rtsp/common.rb
216
+ - lib/rtsp/error.rb
217
+ - lib/rtsp/global.rb
218
+ - lib/rtsp/helpers.rb
219
+ - lib/rtsp/message.rb
209
220
  - lib/rtsp/request.rb
210
- - lib/rtsp/version.rb
211
221
  - lib/rtsp/response.rb
212
- - bin/rtsp_client
213
- - spec/rtsp_spec.rb
214
- - spec/spec_helper.rb
215
- - spec/support/fake_rtsp_server.rb
216
- - spec/rtsp/message_spec.rb
222
+ - lib/rtsp/server.rb
223
+ - lib/rtsp/socat_streaming.rb
224
+ - lib/rtsp/stream_server.rb
225
+ - lib/rtsp/transport_parser.rb
226
+ - lib/rtsp/version.rb
227
+ - rtsp.gemspec
228
+ - spec/rtsp/client_spec.rb
217
229
  - spec/rtsp/helpers_spec.rb
230
+ - spec/rtsp/message_spec.rb
218
231
  - spec/rtsp/response_spec.rb
219
- - spec/rtsp/client_spec.rb
220
232
  - spec/rtsp/transport_parser_spec.rb
221
- - tasks/stats.rake
233
+ - spec/rtsp_spec.rb
234
+ - spec/spec_helper.rb
235
+ - spec/support/fake_rtsp_server.rb
222
236
  - tasks/roodi.rake
223
237
  - tasks/roodi_config.yaml
224
- - LICENSE.rdoc
225
- - ChangeLog.rdoc
226
- - README.rdoc
227
- - .gemtest
228
- - rtsp.gemspec
229
- - Gemfile
230
- - Rakefile
231
- - features/client_requests.feature
232
- - features/client_changes_state.feature
233
- - features/step_definitions/client_changes_state_steps.rb
234
- - features/step_definitions/control_streams_as_client_steps.rb
235
- - features/step_definitions/client_requests_steps.rb
236
- - features/support/env.rb
237
- - features/support/hooks.rb
238
- - features/control_streams_as_client.feature
238
+ - tasks/stats.rake
239
239
  homepage: https://github.com/turboladen/rtsp
240
240
  licenses:
241
241
  - MIT
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  requirements: []
258
258
  rubyforge_project:
259
- rubygems_version: 2.0.3
259
+ rubygems_version: 2.2.1
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Library to allow RTSP streaming from RTSP-enabled devices.