diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad20ffa88..1f174fc724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ [1.0.12] - 2025-09-30 * [Android] Changed the configuration used when creating EGL rendering context to one that supports alpha channel to fix an issue with Impeller blending background with video texture on some devices. +* [Android] Migrate from onSurfaceDestroyed to onSurfaceCleanup for SurfaceProducer.Callback. [1.0.11] - 2025-08-13 * [Android] Added option to configure Android audio attributes in AudioFocusManager diff --git a/android/src/main/java/io/getstream/webrtc/flutter/SurfaceTextureRenderer.java b/android/src/main/java/io/getstream/webrtc/flutter/SurfaceTextureRenderer.java index 31b9416614..14ee7e5fc0 100755 --- a/android/src/main/java/io/getstream/webrtc/flutter/SurfaceTextureRenderer.java +++ b/android/src/main/java/io/getstream/webrtc/flutter/SurfaceTextureRenderer.java @@ -115,21 +115,20 @@ public void surfaceCreated(final TextureRegistry.SurfaceProducer producer) { ThreadUtils.checkIsOnMainThread(); this.producer = producer; this.producer.setCallback( - new TextureRegistry.SurfaceProducer.Callback() { - @Override - public void onSurfaceAvailable() { - // Do surface initialization here, and draw the current frame. - } + new TextureRegistry.SurfaceProducer.Callback() { + @Override + public void onSurfaceAvailable() { + // Do surface initialization here, and draw the current frame. + } - @Override - public void onSurfaceDestroyed() { - surfaceDestroyed(); - } - } - ); + @Override + public void onSurfaceCleanup() { + onSurfaceCleanup(); + } + }); } - public void surfaceDestroyed() { + public void onSurfaceCleanup() { ThreadUtils.checkIsOnMainThread(); final CountDownLatch completionLatch = new CountDownLatch(1); releaseEglSurface(completionLatch::countDown); diff --git a/pubspec.yaml b/pubspec.yaml index 62ac1ede14..588c1a80cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,8 +3,8 @@ description: Flutter WebRTC plugin for iOS/Android/Destkop/Web, based on GoogleW version: 1.0.12 homepage: https://github.com/GetStream/webrtc-flutter environment: - sdk: ">=3.3.0 <4.0.0" - flutter: ">=1.22.0" + sdk: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" dependencies: collection: ^1.17.0