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

android: release audio device module after creating factory #11

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 3 additions & 8 deletions android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public WebRTCModule(ReactApplicationContext reactContext) {
.setVideoDecoderFactory(decoderFactory)
.createPeerConnectionFactory();

// PeerConnectionFactory now owns the adm native pointer, and we don't need it anymore.
adm.release();

// Saving the encoder and decoder factories to get codec info later when needed.
mVideoEncoderFactory = encoderFactory;
mVideoDecoderFactory = decoderFactory;
Expand All @@ -116,14 +119,6 @@ public String getName() {
return "WebRTCModule";
}

@Override
public void onCatalystInstanceDestroy() {
if (mAudioDeviceModule != null) {
mAudioDeviceModule.release();
}
super.onCatalystInstanceDestroy();
}

private PeerConnection getPeerConnection(int id) {
PeerConnectionObserver pco = mPeerConnectionObservers.get(id);
return (pco == null) ? null : pco.getPeerConnection();
Expand Down
2 changes: 1 addition & 1 deletion examples/GumTestApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"react": "18.2.0",
"react-native": "0.71.4",
"react-native-webrtc": "*"
"@livekit/react-native-webrtc": "*"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
Loading