Top | ![]() |
![]() |
![]() |
![]() |
gboolean | xdp_portal_is_camera_present () |
void | xdp_portal_access_camera () |
gboolean | xdp_portal_access_camera_finish () |
int | xdp_portal_open_pipewire_remote_for_camera () |
These functions lets applications access cameras and open pipewire remotes for them.
The underlying portal is org.freedesktop.portal.Camera.
gboolean
xdp_portal_is_camera_present (XdpPortal *portal
);
Returns whether any camera are present.
void xdp_portal_access_camera (XdpPortal *portal
,XdpParent *parent
,XdpCameraFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer data
);
Request access to a camera.
When the request is done, callback
will be called.
You can then call xdp_portal_access_camera_finished()
to get the results.
portal |
||
parent |
parent window information. |
[nullable] |
flags |
options for this call |
|
cancellable |
optional GCancellable. |
[nullable] |
callback |
a callback to call when the request is done. |
[scope async] |
data |
data to pass to |
[closure] |
gboolean xdp_portal_access_camera_finish (XdpPortal *portal
,GAsyncResult *result
,GError **error
);
Finishes a camera acess request, and returns the result as a boolean.
If the access was granted, you can then call
xdp_portal_open_pipewire_remote_for_camera()
to obtain a pipewire remote.
int
xdp_portal_open_pipewire_remote_for_camera
(XdpPortal *portal
);
Opens a file descriptor to the pipewire remote where the camera
nodes are available. The file descriptor should be used to create
a pw_remote object, by using pw_remote_connect_fd()
. Only the
camera nodes will be available from this pipewire node.