feat(rtcstats): send facial expressions to rtcstats-server (#10461)

* send facial expressions to rtcstats

* remove comment

* remove extra line
This commit is contained in:
Andrei Gavrilescu 2021-11-26 12:24:28 +02:00 committed by GitHub
parent 73fb586d59
commit 0fc381fc6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -95,6 +95,16 @@ class RTCStats {
this.trace && this.trace.statsEntry('dominantSpeaker', null, dominantSpeakerData);
}
/**
* Send facial expression data, the data will be processed by rtcstats-server and saved in the dump file.
*
* @param {Object} facialExpressionData - Facial expression data to be saved in the rtcstats dump.
* @returns {void}
*/
sendFacialExpressionData(facialExpressionData) {
this.trace && this.trace.statsEntry('facialExpression', null, facialExpressionData);
}
/**
* Connect to the rtcstats server instance. Stats (data obtained from getstats) won't be send until the
* connect successfully initializes, however calls to GUM are recorded in an internal buffer even if not

View File

@ -7,6 +7,7 @@ import { CONFERENCE_UNIQUE_ID_SET, getConferenceOptions, getRoomName } from '../
import { LIB_WILL_INIT } from '../base/lib-jitsi-meet';
import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
import { ADD_FACIAL_EXPRESSION } from '../facial-recognition/actionTypes';
import RTCStats from './RTCStats';
import { canSendRtcstatsData, isRtcstatsEnabled } from './functions';
@ -104,6 +105,17 @@ MiddlewareRegistry.register(store => next => action => {
}
break;
}
case ADD_FACIAL_EXPRESSION: {
if (canSendRtcstatsData(state)) {
const { duration, facialExpression } = action;
RTCStats.sendFacialExpressionData({
duration,
facialExpression
});
}
break;
}
}
return next(action);