Skip to content

Conversation

@shiena
Copy link
Contributor

@shiena shiena commented Mar 31, 2025

fixed godotengine/godot-proposals#12125
Added Continuity Camera to the device discovery session to provide users with more camera options. Users on macOS 13+ can now select their Continuity Camera device within the application.
https://support.apple.com/en-us/102546

@shiena shiena requested a review from a team as a code owner March 31, 2025 19:00
@AThousandShips AThousandShips changed the title feat: Allow users to select Continuity Camera macOS: Allow users to select Continuity Camera Mar 31, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Mar 31, 2025
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, but I don't have an iOS device to test this.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but I do not have anything to test it with.

Since you are changing this code, it probably worth replacing __MAC_OS_X_VERSION_MIN_REQUIRED (which only suppresses warnings) with runtime checks:

	NSArray<AVCaptureDevice *> *devices = nullptr;
#if defined(__x86_64__)
	if (@available(macOS 10.15, *)) {
#endif
		AVCaptureDeviceDiscoverySession *session;
		if (@available(macOS 14.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];
		}
		devices = session.devices;
#if defined(__x86_64__)
	} else {
		devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
	}
#endif

Added Continuity Camera to the device discovery session to provide
users with more camera options. Users on macOS 13+ can now select
their Continuity Camera device within the application.
@shiena shiena force-pushed the feature/discovery-continuity-camera branch from 8ccebbe to e37d785 Compare April 1, 2025 11:31
@RubenGarcia
Copy link

I´m also interested in this feature.

@Repiteo Repiteo modified the milestones: 4.x, 4.5 May 13, 2025
@Repiteo Repiteo merged commit 5db0aab into godotengine:master May 13, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented May 13, 2025

Thanks! Congratulations on your first merged contribution! 🎉

@shiena shiena deleted the feature/discovery-continuity-camera branch May 13, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for iPhone Continuity Camera feature in CameraServer

6 participants