Skip to content

Commit bdda90e

Browse files
authored
Merge pull request #31 from GetStream/chore/sync_0.14.1
chore: sync with flutter_webrtc 0.14.1
2 parents 15b8e27 + d7dad42 commit bdda90e

File tree

6 files changed

+57
-18
lines changed

6 files changed

+57
-18
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11

22
# Changelog
33

4+
[1.0.6] - 2025-05-27
5+
* [iOS] Added native audio route picker for iOS
6+
* [Android] Expanded the mapping for audio device types
7+
* Synced flutter-webrtc v0.14.1
8+
* [Android] fix: Recording bug (#1839)
9+
* [Android] fix: calls in terminated mode by disabling orientation manager (#1840)
10+
* [Android] fix: Wait for audio and video thread to fully stop to avoid corrupted recordings (#1836)
11+
412
[1.0.5] - 2025-05-20
513
* [iOS] Bumped StreamWebRTC version to 125.6422.070
614
* Synced flutter-webrtc v0.14.0

android/src/main/java/io/getstream/webrtc/flutter/record/VideoFileRenderer.java

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.io.IOException;
2121
import java.nio.ByteBuffer;
22+
import java.util.concurrent.CountDownLatch;
2223

2324
class VideoFileRenderer implements VideoSink, SamplesReadyCallback {
2425
private static final String TAG = "VideoFileRenderer";
@@ -127,27 +128,50 @@ private void renderFrameOnRenderThread(VideoFrame frame) {
127128
/**
128129
* Release all resources. All already posted frames will be rendered first.
129130
*/
131+
// Start Signify modification
130132
void release() {
131133
isRunning = false;
132-
if (audioThreadHandler != null)
134+
CountDownLatch latch = new CountDownLatch(audioThreadHandler != null ? 2 : 1);
135+
if (audioThreadHandler != null) {
133136
audioThreadHandler.post(() -> {
134-
if (audioEncoder != null) {
135-
audioEncoder.stop();
136-
audioEncoder.release();
137+
try{
138+
if (audioEncoder != null) {
139+
audioEncoder.stop();
140+
audioEncoder.release();
141+
}
142+
audioThread.quit();
143+
} finally {
144+
latch.countDown();
137145
}
138-
audioThread.quit();
139146
});
147+
}
148+
140149
renderThreadHandler.post(() -> {
141-
if (encoder != null) {
142-
encoder.stop();
143-
encoder.release();
150+
try {
151+
if (encoder != null) {
152+
encoder.stop();
153+
encoder.release();
154+
}
155+
eglBase.release();
156+
if (muxerStarted) {
157+
mediaMuxer.stop();
158+
mediaMuxer.release();
159+
muxerStarted = false;
160+
}
161+
renderThread.quit();
162+
} finally {
163+
latch.countDown();
144164
}
145-
eglBase.release();
146-
mediaMuxer.stop();
147-
mediaMuxer.release();
148-
renderThread.quit();
149165
});
166+
167+
try {
168+
latch.await();
169+
} catch (InterruptedException e) {
170+
Log.e(TAG, "Release interrupted", e);
171+
Thread.currentThread().interrupt();
172+
}
150173
}
174+
// End Signify modification
151175

152176
private boolean encoderStarted = false;
153177
private volatile boolean muxerStarted = false;
@@ -174,7 +198,7 @@ private void drainEncoder() {
174198

175199
Log.e(TAG, "encoder output format changed: " + newFormat);
176200
trackIndex = mediaMuxer.addTrack(newFormat);
177-
if (audioTrackIndex != -1 && !muxerStarted) {
201+
if (trackIndex != -1 && !muxerStarted) {
178202
mediaMuxer.start();
179203
muxerStarted = true;
180204
}
@@ -230,7 +254,7 @@ private void drainAudio() {
230254

231255
Log.w(TAG, "encoder output format changed: " + newFormat);
232256
audioTrackIndex = mediaMuxer.addTrack(newFormat);
233-
if (trackIndex != -1 && !muxerStarted) {
257+
if (audioTrackIndex != -1 && !muxerStarted) {
234258
mediaMuxer.start();
235259
muxerStarted = true;
236260
}

android/src/main/java/io/getstream/webrtc/flutter/video/camera/CameraUtils.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ public CameraUtils(GetUserMediaImpl getUserMediaImpl, Activity activity) {
4545
this.getUserMediaImpl = getUserMediaImpl;
4646
this.activity = activity;
4747
this.deviceOrientationManager = new DeviceOrientationManager(activity, 0);
48-
this.deviceOrientationManager.start();
48+
// commented out because you cannot register a reciever when the app is terminated
49+
// because the activity is null?
50+
// this causes the call to break if the app is terminated
51+
// the manager seems to end up at handleOrientationChange which does not do
52+
// anything at the moment so this should be ok
53+
54+
// TODO: get a proper fix at some point
55+
// this.deviceOrientationManager.start();
4956
}
5057

5158
public void setFocusMode(MethodCall call, AnyThreadResult result) {

ios/stream_webrtc_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'stream_webrtc_flutter'
6-
s.version = '1.0.5'
6+
s.version = '1.0.6'
77
s.summary = 'Flutter WebRTC plugin for iOS.'
88
s.description = <<-DESC
99
A new flutter plugin project.

macos/stream_webrtc_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'stream_webrtc_flutter'
6-
s.version = '1.0.5'
6+
s.version = '1.0.6'
77
s.summary = 'Flutter WebRTC plugin for macOS.'
88
s.description = <<-DESC
99
A new flutter plugin project.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: stream_webrtc_flutter
22
description: Flutter WebRTC plugin for iOS/Android/Destkop/Web, based on GoogleWebRTC.
3-
version: 1.0.5
3+
version: 1.0.6
44
homepage: https://github.com/GetStream/webrtc-flutter
55
environment:
66
sdk: ">=3.3.0 <4.0.0"

0 commit comments

Comments
 (0)