Skip to content

Commit

Permalink
feat: support native sdk 3.5.1 (#472)
Browse files Browse the repository at this point in the history
* feat: support native sdk 3.5.1

* Fix CI error
  • Loading branch information
littleGnAl committed Oct 26, 2021
1 parent 11d24f9 commit 170783f
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 28 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
api 'com.github.agorabuilder:native-full-sdk:3.5.0.3'
api 'com.github.agorabuilder:native-full-sdk:3.5.1'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${safeExtGet('kotlin_version', '1.3.72')}"
}
11 changes: 8 additions & 3 deletions android/src/main/java/io/agora/rtc/base/RtcEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class IRtcEngine {

fun getAudioMixingDuration(params: Map<String, *>, callback: Callback)

fun getAudioFileInfo(params: Map<String, *>, callback: Callback)

fun getAudioMixingCurrentPosition(callback: Callback)

fun setAudioMixingPosition(params: Map<String, *>, callback: Callback)
Expand Down Expand Up @@ -817,11 +819,14 @@ open class RtcEngineManager(
}

override fun getAudioMixingDuration(params: Map<String, *>, callback: Callback) {
callback.code(engine?.audioMixingDuration) { it }
}

override fun getAudioFileInfo(params: Map<String, *>, callback: Callback) {
(params["filePath"] as? String)?.let { file ->
callback.code(engine?.getAudioMixingDuration(file)) { it }
return@getAudioMixingDuration
callback.code(engine?.getAudioFileInfo(file)) { it }
return@getAudioFileInfo
}
callback.code(engine?.audioMixingDuration) { it }
}

override fun getAudioMixingCurrentPosition(callback: Callback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,22 @@ class FakeRtcEngine : RtcEngineEx(), IAudioEffectManager {
return 0
}

override fun selectAudioTrack(audioIndex: Int): Int {
return 0
}

override fun getAudioTrackCount(): Int {
return 0
}

override fun setAudioMixingDualMonoMode(mode: Int): Int {
return 0
}

override fun setAudioMixingPlaybackSpeed(speed: Int): Int {
return 0
}

override fun stopAudioMixing(): Int {
return 0
}
Expand Down Expand Up @@ -362,10 +378,6 @@ class FakeRtcEngine : RtcEngineEx(), IAudioEffectManager {
return 0
}

override fun getAudioMixingDuration(filePath: String?): Int {
return 0
}

override fun getAudioMixingCurrentPosition(): Int {
return 0
}
Expand All @@ -382,6 +394,10 @@ class FakeRtcEngine : RtcEngineEx(), IAudioEffectManager {
return this
}

override fun getAudioFileInfo(filePath: String?): Int {
return 0
}

override fun startAudioRecording(filePath: String?, quality: Int): Int {
return 0
}
Expand Down Expand Up @@ -454,6 +470,14 @@ class FakeRtcEngine : RtcEngineEx(), IAudioEffectManager {
return 0
}

override fun pushExternalAudioFrame(data: ByteArray?, timestamp: Long, sampleRate: Int, channels: Int, bytesPerSample: Int, sourcePos: Int): Int {
return 0
}

override fun setExternalAudioSourceVolume(sourcePos: Int, volume: Int): Int {
return 0
}

override fun setExternalVideoSource(enable: Boolean, useTexture: Boolean, pushMode: Boolean) {
}

Expand Down Expand Up @@ -706,6 +730,14 @@ class FakeRtcEngine : RtcEngineEx(), IAudioEffectManager {
return 0
}

override fun pauseAllChannelMediaRelay(): Int {
return 0
}

override fun resumeAllChannelMediaRelay(): Int {
return 0
}

override fun startDumpVideoReceiveTrack(uid: Int, dumpFile: String?): Int {
return 0
}
Expand Down Expand Up @@ -1024,6 +1056,14 @@ class FakeRtcChannel : RtcChannel() {
return 0
}

override fun pauseAllChannelMediaRelay(): Int {
return 0
}

override fun resumeAllChannelMediaRelay(): Int {
return 0
}

override fun setRemoteVideoRenderer(uid: Int, render: IVideoSink?): Int {
return 0
}
Expand Down
30 changes: 15 additions & 15 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
71E2A2A32722C75F00C7B7BC /* FakeAgoraRtcEngineKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71E2A2A02722C75F00C7B7BC /* FakeAgoraRtcEngineKit.swift */; };
71E2A2A52722C80800C7B7BC /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71E2A2A42722C80800C7B7BC /* RunnerTests.swift */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
79A46E92E4ECC918A6416856 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C19073D58DAE1174E6498C5 /* libPods-RunnerTests.a */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -71,9 +70,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9C19073D58DAE1174E6498C5 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
E5064CBFB9AE669943232E3B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
EABB33DE0B3F52DFFE20C9CF /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -473,7 +470,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -488,9 +485,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = GM72UGLGZW;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -508,7 +506,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = io.agora.agoraRtcEngineExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = App;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -667,7 +665,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -716,7 +714,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -733,9 +731,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = GM72UGLGZW;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -753,7 +752,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = io.agora.agoraRtcEngineExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = App;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
Expand All @@ -767,9 +766,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = GM72UGLGZW;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -787,7 +787,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = io.agora.agoraRtcEngineExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = App;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
13 changes: 9 additions & 4 deletions ios/Classes/Base/RtcEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ protocol RtcEngineAudioMixingInterface {
func getAudioMixingPublishVolume(_ callback: Callback)

func getAudioMixingDuration(_ params: NSDictionary, _ callback: Callback)

func getAudioFileInfo(_ params: NSDictionary, _ callback: Callback)

func getAudioMixingCurrentPosition(_ callback: Callback)

Expand Down Expand Up @@ -707,15 +709,18 @@ class RtcEngineManager: NSObject, RtcEngineInterface {
}

@objc func getAudioMixingDuration(_ params: NSDictionary, _ callback: Callback) {
callback.code(engine?.getAudioMixingDuration()) {
$0
}
}

@objc func getAudioFileInfo(_ params: NSDictionary, _ callback: Callback) {
if let filePath = (params["filePath"] as? String) {
callback.code(engine?.getAudioMixingDuration(filePath)) {
callback.code(engine?.getAudioFileInfo(filePath)) {
$0
}
return
}
callback.code(engine?.getAudioMixingDuration()) {
$0
}
}

@objc func getAudioMixingCurrentPosition(_ callback: Callback) {
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.5.0.3'
s.dependency 'AgoraRtcEngine_iOS', '3.5.1'
s.platform = :ios, '8.0'

# Flutter.framework does not contain a i386 slice.
Expand Down

0 comments on commit 170783f

Please sign in to comment.