Class: WebRTC::RTCOutboundRtpStreamStats

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 = {}) ⇒ RTCOutboundRtpStreamStats

Returns a new instance of RTCOutboundRtpStreamStats.



108
109
110
111
112
113
114
115
116
117
# File 'lib/webrtc/stats_report.rb', line 108

def initialize(options = {})
  super(options.merge(type: :outbound_rtp))
  @ssrc = options[:ssrc]
  @kind = options[:kind]
  @packets_sent = options[:packets_sent] || 0
  @bytes_sent = options[:bytes_sent] || 0
  @frames_encoded = options[:frames_encoded] || 0
  @target_bitrate = options[:target_bitrate]
  @frames_per_second = options[:frames_per_second]
end

Instance Attribute Details

#bytes_sentObject (readonly)

Returns the value of attribute bytes_sent.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def bytes_sent
  @bytes_sent
end

#frames_encodedObject (readonly)

Returns the value of attribute frames_encoded.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def frames_encoded
  @frames_encoded
end

#frames_per_secondObject (readonly)

Returns the value of attribute frames_per_second.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def frames_per_second
  @frames_per_second
end

#kindObject (readonly)

Returns the value of attribute kind.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def kind
  @kind
end

#packets_sentObject (readonly)

Returns the value of attribute packets_sent.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def packets_sent
  @packets_sent
end

#ssrcObject (readonly)

Returns the value of attribute ssrc.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def ssrc
  @ssrc
end

#target_bitrateObject (readonly)

Returns the value of attribute target_bitrate.



106
107
108
# File 'lib/webrtc/stats_report.rb', line 106

def target_bitrate
  @target_bitrate
end

Instance Method Details

#to_hObject



119
120
121
122
123
124
125
126
127
128
129
# File 'lib/webrtc/stats_report.rb', line 119

def to_h
  super.merge(
    ssrc: @ssrc,
    kind: @kind,
    packetsSent: @packets_sent,
    bytesSent: @bytes_sent,
    framesEncoded: @frames_encoded,
    targetBitrate: @target_bitrate,
    framesPerSecond: @frames_per_second
  )
end