Skip to content

Commit

Permalink
Disable all camera drivers if SDL_CAMERA_DISABLED is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 22, 2025
1 parent 1ddba3a commit e50db69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/SDL_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@
#define SDL_HAVE_YUV 1
#endif

#ifdef SDL_CAMERA_DISABLED
#undef SDL_CAMERA_DRIVER_ANDROID
#undef SDL_CAMERA_DRIVER_COREMEDIA
#undef SDL_CAMERA_DRIVER_DUMMY
#undef SDL_CAMERA_DRIVER_EMSCRIPTEN
#undef SDL_CAMERA_DRIVER_MEDIAFOUNDATION
#undef SDL_CAMERA_DRIVER_PIPEWIRE
#undef SDL_CAMERA_DRIVER_V4L2
#undef SDL_CAMERA_DRIVER_VITA
#endif

#ifdef SDL_RENDER_DISABLED
#undef SDL_VIDEO_RENDER_SW
#undef SDL_VIDEO_RENDER_D3D
Expand Down
2 changes: 0 additions & 2 deletions src/camera/SDL_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

// Available camera drivers
static const CameraBootStrap *const bootstrap[] = {
#ifndef SDL_CAMERA_DISABLED
#ifdef SDL_CAMERA_DRIVER_V4L2
&V4L2_bootstrap,
#endif
Expand All @@ -56,7 +55,6 @@ static const CameraBootStrap *const bootstrap[] = {
#endif
#ifdef SDL_CAMERA_DRIVER_DUMMY
&DUMMYCAMERA_bootstrap,
#endif
#endif
NULL
};
Expand Down

0 comments on commit e50db69

Please sign in to comment.