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.2.3 #1081

Merged
merged 44 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
51cd046
chore: update terra to 4.2.3
LichKing-2234 Sep 4, 2023
0e8e620
[AUTO] Generate code by terra (#1067)
LichKing-2234 Sep 8, 2023
c2222ff
[WIP]
LichKing-2234 Sep 21, 2023
43e6519
fix: `GetVideoFrame ret is` log too much
LichKing-2234 Sep 21, 2023
dc11f64
[AUTO] Generate code by terra (#1074)
LichKing-2234 Sep 21, 2023
71e67b5
build: remove `--verbose`
LichKing-2234 Sep 21, 2023
27a2d1c
build: ignore some dependencies
LichKing-2234 Sep 21, 2023
78b5aa8
[WIP]
LichKing-2234 Sep 21, 2023
2d9da5f
chore: lock version
LichKing-2234 Sep 21, 2023
a63defa
[WIP]
LichKing-2234 Sep 21, 2023
c4911e7
[WIP]
LichKing-2234 Sep 21, 2023
bd9f945
[WIP]
LichKing-2234 Sep 22, 2023
e7f0358
[WIP]
LichKing-2234 Sep 22, 2023
862ef20
[WIP]
LichKing-2234 Sep 22, 2023
876e955
[WIP]
LichKing-2234 Sep 22, 2023
d61daad
[WIP]
LichKing-2234 Sep 22, 2023
deddf7a
[WIP]
LichKing-2234 Sep 22, 2023
0684c5b
[WIP]
LichKing-2234 Sep 22, 2023
eba2fef
[WIP]
LichKing-2234 Sep 22, 2023
8a3640e
[WIP]
LichKing-2234 Sep 22, 2023
b76fdfe
[WIP]
LichKing-2234 Sep 22, 2023
f156c53
[WIP]
LichKing-2234 Sep 22, 2023
477caff
[WIP]
LichKing-2234 Sep 22, 2023
f880e05
chore: release 4.2.3-dev.3
LichKing-2234 Sep 22, 2023
858db50
chore(example): update example to install [email protected]
LichKing-2234 Sep 22, 2023
4fd9208
[WIP]
LichKing-2234 Sep 22, 2023
5a9cd6c
[WIP]
LichKing-2234 Sep 22, 2023
de943a9
[WIP]
LichKing-2234 Sep 22, 2023
33cd271
fix: d3d11_texture_2d NMS-15857
LichKing-2234 Sep 25, 2023
52c4022
[Test]
LichKing-2234 Sep 25, 2023
ddc5f59
[Test]
LichKing-2234 Sep 25, 2023
0f39df3
[WIP]
LichKing-2234 Sep 25, 2023
1065ac1
[WIP]
LichKing-2234 Sep 25, 2023
632c701
[WIP]
LichKing-2234 Sep 25, 2023
5284df0
fix: only can open after preload
LichKing-2234 Sep 25, 2023
b66088b
fix: addListener more than once NMS-15883
LichKing-2234 Sep 26, 2023
f76a783
fix: setState miss data issue
LichKing-2234 Sep 28, 2023
cd7f021
[WIP]
LichKing-2234 Sep 28, 2023
352d13d
chore: update to 4.2.3-build.1
LichKing-2234 Oct 7, 2023
f4f4c9c
[AUTO] Generate comments by iris-doc (#1076)
LichKing-2234 Oct 7, 2023
7a8a8a1
ci: update terra
LichKing-2234 Oct 7, 2023
b297228
[AUTO] Generate code by terra (#1079)
LichKing-2234 Oct 7, 2023
491a63f
[AUTO] Generate comments by iris-doc (#1080)
LichKing-2234 Oct 7, 2023
4950988
chore: wip
LichKing-2234 Oct 12, 2023
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
78 changes: 77 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
types: [ published ]

jobs:
build:
build-jenkins:
runs-on: ubuntu-latest
steps:
- name: Build
Expand All @@ -32,3 +32,79 @@ jobs:
curl -X POST -sS -D- -o/dev/null ${{secrets.JENKINS_BUILD_URL}} \
-H 'Content-Type: application/json' \
-d "{\"branch\": \"${{github.ref_name}}\", \"type\": \"${type}\"}"

build-windows:
if: ${{ inputs.type == 'demo' }}
strategy:
matrix:
arch: [ ia32, x64 ]
runs-on: windows-latest
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_agora_electron_arch: ${{ matrix.arch }}
npm_config_agora_electron_sdk_arch: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build SDK
run: |
yarn totalBuild
yarn zipBuild
yarn link

- name: Build Example
run: |
yarn install
yarn link agora-electron-sdk
yarn dist:win --${{ matrix.arch }}
yarn unlink agora-electron-sdk
working-directory: example

- uses: actions/upload-artifact@v3
with:
name: AgoraRtcNgExample-win-${{ matrix.arch }}
path: |
example/dist/Agora-Electron-API-Example-*-win.zip


build-mac:
if: ${{ inputs.type == 'demo' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build SDK
run: |
yarn totalBuild
yarn zipBuild
yarn link

- name: Build Example
run: |
yarn install
yarn link agora-electron-sdk
yarn dist:mac
yarn unlink agora-electron-sdk
env:
USE_HARD_LINKS: false
working-directory: example

- uses: actions/upload-artifact@v3
with:
name: AgoraRtcNgExample-mac
path: |
example/dist/Agora-Electron-API-Example-*-mac.zip

notification:
runs-on: ubuntu-latest
needs: [ build-windows, build-mac ]
steps:
- run: |
curl -X POST "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ secrets.WECHAT_KEY }}" -d '{"msgtype":"text","text":{"content":"Electron Example:\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}'
6 changes: 6 additions & 0 deletions .github/workflows/terra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Generate codes

on:
workflow_dispatch:
inputs:
terra-ref:
description: The terra repo ref
required: true
default: "main"

jobs:
generate-codes:
Expand All @@ -19,6 +24,7 @@ jobs:
LLVM_DOWNLOAD_URL: |
https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
with:
terra-ref: ${{ inputs.terra-ref }}
target-path: ${{ github.workspace }}
config: ci/config/terra_config.yaml
output-dir: ts/Private
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


## [4.2.3-dev.3](https://github.com/AgoraIO-Extensions/Electron-SDK/compare/v4.2.2...v4.2.3-dev.3) (2023-09-22)


### Bug Fixes

* `GetVideoFrame ret is` log too much ([43e6519](https://github.com/AgoraIO-Extensions/Electron-SDK/commit/43e6519c630acf3e4233a891bf5b4f7d938813b3))

## [4.2.2](https://github.com/AgoraIO-Extensions/Electron-SDK/compare/v4.2.1...v4.2.2) (2023-08-01)


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ $ npm install #or yarn
$ npm install --agora_electron_sdk_pre_built=false

# build 32 bit architecture on Windows
$ npm install --verbose --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=ia32
$ npm install --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=ia32

# build 64 bit architecture on Windows
$ npm install --verbose --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=x64
$ npm install --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=x64
```

## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/AgoraIO-Extensions/Electron-SDK/pulls)
Expand Down
2 changes: 1 addition & 1 deletion ci/config/terra_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: shared:rtc_4.2.2/shared_configs.yaml
include: shared:rtc_4.2.3/shared_configs.yaml

language: ts

Expand Down
6 changes: 3 additions & 3 deletions ci/electron-sdk-build-mac-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/
rm -rf node_modules
rm -rf sdk
rm -rf tmp
# npm install --verbose
# npm install
#
# Example 2
npm config set agora_electron_sdk_pre_built false
npm install --verbose
npm run totalBuild --verbose
npm install
npm run totalBuild
npm run zipBuild
npm config delete agora_electron_sdk_pre_built
#
Expand Down
8 changes: 4 additions & 4 deletions ci/electron-sdk-build-windows-release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ call npm config list
call npm config set agora_electron_sdk_pre_built false
if %1 == ia32 (
echo sdk_ia32
call npm install --verbose --agora_electron_sdk_arch=ia32
call npm run totalBuild --verbose --agora_electron_sdk_arch=ia32
call npm install --agora_electron_sdk_arch=ia32
call npm run totalBuild --agora_electron_sdk_arch=ia32
)
if %1 == x64 (
echo sdk_x64
call npm install --verbose --agora_electron_sdk_arch=x64
call npm run totalBuild --verbose --agora_electron_sdk_arch=x64
call npm install --agora_electron_sdk_arch=x64
call npm run totalBuild --agora_electron_sdk_arch=x64
)
call npm config delete agora_electron_sdk_pre_built

Expand Down
4 changes: 1 addition & 3 deletions ci/packager-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ packExample() {
export USE_HARD_LINKS=false
yarn dist:mac

pushd dist/mac
zip -ry $(pwd)/../../../${outterZipName} Agora-Electron-API-Example.app
popd
cp -f dist/Agora-Electron-API-Example-*.zip ../${outterZipName}
popd
}

Expand Down
39 changes: 22 additions & 17 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,35 @@
"start": "electron-webpack dev",
"compile": "electron-webpack",
"rebuild": "electron-rebuild -f -o ref-napi",
"dist": "yarn compile && electron-builder",
"dist:mac": "yarn dist --dir -c.compression=store -c.mac.identity=null",
"dist:win32": "yarn compile && electron-builder --publish never --win --ia32",
"dist:win64": "yarn compile && electron-builder --publish never --win --x64",
"switchEnv:win32": "cd .. && @powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./ci/packager-win.ps1 1 switchEnv",
"switchEnv:win64": "cd .. && @powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./ci/packager-win.ps1 2 switchEnv"
"dist": "npm run compile && electron-builder",
"dist:mac": "npm run dist -- --mac",
"dist:win": "npm run dist -- --win",
"dist:win32": "npm run dist:win -- --ia32",
"dist:win64": "npm run dist:win -- --x64"
},
"build": {
"asar": false,
"appId": "agora.io.ElectronApiExample",
"asar": true,
"asarUnpack": [
"node_modules/agora-electron-sdk"
],
"buildDependenciesFromSource": true,
"compression": "normal",
"productName": "Agora-Electron-API-Example",
"appId": "agora.io.ElectronApiExample",
"publish": [],
"files": [
"!*.log"
],
"mac": {
"target": [
"dir"
],
"type": "distribution",
"hardenedRuntime": true,
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"gatekeeperAssess": false
"gatekeeperAssess": false,
"hardenedRuntime": true,
"identity": null,
"target": [
"zip"
],
"type": "distribution"
},
"dmg": {
"contents": [
Expand All @@ -52,10 +57,10 @@
]
},
"linux": {
"category": "Development",
"target": [
"AppImage"
],
"category": "Development"
]
},
"directories": {
"buildResources": "assets"
Expand All @@ -65,7 +70,7 @@
]
},
"dependencies": {
"agora-electron-sdk": "4.2.2",
"agora-electron-sdk": "4.2.3-dev.3",
"antd": "^4.20.3",
"download": "^8.0.0",
"ffi-napi": "^4.0.3",
Expand Down
18 changes: 10 additions & 8 deletions example/src/renderer/components/BaseComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ export abstract class BaseComponent<
'elapsed',
elapsed
);
const { remoteUsers } = this.state;
if (remoteUsers === undefined) return;
this.setState({
remoteUsers: [...remoteUsers!, remoteUid],
this.setState((preState) => {
return {
remoteUsers: [...(preState.remoteUsers ?? []), remoteUid],
};
});
}

Expand All @@ -129,10 +129,12 @@ export abstract class BaseComponent<
'reason',
reason
);
const { remoteUsers } = this.state;
if (remoteUsers === undefined) return;
this.setState({
remoteUsers: remoteUsers!.filter((value) => value !== remoteUid),
this.setState((preState) => {
return {
remoteUsers: (preState.remoteUsers ?? []).filter(
(value) => value !== remoteUid
),
};
});
}

Expand Down
6 changes: 4 additions & 2 deletions example/src/renderer/components/RtcSurfaceView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ export class RtcSurfaceView extends Component<Props, State> {

render() {
const { canvas } = this.props;
const { isMirror, uniqueId } = this.state;
const { uniqueId } = this.state;

return (
<div
className={styles['window-item']}
onClick={() => {
this.setState({ isMirror: !isMirror }, this.updateRender);
this.setState((preState) => {
return { isMirror: !preState.isMirror };
}, this.updateRender);
}}
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,24 @@ export default class ContentInspect
this.error('interval is invalid');
return;
}
this.setState({
modules: [...modules, { type, interval }],
this.setState((preState) => {
return {
modules: [
...preState.modules,
{ type: preState.type, interval: preState.interval },
],
};
});
}}
/>
<AgoraButton
title={'Remove'}
onPress={() => {
modules.pop();
this.setState({
modules: modules,
this.setState((preState) => {
preState.modules.pop();
return {
modules: preState.modules,
};
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ export default class DeviceManager
})}
value={playbackDeviceId}
onValueChange={(value, index) => {
this.setState({
playbackDeviceId: playbackDevices?.at(index)?.deviceId,
this.setState((preState) => {
return {
playbackDeviceId: preState.playbackDevices?.at(index)?.deviceId,
};
});
}}
/>
Expand All @@ -358,8 +360,11 @@ export default class DeviceManager
})}
value={recordingDeviceId}
onValueChange={(value, index) => {
this.setState({
recordingDeviceId: recordingDevices?.at(index)?.deviceId,
this.setState((preState) => {
return {
recordingDeviceId:
preState.recordingDevices?.at(index)?.deviceId,
};
});
}}
/>
Expand All @@ -374,8 +379,10 @@ export default class DeviceManager
})}
value={videoDeviceId}
onValueChange={(value, index) => {
this.setState({
videoDeviceId: videoDevices?.at(index)?.deviceId,
this.setState((preState) => {
return {
videoDeviceId: preState.videoDevices?.at(index)?.deviceId,
};
});
}}
/>
Expand Down
Loading