.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_GetCameraPermissionState: .\" https://wiki.libsdl.org/SDL_GetCameraPermissionState .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_GetCameraPermissionState .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_GetCameraPermissionState 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_GetCameraPermissionState \- Query if camera access has been approved by the user\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_GetCameraPermissionState(SDL_Camera *camera); .fi .SH DESCRIPTION Cameras will not function between when the device is opened by the app and when the user permits access to the hardware\[char46] On some platforms, this presents as a popup dialog where the user has to explicitly approve access; on others the approval might be implicit and not alert the user at all\[char46] This function can be used to check the status of that approval\[char46] It will return 0 if still waiting for user response, 1 if the camera is approved for use, and -1 if the user denied access\[char46] Instead of polling with this function, you can wait for a .BR SDL_EVENT_CAMERA_DEVICE_APPROVED (or .BR SDL_EVENT_CAMERA_DEVICE_DENIED ) event in the standard SDL event loop, which is guaranteed to be sent once when permission to use the camera is decided\[char46] If a camera is declined, there's nothing to be done but call .BR SDL_CloseCamera () to dispose of it\[char46] .SH FUNCTION PARAMETERS .TP .I camera the opened camera device to query .SH RETURN VALUE Returns -1 if user denied access to the camera, 1 if user approved access, 0 if no decision has been made yet\[char46] .SH THREAD SAFETY It is safe to call this function from any thread\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_OpenCameraDevice (3), .BR SDL_CloseCamera (3)