Class: Argus::VideoData

Inherits:
Object
  • Object
show all
Defined in:
lib/argus/video_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(socket) ⇒ VideoData

Returns a new instance of VideoData.



5
6
7
8
9
# File 'lib/argus/video_data.rb', line 5

def initialize(socket)
  @socket = socket
  @envelope = VideoDataEnvelope.new(@socket)
  @frame = parse_frame
end

Instance Attribute Details

#envelopeObject (readonly)

Returns the value of attribute envelope.



3
4
5
# File 'lib/argus/video_data.rb', line 3

def envelope
  @envelope
end

#frameObject (readonly)

Returns the value of attribute frame.



3
4
5
# File 'lib/argus/video_data.rb', line 3

def frame
  @frame
end

#socketObject (readonly)

Returns the value of attribute socket.



3
4
5
# File 'lib/argus/video_data.rb', line 3

def socket
  @socket
end

Instance Method Details

#parse_frameObject



11
12
13
# File 'lib/argus/video_data.rb', line 11

def parse_frame
  socket.read(envelope.payload_size) if envelope
end