Skip to content
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

camera/pipewire: Implement the XDP Camera portal #10615

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

km9l
Copy link

@km9l km9l commented Aug 29, 2024

Description

This helps the Pipewire camera driver to access cameras in a sandboxed environment without host Pipewire socket access. Unlike other platforms, no event is sent when the user rejects camera access. This is because there is no mechanism to query cameras through the portal, and we only obtain access to the Pipewire fd if the user accepts the request. The Pipewire driver will attempt to open the host socket instead.

Maybe allowing a SDL_GetCameraPermissionState call happen before SDL_GetCameras could work? I didn't bother doing any API change for now.

This helps the Pipewire camera driver to access cameras
in a sandboxed environment without host Pipewire socket access.
Unlike other platforms, no event is sent when the user rejects
camera access. This is because there is no mechanism to query
cameras through the portal, and we only obtain access to the
Pipewire fd if the user accepts the request. The Pipewire driver
will attempt to open the host socket instead.
@km9l km9l changed the title camera: Implement the XDP Camera portal camera/pipewire: Implement the XDP Camera portal Aug 29, 2024
@sezero
Copy link
Contributor

sezero commented Aug 29, 2024

Don't know about the rest, but can you add the following so that it still compiles against older headers, please?

diff --git a/src/core/linux/SDL_dbus.h b/src/core/linux/SDL_dbus.h
--- a/src/core/linux/SDL_dbus.h
+++ b/src/core/linux/SDL_dbus.h
@@ -34,6 +34,9 @@
 #ifndef DBUS_TIMEOUT_INFINITE
 #define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
 #endif
+#ifndef DBUS_TYPE_UNIX_FD
+#define DBUS_TYPE_UNIX_FD ((int) 'h')
+#endif
 
 typedef struct SDL_DBusContext
 {

@km9l
Copy link
Author

km9l commented Aug 29, 2024

Don't know about the rest, but can you add the following so that it still compiles against older headers, please?

Odd, that definition was a recent thing? I'll add it, thanks for pointing it out.

@slouken slouken requested a review from icculus August 29, 2024 16:23
@slouken slouken added this to the 3.2.0 milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants