<commit_before>= rtsp

* https://github.com/turboladen/rtsp

== DESCRIPTION:

This library intends to follow the RTSP RFC document (2326) to allow for working
with RTSP servers.  At this point, it's up to you to parse the data from a play
call, but we'll get there.  ...eventually.

For more information

RTSP: http://www.ietf.org/rfc/rfc2326.txt

SDP: http://tools.ietf.org/html/rfc4566

== FEATURES/PROBLEMS:

* All standard RTSP methods supported
* Captures RTP data to a file, but doesn't ensure RTP sequencing before putting to file
* Currently, only unicast

== SYNOPSIS:

The uber-quick get started:

  RTSP::Client.log?                # => true
  RTSP::Client.log = false
  client = RTSP::Client.new "192.168.127.12/sa.sdp" do |connection, capturer|
    connection.timeout = 5
    capturer.rtp_port = 8554
    capturer.rtp_file = File.open("captured_stuff.rtp", "wb")
  end
  
  client.server_uri                   # => #<URI::Generic:0x00000100ba4db0 URL:rtsp://192.168.127.12:554/sa.sdp>
  client.session_state                # => :init
  client.cseq                         # => 1
  client.connection.do_capture        # => true
  client.connection.interleave        # => false
  client.connection.timeout           # => 5
  client.capturer.broadcast_type      # => :unicast
  client.capturer.rtp_port            # => 8554
  client.capturer.rtp_file            # => #<File:captured_stuff.rtp>
  client.capturer.transport_protocol  # => :UDP
  
  response = client.options
  response.class             # => RTSP::Response
  response.code              # => 200
  response.message           # => "OK"
  client.cseq                # => 2
  
  response = client.describe
  response.body.class             # => SDP::Description
  response.content_type           # => "application/sdp"
  response.server                 # => "DSS/5.5 (Build/489.7; Platform/Linux; Release/Darwin; )"
  client.aggregate_control_track  # => "rtsp://192.168.127.12:554/sa.sdp/"
  client.media_control_tracks     # => ["rtsp://192.168.127.12:554/sa.sdp/trackID=1"]
  client.cseq                     # => 3
  
  response = client.setup(client.media_control_tracks.first)
  response.session          # => 7098486223178290313
  client.session            # => 7098486223178290313
  client.cseq               # => 4
  client.session_state      # => :ready


  response = client.play(client.aggregate_control_track)
  response.range            # => "npt=now="
  resposne.rtp_info         # => "url=rtsp://192.168.127.12:554/sa.sdp/trackID=1"
  client.session_state      # => :playing

  # Wait while the video streams
  sleep 5

  client.pause(client.aggregate_control_track)
  client.session_state    # => :ready

  # Wait while the video is paused
  sleep 2

  client.teardown(client.aggregate_control_track)
  client.session            # => 0
  client.session_state      # => :init

== REQUIREMENTS:

* (Tested) Rubies
  * 1.9.2-p180
* RubyGems
  * sdp, '~> 0.2.2'
* RubyGems (development)
  * ore-core, '~> 0.1.0'
  * jeweler, '~> 1.5.0'
  * ore-tasks, '~> 0.3.0'
  * yard, '~> 0.6.0'
  * metric_fu
  * code_statistics, '~> 0.2.13'

== INSTALL:

* (sudo) gem install rtsp

== DEVELOPERS:

After checking out the source, run:

  $ bundle install

This task will install any missing dependencies.

== LICENSE:

(The MIT License)

Copyright (c) 2011 <NAME>, <NAME><commit_msg>Added access to the captured file<commit_after>= rtsp

* https://github.com/turboladen/rtsp

== DESCRIPTION:

This library intends to follow the RTSP RFC document (2326) to allow for working
with RTSP servers.  At this point, it's up to you to parse the data from a play
call, but we'll get there.  ...eventually.

For more information

RTSP: http://www.ietf.org/rfc/rfc2326.txt

SDP: http://tools.ietf.org/html/rfc4566

== FEATURES/PROBLEMS:

* All standard RTSP methods supported
* Captures RTP data to a file, but doesn't ensure RTP sequencing before putting to file
* Currently, only unicast

== SYNOPSIS:

The uber-quick get started:

  RTSP::Client.log?                # => true
  RTSP::Client.log = false
  client = RTSP::Client.new "192.168.127.12/sa.sdp" do |connection, capturer|
    connection.timeout = 5
    capturer.rtp_port = 8554
    capturer.rtp_file = File.open("captured_stuff.rtp", "wb")
  end
  
  client.server_uri                   # => #<URI::Generic:0x00000100ba4db0 URL:rtsp://192.168.127.12:554/sa.sdp>
  client.session_state                # => :init
  client.cseq                         # => 1
  client.connection.do_capture        # => true
  client.connection.interleave        # => false
  client.connection.timeout           # => 5
  client.capturer.broadcast_type      # => :unicast
  client.capturer.rtp_port            # => 8554
  client.capturer.rtp_file            # => #<File:captured_stuff.rtp>
  client.capturer.transport_protocol  # => :UDP
  
  response = client.options
  response.class             # => RTSP::Response
  response.code              # => 200
  response.message           # => "OK"
  client.cseq                # => 2
  
  response = client.describe
  response.body.class             # => SDP::Description
  response.content_type           # => "application/sdp"
  response.server                 # => "DSS/5.5 (Build/489.7; Platform/Linux; Release/Darwin; )"
  client.aggregate_control_track  # => "rtsp://192.168.127.12:554/sa.sdp/"
  client.media_control_tracks     # => ["rtsp://192.168.127.12:554/sa.sdp/trackID=1"]
  client.cseq                     # => 3
  
  response = client.setup(client.media_control_tracks.first)
  response.session          # => 7098486223178290313
  client.session            # => 7098486223178290313
  client.cseq               # => 4
  client.session_state      # => :ready


  response = client.play(client.aggregate_control_track)
  response.range            # => "npt=now="
  resposne.rtp_info         # => "url=rtsp://192.168.127.12:554/sa.sdp/trackID=1"
  client.session_state      # => :playing

  # Wait while the video streams
  sleep 5

  client.pause(client.aggregate_control_track)
  client.session_state    # => :ready

  # Wait while the video is paused
  sleep 2

  client.teardown(client.aggregate_control_track)
  client.session            # => 0
  client.session_state      # => :init

  # Check the streamed file's contents
  puts client.capturer.rtp_file     # => (Lots of data)

== REQUIREMENTS:

* (Tested) Rubies
  * 1.9.2-p180
* RubyGems
  * sdp, '~> 0.2.2'
* RubyGems (development)
  * ore-core, '~> 0.1.0'
  * jeweler, '~> 1.5.0'
  * ore-tasks, '~> 0.3.0'
  * yard, '~> 0.6.0'
  * metric_fu
  * code_statistics, '~> 0.2.13'

== INSTALL:

* (sudo) gem install rtsp

== DEVELOPERS:

After checking out the source, run:

  $ bundle install

This task will install any missing dependencies.

== LICENSE:

(The MIT License)

Copyright (c) 2011 <NAME>, <NAME>
{'fraction_non_alphanumeric': 0.1291031652989449, 'fraction_numerical': 0.05422039859320047, 'mean_word_length': 2.4964139344262297, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 86, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2296449', 'n_tokens_mistral': 2651, 'n_tokens_neox': 2332, 'n_words': 482}