SDL_camera_dummy.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "SDL_internal.h"
  19. #ifdef SDL_CAMERA_DRIVER_DUMMY
  20. #include "../SDL_syscamera.h"
  21. static int DUMMYCAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec)
  22. {
  23. return SDL_Unsupported();
  24. }
  25. static void DUMMYCAMERA_CloseDevice(SDL_CameraDevice *device)
  26. {
  27. }
  28. static int DUMMYCAMERA_WaitDevice(SDL_CameraDevice *device)
  29. {
  30. return SDL_Unsupported();
  31. }
  32. static int DUMMYCAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS)
  33. {
  34. return SDL_Unsupported();
  35. }
  36. static void DUMMYCAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame)
  37. {
  38. }
  39. static void DUMMYCAMERA_DetectDevices(void)
  40. {
  41. }
  42. static void DUMMYCAMERA_FreeDeviceHandle(SDL_CameraDevice *device)
  43. {
  44. }
  45. static void DUMMYCAMERA_Deinitialize(void)
  46. {
  47. }
  48. static SDL_bool DUMMYCAMERA_Init(SDL_CameraDriverImpl *impl)
  49. {
  50. impl->DetectDevices = DUMMYCAMERA_DetectDevices;
  51. impl->OpenDevice = DUMMYCAMERA_OpenDevice;
  52. impl->CloseDevice = DUMMYCAMERA_CloseDevice;
  53. impl->WaitDevice = DUMMYCAMERA_WaitDevice;
  54. impl->AcquireFrame = DUMMYCAMERA_AcquireFrame;
  55. impl->ReleaseFrame = DUMMYCAMERA_ReleaseFrame;
  56. impl->FreeDeviceHandle = DUMMYCAMERA_FreeDeviceHandle;
  57. impl->Deinitialize = DUMMYCAMERA_Deinitialize;
  58. return SDL_TRUE;
  59. }
  60. CameraBootStrap DUMMYCAMERA_bootstrap = {
  61. "dummy", "SDL dummy camera driver", DUMMYCAMERA_Init, SDL_TRUE
  62. };
  63. #endif // SDL_CAMERA_DRIVER_DUMMY