Skip to content

Commit

Permalink
feat: support native 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed May 17, 2021
1 parent b3c5a57 commit ca658b2
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 57 deletions.
7 changes: 4 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {
def kotlin_version = rootProject.ext.has('kotlin_version') ? rootProject.ext.get('kotlin_version') : '1.3.72'

repositories {
mavenCentral()
google()
jcenter()
}

dependencies {
Expand All @@ -20,8 +20,9 @@ buildscript {

rootProject.allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}

Expand Down Expand Up @@ -50,5 +51,5 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${safeExtGet('kotlin_version', '1.3.72')}"
implementation "io.agora.rtc:full-sdk:3.4.1.1"
api 'com.github.agorabuilder:native-full-sdk:3.4.2'
}
4 changes: 0 additions & 4 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

#include "generated_plugin_registrant.h"

#include <agora_rtc_engine/agora_rtc_engine_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) agora_rtc_engine_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "AgoraRtcEnginePlugin");
agora_rtc_engine_plugin_register_with_registrar(agora_rtc_engine_registrar);
}
1 change: 0 additions & 1 deletion example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
agora_rtc_engine
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
2 changes: 0 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import FlutterMacOS
import Foundation

import agora_rtc_engine

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AgoraRtcEnginePlugin.register(with: registry.registrar(forPlugin: "AgoraRtcEnginePlugin"))
}
3 changes: 0 additions & 3 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

#include "generated_plugin_registrant.h"

#include <agora_rtc_engine/agora_rtc_engine_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
AgoraRtcEnginePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
}
1 change: 0 additions & 1 deletion example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
agora_rtc_engine
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
2 changes: 1 addition & 1 deletion ios/agora_rtc_engine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'AgoraRtcEngine_iOS', '3.4.1'
s.dependency 'AgoraRtcEngine_iOS', '3.4.2'
s.platform = :ios, '8.0'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
Expand Down
70 changes: 51 additions & 19 deletions lib/src/classes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -462,25 +462,6 @@ class ChannelMediaRelayConfiguration {
Map<String, dynamic> toJson() => _$ChannelMediaRelayConfigurationToJson(this);
}


@JsonSerializable(explicitToJson: true)
class RhythmPlayerConfig {

int beatsPerMeasure;
int beatsPerMinute;
bool publish;

/// Constructs a [ChannelMediaRelayConfiguration]
RhythmPlayerConfig(this.beatsPerMeasure, this.beatsPerMinute, this.publish);

/// @nodoc
factory RhythmPlayerConfig.fromJson(Map<String, dynamic> json) =>
_$RhythmPlayerConfigFromJson(json);

/// @nodoc
Map<String, dynamic> toJson() => _$RhythmPlayerConfigToJson(this);
}

/// Lastmile probe configuration.
@JsonSerializable(explicitToJson: true)
class LastmileProbeConfig {
Expand Down Expand Up @@ -1320,3 +1301,54 @@ class RtcEngineConfig {
/// @nodoc
Map<String, dynamic> toJson() => _$RtcEngineConfigToJson(this);
}

/// TODO(doc)
@JsonSerializable(explicitToJson: true)
class RhythmPlayerConfig {
@JsonKey(includeIfNull: false)
int beatsPerMeasure;

@JsonKey(includeIfNull: false)
int beatsPerMinute;

@JsonKey(includeIfNull: false)
bool publish;

/// Constructs a [RhythmPlayerConfig]
RhythmPlayerConfig({this.beatsPerMeasure, this.beatsPerMinute, this.publish});

/// @nodoc
factory RhythmPlayerConfig.fromJson(Map<String, dynamic> json) =>
_$RhythmPlayerConfigFromJson(json);

/// @nodoc
Map<String, dynamic> toJson() => _$RhythmPlayerConfigToJson(this);
}

/// TODO(doc)
@JsonSerializable(explicitToJson: true)
class AudioRecordingConfiguration {
String filePath;

@JsonKey(includeIfNull: false)
AudioRecordingQuality recordingQuality;

@JsonKey(includeIfNull: false)
AudioRecordingPosition recordingPosition;

@JsonKey(includeIfNull: false)
AudioSampleRateType recordingSampleRate;

/// Constructs a [AudioRecordingConfiguration]
AudioRecordingConfiguration(this.filePath,
{this.recordingQuality,
this.recordingPosition,
this.recordingSampleRate});

/// @nodoc
factory AudioRecordingConfiguration.fromJson(Map<String, dynamic> json) =>
_$AudioRecordingConfigurationFromJson(json);

/// @nodoc
Map<String, dynamic> toJson() => _$AudioRecordingConfigurationToJson(this);
}
7 changes: 3 additions & 4 deletions lib/src/enum_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ class AudioLocalStateConverter extends EnumConverter<AudioLocalState, int> {
}

@JsonSerializable()
class AudioMixingErrorCodeConverter
extends EnumConverter<AudioMixingErrorCode, int> {
AudioMixingErrorCodeConverter(AudioMixingErrorCode e) : super(e);
class AudioMixingReasonConverter extends EnumConverter<AudioMixingReason, int> {
AudioMixingReasonConverter(AudioMixingReason e) : super(e);

AudioMixingErrorCodeConverter.fromValue(int value)
AudioMixingReasonConverter.fromValue(int value)
: super.fromValue(_$AudioMixingErrorCodeEnumMap, value);

int value() {
Expand Down
52 changes: 50 additions & 2 deletions lib/src/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ enum AudioLocalState {
}

/// The error code of the audio mixing file.
enum AudioMixingErrorCode {
enum AudioMixingReason {
/// The SDK cannot open the audio mixing file.
@JsonValue(701)
CanNotOpen,
Expand All @@ -148,6 +148,34 @@ enum AudioMixingErrorCode {
@JsonValue(703)
InterruptedEOF,

/// TODO(doc)
@JsonValue(720)
StartedByUser,

/// TODO(doc)
@JsonValue(721)
OneLoopCompleted,

/// TODO(doc)
@JsonValue(722)
StartNewLoop,

/// TODO(doc)
@JsonValue(723)
AllLoopsCompleted,

/// TODO(doc)
@JsonValue(724)
StoppedByUser,

/// TODO(doc)
@JsonValue(725)
PausedByUser,

/// TODO(doc)
@JsonValue(726)
ResumedByUser,

/// No error.
@JsonValue(0)
OK,
Expand All @@ -163,6 +191,10 @@ enum AudioMixingStateCode {
@JsonValue(711)
Paused,

/// TODO(doc)
@JsonValue(712)
Restart,

/// The audio mixing file stops playing.
@JsonValue(713)
Stopped,
Expand Down Expand Up @@ -247,6 +279,7 @@ enum AudioRecordingQuality {
High,
}

/// TODO(doc)
enum AudioRecordingPosition {
/// Low quality. The sample rate is 32 KHz, and the file size is around 1.2 MB after 10 minutes of recording.
@JsonValue(0)
Expand Down Expand Up @@ -852,7 +885,7 @@ enum DegradationPreference {

/// Reserved for future use.
@JsonValue(2)
Balanced
MaintainBalanced
}

/// Encryption mode
Expand Down Expand Up @@ -1336,6 +1369,10 @@ enum LocalVideoStreamError {
/// (iOS only) The application is running in Slide Over, Split View, or Picture in Picture mode.
@JsonValue(7)
CaptureMultipleForegroundApps,

/// TODO(doc)
@JsonValue(8)
DeviceNotFound,
}

/// The state of the local video stream.
Expand Down Expand Up @@ -2344,12 +2381,15 @@ enum CaptureBrightnessLevelType {
/// Wait a few seconds to get the brightness level from [CaptureBrightnessLevelType] in the next callback.
@JsonValue(-1)
Invalid,

/// The brightness level of the video image is normal.
@JsonValue(0)
Normal,

/// The brightness level of the video image is too bright.
@JsonValue(1)
Bright,

/// The brightness level of the video image is too dark.
@JsonValue(2)
Dark,
Expand Down Expand Up @@ -2417,15 +2457,19 @@ enum ExperiencePoorReason {
/// None, indicating good QoE of the local user.
@JsonValue(0)
None,

/// The remote user’s network quality is poor.
@JsonValue(1)
RemoteNetworkQualityPoor,

/// The local user’s network quality is poor.
@JsonValue(2)
LocalNetworkQualityPoor,

/// The local user’s Wi-Fi or mobile network signal is weak.
@JsonValue(4)
WirelessSignalPoor,

/// The local user enables both Wi-Fi and bluetooth, and their signals interfere with each other. As a result, audio transmission quality is undermined.
@JsonValue(8)
WifiBluetoothCoexist,
Expand All @@ -2436,15 +2480,19 @@ enum VoiceConversionPreset {
/// Turn off voice conversion effects and use the original voice.
@JsonValue(0)
Off,

/// A gender-neutral voice. To avoid audio distortion, ensure that you use this enumerator to process a female-sounding voice.
@JsonValue(50397440)
Neutral,

/// A sweet voice. To avoid audio distortion, ensure that you use this enumerator to process a female-sounding voice.
@JsonValue(50397696)
Sweet,

/// A steady voice. To avoid audio distortion, ensure that you use this enumerator to process a male-sounding voice.
@JsonValue(50397952)
Solid,

/// A deep voice. To avoid audio distortion, ensure that you use this enumerator to process a male-sounding voice.
@JsonValue(50398208)
Bass,
Expand Down
6 changes: 3 additions & 3 deletions lib/src/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ typedef RemoteVideoStatsCallback = void Function(RemoteVideoStats stats);
typedef RemoteAudioStatsCallback = void Function(RemoteAudioStats stats);
// ignore: public_member_api_docs
typedef AudioMixingStateCallback = void Function(
AudioMixingStateCode state, AudioMixingErrorCode errorCode);
AudioMixingStateCode state, AudioMixingReason reason);
// ignore: public_member_api_docs
typedef SoundIdCallback = void Function(int soundId);
// ignore: public_member_api_docs
Expand Down Expand Up @@ -590,7 +590,7 @@ class RtcEngineEventHandler {
///
/// The `AudioMixingStateCallback` typedef includes the following parameters:
/// - [AudioMixingStateCode] `state`: The state code.
/// - [AudioMixingErrorCode] `errorCode`: The error code.
/// - [AudioMixingReason] `reason`: The reason.
AudioMixingStateCallback audioMixingStateChanged;

/// Occurs when the audio effect file playback finishes.
Expand Down Expand Up @@ -1269,7 +1269,7 @@ class RtcEngineEventHandler {
case 'AudioMixingStateChanged':
audioMixingStateChanged?.call(
AudioMixingStateCodeConverter.fromValue(data[0]).e,
AudioMixingErrorCodeConverter.fromValue(data[1]).e,
AudioMixingReasonConverter.fromValue(data[1]).e,
);
break;
case 'AudioEffectFinished':
Expand Down
Loading

0 comments on commit ca658b2

Please sign in to comment.