Emit options of all devices
This commit is contained in:
parent
b4668aa320
commit
6460d1b902
@ -29,7 +29,16 @@ void *camera_http_set_option(http_worker_t *worker, FILE *stream, const char *ke
|
|||||||
return NULL;
|
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) {
|
if (!*headers) {
|
||||||
http_200(stream, "");
|
http_200(stream, "");
|
||||||
*headers = true;
|
*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");
|
fprintf(stream, "\r\nSet: /option?name=value\r\n\r\n");
|
||||||
|
|
||||||
if (camera) {
|
if (camera) {
|
||||||
device_dump_options(camera->camera, stream);
|
for (int i = 0; i < MAX_DEVICES; i++) {
|
||||||
|
device_dump_options(camera->devices[i], stream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ int device_video_force_key(device_t *dev)
|
|||||||
|
|
||||||
void device_dump_options(device_t *dev, FILE *stream)
|
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);
|
dev->hw->device_dump_options(dev, stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ void libcamera_device_dump_options(device_t *dev, FILE *stream)
|
|||||||
auto &properties = dev->libcamera->camera->properties();
|
auto &properties = dev->libcamera->camera->properties();
|
||||||
auto idMap = properties.idMap();
|
auto idMap = properties.idMap();
|
||||||
|
|
||||||
fprintf(stream, "Properties:\n");
|
fprintf(stream, "%s Properties:\n", dev->name);
|
||||||
|
|
||||||
for (auto const &control : properties) {
|
for (auto const &control : properties) {
|
||||||
if (!control.first)
|
if (!control.first)
|
||||||
@ -42,7 +42,7 @@ void libcamera_device_dump_options(device_t *dev, FILE *stream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stream, "\n");
|
fprintf(stream, "\n");
|
||||||
fprintf(stream, "Options:\n");
|
fprintf(stream, "%s Options:\n", dev->name);
|
||||||
|
|
||||||
for (auto const &control : libcamera_control_list(dev)) {
|
for (auto const &control : libcamera_control_list(dev)) {
|
||||||
if (!control.first)
|
if (!control.first)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user