-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Add CameraFeed support for iOS #106305
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
base: master
Are you sure you want to change the base?
Add CameraFeed support for iOS #106305
Conversation
|
CI errors should be resolved in #104857 . |
|
applied the diff
diff --git a/modules/camera/camera_macos.mm b/modules/camera/camera_macos.mm
--- a/modules/camera/camera_macos.mm (revision e37d785a0a7f41d37aa42fe3689e86f322c13dc3)
+++ b/modules/camera/camera_macos.mm (date 1747067891596)
@@ -314,10 +314,14 @@
if (@available(macOS 10.15, *)) {
#endif
AVCaptureDeviceDiscoverySession *session;
- if (@available(macOS 14.0, *)) {
+ if (@available(macOS 14.0, iOS 17.0, *)) {
session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeExternal, AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeContinuityCamera, nil] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
} else {
- session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeExternalUnknown, AVCaptureDeviceTypeBuiltInWideAngleCamera, nil] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
+#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
+ session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeBuiltInWideAngleCamera, nil] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
+#else
+ session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeExternalUnknown, AVCaptureDeviceTypeBuiltInWideAngleCamera, nil] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
+#endif
}
devices = session.devices;
#if defined(__x86_64__)
|
b68fa03 to
990f5de
Compare
990f5de to
a1d1102
Compare
73ade2f to
86c594f
Compare
2b908dc to
2a75995
Compare
a4fa196 to
5b4bec4
Compare
5b4bec4 to
910729b
Compare
|
On a brief review I didn't see anything bad, but also probably want to test to see it works. |
|
@fire A camera feed demo project is available. |
910729b to
dc74105
Compare
dc74105 to
5ec1f21
Compare
5ec1f21 to
e6c4971
Compare
bc2ebe7 to
c28134a
Compare
Co-authored-by: Leo de Penning <[email protected]>
c28134a to
9bab6b4
Compare
9bab6b4 to
57c0a9e
Compare
|
Note: Camera code was moved out of the main repo to the godot-ios-plugins, because simply having it in the app (even if it's not used) require camera permission and marking the app as using camera on the AppStore. Which is not desired by majority of Godot project. So unless something about AppStore rules changed, this can't be merged. |
|
In that case, I'd like to split the pull request as follows:
|
Split iOS definitions (squashing #98416).
I tested on iPhone 15 Pro (iOS 18.4.1)
Relations: