Skip to content

Commit 45dffe2

Browse files
authored
high scale livestream publisher hint added (#1219)
1 parent 5201b9b commit 45dffe2

10 files changed

Lines changed: 166 additions & 4 deletions

File tree

dogfooding/lib/app/app_content.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ class _StreamDogFoodingAppContentState
104104
if (_router.routerDelegate.navigatorKey.currentContext == null) {
105105
// App is not running yet. Postpone consuming after app is in the foreground
106106
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
107+
if (!locator.isRegistered<StreamVideo>()) return;
108+
107109
final streamVideo = locator.get<StreamVideo>();
108110
streamVideo.consumeAndAcceptActiveCall(
109111
onCallAccepted: (call) {

packages/stream_video/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Upcoming
2+
3+
### ✅ Added
4+
* Added `hintHighScaleLivestreamPublisher` parameter to `Call.join()` to allow marking the participant as publishing to a large audience.
5+
16
## 1.3.2
27

38
### 🐞 Fixed

packages/stream_video/lib/globals.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'protobuf/video/sfu/models/models.pb.dart';
55

66
const String streamSdkName = 'stream-flutter';
77
const String streamVideoVersion = '1.3.2';
8-
const String openapiModelsVersion = '225.2.0';
8+
const String openapiModelsVersion = '225.14.0';
99
const String protocolModelsVersion = '1.46.1';
1010
const String androidWebRTCVersion = webrtc.androidWebRTCVersion;
1111
const String iosWebRTCVersion = webrtc.iosWebRTCVersion;

packages/stream_video/lib/open_api/video/coordinator/model/call_stats_participant_counts.dart

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,37 @@ part of openapi.api;
1313
class CallStatsParticipantCounts {
1414
/// Returns a new [CallStatsParticipantCounts] instance.
1515
CallStatsParticipantCounts({
16+
this.averageJitterMs,
17+
this.averageLatencyMs,
1618
this.callEventCount,
1719
this.cqScore,
1820
required this.liveSessions,
21+
this.maxFreezesDurationMs,
1922
required this.participants,
2023
required this.peakConcurrentSessions,
2124
required this.peakConcurrentUsers,
2225
required this.publishers,
2326
required this.sessions,
27+
required this.sfusUsed,
2428
this.totalParticipantDuration,
2529
});
2630

31+
///
32+
/// Please note: This property should have been non-nullable! Since the specification file
33+
/// does not include a default value (using the "default:" property), however, the generated
34+
/// source code must fall back to having a nullable type.
35+
/// Consider adding a "default:" property in the specification file to hide this note.
36+
///
37+
int? averageJitterMs;
38+
39+
///
40+
/// Please note: This property should have been non-nullable! Since the specification file
41+
/// does not include a default value (using the "default:" property), however, the generated
42+
/// source code must fall back to having a nullable type.
43+
/// Consider adding a "default:" property in the specification file to hide this note.
44+
///
45+
int? averageLatencyMs;
46+
2747
///
2848
/// Please note: This property should have been non-nullable! Since the specification file
2949
/// does not include a default value (using the "default:" property), however, the generated
@@ -42,6 +62,14 @@ class CallStatsParticipantCounts {
4262

4363
int liveSessions;
4464

65+
///
66+
/// Please note: This property should have been non-nullable! Since the specification file
67+
/// does not include a default value (using the "default:" property), however, the generated
68+
/// source code must fall back to having a nullable type.
69+
/// Consider adding a "default:" property in the specification file to hide this note.
70+
///
71+
int? maxFreezesDurationMs;
72+
4573
int participants;
4674

4775
int peakConcurrentSessions;
@@ -52,6 +80,8 @@ class CallStatsParticipantCounts {
5280

5381
int sessions;
5482

83+
int sfusUsed;
84+
5585
///
5686
/// Please note: This property should have been non-nullable! Since the specification file
5787
/// does not include a default value (using the "default:" property), however, the generated
@@ -64,37 +94,55 @@ class CallStatsParticipantCounts {
6494
bool operator ==(Object other) =>
6595
identical(this, other) ||
6696
other is CallStatsParticipantCounts &&
97+
other.averageJitterMs == averageJitterMs &&
98+
other.averageLatencyMs == averageLatencyMs &&
6799
other.callEventCount == callEventCount &&
68100
other.cqScore == cqScore &&
69101
other.liveSessions == liveSessions &&
102+
other.maxFreezesDurationMs == maxFreezesDurationMs &&
70103
other.participants == participants &&
71104
other.peakConcurrentSessions == peakConcurrentSessions &&
72105
other.peakConcurrentUsers == peakConcurrentUsers &&
73106
other.publishers == publishers &&
74107
other.sessions == sessions &&
108+
other.sfusUsed == sfusUsed &&
75109
other.totalParticipantDuration == totalParticipantDuration;
76110

77111
@override
78112
int get hashCode =>
79113
// ignore: unnecessary_parenthesis
114+
(averageJitterMs == null ? 0 : averageJitterMs!.hashCode) +
115+
(averageLatencyMs == null ? 0 : averageLatencyMs!.hashCode) +
80116
(callEventCount == null ? 0 : callEventCount!.hashCode) +
81117
(cqScore == null ? 0 : cqScore!.hashCode) +
82118
(liveSessions.hashCode) +
119+
(maxFreezesDurationMs == null ? 0 : maxFreezesDurationMs!.hashCode) +
83120
(participants.hashCode) +
84121
(peakConcurrentSessions.hashCode) +
85122
(peakConcurrentUsers.hashCode) +
86123
(publishers.hashCode) +
87124
(sessions.hashCode) +
125+
(sfusUsed.hashCode) +
88126
(totalParticipantDuration == null
89127
? 0
90128
: totalParticipantDuration!.hashCode);
91129

92130
@override
93131
String toString() =>
94-
'CallStatsParticipantCounts[callEventCount=$callEventCount, cqScore=$cqScore, liveSessions=$liveSessions, participants=$participants, peakConcurrentSessions=$peakConcurrentSessions, peakConcurrentUsers=$peakConcurrentUsers, publishers=$publishers, sessions=$sessions, totalParticipantDuration=$totalParticipantDuration]';
132+
'CallStatsParticipantCounts[averageJitterMs=$averageJitterMs, averageLatencyMs=$averageLatencyMs, callEventCount=$callEventCount, cqScore=$cqScore, liveSessions=$liveSessions, maxFreezesDurationMs=$maxFreezesDurationMs, participants=$participants, peakConcurrentSessions=$peakConcurrentSessions, peakConcurrentUsers=$peakConcurrentUsers, publishers=$publishers, sessions=$sessions, sfusUsed=$sfusUsed, totalParticipantDuration=$totalParticipantDuration]';
95133

96134
Map<String, dynamic> toJson() {
97135
final json = <String, dynamic>{};
136+
if (this.averageJitterMs != null) {
137+
json[r'average_jitter_ms'] = this.averageJitterMs;
138+
} else {
139+
json[r'average_jitter_ms'] = null;
140+
}
141+
if (this.averageLatencyMs != null) {
142+
json[r'average_latency_ms'] = this.averageLatencyMs;
143+
} else {
144+
json[r'average_latency_ms'] = null;
145+
}
98146
if (this.callEventCount != null) {
99147
json[r'call_event_count'] = this.callEventCount;
100148
} else {
@@ -106,11 +154,17 @@ class CallStatsParticipantCounts {
106154
json[r'cq_score'] = null;
107155
}
108156
json[r'live_sessions'] = this.liveSessions;
157+
if (this.maxFreezesDurationMs != null) {
158+
json[r'max_freezes_duration_ms'] = this.maxFreezesDurationMs;
159+
} else {
160+
json[r'max_freezes_duration_ms'] = null;
161+
}
109162
json[r'participants'] = this.participants;
110163
json[r'peak_concurrent_sessions'] = this.peakConcurrentSessions;
111164
json[r'peak_concurrent_users'] = this.peakConcurrentUsers;
112165
json[r'publishers'] = this.publishers;
113166
json[r'sessions'] = this.sessions;
167+
json[r'sfus_used'] = this.sfusUsed;
114168
if (this.totalParticipantDuration != null) {
115169
json[r'total_participant_duration'] = this.totalParticipantDuration;
116170
} else {
@@ -154,20 +208,29 @@ class CallStatsParticipantCounts {
154208
'Required key "CallStatsParticipantCounts[sessions]" is missing from JSON.');
155209
assert(json[r'sessions'] != null,
156210
'Required key "CallStatsParticipantCounts[sessions]" has a null value in JSON.');
211+
assert(json.containsKey(r'sfus_used'),
212+
'Required key "CallStatsParticipantCounts[sfus_used]" is missing from JSON.');
213+
assert(json[r'sfus_used'] != null,
214+
'Required key "CallStatsParticipantCounts[sfus_used]" has a null value in JSON.');
157215
return true;
158216
}());
159217

160218
return CallStatsParticipantCounts(
219+
averageJitterMs: mapValueOfType<int>(json, r'average_jitter_ms'),
220+
averageLatencyMs: mapValueOfType<int>(json, r'average_latency_ms'),
161221
callEventCount: mapValueOfType<int>(json, r'call_event_count'),
162222
cqScore: mapValueOfType<int>(json, r'cq_score'),
163223
liveSessions: mapValueOfType<int>(json, r'live_sessions')!,
224+
maxFreezesDurationMs:
225+
mapValueOfType<int>(json, r'max_freezes_duration_ms'),
164226
participants: mapValueOfType<int>(json, r'participants')!,
165227
peakConcurrentSessions:
166228
mapValueOfType<int>(json, r'peak_concurrent_sessions')!,
167229
peakConcurrentUsers:
168230
mapValueOfType<int>(json, r'peak_concurrent_users')!,
169231
publishers: mapValueOfType<int>(json, r'publishers')!,
170232
sessions: mapValueOfType<int>(json, r'sessions')!,
233+
sfusUsed: mapValueOfType<int>(json, r'sfus_used')!,
171234
totalParticipantDuration:
172235
mapValueOfType<int>(json, r'total_participant_duration'),
173236
);
@@ -232,5 +295,6 @@ class CallStatsParticipantCounts {
232295
'peak_concurrent_users',
233296
'publishers',
234297
'sessions',
298+
'sfus_used',
235299
};
236300
}

packages/stream_video/lib/open_api/video/coordinator/model/call_stats_participant_session.dart

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class CallStatsParticipantSession {
2020
this.currentSfu,
2121
this.distanceToSfuKilometers,
2222
this.endedAt,
23+
this.freezesDurationMs,
2324
required this.isLive,
25+
this.jitterMs,
26+
this.latencyMs,
2427
this.location,
2528
this.os,
2629
required this.publishedTracks,
@@ -89,8 +92,32 @@ class CallStatsParticipantSession {
8992
///
9093
DateTime? endedAt;
9194

95+
///
96+
/// Please note: This property should have been non-nullable! Since the specification file
97+
/// does not include a default value (using the "default:" property), however, the generated
98+
/// source code must fall back to having a nullable type.
99+
/// Consider adding a "default:" property in the specification file to hide this note.
100+
///
101+
int? freezesDurationMs;
102+
92103
bool isLive;
93104

105+
///
106+
/// Please note: This property should have been non-nullable! Since the specification file
107+
/// does not include a default value (using the "default:" property), however, the generated
108+
/// source code must fall back to having a nullable type.
109+
/// Consider adding a "default:" property in the specification file to hide this note.
110+
///
111+
int? jitterMs;
112+
113+
///
114+
/// Please note: This property should have been non-nullable! Since the specification file
115+
/// does not include a default value (using the "default:" property), however, the generated
116+
/// source code must fall back to having a nullable type.
117+
/// Consider adding a "default:" property in the specification file to hide this note.
118+
///
119+
int? latencyMs;
120+
94121
///
95122
/// Please note: This property should have been non-nullable! Since the specification file
96123
/// does not include a default value (using the "default:" property), however, the generated
@@ -170,7 +197,10 @@ class CallStatsParticipantSession {
170197
other.currentSfu == currentSfu &&
171198
other.distanceToSfuKilometers == distanceToSfuKilometers &&
172199
other.endedAt == endedAt &&
200+
other.freezesDurationMs == freezesDurationMs &&
173201
other.isLive == isLive &&
202+
other.jitterMs == jitterMs &&
203+
other.latencyMs == latencyMs &&
174204
other.location == location &&
175205
other.os == os &&
176206
other.publishedTracks == publishedTracks &&
@@ -194,7 +224,10 @@ class CallStatsParticipantSession {
194224
? 0
195225
: distanceToSfuKilometers!.hashCode) +
196226
(endedAt == null ? 0 : endedAt!.hashCode) +
227+
(freezesDurationMs == null ? 0 : freezesDurationMs!.hashCode) +
197228
(isLive.hashCode) +
229+
(jitterMs == null ? 0 : jitterMs!.hashCode) +
230+
(latencyMs == null ? 0 : latencyMs!.hashCode) +
198231
(location == null ? 0 : location!.hashCode) +
199232
(os == null ? 0 : os!.hashCode) +
200233
(publishedTracks.hashCode) +
@@ -208,7 +241,7 @@ class CallStatsParticipantSession {
208241

209242
@override
210243
String toString() =>
211-
'CallStatsParticipantSession[browser=$browser, browserVersion=$browserVersion, cqScore=$cqScore, currentIp=$currentIp, currentSfu=$currentSfu, distanceToSfuKilometers=$distanceToSfuKilometers, endedAt=$endedAt, isLive=$isLive, location=$location, os=$os, publishedTracks=$publishedTracks, publisherType=$publisherType, sdk=$sdk, sdkVersion=$sdkVersion, startedAt=$startedAt, unifiedSessionId=$unifiedSessionId, userSessionId=$userSessionId, webrtcVersion=$webrtcVersion]';
244+
'CallStatsParticipantSession[browser=$browser, browserVersion=$browserVersion, cqScore=$cqScore, currentIp=$currentIp, currentSfu=$currentSfu, distanceToSfuKilometers=$distanceToSfuKilometers, endedAt=$endedAt, freezesDurationMs=$freezesDurationMs, isLive=$isLive, jitterMs=$jitterMs, latencyMs=$latencyMs, location=$location, os=$os, publishedTracks=$publishedTracks, publisherType=$publisherType, sdk=$sdk, sdkVersion=$sdkVersion, startedAt=$startedAt, unifiedSessionId=$unifiedSessionId, userSessionId=$userSessionId, webrtcVersion=$webrtcVersion]';
212245

213246
Map<String, dynamic> toJson() {
214247
final json = <String, dynamic>{};
@@ -247,7 +280,22 @@ class CallStatsParticipantSession {
247280
} else {
248281
json[r'ended_at'] = null;
249282
}
283+
if (this.freezesDurationMs != null) {
284+
json[r'freezes_duration_ms'] = this.freezesDurationMs;
285+
} else {
286+
json[r'freezes_duration_ms'] = null;
287+
}
250288
json[r'is_live'] = this.isLive;
289+
if (this.jitterMs != null) {
290+
json[r'jitter_ms'] = this.jitterMs;
291+
} else {
292+
json[r'jitter_ms'] = null;
293+
}
294+
if (this.latencyMs != null) {
295+
json[r'latency_ms'] = this.latencyMs;
296+
} else {
297+
json[r'latency_ms'] = null;
298+
}
251299
if (this.location != null) {
252300
json[r'location'] = this.location;
253301
} else {
@@ -328,7 +376,10 @@ class CallStatsParticipantSession {
328376
distanceToSfuKilometers:
329377
mapValueOfType<double>(json, r'distance_to_sfu_kilometers'),
330378
endedAt: mapDateTime(json, r'ended_at', r''),
379+
freezesDurationMs: mapValueOfType<int>(json, r'freezes_duration_ms'),
331380
isLive: mapValueOfType<bool>(json, r'is_live')!,
381+
jitterMs: mapValueOfType<int>(json, r'jitter_ms'),
382+
latencyMs: mapValueOfType<int>(json, r'latency_ms'),
332383
location: CallStatsLocation.fromJson(json[r'location']),
333384
os: mapValueOfType<String>(json, r'os'),
334385
publishedTracks:

packages/stream_video/lib/open_api/video/coordinator/model/join_call_request.dart

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class JoinCallRequest {
1515
JoinCallRequest({
1616
this.create,
1717
this.data,
18+
this.hintHighScaleLivestreamPublisher,
1819
required this.location,
1920
this.membersLimit,
2021
this.migratingFrom,
@@ -41,6 +42,15 @@ class JoinCallRequest {
4142
///
4243
CallRequest? data;
4344

45+
/// if true, the participant will be marked as publsihing to large audience
46+
///
47+
/// Please note: This property should have been non-nullable! Since the specification file
48+
/// does not include a default value (using the "default:" property), however, the generated
49+
/// source code must fall back to having a nullable type.
50+
/// Consider adding a "default:" property in the specification file to hide this note.
51+
///
52+
bool? hintHighScaleLivestreamPublisher;
53+
4454
String location;
4555

4656
/// Maximum value: 100
@@ -95,6 +105,8 @@ class JoinCallRequest {
95105
other is JoinCallRequest &&
96106
other.create == create &&
97107
other.data == data &&
108+
other.hintHighScaleLivestreamPublisher ==
109+
hintHighScaleLivestreamPublisher &&
98110
other.location == location &&
99111
other.membersLimit == membersLimit &&
100112
other.migratingFrom == migratingFrom &&
@@ -108,6 +120,9 @@ class JoinCallRequest {
108120
// ignore: unnecessary_parenthesis
109121
(create == null ? 0 : create!.hashCode) +
110122
(data == null ? 0 : data!.hashCode) +
123+
(hintHighScaleLivestreamPublisher == null
124+
? 0
125+
: hintHighScaleLivestreamPublisher!.hashCode) +
111126
(location.hashCode) +
112127
(membersLimit == null ? 0 : membersLimit!.hashCode) +
113128
(migratingFrom == null ? 0 : migratingFrom!.hashCode) +
@@ -118,7 +133,7 @@ class JoinCallRequest {
118133

119134
@override
120135
String toString() =>
121-
'JoinCallRequest[create=$create, data=$data, location=$location, membersLimit=$membersLimit, migratingFrom=$migratingFrom, migratingFromList=$migratingFromList, notify=$notify, ring=$ring, video=$video]';
136+
'JoinCallRequest[create=$create, data=$data, hintHighScaleLivestreamPublisher=$hintHighScaleLivestreamPublisher, location=$location, membersLimit=$membersLimit, migratingFrom=$migratingFrom, migratingFromList=$migratingFromList, notify=$notify, ring=$ring, video=$video]';
122137

123138
Map<String, dynamic> toJson() {
124139
final json = <String, dynamic>{};
@@ -132,6 +147,12 @@ class JoinCallRequest {
132147
} else {
133148
json[r'data'] = null;
134149
}
150+
if (this.hintHighScaleLivestreamPublisher != null) {
151+
json[r'hint_high_scale_livestream_publisher'] =
152+
this.hintHighScaleLivestreamPublisher;
153+
} else {
154+
json[r'hint_high_scale_livestream_publisher'] = null;
155+
}
135156
json[r'location'] = this.location;
136157
if (this.membersLimit != null) {
137158
json[r'members_limit'] = this.membersLimit;
@@ -183,6 +204,8 @@ class JoinCallRequest {
183204
return JoinCallRequest(
184205
create: mapValueOfType<bool>(json, r'create'),
185206
data: CallRequest.fromJson(json[r'data']),
207+
hintHighScaleLivestreamPublisher:
208+
mapValueOfType<bool>(json, r'hint_high_scale_livestream_publisher'),
186209
location: mapValueOfType<String>(json, r'location')!,
187210
membersLimit: mapValueOfType<int>(json, r'members_limit'),
188211
migratingFrom: mapValueOfType<String>(json, r'migrating_from'),

0 commit comments

Comments
 (0)