---
name: "SDL_GetCameraFormat"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetCameraFormat"
---

# SDL\_GetCameraFormat(3)

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

## NAME

SDL\_GetCameraFormat - Get the spec that a camera is using when generating images.

## HEADER FILE

Defined in SDL3/SDL\_camera.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_GetCameraFormat(SDL\_Camera \*camera, SDL\_CameraSpec \*spec);**

## 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.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_OpenCamera**(3)](/SDL_OpenCamera/3.md)
