more logging for dynacast

This commit is contained in:
Hiroshi Horie
2022-01-03 16:37:51 +07:00
parent d346763ecd
commit 677ad94e75
5 changed files with 29 additions and 4 deletions
+3 -1
View File
@@ -1,14 +1,16 @@
import 'package:flutter/material.dart';
import 'package:livekit_example/theme.dart';
import 'package:logging/logging.dart';
import 'package:intl/intl.dart';
import 'pages/connect.dart';
void main() {
final format = DateFormat('HH:mm:ss');
// configure logs for debugging
Logger.root.level = Level.FINE;
Logger.root.onRecord.listen((record) {
print('${record.level.name}: ${record.message}');
print('${format.format(record.time)}: ${record.message}');
});
WidgetsFlutterBinding.ensureInitialized();
+7
View File
@@ -156,6 +156,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
js:
dependency: transitive
description:
+1
View File
@@ -11,6 +11,7 @@ dependencies:
flutter:
sdk: flutter
intl: ^0.17.0
flutter_background: 1.1.0
provider: ^6.0.1
logging: ^1.0.1
+5 -1
View File
@@ -177,7 +177,11 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
// Signal for Dynacast
final options = roomOptions ?? const RoomOptions();
// Dynacast is off or is unsupported
if (!options.dynacast || _serverVersion == '0.15.1') return;
if (!options.dynacast || _serverVersion == '0.15.1') {
logger.fine('Received subscribed quality update'
' but Dynacast is off or server version is not supported.');
return;
}
// Find the publication
final publication = localParticipant?.trackPublications[event.trackSid];
if (publication == null) {
+13 -2
View File
@@ -37,15 +37,24 @@ class LocalTrackPublication<T extends LocalTrack> extends TrackPublication<T> {
@internal
void updatePublishingLayers(List<lk_rtc.SubscribedQuality> layers) async {
//
logger.fine('Update publishing layers: $layers');
final params = track?.sender?.parameters;
if (params == null) return;
if (params == null) {
logger.fine('Update publishing layers: sender params are null');
return;
}
final encodings = params.encodings;
if (encodings == null) return;
if (encodings == null) {
logger.fine('Update publishing layers: encodings are null');
return;
}
bool didChange = false;
for (final encoding in encodings) {
logger.fine('Processing encoding: ${encoding.rid}...');
final layer = layers.firstWhereOrNull((e) =>
// If there is exact match, use it
(e.quality.toRid() == encoding.rid) ||
@@ -67,6 +76,8 @@ class LocalTrackPublication<T extends LocalTrack> extends TrackPublication<T> {
if (result == false) {
logger.warning('Failed to update sender parameters');
}
} else {
logger.fine('Update publishing layers: nothing to change');
}
}
}