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