rtcEngine$onPerformanceAlarms$info$mode$reason$sourceWantedData method
- dynamic engine,
- dynamic streamId,
- dynamic info,
- dynamic mode,
- dynamic reason,
- dynamic data,
@detail callback
@author panjian.fishing
@brief When the publish performance fallback setPublishFallbackOption:{@link #ByteRTCEngine#setPublishFallbackOption} is not turned on locally, and when insufficient device performance is detected, this callback is received.
When the setPublishFallbackOption:{@link #ByteRTCEngine#setPublishFallbackOption} is locally turned on, and when the publish performance fallback/recovery is caused due to device performance/network reasons, this callback is received.
@param engine ByteRTCEngine object
@param streamId Stream ID
@param info Stream information, see ByteRTCStreamInfo{@link #ByteRTCStreamInfo}.
@param mode Indicates whether the release fallback function is turned on locally. See ByteRTCPerformanceAlarmMode{@link #ByteRTCPerformanceAlarmMode}
- When the publiiher does not turn on the release performance fallback, the mode value is ByteRTCPerformanceAlarmModeNormal.
- When the publisher turns on the release performance fallback, the mode value is ByteRTCPerformanceAlarmModeSimulcast.
@param reason For alarm reasons. See ByteRTCPerformanceAlarmReason{@link #ByteRTCPerformanceAlarmReason}
@param data Performance fallback related data. See ByteRTCSourceWantedData{@link #ByteRTCSourceWantedData}.
Implementation
FutureOr<void>
rtcEngine$onPerformanceAlarms$info$mode$reason$sourceWantedData(
dynamic engine,
dynamic streamId,
dynamic info,
dynamic mode,
dynamic reason,
dynamic data) async {
if ($instance == null || $instance is! IRTCEngineEventHandler) {
return;
}
return ($instance as IRTCEngineEventHandler).onPerformanceAlarms?.call(
streamId.toString(),
packObject(
info,
() => StreamInfo.fromMap(StreamInfo.deepPackedMapValues(
StreamInfo.mapMemberToConstructorParams(info)))),
t_PerformanceAlarmMode.ios_to_code($p_i
.ByteRTCPerformanceAlarmMode.values
.firstWhere((t) => t.$value == mode || t.name == mode)),
t_PerformanceAlarmReason.ios_to_code($p_i
.ByteRTCPerformanceAlarmReason.values
.firstWhere((t) => t.$value == reason || t.name == reason)),
packObject(
data,
() => SourceWantedData.fromMap(SourceWantedData.deepPackedMapValues(
SourceWantedData.mapMemberToConstructorParams(data)))));
}