You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GDExtension library that involves accessing camera devices for frames capture.
Describe the problem or limitation you are having in your project
Many platforms (AFAIK: Android, iOS, macOS, Linux with XDG Portal and PipeWire when running in sandbox, Web) require explicit user interaction for camera permission before accessing camera devices for frames capture. While CameraServer is not supported on all platforms, there has been progress on implementing support for Linux.
But with currently available methods provided by CameraServer, there is no way no know if camera permission is granted in advance, and requesting permission is handled in activate_feed, if user refused camera access, there is no way to react to it.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The following enhancement should be able to solve the limitation stated above:
Add a method to CameraServer for querying if camera access is granted, with bool return value indicating it is granted or not, it will always return true if no permission is required.
Add a method to CameraServer for requesting camera permission, no-op if no permission is required or it is already granted.
Add a signal for indicating request camera permission result or permission change.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
...
func_ready():
CameraServer.permission_changed.connect(self.on_camera_permission_changed)
start_camera()
funcon_camera_permission_changed(granted: bool):
ifnotgrantedandcamera_started:
# Do something about itelifgrantedandcamera_started:
# Access camera feedsfuncstart_camera():
camera_started=trueifCameraServer.permission_granted():
# Access camera feedselse:
CameraServer.request_permission()
If this enhancement will not be used often, can it be worked around with a few lines of script?
Permission-related operation usually requires access to platform-specific API.
While OS.request_permission exists, it is currently specific to Android, and IMO leaving camera permission handling to CameraServer feels more consistent.
Is there a reason why this should be core and not an add-on in the asset library?
It is absolutely possible to handle camera permission with GDExtension/GDNative library, but it would feel redundant, and since CameraServer is already there, it wouldn't hurt to add permission-related methods to CameraServer for supported platforms.
The text was updated successfully, but these errors were encountered:
On Windows, you can also prevent apps from accessing the camera (or microphone) in the system settings, although no explicit permission is required when access is allowed. We could make the permission grant status return false in this case.
Describe the project you are working on
GDExtension library that involves accessing camera devices for frames capture.
Describe the problem or limitation you are having in your project
Many platforms (AFAIK: Android, iOS, macOS, Linux with XDG Portal and PipeWire when running in sandbox, Web) require explicit user interaction for camera permission before accessing camera devices for frames capture. While
CameraServer
is not supported on all platforms, there has been progress on implementing support for Linux.But with currently available methods provided by CameraServer, there is no way no know if camera permission is granted in advance, and requesting permission is handled in
activate_feed
, if user refused camera access, there is no way to react to it.Describe the feature / enhancement and how it helps to overcome the problem or limitation
The following enhancement should be able to solve the limitation stated above:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
Permission-related operation usually requires access to platform-specific API.
While
OS.request_permission
exists, it is currently specific to Android, and IMO leaving camera permission handling to CameraServer feels more consistent.Is there a reason why this should be core and not an add-on in the asset library?
It is absolutely possible to handle camera permission with GDExtension/GDNative library, but it would feel redundant, and since CameraServer is already there, it wouldn't hurt to add permission-related methods to CameraServer for supported platforms.
The text was updated successfully, but these errors were encountered: