refact: quality status event (#9268)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
3bd34bf0b9
commit
7a1157f1b0
flutter/lib
@ -595,7 +595,8 @@ class QualityMonitor extends StatelessWidget {
|
||||
"${qualityMonitorModel.data.targetBitrate ?? '-'}kb"),
|
||||
_row(
|
||||
"Codec", qualityMonitorModel.data.codecFormat ?? '-'),
|
||||
_row("Chroma", qualityMonitorModel.data.chroma ?? '-'),
|
||||
if (!isWeb)
|
||||
_row("Chroma", qualityMonitorModel.data.chroma ?? '-'),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
@ -2230,8 +2230,10 @@ class QualityMonitorModel with ChangeNotifier {
|
||||
|
||||
updateQualityStatus(Map<String, dynamic> evt) {
|
||||
try {
|
||||
if ((evt['speed'] as String).isNotEmpty) _data.speed = evt['speed'];
|
||||
if ((evt['fps'] as String).isNotEmpty) {
|
||||
if (evt.containsKey('speed') && (evt['speed'] as String).isNotEmpty) {
|
||||
_data.speed = evt['speed'];
|
||||
}
|
||||
if (evt.containsKey('fps') && (evt['fps'] as String).isNotEmpty) {
|
||||
final fps = jsonDecode(evt['fps']) as Map<String, dynamic>;
|
||||
final pi = parent.target?.ffiModel.pi;
|
||||
if (pi != null) {
|
||||
@ -2252,14 +2254,18 @@ class QualityMonitorModel with ChangeNotifier {
|
||||
_data.fps = null;
|
||||
}
|
||||
}
|
||||
if ((evt['delay'] as String).isNotEmpty) _data.delay = evt['delay'];
|
||||
if ((evt['target_bitrate'] as String).isNotEmpty) {
|
||||
if (evt.containsKey('delay') && (evt['delay'] as String).isNotEmpty) {
|
||||
_data.delay = evt['delay'];
|
||||
}
|
||||
if (evt.containsKey('target_bitrate') &&
|
||||
(evt['target_bitrate'] as String).isNotEmpty) {
|
||||
_data.targetBitrate = evt['target_bitrate'];
|
||||
}
|
||||
if ((evt['codec_format'] as String).isNotEmpty) {
|
||||
if (evt.containsKey('codec_format') &&
|
||||
(evt['codec_format'] as String).isNotEmpty) {
|
||||
_data.codecFormat = evt['codec_format'];
|
||||
}
|
||||
if ((evt['chroma'] as String).isNotEmpty) {
|
||||
if (evt.containsKey('chroma') && (evt['chroma'] as String).isNotEmpty) {
|
||||
_data.chroma = evt['chroma'];
|
||||
}
|
||||
notifyListeners();
|
||||
|
Loading…
x
Reference in New Issue
Block a user