@expo/serve-sim 0.1.35-canary.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/LICENSE +202 -0
- package/README.md +279 -0
- package/Sources/SimAXSettings/build.sh +21 -0
- package/Sources/SimAXSettings/sim-ax-settings.m +273 -0
- package/Sources/SimCameraHelper/build.sh +33 -0
- package/Sources/SimCameraHelper/main.m +955 -0
- package/Sources/SimCameraInjector/SimCamFakes.h +88 -0
- package/Sources/SimCameraInjector/SimCamFakes.m +704 -0
- package/Sources/SimCameraInjector/SimCamFrameSource.h +26 -0
- package/Sources/SimCameraInjector/SimCamFrameSource.m +577 -0
- package/Sources/SimCameraInjector/SimCamLog.h +5 -0
- package/Sources/SimCameraInjector/SimCamLog.m +9 -0
- package/Sources/SimCameraInjector/SimCamSwizzles.h +3 -0
- package/Sources/SimCameraInjector/SimCamSwizzles.m +1338 -0
- package/Sources/SimCameraInjector/SimCameraInjector.m +19 -0
- package/Sources/SimCameraInjector/build.sh +39 -0
- package/Sources/SimCameraInjector/include/SimCamShared.h +79 -0
- package/dist/bin/LiveKitWebRTC.framework/LiveKitWebRTC +0 -0
- package/dist/bin/LiveKitWebRTC.framework/Resources/Info.plist +36 -0
- package/dist/bin/LiveKitWebRTC.framework/Resources/LICENSE.webrtc +29 -0
- package/dist/bin/LiveKitWebRTC.framework/Resources/PrivacyInfo.xcprivacy +32 -0
- package/dist/bin/LiveKitWebRTC.framework/_CodeSignature/CodeResources +150 -0
- package/dist/middleware.cjs +2 -0
- package/dist/middleware.js +123 -0
- package/dist/native/serve-sim-native.node +0 -0
- package/dist/serve-sim.js +218 -0
- package/dist/simax/serve-sim-ax-settings +0 -0
- package/dist/simcam/libSimCameraInjector.dylib +0 -0
- package/dist/simcam/serve-sim-camera-helper +0 -0
- package/dist/state.js +1 -0
- package/package.json +99 -0
- package/src/ax-shared.ts +25 -0
- package/src/ax.ts +258 -0
- package/src/camera-helper.ts +150 -0
- package/src/connect-to-fetch.ts +239 -0
- package/src/middleware.ts +2208 -0
- package/src/native.ts +294 -0
- package/src/state.ts +86 -0
- package/src/stream-settings.ts +202 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#import <AVFoundation/AVFoundation.h>
|
|
4
|
+
#import <CoreMotion/CoreMotion.h>
|
|
5
|
+
|
|
6
|
+
#pragma mark - Mirror mode
|
|
7
|
+
|
|
8
|
+
typedef NS_ENUM(NSInteger, SimCamMirrorMode) {
|
|
9
|
+
SimCamMirrorAuto = 0,
|
|
10
|
+
SimCamMirrorForceOn,
|
|
11
|
+
SimCamMirrorForceOff,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
SimCamMirrorMode SimCamGetMirrorMode(void);
|
|
15
|
+
void SimCamSetMirrorMode(SimCamMirrorMode m);
|
|
16
|
+
BOOL SimCamShouldMirror(AVCaptureDevicePosition p);
|
|
17
|
+
|
|
18
|
+
void SimCamReadMirrorModeFromEnv(void);
|
|
19
|
+
|
|
20
|
+
#pragma mark - Position tag
|
|
21
|
+
|
|
22
|
+
AVCaptureDevicePosition SimCamPositionOf(id obj);
|
|
23
|
+
void SimCamSetPosition(id obj, AVCaptureDevicePosition p);
|
|
24
|
+
|
|
25
|
+
#pragma mark - Camera-in-use sticky flag
|
|
26
|
+
|
|
27
|
+
BOOL SimCamCameraIsInUse(void);
|
|
28
|
+
void SimCamMarkCameraInUse(void);
|
|
29
|
+
void SimCamMarkSessionUsingFakeCamera(id session, BOOL usingFakeCamera);
|
|
30
|
+
|
|
31
|
+
#pragma mark - AVF runtime-error notification suppression
|
|
32
|
+
|
|
33
|
+
BOOL SimCamShouldSwallowAVFRuntimeError(NSNotificationName name, id object);
|
|
34
|
+
void SimCamLogSwallowedRuntimeError(NSString *via, id object, NSDictionary *userInfo);
|
|
35
|
+
|
|
36
|
+
#pragma mark - Fake objects
|
|
37
|
+
|
|
38
|
+
@interface SimCamWeakRef : NSObject
|
|
39
|
+
@property (nonatomic, weak) id target;
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
@interface SimCamFakeFormat : AVCaptureDeviceFormat
|
|
43
|
+
@end
|
|
44
|
+
@interface SimCamFakeDevice : AVCaptureDevice
|
|
45
|
+
@end
|
|
46
|
+
@interface SimCamFakeConnection : AVCaptureConnection
|
|
47
|
+
@end
|
|
48
|
+
@interface SimCamFakeResolvedPhotoSettings : AVCaptureResolvedPhotoSettings
|
|
49
|
+
@end
|
|
50
|
+
|
|
51
|
+
@interface SimCamFakePhoto : AVCapturePhoto
|
|
52
|
+
+ (instancetype)photoFromImage:(CGImageRef)cgImage
|
|
53
|
+
jpegQuality:(CGFloat)q
|
|
54
|
+
mirrored:(BOOL)mirrored;
|
|
55
|
+
@end
|
|
56
|
+
|
|
57
|
+
@interface SimCamAttitude : CMAttitude
|
|
58
|
+
@end
|
|
59
|
+
@interface SimCamAccelerometerData : CMAccelerometerData
|
|
60
|
+
@end
|
|
61
|
+
@interface SimCamGyroData : CMGyroData
|
|
62
|
+
@end
|
|
63
|
+
@interface SimCamMagnetometerData : CMMagnetometerData
|
|
64
|
+
@end
|
|
65
|
+
@interface SimCamDeviceMotion : CMDeviceMotion
|
|
66
|
+
@end
|
|
67
|
+
|
|
68
|
+
#pragma mark - Fake-object factories / caches
|
|
69
|
+
|
|
70
|
+
AVCaptureDeviceFormat *SimCamSharedFakeFormat(void);
|
|
71
|
+
AVCaptureDevice *SimCamFakeDeviceForPosition(AVCaptureDevicePosition p);
|
|
72
|
+
AVCaptureDeviceInput *SimCamFakeInputForPosition(AVCaptureDevicePosition p);
|
|
73
|
+
|
|
74
|
+
AVCaptureConnection *SimCamFakeConnectionForOutput(AVCaptureOutput *out);
|
|
75
|
+
void SimCamSetOutputInput(AVCaptureOutput *out, AVCaptureInput *input);
|
|
76
|
+
AVCaptureInput *SimCamOutputInput(AVCaptureOutput *out);
|
|
77
|
+
|
|
78
|
+
CMAttitude *SimCamSharedAttitude(void);
|
|
79
|
+
CMAccelerometerData *SimCamSharedAccelerometerData(void);
|
|
80
|
+
CMGyroData *SimCamSharedGyroData(void);
|
|
81
|
+
CMMagnetometerData *SimCamSharedMagnetometerData(void);
|
|
82
|
+
CMDeviceMotion *SimCamSharedDeviceMotion(void);
|
|
83
|
+
|
|
84
|
+
#pragma mark - Fake-input marking (used by AVCaptureDeviceInput swizzle)
|
|
85
|
+
|
|
86
|
+
void SimCamMarkFakeInput(id input, AVCaptureDevice *fakeDevice);
|
|
87
|
+
BOOL SimCamIsFakeInput(id input);
|
|
88
|
+
AVCaptureDevice *SimCamFakeInputDevice(id input);
|