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

Fix iOS integration tests #162

Merged
merged 68 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
657e5b0
test: fix iOS integration tests
evdokimovs Jun 10, 2024
f299a1b
ci: enable iOS test
evdokimovs Jun 10, 2024
3d753ee
test: try to fix it differently
evdokimovs Jun 10, 2024
e9cc3f0
test: hold `IntegrationTestWidgetsFlutterBinding`
evdokimovs Jun 11, 2024
bd2d07f
test: remove debug code
evdokimovs Jun 11, 2024
5d35d5e
test: remove `final binding`
evdokimovs Jun 11, 2024
dbfc3bb
test: migrate to `test` instead of `testWidget` in Flutter tests
evdokimovs Jun 11, 2024
b3a78af
test: extend timeout to 3 minutes
evdokimovs Jun 11, 2024
1ccefcc
test: try to extend concrete tests timeouts
evdokimovs Jun 11, 2024
4444bad
test: fix Dart analyze
evdokimovs Jun 11, 2024
8362b4b
test: extend timeout
evdokimovs Jun 12, 2024
7f4bdb1
refactor: run on ARM
evdokimovs Jun 26, 2024
9c9d03f
refactor: disable broken lint
evdokimovs Jun 26, 2024
cef53c8
ci: skip lints
evdokimovs Jun 26, 2024
beb02cd
ci: debug
evdokimovs Jun 26, 2024
c565df2
ci: debug
evdokimovs Jun 26, 2024
9afd8e5
ci: fix xcode version
evdokimovs Jun 26, 2024
f3d0256
test: revert
evdokimovs Jun 27, 2024
8cc2f15
test: fmt
evdokimovs Jun 27, 2024
b39c221
[run ci]
evdokimovs Jun 28, 2024
c06304a
ci: do not erase iOS Simulator
evdokimovs Jun 30, 2024
1e2ba02
ci: use latest XCode version
evdokimovs Jun 30, 2024
1cf45b5
refactor: update libwebrtc-bin version
evdokimovs Jul 1, 2024
64404ea
refactor: use libyuv helper
evdokimovs Jul 1, 2024
5c0da2f
chore: update Podfile.lock
evdokimovs Jul 1, 2024
197dd39
refactor: fix
evdokimovs Jul 1, 2024
11d0c44
ci: cleanup Simulator
evdokimovs Jul 1, 2024
7ddbac5
refactor: fixes
evdokimovs Jul 1, 2024
58c5231
ci: minor CI spec improvements and fixes
evdokimovs Jul 1, 2024
803d5ce
docs: fix lint
evdokimovs Jul 1, 2024
7c431db
build: revert `static_framework` setting
evdokimovs Jul 1, 2024
447104f
refactor: minor Linux lint fix
evdokimovs Jul 1, 2024
6060c1b
refactor: fix dead_code lint ignore
evdokimovs Jul 1, 2024
f63147a
ci: lock up xcode version
evdokimovs Jul 1, 2024
f7aac72
refactor: minir media devices correction
evdokimovs Jul 2, 2024
52a0e4f
refactor: minor correction
evdokimovs Jul 2, 2024
c7bd0be
Corrections
tyranron Jul 2, 2024
bf87463
Fix hashes
tyranron Jul 2, 2024
a4141e3
deps: upgrate to libwebrtc v126.0.6478.182
evdokimovs Jul 17, 2024
8cca24e
deps: update checksums of libwebrtc
evdokimovs Jul 17, 2024
5d9a54a
refactor: add perfetto includes
evdokimovs Jul 17, 2024
5bf426e
build: add more include
evdokimovs Jul 17, 2024
586c87f
Minor corrections
tyranron Jul 18, 2024
91b53eb
Fix comment for fmt
tyranron Jul 18, 2024
2bd6428
refactor: update libwebrtc-bin version
evdokimovs Jul 21, 2024
d8a75ca
Merge remote-tracking branch 'origin/fix-ios-ci' into fix-ios-ci
evdokimovs Jul 21, 2024
1a8fd9d
refactor: update libwebrtc-bin version
evdokimovs Jul 22, 2024
28766cc
refactor: fix misspell of argument in iOS renderer
evdokimovs Jul 22, 2024
d31a841
refactor: upgrade libwebrtc-bin manually in podspec
evdokimovs Jul 23, 2024
56182ea
refactor: try old fix
evdokimovs Jul 23, 2024
42062cd
style: fix fmt
evdokimovs Jul 23, 2024
290bde9
ci: grant microphone access in CI
evdokimovs Jul 23, 2024
20fa91a
ci: more suitable fix
evdokimovs Jul 23, 2024
d775f05
ci: add Camera permission and screenshot debug
evdokimovs Jul 23, 2024
3cb0b0d
ci: fix GHA spec
evdokimovs Jul 23, 2024
91b8d0b
ci: upload screenshots on fail
evdokimovs Jul 23, 2024
0a342f4
ci: more screenshoting
evdokimovs Jul 24, 2024
cef9635
ci: run only iOS tests
evdokimovs Jul 24, 2024
13c251f
ci: comment out
evdokimovs Jul 24, 2024
7ccee36
ci: add tmate action
evdokimovs Jul 24, 2024
aad16d2
ci: try running on another simulator
evdokimovs Jul 24, 2024
6125d06
ci: try another GHA permissions workaround
evdokimovs Jul 24, 2024
9634b0f
refactor: cleanup
evdokimovs Jul 24, 2024
a8bf979
refactor: fix MacOS build step
evdokimovs Jul 25, 2024
cda2890
ci: disable iOS tests
evdokimovs Jul 25, 2024
b175553
ci: remove obsolete includes for perfetto
evdokimovs Jul 25, 2024
4d202c8
Minor corrections
tyranron Jul 25, 2024
7f91caf
Fix missing `fake-media` feature
tyranron Jul 25, 2024
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
39 changes: 37 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
- macos
- windows
runs-on: ${{ (matrix.platform == 'windows' && 'windows-latest')
|| 'macos-11' }}
|| 'macos-13' }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
Expand All @@ -151,7 +151,7 @@ jobs:
# Pin Xcode version for better compatibility.
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "12.4"
xcode-version: "15.2"
if: ${{ matrix.platform == 'macos' }}

- run: make cargo.build platform=${{ matrix.platform }} debug=no
Expand Down Expand Up @@ -217,6 +217,7 @@ jobs:
- windows
runs-on: ${{ (matrix.platform == 'linux' && 'ubuntu-latest')
|| (matrix.platform == 'windows' && 'windows-latest')
|| (matrix.platform == 'ios' && 'macos-14')
|| 'macos-13' }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -259,6 +260,40 @@ jobs:
script: make flutter.test.mobile
if: ${{ matrix.platform == 'android' }}

- name: Add TCC permissions on macOS
run: |
configure_user_tccdb () {
local values=$1
local dbPath="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
sqlite3 "$dbPath" "$sqlQuery"
}

configure_sys_tccdb () {
local values=$1
local dbPath="/Library/Application Support/com.apple.TCC/TCC.db"
local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
sudo sqlite3 "$dbPath" "$sqlQuery"
}

userValuesArray=(
"'kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
"'kTCCServiceCamera','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
"'kTCCServiceBluetoothAlways','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
)
for values in "${userValuesArray[@]}"; do
# Sonoma and higher have a few extra values:
# https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/configure-tccdb-macos.sh
if [ "$OSTYPE" = "darwin23" ]; then
configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
configure_sys_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
else
configure_user_tccdb "$values"
configure_sys_tccdb "$values"
fi
done
if: ${{ matrix.platform == 'ios' }}

- name: Start iOS simulator
id: simulator
uses: futureware-tech/simulator-action@v3
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ All user visible changes to this project will be documented in this file. This p

### Changed

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

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



Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Medea Flutter-WebRTC
====================

[![pub](https://img.shields.io/pub/v/medea_flutter_webrtc "pub")](https://pub.dev/packages/medea_flutter_webrtc)
[![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)
[![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)
[![OpenAL](https://img.shields.io/badge/OpenAL-1.23.1-blue "OpenAL")](https://github.com/kcat/openal-soft/releases/tag/1.23.1)

[Changelog](https://github.com/instrumentisto/medea-flutter-webrtc/blob/main/CHANGELOG.md)
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}

dependencies {
implementation 'com.github.instrumentisto:libwebrtc-bin:123.0.6312.105@aar'
implementation 'com.github.instrumentisto:libwebrtc-bin:126.0.6478.182-r2@aar'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
}
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libwebrtc-sys"
version = "0.0.0+123.0.6312.105"
version = "0.0.0+126.0.6478.182-r2"
edition = "2021"
rust-version = "1.62"
publish = false
Expand Down
12 changes: 6 additions & 6 deletions crates/libwebrtc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use walkdir::{DirEntry, WalkDir};
/// [`libwebrtc-bin`]: https://github.com/instrumentisto/libwebrtc-bin
static LIBWEBRTC_URL: &str =
"https://github.com/instrumentisto/libwebrtc-bin/releases/download\
/123.0.6312.105";
/126.0.6478.182-r2";

/// URL for downloading `openal-soft` source code.
static OPENAL_URL: &str =
Expand Down Expand Up @@ -120,19 +120,19 @@ fn get_target() -> anyhow::Result<String> {
fn get_expected_libwebrtc_hash() -> anyhow::Result<&'static str> {
Ok(match get_target()?.as_str() {
"aarch64-unknown-linux-gnu" => {
"db6504b732fcc59541ea37279ff1e2ce8bc6c7c7018ac2973b782e69d3702889"
"f35ef4076a4c6a9adce54717f14c7408a5a3e2d9e09c3f112a70a823b7369933"
}
"x86_64-unknown-linux-gnu" => {
"6b212cc8f91fb1e4ec8358ab1f9c2147e39f0e655bb1f6521df2a84239da95bd"
"9bc1995fcd28d6b26191717a92bae64e13e583d15e8c582322527b43be2b7c84"
}
"aarch64-apple-darwin" => {
"cac4b30b08c95751ab0c299d1f8bb3552df0b7a50dc90b9741fa893a8f9b412e"
"8e135face9e03b3f90c9fd73d02bc9a024fe9f1ac07fd8aa6d4c1dfaef61de86"
}
"x86_64-apple-darwin" => {
"f2ed68ac50750b609f3371c7e38d4fd6931a234d36523b36f516b127a5c1fb49"
"0ffcee42398804e27408f1c4acadefce69f88e425ac311eda8a6ff0f9da12eb1"
}
"x86_64-pc-windows-msvc" => {
"6604e95fe102bc62e45da3230aabfb088cfdf3cc2859f3ced310136466d658b0"
"7dda117194077d0408d9e644014cca499f80dd4df4c78dc069ba09ac4b95549a"
}
arch => return Err(anyhow::anyhow!("Unsupported target: {arch}")),
})
Expand Down
2 changes: 2 additions & 0 deletions crates/libwebrtc-sys/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2811,6 +2811,7 @@ pub(crate) mod webrtc {
/// # Safety
///
/// Caller must ensure that the provided `buffer` is large enough.
#[allow(clippy::missing_safety_doc)] // false positive
pub unsafe fn video_frame_to_abgr(frame: &VideoFrame, buffer: *mut u8);

/// Converts the provided [`webrtc::VideoFrame`] pixels to the `ARGB`
Expand All @@ -2819,6 +2820,7 @@ pub(crate) mod webrtc {
/// # Safety
///
/// Caller must ensure that the provided `buffer` is large enough.
#[allow(clippy::missing_safety_doc)] // false positive
pub unsafe fn video_frame_to_argb(
frame: &VideoFrame,
argb_stride: i32,
Expand Down
5 changes: 4 additions & 1 deletion crates/native/src/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ pub mod linux_device_change {
pub struct AudioMonitor {
/// [PulseAudio] context.
///
/// [PulseAudio]: https://freedesktop.org/wiki/Software/PulseAudio
/// [PulseAudio]: https://freedesktop.org/wiki/Software/PulseAudio`.
// It's not read, but is required to live for correct destruction of
// the PulseAudio `Context`.
#[allow(dead_code)] // for destruction
pub context: Context,

/// [PulseAudio] main loop.
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
16 changes: 6 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
PODS:
- Flutter (1.0.0)
- instrumentisto-libwebrtc-bin (123.0.6312.105)
- instrumentisto-libwebrtc-bin (126.0.6478.182-r2)
- integration_test (0.0.1):
- Flutter
- libyuv-iOS (1.0.2)
- medea_flutter_webrtc (0.10.0-dev):
- Flutter
- instrumentisto-libwebrtc-bin (= 123.0.6312.105)
- libyuv-iOS
- instrumentisto-libwebrtc-bin (= 126.0.6478.182-r2)

DEPENDENCIES:
- Flutter (from `Flutter`)
Expand All @@ -17,7 +15,6 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- instrumentisto-libwebrtc-bin
- libyuv-iOS

EXTERNAL SOURCES:
Flutter:
Expand All @@ -28,11 +25,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/medea_flutter_webrtc/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
instrumentisto-libwebrtc-bin: 295e1721ff9a8ccfc030c0de5f095c7d6b3e53ce
integration_test: 13825b8a9334a850581300559b8839134b124670
libyuv-iOS: 5a154ccc84ec754029886ecb607512731fe30640
medea_flutter_webrtc: ca2335744f08d45963f26f8db159c6dcd19a31a3
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
instrumentisto-libwebrtc-bin: 146854184f62ca80d79ff3d95bf9446eff5e54a9
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
medea_flutter_webrtc: 37c4a65c3d4709bea5a612f655c79b4cf143cee7

PODFILE CHECKSUM: be3ab4e988bb308d23906be69146fcbef66fac55

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
52 changes: 26 additions & 26 deletions ios/Classes/FlutterRtcVideoRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,22 @@ class FlutterRtcVideoRenderer: NSObject, FlutterTexture, RTCVideoRenderer {
}

let buffer = RTCI420Buffer(width: rotatedWidth, height: rotatedHeight)
libyuv_I420Rotate(
RTCYUVHelper.i420Rotate(
src.dataY,
src.strideY,
src.dataU,
src.strideU,
src.dataV,
src.strideV,
UnsafeMutablePointer(mutating: buffer.dataY),
buffer.strideY,
UnsafeMutablePointer(mutating: buffer.dataU),
buffer.strideU,
UnsafeMutablePointer(mutating: buffer.dataV),
buffer.strideV,
src.width,
src.height,
rotation
srcStrideY: src.strideY,
srcU: src.dataU,
srcStrideU: src.strideU,
srcV: src.dataV,
srcStrideV: src.strideV,
dstY: UnsafeMutablePointer(mutating: buffer.dataY),
dstStrideY: buffer.strideY,
dstU: UnsafeMutablePointer(mutating: buffer.dataU),
dstStrideU: buffer.strideU,
dstV: UnsafeMutablePointer(mutating: buffer.dataV),
dstStrideV: buffer.strideV,
width: src.width,
height: src.height,
mode: rotation
)
return buffer
}
Expand Down Expand Up @@ -287,17 +287,17 @@ class FlutterRtcVideoRenderer: NSObject, FlutterTexture, RTCVideoRenderer {
)
let dst = CVPixelBufferGetBaseAddress(self.pixelBuffer!)!
let bytesPerRow = CVPixelBufferGetBytesPerRow(self.pixelBuffer!)
libyuv_I420ToARGB(
buffer.dataY,
buffer.strideY,
buffer.dataU,
buffer.strideU,
buffer.dataV,
buffer.strideV,
UnsafeMutablePointer<UInt8>(OpaquePointer(dst)),
Int32(bytesPerRow),
buffer.width,
buffer.height
RTCYUVHelper.i420(
toARGB: buffer.dataY,
srcStrideY: buffer.strideY,
srcU: buffer.dataU,
srcStrideU: buffer.strideU,
srcV: buffer.dataV,
srcStrideV: buffer.strideV,
dstARGB: UnsafeMutablePointer<UInt8>(OpaquePointer(dst)),
dstStrideARGB: Int32(bytesPerRow),
width: buffer.width,
height: buffer.height
)
CVPixelBufferUnlockBaseAddress(
self.pixelBuffer!,
Expand Down
30 changes: 0 additions & 30 deletions ios/Classes/MedeaFlutterWebrtcPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,3 @@
@interface MedeaFlutterWebrtcPlugin : NSObject<FlutterPlugin>
@end

bool libyuv_I420ToARGB(
const uint8_t* src_y,
int src_stride_y,
const uint8_t* src_u,
int src_stride_u,
const uint8_t* src_v,
int src_stride_v,
uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height
);

void libyuv_I420Rotate(
const uint8_t* srcY,
int srcStrideY,
const uint8_t* srcU,
int srcStrideU,
const uint8_t* srcV,
int srcStrideV,
uint8_t* dstY,
int dstStrideY,
uint8_t* dstU,
int dstStrideU,
uint8_t* dstV,
int dstStrideV,
int width,
int height,
RTCVideoRotation mode
);
Loading
Loading