Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

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

Availability

       This function is available since SDL 3.2.0.

Description

       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.

Function Parameters

camera opened camera device.

       spec   the SDL_CameraSpec
               to be initialized by this function.

Header File

       Defined in SDL3/SDL_camera.h

Name

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

Return Value

       Returns true on success or false on failure; call

       SDL_GetError () for more information.

See Also

(3), SDL_OpenCamera(3)

Simple Directmedia Layer                           SDL 3.2.10                             SDL_GetCameraFormat(3)

Synopsis

#include"SDL3/SDL.h"boolSDL_GetCameraFormat(SDL_Camera*camera,SDL_CameraSpec*spec);

Thread Safety

       It is safe to call this function from any thread.

See Also