diff --git a/cmd/camera-streamer.c b/cmd/camera-streamer.c index 728c749..392f180 100644 --- a/cmd/camera-streamer.c +++ b/cmd/camera-streamer.c @@ -29,7 +29,16 @@ void *camera_http_set_option(http_worker_t *worker, FILE *stream, const char *ke return NULL; } - if (device_set_option_string(camera->camera, key, value) == 0) { + bool set = false; + + for (int i = 0; i < MAX_DEVICES; i++) { + if (device_set_option_string(camera->devices[i], key, value) == 0) { + set = true; + break; + } + } + + if (set) { if (!*headers) { http_200(stream, ""); *headers = true; @@ -58,7 +67,9 @@ void camera_http_option(http_worker_t *worker, FILE *stream) fprintf(stream, "\r\nSet: /option?name=value\r\n\r\n"); if (camera) { - device_dump_options(camera->camera, stream); + for (int i = 0; i < MAX_DEVICES; i++) { + device_dump_options(camera->devices[i], stream); + } } } diff --git a/device/device.c b/device/device.c index d3ab7d3..c84f838 100644 --- a/device/device.c +++ b/device/device.c @@ -213,7 +213,7 @@ int device_video_force_key(device_t *dev) void device_dump_options(device_t *dev, FILE *stream) { - if (dev || dev->hw->device_dump_options) { + if (dev && dev->hw->device_dump_options) { dev->hw->device_dump_options(dev, stream); } } diff --git a/device/libcamera/device.cc b/device/libcamera/device.cc index 5bc17ed..f648946 100644 --- a/device/libcamera/device.cc +++ b/device/libcamera/device.cc @@ -22,7 +22,7 @@ void libcamera_device_dump_options(device_t *dev, FILE *stream) auto &properties = dev->libcamera->camera->properties(); auto idMap = properties.idMap(); - fprintf(stream, "Properties:\n"); + fprintf(stream, "%s Properties:\n", dev->name); for (auto const &control : properties) { if (!control.first) @@ -42,7 +42,7 @@ void libcamera_device_dump_options(device_t *dev, FILE *stream) } fprintf(stream, "\n"); - fprintf(stream, "Options:\n"); + fprintf(stream, "%s Options:\n", dev->name); for (auto const &control : libcamera_control_list(dev)) { if (!control.first)