rtsp_server 0.0.3 → 0.0.4

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: 783ad8ca36979572a087b869a22583dec31dfe7e
4
- data.tar.gz: 42156099ccb1369858211185d2df201ad551d864
3
+ metadata.gz: e2e47197e6b28f0761ec7faf33a18d9924aa26b5
4
+ data.tar.gz: d5aeeffafe5493aa17087b045a79dbcdb6a7c47a
5
5
  SHA512:
6
- metadata.gz: 6182fbd29371b51cc517119160aaea998c78779aecc1efdd186bbf668efc2f7942893d7a6c0746cabd66d3f22734ac2f67cfcf1d01e0d001a1f918656c6d6128
7
- data.tar.gz: 2a854b637b8ad307a199b225a1276554bcc99bc7601e483267fab45d0e4943376492d594549a4c99c3dda7afa6c2feaa54901cd298507f9db2134f2cf471147d
6
+ metadata.gz: b3192fd082fe4f2c6372a468b309800bc1baf5a702cf1179f40f53a611babb76bfbea34f69b1fc3ec7dd1a7042ae3e171d7fef194f4386e04b90e9545bb8756d
7
+ data.tar.gz: 05c443abd96199f29b577489063c54670baf81932e985223738d3159d521e5b958371adf0acdc2ee9e11ab0983ff900ad30ec41eb0bd86a9d340063d8ef1ef92
data/lib/rtsp/common.rb CHANGED
@@ -62,7 +62,7 @@ module RTSP
62
62
  /client_port=(?<port>.*)-/ =~ transport
63
63
 
64
64
  if port.nil?
65
- log("Could not find client port associated with transport", :warn)
65
+ RTSP::Request.log("Could not find client port associated with transport", :warn)
66
66
  else
67
67
  "#{@remote_host}:#{port}"
68
68
  end
data/lib/rtsp/server.rb CHANGED
@@ -110,7 +110,7 @@ module RTSP
110
110
  remote_address = io.remote_address.ip_address
111
111
  /(?<action>.*) rtsp:\/\// =~ request_str
112
112
  request = RTSP::Request.new(request_str, remote_address)
113
- @agent[io] = request.user_agent
113
+ @agent[io] = request.user_agent rescue NoMethodError
114
114
  response, body = send(action.downcase.to_sym, request)
115
115
 
116
116
  add_headers(request, response, body)
@@ -292,8 +292,14 @@ module RTSP
292
292
  # @param [Fixnum] server_port Port on which the stream_server is streaming from.
293
293
  def generate_transport request, server_port, index=1
294
294
  port_specifier = 'client_port'
295
- transport = request.transport.split(port_specifier)
296
- transport[1] = port_specifier + transport[1]
295
+
296
+ if request.transport.include?(port_specifier)
297
+ transport = request.transport.split(port_specifier)
298
+ transport[1] = port_specifier + transport[1]
299
+ else
300
+ stream_port = RTSP::StreamServer.instance.source_port.first
301
+ transport = [request.transport + ';', "port=#{stream_port}-#{stream_port + 1}"]
302
+ end
297
303
 
298
304
  if request.transport.include?("unicast")
299
305
  transport[0] << "destination=#{request.remote_host};"
@@ -69,7 +69,7 @@ module RTSP
69
69
  # @param [Fixnum] index Stream index.
70
70
  # @return [Fixnum] The port the streamer will stream on.
71
71
  def setup_streamer(sid, transport_url, index=1, multicast=false)
72
- dest_ip, dest_port = transport_url.split ":"
72
+ dest_ip, dest_port = transport_url.split ":" unless multicast
73
73
 
74
74
  @rtcp_source_identifier ||= RTCP_SOURCE.pack("H*")
75
75
  local_port = multicast ? @source_port[index - 1] : free_port(true)
data/lib/rtsp/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module RTSP
2
2
  # rtsp version
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
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-19 00:00:00.000000000 Z
12
+ date: 2013-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parslet