Class: WebRTC::RTCInboundRtpStreamStats

Inherits:
RTCStats
  • Object
show all
Defined in:
lib/webrtc/stats_report.rb

Constant Summary

Constants inherited from RTCStats

WebRTC::RTCStats::TYPES

Instance Attribute Summary collapse

Attributes inherited from RTCStats

#id, #timestamp, #type

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RTCInboundRtpStreamStats

Returns a new instance of RTCInboundRtpStreamStats.



79
80
81
82
83
84
85
86
87
88
89
# File 'lib/webrtc/stats_report.rb', line 79

def initialize(options = {})
  super(options.merge(type: :inbound_rtp))
  @ssrc = options[:ssrc]
  @kind = options[:kind]
  @packets_received = options[:packets_received] || 0
  @bytes_received = options[:bytes_received] || 0
  @packets_lost = options[:packets_lost] || 0
  @jitter = options[:jitter] || 0.0
  @frames_decoded = options[:frames_decoded] || 0
  @frames_dropped = options[:frames_dropped] || 0
end

Instance Attribute Details

#bytes_receivedObject (readonly)

Returns the value of attribute bytes_received.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def bytes_received
  @bytes_received
end

#frames_decodedObject (readonly)

Returns the value of attribute frames_decoded.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def frames_decoded
  @frames_decoded
end

#frames_droppedObject (readonly)

Returns the value of attribute frames_dropped.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def frames_dropped
  @frames_dropped
end

#jitterObject (readonly)

Returns the value of attribute jitter.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def jitter
  @jitter
end

#kindObject (readonly)

Returns the value of attribute kind.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def kind
  @kind
end

#packets_lostObject (readonly)

Returns the value of attribute packets_lost.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def packets_lost
  @packets_lost
end

#packets_receivedObject (readonly)

Returns the value of attribute packets_received.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def packets_received
  @packets_received
end

#ssrcObject (readonly)

Returns the value of attribute ssrc.



76
77
78
# File 'lib/webrtc/stats_report.rb', line 76

def ssrc
  @ssrc
end

Instance Method Details

#to_hObject



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/webrtc/stats_report.rb', line 91

def to_h
  super.merge(
    ssrc: @ssrc,
    kind: @kind,
    packetsReceived: @packets_received,
    bytesReceived: @bytes_received,
    packetsLost: @packets_lost,
    jitter: @jitter,
    framesDecoded: @frames_decoded,
    framesDropped: @frames_dropped
  )
end