Class: RTSP::StreamServer

Inherits:
Object
  • Object
show all
Includes:
SocatStreaming, Singleton
Defined in:
lib/rtsp/stream_server.rb

Constant Summary

Constants included from SocatStreaming

RTSP::SocatStreaming::BLOCK_SIZE, RTSP::SocatStreaming::BSD_OPTIONS, RTSP::SocatStreaming::H264_FMTP, RTSP::SocatStreaming::H264_RTP_MAP, RTSP::SocatStreaming::MP4_FMTP, RTSP::SocatStreaming::MP4_RTP_MAP, RTSP::SocatStreaming::RTCP_SOURCE, RTSP::SocatStreaming::SOCAT_OPTIONS

Constants included from Global

Global::DEFAULT_RTSP_PORT, Global::DEFAULT_VERSION

Instance Attribute Summary

Attributes included from SocatStreaming

#fmtp, #interface_ip, #pids, #rtcp_source_identifier, #rtcp_threads, #rtp_map, #rtp_sequence, #rtp_timestamp, #sessions, #source_ip, #source_port

Attributes included from Global

#log, #log_level, #logger, #raise_errors

Instance Method Summary collapse

Methods included from SocatStreaming

#description, #disconnect, #generate_rtcp_source_id, #parse_sequence_number, #setup_streamer, #start_streaming, #stop_streaming

Methods included from Global

#log?, #raise_errors?, #reset_config!, #rtsp_version

Constructor Details

#initializeStreamServer

Returns a new instance of StreamServer.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rtsp/stream_server.rb', line 9

def initialize
  @stream_module = SocatStreaming
  @sessions = {}
  @pids = {}
  @rtcp_threads = {}
  @rtp_timestamp = 2612015746
  @rtp_sequence = 21934
  @rtp_map = []
  @fmtp = []
  @source_ip = []
  @source_port = []
end

Instance Method Details

#stream_moduleModule

Gets the current stream_module

Returns:

  • (Module)

    Module name.



33
34
35
# File 'lib/rtsp/stream_server.rb', line 33

def stream_module
  @stream_module
end

#stream_module=(module_name) ⇒ Object

Sets the stream module to be used by the stream server.

Parameters:

  • Module (Module)

    name.



25
26
27
28
# File 'lib/rtsp/stream_server.rb', line 25

def stream_module= module_name
  @stream_module = module_name
  self.class.send(:include, module_name)
end