send video type to rtcstats (#11426)

This commit is contained in:
George Politis 2022-05-16 15:56:37 +02:00 committed by GitHub
parent 05127467c2
commit e4b50ba419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -105,6 +105,16 @@ class RTCStats {
this.trace && this.trace.statsEntry('e2eRtt', null, e2eRttData);
}
/**
* Send videoType data, the data will be processed by rtcstats-server and saved in the dump file.
*
* @param {Object} videoTypeData - The object that holds the videoType data.
* @returns {void}
*/
sendVideoTypeData(videoTypeData) {
this.trace && this.trace.statsEntry('setVideoType', null, videoTypeData);
}
/**
* Send face expression data, the data will be processed by rtcstats-server and saved in the dump file.
*

View File

@ -7,6 +7,7 @@ import { CONFERENCE_UNIQUE_ID_SET, E2E_RTT_CHANGED, getConferenceOptions, getRoo
import { LIB_WILL_INIT } from '../base/lib-jitsi-meet/actionTypes';
import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
import { TRACK_ADDED, TRACK_UPDATED } from '../base/tracks';
import { ADD_FACE_EXPRESSION } from '../face-landmarks/actionTypes';
import RTCStats from './RTCStats';
@ -52,6 +53,38 @@ MiddlewareRegistry.register(store => next => action => {
}
break;
}
case TRACK_ADDED: {
if (canSendRtcstatsData(state)) {
const jitsiTrack = action?.track?.jitsiTrack;
const { ssrc, videoType } = jitsiTrack || { };
// Remote tracks store their ssrc in the jitsiTrack object. Local tracks don't. See getSsrcByTrack.
if (videoType && ssrc && !jitsiTrack.isLocal()) {
RTCStats.sendVideoTypeData({
ssrc,
videoType
});
}
}
break;
}
case TRACK_UPDATED: {
if (canSendRtcstatsData(state)) {
const { videoType, jitsiTrack } = action?.track || { };
const { ssrc } = jitsiTrack || { };
// if the videoType of the remote track has changed we expect to find it in track.videoType. grep for
// trackVideoTypeChanged.
if (videoType && ssrc && !jitsiTrack.isLocal()) {
RTCStats.sendVideoTypeData({
ssrc,
videoType
});
}
}
break;
}
case CONFERENCE_UNIQUE_ID_SET: {
if (canSendRtcstatsData(state)) {