Skip to content

Commit 64a149e

Browse files
authored
Fix iOS integration tests (#162)
Additionally: - upgrade `libwebrtc-bin` to `126.0.6478.182-r2` version
1 parent c8bcd8b commit 64a149e

File tree

18 files changed

+97
-149
lines changed

18 files changed

+97
-149
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
- macos
139139
- windows
140140
runs-on: ${{ (matrix.platform == 'windows' && 'windows-latest')
141-
|| 'macos-11' }}
141+
|| 'macos-13' }}
142142
steps:
143143
- uses: actions/checkout@v4
144144
- uses: dtolnay/rust-toolchain@v1
@@ -151,7 +151,7 @@ jobs:
151151
# Pin Xcode version for better compatibility.
152152
- uses: maxim-lobanov/setup-xcode@v1
153153
with:
154-
xcode-version: "12.4"
154+
xcode-version: "15.2"
155155
if: ${{ matrix.platform == 'macos' }}
156156

157157
- run: make cargo.build platform=${{ matrix.platform }} debug=no
@@ -217,6 +217,7 @@ jobs:
217217
- windows
218218
runs-on: ${{ (matrix.platform == 'linux' && 'ubuntu-latest')
219219
|| (matrix.platform == 'windows' && 'windows-latest')
220+
|| (matrix.platform == 'ios' && 'macos-14')
220221
|| 'macos-13' }}
221222
steps:
222223
- uses: actions/checkout@v4
@@ -259,6 +260,40 @@ jobs:
259260
script: make flutter.test.mobile
260261
if: ${{ matrix.platform == 'android' }}
261262

263+
- name: Add TCC permissions on macOS
264+
run: |
265+
configure_user_tccdb () {
266+
local values=$1
267+
local dbPath="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
268+
local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
269+
sqlite3 "$dbPath" "$sqlQuery"
270+
}
271+
272+
configure_sys_tccdb () {
273+
local values=$1
274+
local dbPath="/Library/Application Support/com.apple.TCC/TCC.db"
275+
local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
276+
sudo sqlite3 "$dbPath" "$sqlQuery"
277+
}
278+
279+
userValuesArray=(
280+
"'kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
281+
"'kTCCServiceCamera','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
282+
"'kTCCServiceBluetoothAlways','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
283+
)
284+
for values in "${userValuesArray[@]}"; do
285+
# Sonoma and higher have a few extra values:
286+
# https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/configure-tccdb-macos.sh
287+
if [ "$OSTYPE" = "darwin23" ]; then
288+
configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
289+
configure_sys_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
290+
else
291+
configure_user_tccdb "$values"
292+
configure_sys_tccdb "$values"
293+
fi
294+
done
295+
if: ${{ matrix.platform == 'ios' }}
296+
262297
- name: Start iOS simulator
263298
id: simulator
264299
uses: futureware-tech/simulator-action@v3

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ All user visible changes to this project will be documented in this file. This p
2121

2222
### Changed
2323

24-
- Upgraded [libwebrtc] to [123.0.6312.105] version. ([#155])
24+
- Upgraded [libwebrtc] to [126.0.6478.182-r2] version. ([#155], [#162])
2525
- Disable [H264] software encoders and decoders. ([#153])
2626

2727
### Fixed
@@ -44,7 +44,8 @@ All user visible changes to this project will be documented in this file. This p
4444
[#153]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/153
4545
[#155]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/155
4646
[#156]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/156
47-
[123.0.6312.105]: https://github.com/instrumentisto/libwebrtc-bin/releases/tag/123.0.6312.105
47+
[#162]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/162
48+
[126.0.6478.182-r2]: https://github.com/instrumentisto/libwebrtc-bin/releases/tag/126.0.6478.182-r2
4849

4950

5051

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Medea Flutter-WebRTC
22
====================
33

44
[![pub](https://img.shields.io/pub/v/medea_flutter_webrtc "pub")](https://pub.dev/packages/medea_flutter_webrtc)
5-
[![libwebrtc](https://img.shields.io/badge/libwebrtc-123.0.6312.105-blue "libwebrtc")](https://github.com/instrumentisto/libwebrtc-bin/releases/tag/123.0.6312.105)
5+
[![libwebrtc](https://img.shields.io/badge/libwebrtc-126.0.6478.182-r2-blue "libwebrtc")](https://github.com/instrumentisto/libwebrtc-bin/releases/tag/126.0.6478.182-r2)
66
[![OpenAL](https://img.shields.io/badge/OpenAL-1.23.1-blue "OpenAL")](https://github.com/kcat/openal-soft/releases/tag/1.23.1)
77

88
[Changelog](https://github.com/instrumentisto/medea-flutter-webrtc/blob/main/CHANGELOG.md)

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation 'com.github.instrumentisto:libwebrtc-bin:123.0.6312.105@aar'
56+
implementation 'com.github.instrumentisto:libwebrtc-bin:126.0.6478.182-r2@aar'
5757
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version'
5858
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
5959
}

crates/libwebrtc-sys/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
[package]
22
name = "libwebrtc-sys"
3-
version = "0.0.0+123.0.6312.105"
3+
version = "0.0.0+126.0.6478.182-r2"
44
edition = "2021"
55
rust-version = "1.62"
66
publish = false
77
links = "webrtc"
88

9+
[features]
10+
fake-media = []
11+
912
[dependencies]
1013
anyhow = "1.0"
1114
cxx = "1.0"

crates/libwebrtc-sys/build.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use walkdir::{DirEntry, WalkDir};
2323
/// [`libwebrtc-bin`]: https://github.com/instrumentisto/libwebrtc-bin
2424
static LIBWEBRTC_URL: &str =
2525
"https://github.com/instrumentisto/libwebrtc-bin/releases/download\
26-
/123.0.6312.105";
26+
/126.0.6478.182-r2";
2727

2828
/// URL for downloading `openal-soft` source code.
2929
static OPENAL_URL: &str =
@@ -90,7 +90,7 @@ fn main() -> anyhow::Result<()> {
9090
build.flag("-DWEBRTC_WIN").flag("/std:c++20");
9191
}
9292

93-
#[cfg(feature = "fake_media")]
93+
#[cfg(feature = "fake-media")]
9494
{
9595
build.flag("-DFAKE_MEDIA");
9696
}
@@ -120,19 +120,19 @@ fn get_target() -> anyhow::Result<String> {
120120
fn get_expected_libwebrtc_hash() -> anyhow::Result<&'static str> {
121121
Ok(match get_target()?.as_str() {
122122
"aarch64-unknown-linux-gnu" => {
123-
"db6504b732fcc59541ea37279ff1e2ce8bc6c7c7018ac2973b782e69d3702889"
123+
"f35ef4076a4c6a9adce54717f14c7408a5a3e2d9e09c3f112a70a823b7369933"
124124
}
125125
"x86_64-unknown-linux-gnu" => {
126-
"6b212cc8f91fb1e4ec8358ab1f9c2147e39f0e655bb1f6521df2a84239da95bd"
126+
"9bc1995fcd28d6b26191717a92bae64e13e583d15e8c582322527b43be2b7c84"
127127
}
128128
"aarch64-apple-darwin" => {
129-
"cac4b30b08c95751ab0c299d1f8bb3552df0b7a50dc90b9741fa893a8f9b412e"
129+
"8e135face9e03b3f90c9fd73d02bc9a024fe9f1ac07fd8aa6d4c1dfaef61de86"
130130
}
131131
"x86_64-apple-darwin" => {
132-
"f2ed68ac50750b609f3371c7e38d4fd6931a234d36523b36f516b127a5c1fb49"
132+
"0ffcee42398804e27408f1c4acadefce69f88e425ac311eda8a6ff0f9da12eb1"
133133
}
134134
"x86_64-pc-windows-msvc" => {
135-
"6604e95fe102bc62e45da3230aabfb088cfdf3cc2859f3ced310136466d658b0"
135+
"7dda117194077d0408d9e644014cca499f80dd4df4c78dc069ba09ac4b95549a"
136136
}
137137
arch => return Err(anyhow::anyhow!("Unsupported target: {arch}")),
138138
})

crates/libwebrtc-sys/src/bridge.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,6 +2811,7 @@ pub(crate) mod webrtc {
28112811
/// # Safety
28122812
///
28132813
/// Caller must ensure that the provided `buffer` is large enough.
2814+
#[allow(clippy::missing_safety_doc)] // false positive
28142815
pub unsafe fn video_frame_to_abgr(frame: &VideoFrame, buffer: *mut u8);
28152816

28162817
/// Converts the provided [`webrtc::VideoFrame`] pixels to the `ARGB`
@@ -2819,6 +2820,7 @@ pub(crate) mod webrtc {
28192820
/// # Safety
28202821
///
28212822
/// Caller must ensure that the provided `buffer` is large enough.
2823+
#[allow(clippy::missing_safety_doc)] // false positive
28222824
pub unsafe fn video_frame_to_argb(
28232825
frame: &VideoFrame,
28242826
argb_stride: i32,

crates/native/src/devices.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,10 @@ pub mod linux_device_change {
445445
pub struct AudioMonitor {
446446
/// [PulseAudio] context.
447447
///
448-
/// [PulseAudio]: https://freedesktop.org/wiki/Software/PulseAudio
448+
/// [PulseAudio]: https://freedesktop.org/wiki/Software/PulseAudio`.
449+
// It's not read, but is required to live for correct destruction of
450+
// the PulseAudio `Context`.
451+
#[allow(dead_code)] // for destruction
449452
pub context: Context,
450453

451454
/// [PulseAudio] main loop.

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

0 commit comments

Comments
 (0)