diff --git a/lib/src/agora_base.dart b/lib/src/agora_base.dart index e40dd2ec3..7ec8c6ecd 100644 --- a/lib/src/agora_base.dart +++ b/lib/src/agora_base.dart @@ -930,6 +930,10 @@ extension OrientationModeExt on OrientationMode { /// Video degradation preferences when the bandwidth is a constraint. @JsonEnum(alwaysCreate: true) enum DegradationPreference { + /// @nodoc + @JsonValue(-1) + maintainAuto, + /// 0: (Default) Prefers to reduce the video frame rate while maintaining video resolution during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized. @JsonValue(0) maintainQuality, diff --git a/lib/src/agora_base.g.dart b/lib/src/agora_base.g.dart index 92dc1822c..0583de089 100644 --- a/lib/src/agora_base.g.dart +++ b/lib/src/agora_base.g.dart @@ -436,6 +436,7 @@ const _$OrientationModeEnumMap = { }; const _$DegradationPreferenceEnumMap = { + DegradationPreference.maintainAuto: -1, DegradationPreference.maintainQuality: 0, DegradationPreference.maintainFramerate: 1, DegradationPreference.maintainBalanced: 2, diff --git a/lib/src/agora_rtc_engine.dart b/lib/src/agora_rtc_engine.dart index a4fbfd16a..3adad3529 100644 --- a/lib/src/agora_rtc_engine.dart +++ b/lib/src/agora_rtc_engine.dart @@ -110,6 +110,10 @@ enum AudioMixingReasonType { @JsonValue(724) audioMixingReasonStoppedByUser, + /// @nodoc + @JsonValue(726) + audioMixingReasonResumedByUser, + /// 0: The SDK opens music file successfully. @JsonValue(0) audioMixingReasonOk, @@ -5475,7 +5479,7 @@ abstract class RtcEngine { Future> queryCameraFocalLengthCapability(); /// @nodoc - Future setExternalMediaProjection(); + Future setExternalMediaProjection(int mediaProjection); /// Sets the screen sharing scenario. /// diff --git a/lib/src/agora_rtc_engine.g.dart b/lib/src/agora_rtc_engine.g.dart index 1e3881c25..555752915 100644 --- a/lib/src/agora_rtc_engine.g.dart +++ b/lib/src/agora_rtc_engine.g.dart @@ -1051,6 +1051,7 @@ const _$AudioMixingReasonTypeEnumMap = { AudioMixingReasonType.audioMixingReasonOneLoopCompleted: 721, AudioMixingReasonType.audioMixingReasonAllLoopsCompleted: 723, AudioMixingReasonType.audioMixingReasonStoppedByUser: 724, + AudioMixingReasonType.audioMixingReasonResumedByUser: 726, AudioMixingReasonType.audioMixingReasonOk: 0, }; diff --git a/lib/src/binding/agora_rtc_engine_impl.dart b/lib/src/binding/agora_rtc_engine_impl.dart index d187742b5..ff4f79e81 100644 --- a/lib/src/binding/agora_rtc_engine_impl.dart +++ b/lib/src/binding/agora_rtc_engine_impl.dart @@ -3983,10 +3983,10 @@ class RtcEngineImpl implements RtcEngine { } @override - Future setExternalMediaProjection() async { + Future setExternalMediaProjection(int mediaProjection) async { final apiType = '${isOverrideClassName ? className : 'RtcEngine'}_setExternalMediaProjection_f337cbf'; - final param = createParams({}); + final param = createParams({'mediaProjection': mediaProjection}); final callApiResult = await irisMethodChannel.invokeMethod( IrisMethodCall(apiType, jsonEncode(param), buffers: null)); if (callApiResult.irisReturnCode < 0) { @@ -3997,9 +3997,6 @@ class RtcEngineImpl implements RtcEngine { if (result < 0) { throw AgoraRtcException(code: result); } - final setExternalMediaProjectionJson = - RtcEngineSetExternalMediaProjectionJson.fromJson(rm); - return setExternalMediaProjectionJson.mediaProjection; } @override diff --git a/lib/src/binding/call_api_impl_params_json.dart b/lib/src/binding/call_api_impl_params_json.dart index f5d12b29e..340d8ff81 100644 --- a/lib/src/binding/call_api_impl_params_json.dart +++ b/lib/src/binding/call_api_impl_params_json.dart @@ -360,21 +360,6 @@ class RtcEngineQueryCameraFocalLengthCapabilityJson { _$RtcEngineQueryCameraFocalLengthCapabilityJsonToJson(this); } -@JsonSerializable(explicitToJson: true, includeIfNull: false) -class RtcEngineSetExternalMediaProjectionJson { - const RtcEngineSetExternalMediaProjectionJson(this.mediaProjection); - - @JsonKey(name: 'mediaProjection', readValue: readIntPtr) - final int mediaProjection; - - factory RtcEngineSetExternalMediaProjectionJson.fromJson( - Map json) => - _$RtcEngineSetExternalMediaProjectionJsonFromJson(json); - - Map toJson() => - _$RtcEngineSetExternalMediaProjectionJsonToJson(this); -} - @JsonSerializable(explicitToJson: true, includeIfNull: false) class RtcEngineGetCallIdJson { const RtcEngineGetCallIdJson(this.callId); diff --git a/lib/src/binding/call_api_impl_params_json.g.dart b/lib/src/binding/call_api_impl_params_json.g.dart index d82f5310f..919265014 100644 --- a/lib/src/binding/call_api_impl_params_json.g.dart +++ b/lib/src/binding/call_api_impl_params_json.g.dart @@ -325,19 +325,6 @@ Map _$RtcEngineQueryCameraFocalLengthCapabilityJsonToJson( instance.focalLengthInfos.map((e) => e.toJson()).toList(), }; -RtcEngineSetExternalMediaProjectionJson - _$RtcEngineSetExternalMediaProjectionJsonFromJson( - Map json) => - RtcEngineSetExternalMediaProjectionJson( - (readIntPtr(json, 'mediaProjection') as num).toInt(), - ); - -Map _$RtcEngineSetExternalMediaProjectionJsonToJson( - RtcEngineSetExternalMediaProjectionJson instance) => - { - 'mediaProjection': instance.mediaProjection, - }; - RtcEngineGetCallIdJson _$RtcEngineGetCallIdJsonFromJson( Map json) => RtcEngineGetCallIdJson( diff --git a/lib/src/binding/event_handler_param_json.g.dart b/lib/src/binding/event_handler_param_json.g.dart index 2bf1b492b..0a4292c10 100644 --- a/lib/src/binding/event_handler_param_json.g.dart +++ b/lib/src/binding/event_handler_param_json.g.dart @@ -2515,6 +2515,7 @@ const _$AudioMixingReasonTypeEnumMap = { AudioMixingReasonType.audioMixingReasonOneLoopCompleted: 721, AudioMixingReasonType.audioMixingReasonAllLoopsCompleted: 723, AudioMixingReasonType.audioMixingReasonStoppedByUser: 724, + AudioMixingReasonType.audioMixingReasonResumedByUser: 726, AudioMixingReasonType.audioMixingReasonOk: 0, }; diff --git a/test_shard/fake_test_app/integration_test/generated/rtcengine_fake_test.generated.dart b/test_shard/fake_test_app/integration_test/generated/rtcengine_fake_test.generated.dart index eaa2e9fb0..5f562df09 100644 --- a/test_shard/fake_test_app/integration_test/generated/rtcengine_fake_test.generated.dart +++ b/test_shard/fake_test_app/integration_test/generated/rtcengine_fake_test.generated.dart @@ -1031,7 +1031,7 @@ void rtcEngineSmokeTestCases() { OrientationMode configOrientationMode = OrientationMode.orientationModeAdaptive; DegradationPreference configDegradationPreference = - DegradationPreference.maintainQuality; + DegradationPreference.maintainAuto; VideoMirrorModeType configMirrorMode = VideoMirrorModeType.videoMirrorModeAuto; EncodingPreference advanceOptionsEncodingPreference = @@ -7461,7 +7461,10 @@ void rtcEngineSmokeTestCases() { await rtcEngine.setParameters('{"rtc.enable_debug_log": true}'); try { - await rtcEngine.setExternalMediaProjection(); + int mediaProjection = 5; + await rtcEngine.setExternalMediaProjection( + mediaProjection, + ); } catch (e) { if (e is! AgoraRtcException) { debugPrint( @@ -7885,7 +7888,7 @@ void rtcEngineSmokeTestCases() { OrientationMode videoOutputConfigurationOrientationMode = OrientationMode.orientationModeAdaptive; DegradationPreference videoOutputConfigurationDegradationPreference = - DegradationPreference.maintainQuality; + DegradationPreference.maintainAuto; VideoMirrorModeType videoOutputConfigurationMirrorMode = VideoMirrorModeType.videoMirrorModeAuto; EncodingPreference advanceOptionsEncodingPreference = @@ -7967,7 +7970,7 @@ void rtcEngineSmokeTestCases() { OrientationMode videoOutputConfigurationOrientationMode = OrientationMode.orientationModeAdaptive; DegradationPreference videoOutputConfigurationDegradationPreference = - DegradationPreference.maintainQuality; + DegradationPreference.maintainAuto; VideoMirrorModeType videoOutputConfigurationMirrorMode = VideoMirrorModeType.videoMirrorModeAuto; EncodingPreference advanceOptionsEncodingPreference = @@ -9897,7 +9900,7 @@ void rtcEngineSmokeTestCases() { OrientationMode configOrientationMode = OrientationMode.orientationModeAdaptive; DegradationPreference configDegradationPreference = - DegradationPreference.maintainQuality; + DegradationPreference.maintainAuto; VideoMirrorModeType configMirrorMode = VideoMirrorModeType.videoMirrorModeAuto; EncodingPreference advanceOptionsEncodingPreference = diff --git a/test_shard/fake_test_app/integration_test/generated/rtcengineex_fake_test.generated.dart b/test_shard/fake_test_app/integration_test/generated/rtcengineex_fake_test.generated.dart index 86d46805c..cf29ceab7 100644 --- a/test_shard/fake_test_app/integration_test/generated/rtcengineex_fake_test.generated.dart +++ b/test_shard/fake_test_app/integration_test/generated/rtcengineex_fake_test.generated.dart @@ -376,7 +376,7 @@ void rtcEngineExSmokeTestCases() { OrientationMode configOrientationMode = OrientationMode.orientationModeAdaptive; DegradationPreference configDegradationPreference = - DegradationPreference.maintainQuality; + DegradationPreference.maintainAuto; VideoMirrorModeType configMirrorMode = VideoMirrorModeType.videoMirrorModeAuto; EncodingPreference advanceOptionsEncodingPreference =