Skip to content

Commit 314f6a3

Browse files
committed
changes done as per the comments
1 parent 0f33d35 commit 314f6a3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

modules/statistics/RTPStatsCollector.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ class SsrcStats {
9393
* Sets the "loss" object.
9494
* @param loss the value to set.
9595
*/
96-
setLoss(loss: ILoss | undefined): void {
96+
setLoss(loss: ILoss): void {
9797
this.loss = loss || { isDownloadStream: true, packetsLost: 0, packetsTotal: 0 };
9898
}
9999

100100
/**
101101
* Sets resolution that belong to the ssrc represented by this instance.
102102
* @param resolution new resolution value to be set.
103103
*/
104-
setResolution(resolution?: IResolution): void {
104+
setResolution(resolution: IResolution): void {
105105
this.resolution = resolution || {
106106
height: 0,
107107
width: 0
@@ -147,8 +147,8 @@ class SsrcStats {
147147
* Sets the encode stats.
148148
* @param encodeStats the value to set.
149149
*/
150-
setEncodeStats(encodeStats?: Map<number, IEncodeStats>): void {
151-
this.encodeStats = encodeStats || undefined;
150+
setEncodeStats(encodeStats: Map<number, IEncodeStats>): void {
151+
this.encodeStats = encodeStats;
152152
}
153153
}
154154

@@ -407,8 +407,8 @@ export default class StatsCollector {
407407
continue; // eslint-disable-line no-continue
408408
}
409409

410-
let audioCodec: string | undefined;
411-
let videoCodec: string | undefined;
410+
let audioCodec: Optional<string>;
411+
let videoCodec: Optional<string>;
412412

413413
if (track.isAudioTrack()) {
414414
audioBitrateDownload += ssrcBitrateDownload;
@@ -526,15 +526,15 @@ export default class StatsCollector {
526526
* Callback passed to <tt>getStats</tt> method.
527527
* @param error an error that occurred on <tt>getStats</tt> call.
528528
*/
529-
errorCallback(error: Error): void {
529+
public errorCallback(error: Error): void {
530530
logger.error('Get stats error', error);
531531
this.stop();
532532
}
533533

534534
/**
535535
* Stats processing for spec-compliant RTCPeerConnection#getStats.
536536
*/
537-
processStatsReport(): void {
537+
public processStatsReport(): void {
538538
const byteSentStats: Record<number, number> = {};
539539
const encodedTimeStatsPerSsrc: Map<number, IEncodeStats> = new Map();
540540

@@ -639,7 +639,7 @@ export default class StatsCollector {
639639
});
640640
}
641641

642-
let resolution: IResolution | undefined;
642+
let resolution: Optional<IResolution>;
643643

644644
// Process the stats for 'inbound-rtp' streams always and 'outbound-rtp' only if the browser is
645645
// Chromium based and version 112 and later since 'track' based stats are no longer available there
@@ -774,14 +774,14 @@ export default class StatsCollector {
774774
* @param {Array<string>} speakerList - Endpoint ids.
775775
* @returns {void}
776776
*/
777-
setSpeakerList(speakerList: Array<string>): void {
777+
public setSpeakerList(speakerList: Array<string>): void {
778778
this.speakerList = speakerList;
779779
}
780780

781781
/**
782782
* Stops stats updates.
783783
*/
784-
stop(): void {
784+
public stop(): void {
785785
if (this.audioLevelsIntervalId) {
786786
clearInterval(this.audioLevelsIntervalId);
787787
this.audioLevelsIntervalId = null;
@@ -796,7 +796,7 @@ export default class StatsCollector {
796796
/**
797797
* Starts stats updates.
798798
*/
799-
start(startAudioLevelStats: boolean): void {
799+
public start(startAudioLevelStats: boolean): void {
800800
if (startAudioLevelStats && browser.supportsReceiverStats()) {
801801
this.audioLevelsIntervalId = setInterval(
802802
() => {

0 commit comments

Comments
 (0)