SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_GetCameraFormat

Get the spec that a camera is using when generating images.

Header File

Defined in <SDL3/SDL_camera.h>

Syntax

bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);

Function Parameters

SDL_Camera * camera opened camera device.
SDL_CameraSpec * spec the SDL_CameraSpec to be initialized by this function.

Return Value

(bool) Returns true on success or false on failure; call SDL_GetError() for more information.

Remarks

Note that this might not be the native format of the hardware, as SDL might be converting to this format behind the scenes.

If the system is waiting for the user to approve access to the camera, as some platforms require, this will return false, but this isn't necessarily a fatal error; you should either wait for an SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event, or poll SDL_GetCameraPermissionState() occasionally until it returns non-zero.

Thread Safety

It is safe to call this function from any thread.

Version

This function is available since SDL 3.1.3.

See Also


CategoryAPI, CategoryAPIFunction, CategoryCamera


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.