Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support 4.4.0 #795

Merged
merged 40 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2f9870e
chore: convert unsigned long long to number EP-600
guoxianzhe May 9, 2024
8b5f0a7
chore: optimize
guoxianzhe Jun 7, 2024
a8a9a25
Merge branch 'main' into dev/4.4.0
guoxianzhe Jun 7, 2024
6b646e8
feat(example): add AudioCallRoute, call quality monitoring in JoinCha…
guoxianzhe Jun 7, 2024
00f89b0
feat(example): processVideoRawData from native side
guoxianzhe Jun 14, 2024
0750739
chore: generate codes by terra with 4.4.0
guoxianzhe Jun 14, 2024
f31ac96
chore: bump iris to 4.4.0-dev.1
guoxianzhe Jun 14, 2024
635f1a8
chore: optimize
guoxianzhe Jun 14, 2024
cc845a0
ci: terra workflow_dispatch
guoxianzhe Jun 14, 2024
8afbc8c
chore: synchronized control irisApiCall ep-629
guoxianzhe Jun 21, 2024
ed01994
chore: terra adapt overrideNodeParser
guoxianzhe Jun 21, 2024
4bbd0ff
[AUTO] Generate codes by terra (#798)
sda-rob Jun 21, 2024
561a07b
[AUTO] Generate codes by terra (#799)
sda-rob Jun 24, 2024
2e492cd
chore: bump iris to 4.4.0-dev.4
guoxianzhe Jun 24, 2024
4924db1
[AUTO] Generate codes by terra (#800)
sda-rob Jun 24, 2024
e5d673a
chore: optimize
guoxianzhe Jun 24, 2024
518fca9
chore: optimize
guoxianzhe Jun 24, 2024
f0a9124
chore: optimize
guoxianzhe Jun 24, 2024
a580200
chore: optimize
guoxianzhe Jun 25, 2024
50e4d86
chore: optimize
guoxianzhe Jun 25, 2024
3242551
chore: optimize
guoxianzhe Jul 29, 2024
0305f4c
chore: optimize
guoxianzhe Jul 29, 2024
00a3e28
[AUTO] Generate codes by terra (#804)
sda-rob Jul 29, 2024
724a553
chore: optimize
guoxianzhe Jul 29, 2024
fcb485d
[AUTO] Update dependencies (#806)
sda-rob Aug 5, 2024
fe81247
chore: optimize
guoxianzhe Aug 5, 2024
d8e6d32
chore: optimize
guoxianzhe Aug 6, 2024
37de6ae
chore: optimize
guoxianzhe Aug 6, 2024
cbc643b
Revert "chore: optimize"
guoxianzhe Aug 6, 2024
d1fbdfa
Revert "chore: optimize"
guoxianzhe Aug 6, 2024
9859e49
chore: optimize
guoxianzhe Aug 6, 2024
e043377
chore: optimize
guoxianzhe Aug 6, 2024
9dc0e94
chore: fix extension demo NMS-21902
guoxianzhe Aug 8, 2024
927457b
chore: optimize
guoxianzhe Aug 19, 2024
15a0ae9
Revert "chore: optimize"
guoxianzhe Aug 19, 2024
1ad0af7
chore: optimize
guoxianzhe Aug 20, 2024
4858efd
chore: optimize
guoxianzhe Aug 21, 2024
6e4498c
chore: remove doc ci
guoxianzhe Aug 21, 2024
0c74a60
[AUTO] Generate codes by terra (#810)
sda-rob Aug 22, 2024
9846ac1
chore: optimize
guoxianzhe Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"root": true,
"extends": [
"@react-native",
"prettier"
],
"plugins": [
"import",
"auto-import"
],
"extends": ["@react-native", "prettier"],
"env": {
"es2020": true
},
"plugins": ["import", "auto-import"],
"rules": {
"prettier/prettier": [
"error",
Expand Down
26 changes: 2 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ concurrency:

on:
workflow_dispatch:
inputs:
force:
description: 'force build'
required: false
type: boolean
default: false
build_ios:
description: 'build iOS'
required: false
type: boolean
default: true

jobs:
build-android:
Expand Down Expand Up @@ -78,7 +67,7 @@ jobs:

- name: Build example for Android
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force="${{ inputs.force }}"
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force=true

- name: Upload APK
uses: actions/upload-artifact@v3
Expand All @@ -89,7 +78,6 @@ jobs:
if-no-files-found: error

build-ios:
if: ${{ inputs.build_ios }}
runs-on: macos-latest
env:
TURBO_CACHE_DIR: .turbo/ios
Expand All @@ -113,15 +101,6 @@ jobs:
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
if: ${{ !inputs.force }}
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
Expand All @@ -134,7 +113,6 @@ jobs:
${{ runner.os }}-cocoapods-0-

- name: Install cocoapods
if: ${{ inputs.force }} || (env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true')
run: |
yarn pod-install example/ios

Expand Down Expand Up @@ -175,7 +153,7 @@ jobs:

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force="${{ inputs.force }}"
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force=true

- name: Upload IPA
uses: actions/upload-artifact@v3
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/doc.yml

This file was deleted.

6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
api 'io.agora.rtc:full-sdk:4.3.2'
implementation 'io.agora.rtc:full-screen-sharing:4.3.2'
implementation 'io.agora.rtc:iris-rtc:4.3.2-build.1'
api 'io.agora.rtc:full-sdk:4.4.1'
implementation 'io.agora.rtc:full-screen-sharing:4.4.1'
implementation 'io.agora.rtc:iris-rtc:4.4.0-build.6'
}

if (isNewArchitectureEnabled()) {
Expand Down
67 changes: 37 additions & 30 deletions android/src/main/java/io/agora/rtc/ng/react/AgoraRtcNgModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@ReactModule(name = AgoraRtcNgModule.NAME)
public class AgoraRtcNgModule extends AgoraRtcNgSpec implements IrisEventHandler {
public static final String NAME = "AgoraRtcNg";
public final Object irisApiLock = new Object();
public IrisApiEngine irisApiEngine;

AgoraRtcNgModule(ReactApplicationContext context) {
Expand All @@ -41,49 +42,55 @@ public String getName() {

@ReactMethod(isBlockingSynchronousMethod = true)
public boolean newIrisApiEngine() {
if (irisApiEngine == null) {
IrisApiEngine.enableUseJsonArray(true);
irisApiEngine = new IrisApiEngine(getReactApplicationContext());
irisApiEngine.setEventHandler(this);
return true;
synchronized (irisApiLock) {
if (irisApiEngine == null) {
IrisApiEngine.enableUseJsonArray(true);
irisApiEngine = new IrisApiEngine(getReactApplicationContext());
irisApiEngine.setEventHandler(this);
return true;
}
}
return false;
}

@ReactMethod(isBlockingSynchronousMethod = true)
public boolean destroyIrisApiEngine() {
if (irisApiEngine != null) {
irisApiEngine.setEventHandler(null);
irisApiEngine.destroy();
irisApiEngine = null;
return true;
synchronized (irisApiLock) {
if (irisApiEngine != null) {
irisApiEngine.setEventHandler(null);
irisApiEngine.destroy();
irisApiEngine = null;
return true;
}
}
return false;
}

@ReactMethod(isBlockingSynchronousMethod = true)
public String callApi(ReadableMap args) {
String funcName = args.getString("funcName");
String params = args.getString("params");
List<byte[]> buffers = null;

ReadableArray array = args.getArray("buffers");
if (array != null) {
buffers = new ArrayList<>();
for (int i = 0; i < array.size(); i++) {
buffers.add(Base64.decode(array.getString(i), Base64.DEFAULT));
synchronized (irisApiLock) {
String funcName = args.getString("funcName");
String params = args.getString("params");
List<byte[]> buffers = null;

ReadableArray array = args.getArray("buffers");
if (array != null) {
buffers = new ArrayList<>();
for (int i = 0; i < array.size(); i++) {
buffers.add(Base64.decode(array.getString(i), Base64.DEFAULT));
}
}
}

try {
newIrisApiEngine();
return irisApiEngine.callIrisApi(funcName, params, buffers);
} catch (Exception e) {
e.printStackTrace();
try {
return new JSONObject().put("result", e.getMessage()).toString();
} catch (JSONException ex) {
throw new RuntimeException(ex);
newIrisApiEngine();
return irisApiEngine.callIrisApi(funcName, params, buffers);
} catch (Exception e) {
e.printStackTrace();
try {
return new JSONObject().put("result", e.getMessage()).toString();
} catch (JSONException ex) {
throw new RuntimeException(ex);
}
}
}
}
Expand Down Expand Up @@ -117,7 +124,7 @@ public void OnEvent(String event, String data, List<byte[]> buffers) {
map.putArray("buffers", array);
}
getReactApplicationContext()
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("AgoraRtcNg:onEvent", map);
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("AgoraRtcNg:onEvent", map);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ public void setCallApi(FrameLayout view, @Nullable ReadableMap arguments) {
String funcName = arguments.getString("funcName");
String params = arguments.getString("params");
AgoraRtcNgModule module = context.getNativeModule(AgoraRtcNgModule.class);
if (module != null) {
try {
module.irisApiEngine.callIrisApi(funcName, params, view.getChildAt(0));
} catch (Exception e) {
e.printStackTrace();
synchronized (module.irisApiLock) {
if (module != null) {
try {
module.irisApiEngine.callIrisApi(funcName, params, view.getChildAt(0));
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ public void setCallApi(TextureView view, @Nullable ReadableMap arguments) {
String funcName = arguments.getString("funcName");
String params = arguments.getString("params");
AgoraRtcNgModule module = context.getNativeModule(AgoraRtcNgModule.class);
if (module != null) {
try {
module.irisApiEngine.callIrisApi(funcName, params, view);
} catch (Exception e) {
e.printStackTrace();
synchronized (module.irisApiLock) {
if (module != null) {
try {
module.irisApiEngine.callIrisApi(funcName, params, view);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Any scene of this project can run successfully alone.

| Demo | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [AudioCallRoute](./src/examples/advanced/AudioCallRoute) | control audio call route |
| [AudioMixing](./src/examples/advanced/AudioMixing) | Starts playing the music file |
| [AudioSpectrum](./src/examples/advanced/AudioSpectrum) | Turn on audio spectrum monitoring |
| [BeautyEffect](./src/examples/advanced/BeautyEffect) | Sets the image enhancement options |
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ android {
}

dependencies {
androidTestImplementation('com.wix:detox:+')
androidTestImplementation('com.wix:detox-legacy:+')
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new VideoRawDataNativeModulePackage());
return packages;
}

Expand Down
Loading
Loading