more logging for dynacast
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user