Renamed CameraDevice to Camera

This is consistent with the rest of the SDL API
This commit is contained in:
Sam Lantinga
2024-07-14 12:22:42 -07:00
parent 9358333286
commit 9797c5d0c0
15 changed files with 284 additions and 284 deletions

View File

@@ -429,12 +429,12 @@ static void on_process(void *data)
static void on_stream_state_changed(void *data, enum pw_stream_state old,
enum pw_stream_state state, const char *error)
{
SDL_CameraDevice *device = data;
SDL_Camera *device = data;
switch (state) {
case PW_STREAM_STATE_UNCONNECTED:
break;
case PW_STREAM_STATE_STREAMING:
SDL_CameraDevicePermissionOutcome(device, SDL_TRUE);
SDL_CameraPermissionOutcome(device, SDL_TRUE);
break;
default:
break;
@@ -447,13 +447,13 @@ static void on_stream_param_changed(void *data, uint32_t id, const struct spa_po
static void on_add_buffer(void *data, struct pw_buffer *buffer)
{
SDL_CameraDevice *device = data;
SDL_Camera *device = data;
pw_array_add_ptr(&device->hidden->buffers, buffer);
}
static void on_remove_buffer(void *data, struct pw_buffer *buffer)
{
SDL_CameraDevice *device = data;
SDL_Camera *device = data;
struct pw_buffer **p;
pw_array_for_each(p, &device->hidden->buffers) {
if (*p == buffer) {
@@ -472,7 +472,7 @@ static const struct pw_stream_events stream_events = {
.process = on_process,
};
static int PIPEWIRECAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec)
static int PIPEWIRECAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec)
{
struct pw_properties *props;
const struct spa_pod *params[3];
@@ -533,7 +533,7 @@ static int PIPEWIRECAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraS
return 0;
}
static void PIPEWIRECAMERA_CloseDevice(SDL_CameraDevice *device)
static void PIPEWIRECAMERA_CloseDevice(SDL_Camera *device)
{
if (!device) {
return;
@@ -550,7 +550,7 @@ static void PIPEWIRECAMERA_CloseDevice(SDL_CameraDevice *device)
PIPEWIRE_pw_thread_loop_unlock(hotplug.loop);
}
static int PIPEWIRECAMERA_WaitDevice(SDL_CameraDevice *device)
static int PIPEWIRECAMERA_WaitDevice(SDL_Camera *device)
{
PIPEWIRE_pw_thread_loop_lock(hotplug.loop);
PIPEWIRE_pw_thread_loop_wait(hotplug.loop);
@@ -558,7 +558,7 @@ static int PIPEWIRECAMERA_WaitDevice(SDL_CameraDevice *device)
return 0;
}
static int PIPEWIRECAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS)
static int PIPEWIRECAMERA_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS)
{
struct pw_buffer *b;
@@ -590,7 +590,7 @@ static int PIPEWIRECAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *fr
return 1;
}
static void PIPEWIRECAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame)
static void PIPEWIRECAMERA_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame)
{
struct pw_buffer **p;
PIPEWIRE_pw_thread_loop_lock(hotplug.loop);
@@ -717,7 +717,7 @@ static void add_device(struct global *g)
collect_format(&data, p);
}
if (data.num_specs > 0) {
SDL_AddCameraDevice(g->name, SDL_CAMERA_POSITION_UNKNOWN,
SDL_AddCamera(g->name, SDL_CAMERA_POSITION_UNKNOWN,
data.num_specs, data.specs, g);
}
SDL_free(data.specs);
@@ -747,7 +747,7 @@ static void PIPEWIRECAMERA_DetectDevices(void)
PIPEWIRE_pw_thread_loop_unlock(hotplug.loop);
}
static void PIPEWIRECAMERA_FreeDeviceHandle(SDL_CameraDevice *device)
static void PIPEWIRECAMERA_FreeDeviceHandle(SDL_Camera *device)
{
}