Skip to content

Commit 0a66a73

Browse files
authored
fix(llc): update stats format (#600)
1 parent 4629e15 commit 0a66a73

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

packages/stream_video/lib/src/call/session/call_session.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ class CallSession extends Disposable {
592592
StreamPeerConnection pc,
593593
List<RtcStats> rtcStats,
594594
RtcPrintableStats rtcPrintableStats,
595-
Map<String, dynamic> rtcRawStats,
595+
List<Map<String, dynamic>> rtcRawStats,
596596
) {
597597
_stats.emit(
598598
CallStats(

packages/stream_video/lib/src/models/call_stats.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CallStats {
1717
final StreamPeerType peerType;
1818
final List<RtcStats> stats;
1919
final RtcPrintableStats printable;
20-
final Map<String, dynamic> raw;
20+
final List<Map<String, dynamic>> raw;
2121

2222
@override
2323
String toString() {

packages/stream_video/lib/src/webrtc/model/stats/rtc_stats_mapper.dart

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,16 @@ const _space = ' ';
2929
const _lineFeed = '\n';
3030

3131
extension RtcStatsMapper on List<rtc.StatsReport> {
32-
Map<String, dynamic> toRawStats() {
33-
var rawStats = <String, dynamic>{};
32+
List<Map<String, dynamic>> toRawStats() {
33+
final rawStats = <Map<String, dynamic>>[];
3434

3535
for (final report in this) {
36-
final type = report.type;
37-
38-
rawStats = {
39-
...rawStats,
40-
type: {
36+
rawStats.add({
4137
'id': report.id,
4238
'type': report.type,
4339
'timestamp': report.timestamp,
4440
...report.values,
45-
},
46-
};
41+
});
4742
}
4843

4944
return rawStats;

packages/stream_video/lib/src/webrtc/peer_connection.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ typedef OnStats = void Function(
5757
StreamPeerConnection,
5858
List<RtcStats>,
5959
RtcPrintableStats,
60-
Map<String, dynamic>,
60+
List<Map<String, dynamic>>,
6161
);
6262

6363
/// Wrapper around the WebRTC connection that contains tracks.

0 commit comments

Comments
 (0)