sdlGetCameraSupportedFormats function
Get the list of native formats/sizes a camera supports.
This returns a list of all formats and frame sizes that a specific camera can offer. This is useful if your app can accept a variety of image formats and sizes and so want to find the optimal spec that doesn't require conversion.
This function isn't strictly required; if you call SDL_OpenCamera with a NULL spec, SDL will choose a native format for you, and if you instead specify a desired format, it will transparently convert to the requested format on your behalf.
If count
is not NULL, it will be filled with the number of elements in
the returned array.
Note that it's legal for a camera to supply an empty list. This is what will happen on Emscripten builds, since that platform won't tell anything about available cameras until you've opened one, and won't even tell if there is a camera until the user has given you permission to check through a scary warning popup.
\param devid the camera device instance ID to query. \param count a pointer filled in with the number of elements in the list, may be NULL. \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.1.3.
\sa SDL_GetCameras \sa SDL_OpenCamera
extern SDL_DECLSPEC SDL_CameraSpec ** SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count)
Implementation
Pointer<Pointer<SdlCameraSpec>> sdlGetCameraSupportedFormats(
int devid, Pointer<Int32> count) {
final sdlGetCameraSupportedFormatsLookupFunction = libSdl3.lookupFunction<
Pointer<Pointer<SdlCameraSpec>> Function(
Uint32 devid, Pointer<Int32> count),
Pointer<Pointer<SdlCameraSpec>> Function(
int devid, Pointer<Int32> count)>('SDL_GetCameraSupportedFormats');
return sdlGetCameraSupportedFormatsLookupFunction(devid, count);
}