godot-ios-plugins icon indicating copy to clipboard operation
godot-ios-plugins copied to clipboard

Add Godot 4.x camera module support with display rotation and CameraFeed formats

Open shiena opened this issue 1 month ago • 1 comments

split from https://github.com/godotengine/godot/pull/106305 and merge from https://github.com/godotengine/godot/pull/106777

This PR adds comprehensive Godot 4.x support for the iOS camera module with the following improvements:

  • File separation for version-specific code: Split camera implementation into camera_ios.mm (Godot 3.x) and camera_ios_4x.mm (Godot 4.x) to reduce #if directive complexity
  • Display rotation handling: Added handle_display_rotation_change() support for Godot 4.6+ to properly handle camera feed orientation when device rotates
  • CameraFeed format support: Implemented get_formats() and set_format() for Godot 4.5+ allowing users to query and select camera formats
  • Lazy feed initialization: For Godot 4.5+, camera feeds are now initialized via set_monitoring_feeds() instead of constructor, following the new CameraServer pattern

Version Compatibility

  • Godot 3.x: Uses camera_ios.mm (unchanged behavior)
  • Godot 4.0-4.4: Basic camera functionality
  • Godot 4.5+: CameraFeed format selection support
  • Godot 4.6+: Display rotation change callback support

shiena avatar Dec 05 '25 08:12 shiena

This pull request contains changes for the upcoming 4.6 release, so I'll mark it as ready for review once 4.6 is released.

shiena avatar Dec 06 '25 07:12 shiena