Skip to content

Commit 62e2466

Browse files
committed
add macOS support
1 parent dc20470 commit 62e2466

File tree

125 files changed

+794
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+794
-206
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ jobs:
2323
os: macos-latest
2424
- cmd: "./gradlew :example:androidApp:assembleDebug"
2525
os: macos-latest
26-
- cmd: "./gradlew :kmp-webrtc:podspec :kmp-webrtc:generateDummyFramework && cd example/iosApp && xcodegen && pod install && xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -configuration Debug"
26+
- cmd: "./scripts/build_ios_demo.sh"
27+
os: macos-latest
28+
dep: "brew update && brew install cocoapods xcodegen"
29+
- cmd: "./scripts/build_mac_demo.sh"
2730
os: macos-latest
2831
dep: "brew update && brew install cocoapods xcodegen"
2932
runs-on: ${{ matrix.os }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ local.properties
1212
xcuserdata
1313
**.podspec
1414
**.xcodeproj
15+
**.xcworkspace
1516
Podfile.lock
1617
Pods
1718

README.md

Lines changed: 11 additions & 6 deletions

example/iosApp/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ target 'iosApp' do
55
platform :ios, '14.0'
66
pod 'kmp_webrtc', :path => '../../kmp-webrtc/kmp_webrtc.podspec'
77
pod 'WebRTC', :path => '../../libs/apple/WebRTC.podspec'
8-
pod 'kmp_xlog', '~> 1.3.1'
8+
pod 'kmp_xlog', '~> 1.3.4'
99
end

example/iosApp/iosApp.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 10 deletions
This file was deleted.

example/iosApp/iosApp/CallViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ @implementation CallViewController {
4040
ARDSettingsModel* _settingsModel;
4141
bool _isLandscape;
4242

43-
Kmp_webrtcObjCPeerConnectionClientFactory* _pcClientFactory;
43+
Kmp_webrtcIOSPeerConnectionClientFactory* _pcClientFactory;
4444
id<Kmp_webrtcPeerConnectionClient> _pcClient;
4545
NSTimer* _statsTimer;
4646
CFAudioMixer* _mixer;
@@ -354,9 +354,9 @@ - (void)startLoopback {
354354
videoCaptureFps:30
355355
initCameraFace:0
356356
privateConfig:privateConfig];
357-
_pcClientFactory = (Kmp_webrtcObjCPeerConnectionClientFactory*)
358-
[Kmp_webrtcObjCPeerConnectionClientFactoryKt createPeerConnectionClientFactoryConfig:pcClientFactoryConfig
359-
errorHandler:^(Kmp_webrtcInt * _Nonnull code, NSString * _Nonnull msg) {
357+
_pcClientFactory = (Kmp_webrtcIOSPeerConnectionClientFactory*)
358+
[Kmp_webrtcIOSPeerConnectionClientFactoryKt createPeerConnectionClientFactoryConfig:pcClientFactoryConfig
359+
errorHandler:^(Kmp_webrtcInt * _Nonnull code, NSString * _Nonnull msg) {
360360
NSLog(@"XXPXX PCFactory errorHandler %@ %@", code, msg);
361361
}];
362362

Lines changed: 1 addition & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1 @@
1-
{
2-
"images" : [
3-
{
4-
"size" : "20x20",
5-
"idiom" : "iphone",
6-
"filename" : "[email protected]",
7-
"scale" : "2x"
8-
},
9-
{
10-
"size" : "20x20",
11-
"idiom" : "iphone",
12-
"filename" : "[email protected]",
13-
"scale" : "3x"
14-
},
15-
{
16-
"size" : "29x29",
17-
"idiom" : "iphone",
18-
"filename" : "[email protected]",
19-
"scale" : "1x"
20-
},
21-
{
22-
"size" : "29x29",
23-
"idiom" : "iphone",
24-
"filename" : "[email protected]",
25-
"scale" : "2x"
26-
},
27-
{
28-
"size" : "29x29",
29-
"idiom" : "iphone",
30-
"filename" : "[email protected]",
31-
"scale" : "3x"
32-
},
33-
{
34-
"size" : "40x40",
35-
"idiom" : "iphone",
36-
"filename" : "[email protected]",
37-
"scale" : "2x"
38-
},
39-
{
40-
"size" : "40x40",
41-
"idiom" : "iphone",
42-
"filename" : "[email protected]",
43-
"scale" : "3x"
44-
},
45-
{
46-
"size" : "60x60",
47-
"idiom" : "iphone",
48-
"filename" : "[email protected]",
49-
"scale" : "2x"
50-
},
51-
{
52-
"size" : "60x60",
53-
"idiom" : "iphone",
54-
"filename" : "[email protected]",
55-
"scale" : "3x"
56-
},
57-
{
58-
"size" : "20x20",
59-
"idiom" : "ipad",
60-
"filename" : "[email protected]",
61-
"scale" : "1x"
62-
},
63-
{
64-
"size" : "20x20",
65-
"idiom" : "ipad",
66-
"filename" : "[email protected]",
67-
"scale" : "2x"
68-
},
69-
{
70-
"size" : "29x29",
71-
"idiom" : "ipad",
72-
"filename" : "[email protected]",
73-
"scale" : "1x"
74-
},
75-
{
76-
"size" : "29x29",
77-
"idiom" : "ipad",
78-
"filename" : "[email protected]",
79-
"scale" : "2x"
80-
},
81-
{
82-
"size" : "40x40",
83-
"idiom" : "ipad",
84-
"filename" : "[email protected]",
85-
"scale" : "1x"
86-
},
87-
{
88-
"size" : "40x40",
89-
"idiom" : "ipad",
90-
"filename" : "[email protected]",
91-
"scale" : "2x"
92-
},
93-
{
94-
"size" : "76x76",
95-
"idiom" : "ipad",
96-
"filename" : "[email protected]",
97-
"scale" : "1x"
98-
},
99-
{
100-
"size" : "76x76",
101-
"idiom" : "ipad",
102-
"filename" : "[email protected]",
103-
"scale" : "2x"
104-
},
105-
{
106-
"size" : "83.5x83.5",
107-
"idiom" : "ipad",
108-
"filename" : "[email protected]",
109-
"scale" : "2x"
110-
},
111-
{
112-
"size" : "1024x1024",
113-
"idiom" : "ios-marketing",
114-
"filename" : "[email protected]",
115-
"scale" : "1x"
116-
}
117-
],
118-
"info" : {
119-
"version" : 1,
120-
"author" : "xcode"
121-
}
122-
}
1+
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"idiom":"watch","filename":"172.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"86x86","expected-size":"172","role":"quickLook"},{"idiom":"watch","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"40x40","expected-size":"80","role":"appLauncher"},{"idiom":"watch","filename":"88.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"40mm","scale":"2x","size":"44x44","expected-size":"88","role":"appLauncher"},{"idiom":"watch","filename":"102.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"45mm","scale":"2x","size":"51x51","expected-size":"102","role":"appLauncher"},{"idiom":"watch","filename":"108.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"49mm","scale":"2x","size":"54x54","expected-size":"108","role":"appLauncher"},{"idiom":"watch","filename":"92.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"46x46","expected-size":"92","role":"appLauncher"},{"idiom":"watch","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"50x50","expected-size":"100","role":"appLauncher"},{"idiom":"watch","filename":"196.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"98x98","expected-size":"196","role":"quickLook"},{"idiom":"watch","filename":"216.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"108x108","expected-size":"216","role":"quickLook"},{"idiom":"watch","filename":"234.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"45mm","scale":"2x","size":"117x117","expected-size":"234","role":"quickLook"},{"idiom":"watch","filename":"258.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"49mm","scale":"2x","size":"129x129","expected-size":"258","role":"quickLook"},{"idiom":"watch","filename":"48.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"24x24","expected-size":"48","role":"notificationCenter"},{"idiom":"watch","filename":"55.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"27.5x27.5","expected-size":"55","role":"notificationCenter"},{"idiom":"watch","filename":"66.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"45mm","scale":"2x","size":"33x33","expected-size":"66","role":"notificationCenter"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"3x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"2x"},{"size":"1024x1024","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch-marketing","scale":"1x"},{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

example/iosApp/iosApp/Info.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>BuildMachineOSBuild</key>
6-
<string>12E55</string>
75
<key>CFBundleDevelopmentRegion</key>
86
<string>en</string>
97
<key>CFBundleDisplayName</key>

example/macApp/Podfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://cdn.cocoapods.org'
2+
3+
target 'macApp' do
4+
use_frameworks!
5+
platform :osx, '11.0'
6+
pod 'kmp_webrtc', :path => '../../kmp-webrtc/kmp_webrtc.podspec'
7+
pod 'WebRTC', :path => '../../libs/apple/WebRTC.podspec'
8+
pod 'kmp_xlog', '~> 1.3.4'
9+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
3+
*
4+
* Use of this source code is governed by a BSD-style license
5+
* that can be found in the LICENSE file in the root of the source
6+
* tree. An additional intellectual property rights grant can be found
7+
* in the file PATENTS. All contributing project authors may
8+
* be found in the AUTHORS file in the root of the source tree.
9+
*/
10+
11+
#import <Cocoa/Cocoa.h>
12+
13+
@interface APPRTCAppDelegate : NSObject <NSApplicationDelegate>
14+
@end
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
3+
*
4+
* Use of this source code is governed by a BSD-style license
5+
* that can be found in the LICENSE file in the root of the source
6+
* tree. An additional intellectual property rights grant can be found
7+
* in the file PATENTS. All contributing project authors may
8+
* be found in the AUTHORS file in the root of the source tree.
9+
*/
10+
11+
#import "APPRTCAppDelegate.h"
12+
#import "APPRTCViewController.h"
13+
14+
@interface APPRTCAppDelegate () <NSWindowDelegate>
15+
@end
16+
17+
@implementation APPRTCAppDelegate {
18+
APPRTCViewController* _viewController;
19+
NSWindow* _window;
20+
}
21+
22+
#pragma mark - NSApplicationDelegate
23+
24+
- (void)applicationDidFinishLaunching:(NSNotification*)notification {
25+
NSScreen* screen = [NSScreen mainScreen];
26+
NSRect visibleRect = [screen visibleFrame];
27+
NSRect windowRect = NSMakeRect(NSMidX(visibleRect),
28+
NSMidY(visibleRect),
29+
1320,
30+
1140);
31+
NSUInteger styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable;
32+
_window = [[NSWindow alloc] initWithContentRect:windowRect
33+
styleMask:styleMask
34+
backing:NSBackingStoreBuffered
35+
defer:NO];
36+
_window.title = @"kmp-webrtc";
37+
_window.delegate = self;
38+
[_window makeKeyAndOrderFront:self];
39+
[_window makeMainWindow];
40+
_viewController = [[APPRTCViewController alloc] initWithNibName:nil
41+
bundle:nil];
42+
[_window setContentView:[_viewController view]];
43+
}
44+
45+
#pragma mark - NSWindow
46+
47+
- (void)windowWillClose:(NSNotification*)notification {
48+
[_viewController windowWillClose:notification];
49+
[NSApp terminate:self];
50+
}
51+
52+
@end
53+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
3+
*
4+
* Use of this source code is governed by a BSD-style license
5+
* that can be found in the LICENSE file in the root of the source
6+
* tree. An additional intellectual property rights grant can be found
7+
* in the file PATENTS. All contributing project authors may
8+
* be found in the AUTHORS file in the root of the source tree.
9+
*/
10+
11+
#import <AppKit/AppKit.h>
12+
13+
@interface APPRTCViewController : NSViewController
14+
15+
- (void)windowWillClose:(NSNotification*)notification;
16+
17+
@end

0 commit comments

Comments
 (0)