@szdziedzic/sim-on 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/bin/sim-on.js +5 -0
- package/dist/simon.mjs +307 -0
- package/package.json +38 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/LiveKitWebRTC.h +113 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioBuffer.h +38 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioCustomProcessingDelegate.h +52 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioDeviceModule.h +287 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioProcessingConfig.h +37 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioProcessingModule.h +31 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioProcessingState.h +137 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioRenderer.h +35 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioSource.h +32 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCAudioTrack.h +150 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCVPixelBuffer.h +52 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCallbackLogger.h +41 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCameraVideoCapturer.h +71 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCertificate.h +47 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCodecSpecificInfo.h +24 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCodecSpecificInfoH264.h +27 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCConfiguration.h +278 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCCryptoOptions.h +66 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDataChannel.h +134 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDataChannelConfiguration.h +52 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDataPacketCryptor.h +52 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDefaultAudioProcessingModule.h +47 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDefaultVideoDecoderFactory.h +26 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDefaultVideoEncoderFactory.h +31 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDesktopCapturer.h +60 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDesktopMediaList.h +51 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDesktopSource.h +40 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDispatcher.h +46 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCDtmfSender.h +73 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCEncodedImage.h +52 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCFieldTrials.h +34 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCFileLogger.h +75 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCFileVideoCapturer.h +51 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCFrameCryptor.h +77 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCFrameCryptorKeyProvider.h +76 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCH264ProfileLevelId.h +60 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCI420Buffer.h +22 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCIODevice.h +41 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCIceCandidate.h +50 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCIceCandidateErrorEvent.h +45 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCIceServer.h +114 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCLegacyStatsReport.h +37 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCLogging.h +66 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMTLNSVideoView.h +22 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMTLVideoView.h +63 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMacros.h +69 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMediaConstraints.h +47 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMediaSource.h +34 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMediaStream.h +50 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMediaStreamTrack.h +50 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMetrics.h +24 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMetricsSampleInfo.h +48 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMutableI420Buffer.h +24 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCMutableYUVPlanarBuffer.h +28 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCNativeI420Buffer.h +23 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCNativeMutableI420Buffer.h +24 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCPeerConnection.h +416 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCPeerConnectionFactory.h +159 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCPeerConnectionFactoryOptions.h +38 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtcpParameters.h +30 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpCapabilities.h +31 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpCodecCapability.h +58 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpCodecParameters.h +74 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpEncodingParameters.h +81 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpHeaderExtension.h +33 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpHeaderExtensionCapability.h +39 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpParameters.h +63 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpReceiver.h +105 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpSender.h +55 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpSource.h +66 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCRtpTransceiver.h +180 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCSSLAdapter.h +20 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCSSLCertificateVerifier.h +25 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCSessionDescription.h +48 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCStatisticsReport.h +58 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCTracing.h +21 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoCapturer.h +37 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoCodecInfo.h +43 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoder.h +41 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoderAV1.h +25 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoderFactory.h +33 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoderFactoryH264.h +18 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoderH264.h +18 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoderVP8.h +25 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoDecoderVP9.h +27 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoder.h +62 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderAV1.h +34 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderFactory.h +78 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderFactoryH264.h +18 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderFactorySimulcast.h +16 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderH264.h +22 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderQpThresholds.h +29 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderSettings.h +42 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderSimulcast.h +13 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderVP8.h +30 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoEncoderVP9.h +34 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoFrame.h +86 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoFrameBuffer.h +40 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoRenderer.h +44 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoSource.h +37 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoTrack.h +41 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCVideoViewShading.h +39 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCYUVHelper.h +118 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Headers/RTCYUVPlanarBuffer.h +46 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/LiveKitWebRTC +0 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Modules/module.modulemap +6 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Resources/Info.plist +36 -0
- package/vendor/helper/LiveKitWebRTC.framework/Versions/A/Versions/A/Resources/PrivacyInfo.xcprivacy +32 -0
- package/vendor/helper/simon-helper +0 -0
- package/vendor/web/app.js +54 -0
- package/vendor/web/index.html +15 -0
- package/vendor/web/styles.css +435 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 LiveKit
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#import <AVFoundation/AVFoundation.h>
|
|
18
|
+
#import <Foundation/Foundation.h>
|
|
19
|
+
|
|
20
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
21
|
+
#import <LiveKitWebRTC/RTCVideoCapturer.h>
|
|
22
|
+
#import <LiveKitWebRTC/RTCDesktopSource.h>
|
|
23
|
+
|
|
24
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
25
|
+
|
|
26
|
+
@class RTC_OBJC_TYPE(RTCDesktopCapturer);
|
|
27
|
+
|
|
28
|
+
RTC_OBJC_EXPORT
|
|
29
|
+
@protocol RTC_OBJC_TYPE(RTCDesktopCapturerDelegate)<NSObject>
|
|
30
|
+
-(void)didSourceCaptureStart:(RTC_OBJC_TYPE(RTCDesktopCapturer) *) capturer;
|
|
31
|
+
|
|
32
|
+
-(void)didSourceCapturePaused:(RTC_OBJC_TYPE(RTCDesktopCapturer) *) capturer;
|
|
33
|
+
|
|
34
|
+
-(void)didSourceCaptureStop:(RTC_OBJC_TYPE(RTCDesktopCapturer) *) capturer;
|
|
35
|
+
|
|
36
|
+
-(void)didSourceCaptureError:(RTC_OBJC_TYPE(RTCDesktopCapturer) *) capturer;
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
RTC_OBJC_EXPORT
|
|
40
|
+
// Screen capture that implements RTCVideoCapturer. Delivers frames to a
|
|
41
|
+
// RTCVideoCapturerDelegate (usually RTCVideoSource).
|
|
42
|
+
@interface RTC_OBJC_TYPE (RTCDesktopCapturer) : RTC_OBJC_TYPE(RTCVideoCapturer)
|
|
43
|
+
|
|
44
|
+
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCDesktopSource) *source;
|
|
45
|
+
|
|
46
|
+
- (instancetype)initWithSource:(RTC_OBJC_TYPE(RTCDesktopSource) *)source delegate:(__weak id<RTC_OBJC_TYPE(RTCDesktopCapturerDelegate)>)delegate captureDelegate:(__weak id<RTC_OBJC_TYPE(RTCVideoCapturerDelegate)>)captureDelegate;
|
|
47
|
+
|
|
48
|
+
- (instancetype)initWithDefaultScreen:(__weak id<RTC_OBJC_TYPE(RTCDesktopCapturerDelegate)>)delegate captureDelegate:(__weak id<RTC_OBJC_TYPE(RTCVideoCapturerDelegate)>)captureDelegate;
|
|
49
|
+
|
|
50
|
+
- (void)startCapture;
|
|
51
|
+
|
|
52
|
+
- (void)startCaptureWithFPS:(NSInteger)fps;
|
|
53
|
+
|
|
54
|
+
- (void)stopCapture;
|
|
55
|
+
|
|
56
|
+
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler;
|
|
57
|
+
|
|
58
|
+
@end
|
|
59
|
+
|
|
60
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 LiveKit
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#import <AVFoundation/AVFoundation.h>
|
|
18
|
+
#import <Foundation/Foundation.h>
|
|
19
|
+
|
|
20
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
21
|
+
#import <LiveKitWebRTC/RTCDesktopSource.h>
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
24
|
+
|
|
25
|
+
RTC_OBJC_EXPORT
|
|
26
|
+
@protocol RTC_OBJC_TYPE
|
|
27
|
+
(RTCDesktopMediaListDelegate)<NSObject>
|
|
28
|
+
|
|
29
|
+
- (void)didDesktopSourceAdded:(RTC_OBJC_TYPE(RTCDesktopSource) *) source;
|
|
30
|
+
|
|
31
|
+
- (void)didDesktopSourceRemoved:(RTC_OBJC_TYPE(RTCDesktopSource) *) source;
|
|
32
|
+
|
|
33
|
+
- (void)didDesktopSourceNameChanged:(RTC_OBJC_TYPE(RTCDesktopSource) *) source;
|
|
34
|
+
|
|
35
|
+
- (void)didDesktopSourceThumbnailChanged:(RTC_OBJC_TYPE(RTCDesktopSource) *) source;
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
RTC_OBJC_EXPORT
|
|
39
|
+
@interface RTC_OBJC_TYPE (RTCDesktopMediaList) : NSObject
|
|
40
|
+
|
|
41
|
+
-(instancetype)initWithType:(RTC_OBJC_TYPE(RTCDesktopSourceType))type delegate:(__weak id<RTC_OBJC_TYPE(RTCDesktopMediaListDelegate)>)delegate;
|
|
42
|
+
|
|
43
|
+
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCDesktopSourceType) sourceType;
|
|
44
|
+
|
|
45
|
+
- (int32_t)UpdateSourceList:(BOOL)forceReload updateAllThumbnails:(BOOL)updateThumbnail;
|
|
46
|
+
|
|
47
|
+
- (NSArray<RTC_OBJC_TYPE (RTCDesktopSource) *>*) getSources;
|
|
48
|
+
|
|
49
|
+
@end
|
|
50
|
+
|
|
51
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 LiveKit
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
#import <AppKit/AppKit.h>
|
|
17
|
+
#import <AVFoundation/AVFoundation.h>
|
|
18
|
+
#import <Foundation/Foundation.h>
|
|
19
|
+
|
|
20
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
21
|
+
|
|
22
|
+
typedef NS_ENUM(NSInteger, RTC_OBJC_TYPE(RTCDesktopSourceType)) {
|
|
23
|
+
RTC_OBJC_TYPE(RTCDesktopSourceTypeScreen),
|
|
24
|
+
RTC_OBJC_TYPE(RTCDesktopSourceTypeWindow),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
RTC_OBJC_EXPORT
|
|
28
|
+
@interface RTC_OBJC_TYPE (RTCDesktopSource) : NSObject
|
|
29
|
+
|
|
30
|
+
@property(nonatomic, readonly) NSString *sourceId;
|
|
31
|
+
|
|
32
|
+
@property(nonatomic, readonly) NSString *name;
|
|
33
|
+
|
|
34
|
+
@property(nonatomic, readonly) NSImage *thumbnail;
|
|
35
|
+
|
|
36
|
+
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCDesktopSourceType) sourceType;
|
|
37
|
+
|
|
38
|
+
-( NSImage *)UpdateThumbnail;
|
|
39
|
+
|
|
40
|
+
@end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2015 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 <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
14
|
+
|
|
15
|
+
typedef NS_ENUM(NSInteger, RTC_OBJC_TYPE(RTCDispatcherQueueType)) {
|
|
16
|
+
// Main dispatcher queue.
|
|
17
|
+
RTC_OBJC_TYPE(RTCDispatcherTypeMain),
|
|
18
|
+
// Used for starting/stopping AVCaptureSession, and assigning
|
|
19
|
+
// capture session to AVCaptureVideoPreviewLayer.
|
|
20
|
+
RTC_OBJC_TYPE(RTCDispatcherTypeCaptureSession),
|
|
21
|
+
// Used for operations on AVAudioSession.
|
|
22
|
+
RTC_OBJC_TYPE(RTCDispatcherTypeAudioSession),
|
|
23
|
+
// Used for operations on NWPathMonitor.
|
|
24
|
+
RTC_OBJC_TYPE(RTCDispatcherTypeNetworkMonitor),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Dispatcher that asynchronously dispatches blocks to a specific
|
|
28
|
+
* shared dispatch queue.
|
|
29
|
+
*/
|
|
30
|
+
RTC_OBJC_EXPORT
|
|
31
|
+
@interface RTC_OBJC_TYPE (RTCDispatcher) : NSObject
|
|
32
|
+
|
|
33
|
+
- (instancetype)init NS_UNAVAILABLE;
|
|
34
|
+
|
|
35
|
+
/** Dispatch the block asynchronously on the queue for dispatchType.
|
|
36
|
+
* @param dispatchType The queue type to dispatch on.
|
|
37
|
+
* @param block The block to dispatch asynchronously.
|
|
38
|
+
*/
|
|
39
|
+
+ (void)dispatchAsyncOnType:(RTC_OBJC_TYPE(RTCDispatcherQueueType))dispatchType block:(dispatch_block_t)block;
|
|
40
|
+
|
|
41
|
+
/** Returns YES if run on queue for the dispatchType otherwise NO.
|
|
42
|
+
* Useful for asserting that a method is run on a correct queue.
|
|
43
|
+
*/
|
|
44
|
+
+ (BOOL)isOnQueueForType:(RTC_OBJC_TYPE(RTCDispatcherQueueType))dispatchType;
|
|
45
|
+
|
|
46
|
+
@end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017 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 <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
+
|
|
17
|
+
RTC_OBJC_EXPORT
|
|
18
|
+
@protocol RTC_OBJC_TYPE
|
|
19
|
+
(RTCDtmfSender)<NSObject>
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns true if this RTCDtmfSender is capable of sending DTMF. Otherwise
|
|
23
|
+
* returns false. To be able to send DTMF, the associated RTCRtpSender must
|
|
24
|
+
* be able to send packets, and a "telephone-event" codec must be
|
|
25
|
+
* negotiated.
|
|
26
|
+
*/
|
|
27
|
+
@property(nonatomic, readonly) BOOL canInsertDtmf;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Queues a task that sends the DTMF tones. The tones parameter is treated
|
|
31
|
+
* as a series of characters. The characters 0 through 9, A through D, #, and *
|
|
32
|
+
* generate the associated DTMF tones. The characters a to d are equivalent
|
|
33
|
+
* to A to D. The character ',' indicates a delay of 2 seconds before
|
|
34
|
+
* processing the next character in the tones parameter.
|
|
35
|
+
*
|
|
36
|
+
* Unrecognized characters are ignored.
|
|
37
|
+
*
|
|
38
|
+
* @param duration The parameter indicates the duration to use for each
|
|
39
|
+
* character passed in the tones parameter. The duration cannot be more
|
|
40
|
+
* than 6000 or less than 70 ms.
|
|
41
|
+
*
|
|
42
|
+
* @param interToneGap The parameter indicates the gap between tones.
|
|
43
|
+
* This parameter must be at least 50 ms but should be as short as
|
|
44
|
+
* possible.
|
|
45
|
+
*
|
|
46
|
+
* If InsertDtmf is called on the same object while an existing task for this
|
|
47
|
+
* object to generate DTMF is still running, the previous task is canceled.
|
|
48
|
+
* Returns true on success and false on failure.
|
|
49
|
+
*/
|
|
50
|
+
- (BOOL)insertDtmf:(nonnull NSString *)tones
|
|
51
|
+
duration:(NSTimeInterval)duration
|
|
52
|
+
interToneGap:(NSTimeInterval)interToneGap;
|
|
53
|
+
|
|
54
|
+
/** The tones remaining to be played out */
|
|
55
|
+
- (nonnull NSString *)remainingTones;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The current tone duration value. This value will be the value last set via
|
|
59
|
+
* the insertDtmf method, or the default value of 100 ms if insertDtmf was never
|
|
60
|
+
* called.
|
|
61
|
+
*/
|
|
62
|
+
- (NSTimeInterval)duration;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The current value of the between-tone gap. This value will be the value last
|
|
66
|
+
* set via the insertDtmf() method, or the default value of 50 ms if
|
|
67
|
+
* insertDtmf() was never called.
|
|
68
|
+
*/
|
|
69
|
+
- (NSTimeInterval)interToneGap;
|
|
70
|
+
|
|
71
|
+
@end
|
|
72
|
+
|
|
73
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017 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 <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import <LiveKitWebRTC/RTCVideoFrame.h>
|
|
14
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
/** Represents an encoded frame's type. */
|
|
19
|
+
typedef NS_ENUM(NSUInteger, RTC_OBJC_TYPE(RTCFrameType)) {
|
|
20
|
+
RTC_OBJC_TYPE(RTCFrameTypeEmptyFrame) = 0,
|
|
21
|
+
RTC_OBJC_TYPE(RTCFrameTypeAudioFrameSpeech) = 1,
|
|
22
|
+
RTC_OBJC_TYPE(RTCFrameTypeAudioFrameCN) = 2,
|
|
23
|
+
RTC_OBJC_TYPE(RTCFrameTypeVideoFrameKey) = 3,
|
|
24
|
+
RTC_OBJC_TYPE(RTCFrameTypeVideoFrameDelta) = 4,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
typedef NS_ENUM(NSUInteger, RTC_OBJC_TYPE(RTCVideoContentType)) {
|
|
28
|
+
RTC_OBJC_TYPE(RTCVideoContentTypeUnspecified),
|
|
29
|
+
RTC_OBJC_TYPE(RTCVideoContentTypeScreenshare),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Represents an encoded frame. Corresponds to webrtc::EncodedImage. */
|
|
33
|
+
RTC_OBJC_EXPORT
|
|
34
|
+
@interface RTC_OBJC_TYPE (RTCEncodedImage) : NSObject
|
|
35
|
+
|
|
36
|
+
@property(nonatomic, strong) NSData *buffer;
|
|
37
|
+
@property(nonatomic, assign) int32_t encodedWidth;
|
|
38
|
+
@property(nonatomic, assign) int32_t encodedHeight;
|
|
39
|
+
@property(nonatomic, assign) uint32_t timeStamp;
|
|
40
|
+
@property(nonatomic, assign) int64_t captureTimeMs;
|
|
41
|
+
@property(nonatomic, assign) int64_t ntpTimeMs;
|
|
42
|
+
@property(nonatomic, assign) uint8_t flags;
|
|
43
|
+
@property(nonatomic, assign) int64_t encodeStartMs;
|
|
44
|
+
@property(nonatomic, assign) int64_t encodeFinishMs;
|
|
45
|
+
@property(nonatomic, assign) RTC_OBJC_TYPE(RTCFrameType) frameType;
|
|
46
|
+
@property(nonatomic, assign) RTC_OBJC_TYPE(RTCVideoRotation) rotation;
|
|
47
|
+
@property(nonatomic, strong) NSNumber *qp;
|
|
48
|
+
@property(nonatomic, assign) RTC_OBJC_TYPE(RTCVideoContentType) contentType;
|
|
49
|
+
|
|
50
|
+
@end
|
|
51
|
+
|
|
52
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 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 <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
14
|
+
|
|
15
|
+
/** The only valid value for the following if set is kRTCFieldTrialEnabledValue. */
|
|
16
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialAudioForceABWENoTWCCKey);
|
|
17
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialFlexFec03AdvertisedKey);
|
|
18
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialFlexFec03Key);
|
|
19
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialH264HighProfileKey);
|
|
20
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialMinimizeResamplingOnMobileKey);
|
|
21
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialUseNWPathMonitor);
|
|
22
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialIceHandshakeDtlsKey);
|
|
23
|
+
|
|
24
|
+
/** The valid value for field trials above. */
|
|
25
|
+
RTC_EXTERN NSString *const RTC_CONSTANT_TYPE(RTCFieldTrialEnabledValue);
|
|
26
|
+
|
|
27
|
+
/** Initialize field trials using a dictionary mapping field trial keys to their
|
|
28
|
+
* values. See above for valid keys and values. Must be called before any other
|
|
29
|
+
* call into WebRTC. See: webrtc/system_wrappers/include/field_trial.h
|
|
30
|
+
*/
|
|
31
|
+
// TODO: bugs.webrtc.org/42220378 - Delete after January 1, 2026.
|
|
32
|
+
RTC_OBJC_DEPRECATED("Pass field trials when building PeerConnectionFactory")
|
|
33
|
+
RTC_EXTERN void RTC_OBJC_TYPE(RTCInitFieldTrialDictionary)(
|
|
34
|
+
NSDictionary<NSString *, NSString *> *fieldTrials);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2015 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 <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
14
|
+
|
|
15
|
+
typedef NS_ENUM(NSUInteger, RTC_OBJC_TYPE(RTCFileLoggerSeverity)) {
|
|
16
|
+
RTC_OBJC_TYPE(RTCFileLoggerSeverityVerbose),
|
|
17
|
+
RTC_OBJC_TYPE(RTCFileLoggerSeverityInfo),
|
|
18
|
+
RTC_OBJC_TYPE(RTCFileLoggerSeverityWarning),
|
|
19
|
+
RTC_OBJC_TYPE(RTCFileLoggerSeverityError)
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
typedef NS_ENUM(NSUInteger, RTC_OBJC_TYPE(RTCFileLoggerRotationType)) {
|
|
23
|
+
RTC_OBJC_TYPE(RTCFileLoggerTypeCall),
|
|
24
|
+
RTC_OBJC_TYPE(RTCFileLoggerTypeApp),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
28
|
+
|
|
29
|
+
// This class intercepts WebRTC logs and saves them to a file. The file size
|
|
30
|
+
// will not exceed the given maximum bytesize. When the maximum bytesize is
|
|
31
|
+
// reached, logs are rotated according to the rotationType specified.
|
|
32
|
+
// For kRTCFileLoggerTypeCall, logs from the beginning and the end
|
|
33
|
+
// are preserved while the middle section is overwritten instead.
|
|
34
|
+
// For kRTCFileLoggerTypeApp, the oldest log is overwritten.
|
|
35
|
+
// This class is not threadsafe.
|
|
36
|
+
RTC_OBJC_EXPORT
|
|
37
|
+
@interface RTC_OBJC_TYPE (RTCFileLogger) : NSObject
|
|
38
|
+
|
|
39
|
+
// The severity level to capture. The default is kRTCFileLoggerSeverityInfo.
|
|
40
|
+
@property(nonatomic, assign) RTC_OBJC_TYPE(RTCFileLoggerSeverity) severity;
|
|
41
|
+
|
|
42
|
+
// The rotation type for this file logger. The default is
|
|
43
|
+
// kRTCFileLoggerTypeCall.
|
|
44
|
+
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCFileLoggerRotationType) rotationType;
|
|
45
|
+
|
|
46
|
+
// Disables buffering disk writes. Should be set before `start`. Buffering
|
|
47
|
+
// is enabled by default for performance.
|
|
48
|
+
@property(nonatomic, assign) BOOL shouldDisableBuffering;
|
|
49
|
+
|
|
50
|
+
// Default constructor provides default settings for dir path, file size and
|
|
51
|
+
// rotation type.
|
|
52
|
+
- (instancetype)init;
|
|
53
|
+
|
|
54
|
+
// Create file logger with default rotation type.
|
|
55
|
+
- (instancetype)initWithDirPath:(NSString *)dirPath
|
|
56
|
+
maxFileSize:(NSUInteger)maxFileSize;
|
|
57
|
+
|
|
58
|
+
- (instancetype)initWithDirPath:(NSString *)dirPath
|
|
59
|
+
maxFileSize:(NSUInteger)maxFileSize
|
|
60
|
+
rotationType:(RTC_OBJC_TYPE(RTCFileLoggerRotationType))rotationType NS_DESIGNATED_INITIALIZER;
|
|
61
|
+
|
|
62
|
+
// Starts writing WebRTC logs to disk if not already started. Overwrites any
|
|
63
|
+
// existing file(s).
|
|
64
|
+
- (void)start;
|
|
65
|
+
|
|
66
|
+
// Stops writing WebRTC logs to disk. This method is also called on dealloc.
|
|
67
|
+
- (void)stop;
|
|
68
|
+
|
|
69
|
+
// Returns the current contents of the logs, or nil if start has been called
|
|
70
|
+
// without a stop.
|
|
71
|
+
- (nullable NSData *)logData;
|
|
72
|
+
|
|
73
|
+
@end
|
|
74
|
+
|
|
75
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017 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 <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import <LiveKitWebRTC/RTCVideoCapturer.h>
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Error passing block.
|
|
19
|
+
*/
|
|
20
|
+
typedef void (^RTCFileVideoCapturerErrorBlock)(NSError *error);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Captures buffers from bundled video file.
|
|
24
|
+
*
|
|
25
|
+
* See @c RTCVideoCapturer for more info on capturers.
|
|
26
|
+
*/
|
|
27
|
+
RTC_OBJC_EXPORT
|
|
28
|
+
|
|
29
|
+
NS_CLASS_AVAILABLE_IOS(10)
|
|
30
|
+
@interface RTC_OBJC_TYPE (RTCFileVideoCapturer) : RTC_OBJC_TYPE(RTCVideoCapturer)
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Starts asynchronous capture of frames from video file.
|
|
34
|
+
*
|
|
35
|
+
* Capturing is not started if error occurs. Underlying error will be
|
|
36
|
+
* relayed in the errorBlock if one is provided.
|
|
37
|
+
* Successfully captured video frames will be passed to the delegate.
|
|
38
|
+
*
|
|
39
|
+
* @param nameOfFile The name of the bundled video file to be read.
|
|
40
|
+
* @errorBlock block to be executed upon error.
|
|
41
|
+
*/
|
|
42
|
+
- (void)startCapturingFromFileNamed:(NSString *)nameOfFile
|
|
43
|
+
onError:(__nullable RTCFileVideoCapturerErrorBlock)errorBlock;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Immediately stops capture.
|
|
47
|
+
*/
|
|
48
|
+
- (void)stopCapture;
|
|
49
|
+
@end
|
|
50
|
+
|
|
51
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 LiveKit
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#import <Foundation/Foundation.h>
|
|
18
|
+
|
|
19
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
22
|
+
|
|
23
|
+
@class RTC_OBJC_TYPE(RTCRtpSender);
|
|
24
|
+
@class RTC_OBJC_TYPE(RTCRtpReceiver);
|
|
25
|
+
@class RTC_OBJC_TYPE(RTCFrameCryptorKeyProvider);
|
|
26
|
+
@class RTC_OBJC_TYPE(RTCFrameCryptor);
|
|
27
|
+
@class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
|
|
28
|
+
|
|
29
|
+
typedef NS_ENUM(NSUInteger, RTC_OBJC_TYPE(RTCCryptorAlgorithm)) {
|
|
30
|
+
RTC_OBJC_TYPE(RTCCryptorAlgorithmAesGcm) = 0,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
typedef NS_ENUM(NSInteger, RTC_OBJC_TYPE(RTCFrameCryptorState)) {
|
|
34
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateNew) = 0,
|
|
35
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateOk),
|
|
36
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateEncryptionFailed),
|
|
37
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateDecryptionFailed),
|
|
38
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateMissingKey),
|
|
39
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateKeyRatcheted),
|
|
40
|
+
RTC_OBJC_TYPE(RTCFrameCryptorStateInternalError),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
RTC_OBJC_EXPORT
|
|
44
|
+
@protocol RTC_OBJC_TYPE
|
|
45
|
+
(RTCFrameCryptorDelegate)<NSObject>
|
|
46
|
+
/** Called when the RTCFrameCryptor got errors. */
|
|
47
|
+
- (void)frameCryptor
|
|
48
|
+
: (RTC_OBJC_TYPE(RTCFrameCryptor) *)frameCryptor didStateChangeWithParticipantId
|
|
49
|
+
: (NSString *)participantId withState : (RTC_OBJC_TYPE(RTCFrameCryptorState))stateChanged;
|
|
50
|
+
@end
|
|
51
|
+
|
|
52
|
+
RTC_OBJC_EXPORT
|
|
53
|
+
@interface RTC_OBJC_TYPE (RTCFrameCryptor) : NSObject
|
|
54
|
+
|
|
55
|
+
@property(nonatomic, assign) BOOL enabled;
|
|
56
|
+
|
|
57
|
+
@property(nonatomic, assign) int keyIndex;
|
|
58
|
+
|
|
59
|
+
@property(nonatomic, readonly) NSString *participantId;
|
|
60
|
+
|
|
61
|
+
@property(nonatomic, weak, nullable) id<RTC_OBJC_TYPE(RTCFrameCryptorDelegate)> delegate;
|
|
62
|
+
|
|
63
|
+
- (nullable instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
|
64
|
+
rtpSender:(RTC_OBJC_TYPE(RTCRtpSender) *)sender
|
|
65
|
+
participantId:(NSString *)participantId
|
|
66
|
+
algorithm:(RTC_OBJC_TYPE(RTCCryptorAlgorithm))algorithm
|
|
67
|
+
keyProvider:(RTC_OBJC_TYPE(RTCFrameCryptorKeyProvider) *)keyProvider;
|
|
68
|
+
|
|
69
|
+
- (nullable instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
|
70
|
+
rtpReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)receiver
|
|
71
|
+
participantId:(NSString *)participantId
|
|
72
|
+
algorithm:(RTC_OBJC_TYPE(RTCCryptorAlgorithm))algorithm
|
|
73
|
+
keyProvider:(RTC_OBJC_TYPE(RTCFrameCryptorKeyProvider) *)keyProvider;
|
|
74
|
+
|
|
75
|
+
@end
|
|
76
|
+
|
|
77
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 LiveKit
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#import <Foundation/Foundation.h>
|
|
18
|
+
|
|
19
|
+
#import <LiveKitWebRTC/RTCMacros.h>
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
22
|
+
|
|
23
|
+
typedef NS_ENUM(NSUInteger, RTC_OBJC_TYPE(RTCKeyDerivationAlgorithm)) {
|
|
24
|
+
RTC_OBJC_TYPE(RTCKeyDerivationAlgorithmPBKDF2) = 0,
|
|
25
|
+
RTC_OBJC_TYPE(RTCKeyDerivationAlgorithmHKDF),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
RTC_OBJC_EXPORT
|
|
29
|
+
@interface RTC_OBJC_TYPE (RTCFrameCryptorKeyProvider) : NSObject
|
|
30
|
+
|
|
31
|
+
- (void)setSharedKey:(NSData *)key withIndex:(int)index;
|
|
32
|
+
|
|
33
|
+
- (NSData *)ratchetSharedKey:(int)index;
|
|
34
|
+
|
|
35
|
+
- (NSData *)exportSharedKey:(int)index;
|
|
36
|
+
|
|
37
|
+
- (void)setKey:(NSData *)key withIndex:(int)index forParticipant:(NSString *)participantId;
|
|
38
|
+
|
|
39
|
+
- (NSData *)ratchetKey:(NSString *)participantId withIndex:(int)index;
|
|
40
|
+
|
|
41
|
+
- (NSData *)exportKey:(NSString *)participantId withIndex:(int)index;
|
|
42
|
+
|
|
43
|
+
- (void)setSifTrailer:(NSData *)trailer;
|
|
44
|
+
|
|
45
|
+
- (instancetype)initWithRatchetSalt:(NSData *)salt
|
|
46
|
+
ratchetWindowSize:(int)windowSize
|
|
47
|
+
sharedKeyMode:(BOOL)sharedKey
|
|
48
|
+
uncryptedMagicBytes:(nullable NSData *)uncryptedMagicBytes;
|
|
49
|
+
|
|
50
|
+
- (instancetype)initWithRatchetSalt:(NSData *)salt
|
|
51
|
+
ratchetWindowSize:(int)windowSize
|
|
52
|
+
sharedKeyMode:(BOOL)sharedKey
|
|
53
|
+
uncryptedMagicBytes:(nullable NSData *)uncryptedMagicBytes
|
|
54
|
+
failureTolerance:(int)failureTolerance
|
|
55
|
+
keyRingSize:(int)keyRingSize;
|
|
56
|
+
|
|
57
|
+
- (instancetype)initWithRatchetSalt:(NSData *)salt
|
|
58
|
+
ratchetWindowSize:(int)windowSize
|
|
59
|
+
sharedKeyMode:(BOOL)sharedKey
|
|
60
|
+
uncryptedMagicBytes:(nullable NSData *)uncryptedMagicBytes
|
|
61
|
+
failureTolerance:(int)failureTolerance
|
|
62
|
+
keyRingSize:(int)keyRingSize
|
|
63
|
+
discardFrameWhenCryptorNotReady:(BOOL)discardFrameWhenCryptorNotReady;
|
|
64
|
+
|
|
65
|
+
- (instancetype)initWithRatchetSalt:(NSData *)salt
|
|
66
|
+
ratchetWindowSize:(int)windowSize
|
|
67
|
+
sharedKeyMode:(BOOL)sharedKey
|
|
68
|
+
uncryptedMagicBytes:(nullable NSData *)uncryptedMagicBytes
|
|
69
|
+
failureTolerance:(int)failureTolerance
|
|
70
|
+
keyRingSize:(int)keyRingSize
|
|
71
|
+
discardFrameWhenCryptorNotReady:(BOOL)discardFrameWhenCryptorNotReady
|
|
72
|
+
keyDerivationAlgorithm:(RTC_OBJC_TYPE(RTCKeyDerivationAlgorithm))keyDerivationAlgorithm;
|
|
73
|
+
|
|
74
|
+
@end
|
|
75
|
+
|
|
76
|
+
NS_ASSUME_NONNULL_END
|