* ref(JSPC): simplify SSRC owner in P2P
There's no need for any extra extensions for SSRCs owner signalling in
P2P, because it's always the remote peer who owns them.
This also fixes a problem where no SSRC owner was added for 'source-add'
in P2P (for JVB conference Jicofo adds that).
* fix(TPC): always advertise 'sendrecv'
Our media direction is only ever updated on the remote side with
the initial offer (or answer). Because of that we want to advertise
'sendrecv' even if we start with no video (or audio) track.
It is OK to adjust this direction in the localDescription getter,
because it's adjusted again in the setter to the correct value based on
local tracks, so the SDP transformation chain still works fine.
Tries to batch as many reports as possible into single analytics event
and sends all of them under "avg.rtp.stats" event name.
Also converts dots to underscores in all of the stat names, because now
they become JSON keys where dots are not allowed.
Reorders JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED event arguments by
putting TraceablePeerConnection at the end. This way it's easier to
treat it as "library internal".
Will actively terminate P2P session by the responder (not moderator) in
order to shutdown P2P in case of eventual initiator's crash. Otherwise
the responder will stay in P2P for too long (until P2P ICE fails).
Prevents from printing Jingle 'session-terminate' error response in case
both responder and initiator terminates their sessions simultaneously
(gracefully). In that case 'item-not-found' error is returned by each
party, because the session is removed immediately from the memory on
termination (see strophe.jingle.js).
fix(JitsiConference): case for stopping JVB transfer
If for any reason invite for the JVB JingleSession is delayed and
arrives after the P2P connection has been established then
the media transfer needs to be disabled after the offer is accepted.
If the app depends on tracking current tracks state using
"track added/removed" events, the tracks will be leaking if
JitsiConference.leave() method is used. That's because peerconnections
are closed and removed from RTC module and then from onMemberLeft those
events will not be fired, because tracks will be gone with
the peerconnections.
Also removes error message log, because it no longer makes sense if
the tracks can be removed early by "stop P2P" logic without actually
removing them from the TPC. Then when the TPC is closed it will try to
emit the events again. But this time it will not match any tracks in
the JitsiParticipant, because it has been removed already.
fix(JingleSessionPC): execute 'invite' on the queue
Invite must be executed on the queue to avoid strange things happening
on the beginning of the call. For example when the local tracks are
added just after the invite was called.
Move the JingleSessionPC to ACTIVE state, as soon as the first
_renegotiate is executed in PENDING state.
Dominant speaker detection which is just based on current audio level of local or remote p2p track. The threshold value is the same used for talk while muted detection.
* doc(JitsiConference): deprecate 'isInLastN'
The 'isInLastN' method should not be used for the UI purposes, but
ParticipantConnectionStatus value should be used instead.
* fix(ParticipantConn..Status): speed up INACTIVE transition
Before this change when user's video stops playing, after user is
removed from last N we were waiting 2 seconds, before going to INACTIVE
state. This commit reduces the time to 500ms for such case.
* fix(ParticipantConn...): reduce logging
Reduce logging verbosity.
* fix(ParticipantConn...): handle LastN == 0
When LastN is set to 0 we should not rely on video playback and last N
set for figuring out participant connection status.
* fix(JitsiConference): undefined participants
Fixes a crash when this.participants field is accessed from _init.
Do the same which was done for the selected endpoint. That is if
an endpoint is pinned, before data channels are available then the value
should be cached and sent as soon as they are opened.
* feat: multiple, simultaneous RTP stats
Makes it possible to have remote RTP stats running for more than one
peerconnection at a time.
* feat(stats): report RTT all the time
Will report JVB RTT (and end to end) while in P2P mode and vice versa.
* fix(JitsiConferenceEvents): remove CONNECTION_STATS
CONNECTION_STATS event is no longer emitted.
* fix(AvgRTPStatsReported): users with no video
Do not include FPS == 0 in average remote FPS calculation. Report NaN
for local FPS when video muted or no video device. NaN will be reported
for avg remote FPS if no video is received.
* fix(AvgRTPStatsReported): reset total packet loss
* feat(AvgRTPStatsReported): report 'screen' FPS
Will report average FPS for screen videos separately from camera videos,
but only if available (camera video reports NaN FPS when not available).
* fix(AvgRTPStatsReported): end2endRTT
Needs to report JSON with value.
* feat(AVG RTP stats): separate audio and video bitrate
Will report average audio and video bitrates separately.
* doc(JitsiConference): try to improve comment
* fix(AvgRTPStatsReporter): remove confusing reset
There's no a clear reason for doing reset there.
* ref(AvgRTPStatsReporter): rename var
* feat(JSPC): ICE establishment time
Will report total ICE establishment time under
'ice.initiator.establishmentDuration' and
'ice.responder.establishmentDuration' ('p2p.' prefix added for P2P).
It's the amount of time between the time when either checking or
gathering started (whichever starts first) and when ICE entered
'connected' for the first time.
* fix(JSPC): simplify and rename event
* ref: store SSRCs as a number
Converts all the places where SSRCs where stored as string to use
numbers.
* doc(RTPStatsCollector): getNonNegativeStat
Fixes invalid description about returning NaN.
* ref(JitsiConf...EventManager): simplify for..of
* ref(JitsiRemoteTrack): throw TypeError
Will throw a TypeError when 'ssrc' is not a number.
* fix(RTPStatsCollector): invalid reference
* doc(RTPStatsCollector): getNonNegativeStat private
* ref(RTPStatsCollector): simplify for..of
* fix(SSRCs): check for negative value
Will not accept negative SSRCs, since those are supposed to be unsigned.
Average end to end RTT calculated as a sum of local RTT towards the JVB
and an average of towards JVB RTTs reported by other participants.
Will be reported under 'stat.avg.end2endrtt' analytics event name.
AvgRTPStatsReporter will calculate arithmetic means of 'n' samples
and submit the values to the analytics module. The 'n' value is
configurable through 'avgRtpStatsN' conference config option. When set
to non-positive value the AvgRTPStatsReporter will be disabled.
The following values are reported:
- average upload bitrate => 'stat.avg.bitrate.upload'
- average download bitrate => 'stat.avg.bitrate.download'
- average upload bandwidth => 'stat.avg.bandwidth.upload'
- average download bandwidth => 'stat.avg.bandwidth.download'
- average total packet loss => 'stat.avg.packetloss.total'
- average upload packet loss => 'stat.avg.packetloss.upload'
- average download packet loss => 'stat.avg.packetloss.download'
- average FPS for remote videos => 'stat.avg.framerate.remote'
- average FPS for local video => 'stat.avg.framerate.local'
- average connection quality as defined by
the ConnectionQuality module => 'stat.avg.cq'
If the conference runs in P2P mode 'p2p.' prefix will be added to
the event's name. Any pending calculations are wiped out on every switch
between P2P and JVB modes and samples have to be collected from
the start.
Will emit analytics events for ICE gathering and ICE checks duration,
separately for initiator/responder and p2p/jvb connections. Initiator
and responder have to be separated, because the flow and the values have
significant differences.
XMPPEvents.CONNECTION_ESTABLISHED is emitted outside of 'is stable'
condition, because for the JVB connection the signalling state is often
not in 'stable' ('have-remote-offer') state when ICE goes to
'connected'.