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 36 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
10 changes: 5 additions & 5 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 @@ -208,16 +208,16 @@ jobs:
strategy:
fail-fast: false
matrix:
# TODO: Run tests on iOS.
platform:
- android
# - ios
- ios
- linux
- macos
- windows
runs-on: ${{ (matrix.platform == 'linux' && 'ubuntu-latest')
|| (matrix.platform == 'windows' && 'windows-latest')
|| 'macos-13' }}
|| (matrix.platform == 'ios' && 'macos-14')
|| 'macos-13' }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
Expand Down
6 changes: 6 additions & 0 deletions crates/libwebrtc-sys/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2811,6 +2811,9 @@ pub(crate) mod webrtc {
/// # Safety
///
/// Caller must ensure that the provided `buffer` is large enough.
// Function has 'Safety' section, but Clippy doesn't sees it for some
// reason:
#[allow(clippy::missing_safety_doc)]
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 +2822,9 @@ pub(crate) mod webrtc {
/// # Safety
///
/// Caller must ensure that the provided `buffer` is large enough.
// Function has 'Safety' section, but Clippy doesn't sees it for some
// reason:
#[allow(clippy::missing_safety_doc)]
pub unsafe fn video_frame_to_argb(
frame: &VideoFrame,
argb_stride: i32,
Expand Down
3 changes: 3 additions & 0 deletions crates/native/src/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ pub mod linux_device_change {
/// [PulseAudio] context.
///
/// [PulseAudio]: https://freedesktop.org/wiki/Software/PulseAudio
// It's not readed, but it's required to live for correct
// destruction of a PulseAudio Context.
#[allow(dead_code)]
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.126)
- 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.126)

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: 3371e419b379f76f0a042a0c224d548297fc9738
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
medea_flutter_webrtc: 21e3bf0573cc3eafaf34fed7a6b5737e35179c56

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,
width: 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
);
62 changes: 0 additions & 62 deletions ios/Classes/MedeaFlutterWebrtcPlugin.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MedeaFlutterWebrtcPlugin.h"
#include "libyuv.h"
#if __has_include(<medea_flutter_webrtc/medea_flutter_webrtc-Swift.h>)
#import <medea_flutter_webrtc/medea_flutter_webrtc-Swift.h>
#else
Expand All @@ -15,64 +14,3 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
}
@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
) {
return I420ToARGB(
src_y,
src_stride_y,
src_u,
src_stride_u,
src_v,
src_stride_v,
dst_argb,
dst_stride_argb,
width,
height
) == 0;
}

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
) {
I420Rotate(
srcY,
srcStrideY,
srcU,
srcStrideU,
srcV,
srcStrideV,
dstY,
dstStrideY,
dstU,
dstStrideU,
dstV,
dstStrideV,
width,
height,
(RotationModeEnum)mode
);
}
1 change: 1 addition & 0 deletions ios/Classes/MediaDevices.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MediaDevices {
AVAudioSession.Category.playAndRecord,
options: AVAudioSession.CategoryOptions.allowBluetooth
)
try! AVAudioSession.sharedInstance().setActive(true)
self.state = state
NotificationCenter.default.addObserver(
forName: AVAudioSession.routeChangeNotification, object: nil,
Expand Down
3 changes: 1 addition & 2 deletions ios/medea_flutter_webrtc.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Flutter WebRTC plugin based on Google WebRTC.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'instrumentisto-libwebrtc-bin', '123.0.6312.105'
s.dependency 'libyuv-iOS'
s.dependency 'instrumentisto-libwebrtc-bin', '126.0.6478.126'
s.platform = :ios, '13.0'
s.static_framework = true

Expand Down
Loading