From 9370fbee3d1ee2c04268b15d7c4d7dbe3df868ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 3 Sep 2022 19:03:11 +0200 Subject: [PATCH] spa: libcamera: indent with tabs instead of spaces --- spa/plugins/libcamera/libcamera-device.cpp | 2 +- spa/plugins/libcamera/libcamera-manager.cpp | 22 ++++++++--------- spa/plugins/libcamera/libcamera-source.cpp | 2 +- spa/plugins/libcamera/libcamera-utils.cpp | 26 ++++++++++----------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/spa/plugins/libcamera/libcamera-device.cpp b/spa/plugins/libcamera/libcamera-device.cpp index f2f10c017..9eec30cc8 100644 --- a/spa/plugins/libcamera/libcamera-device.cpp +++ b/spa/plugins/libcamera/libcamera-device.cpp @@ -285,7 +285,7 @@ impl_init(const struct spa_handle_factory *factory, if (impl->manager == NULL) { res = -errno; spa_log_error(impl->log, "can't start camera manager: %s", spa_strerror(res)); - return res; + return res; } impl->camera = impl->manager->get(impl->props.device); diff --git a/spa/plugins/libcamera/libcamera-manager.cpp b/spa/plugins/libcamera/libcamera-manager.cpp index b9243ad86..c8daf8cde 100644 --- a/spa/plugins/libcamera/libcamera-manager.cpp +++ b/spa/plugins/libcamera/libcamera-manager.cpp @@ -80,10 +80,10 @@ typedef struct impl { CameraManager *manager; void addCamera(std::shared_ptr camera); - void removeCamera(std::shared_ptr camera); + void removeCamera(std::shared_ptr camera); struct device devices[MAX_DEVICES]; - uint32_t n_devices; + uint32_t n_devices; } Impl; int libcamera_manager_release(CameraManager *manager) @@ -176,9 +176,9 @@ static int emit_object_info(struct impl *impl, struct device *device) ADD_ITEM(SPA_KEY_API_LIBCAMERA_PATH, path); #undef ADD_ITEM - dict = SPA_DICT_INIT(items, n_items); - info.props = &dict; - spa_device_emit_object_info(&impl->hooks, id, &info); + dict = SPA_DICT_INIT(items, n_items); + info.props = &dict; + spa_device_emit_object_info(&impl->hooks, id, &info); return 1; } @@ -214,7 +214,7 @@ void Impl::removeCamera(std::shared_ptr camera) static int start_monitor(struct impl *impl) { impl->manager->cameraAdded.connect(impl, &Impl::addCamera); - impl->manager->cameraRemoved.connect(impl, &Impl::removeCamera); + impl->manager->cameraRemoved.connect(impl, &Impl::removeCamera); return 0; } @@ -222,7 +222,7 @@ static int stop_monitor(struct impl *impl) { if (impl->manager != NULL) { impl->manager->cameraAdded.disconnect(impl, &Impl::addCamera); - impl->manager->cameraRemoved.disconnect(impl, &Impl::removeCamera); + impl->manager->cameraRemoved.disconnect(impl, &Impl::removeCamera); } clear_devices (impl); return 0; @@ -233,7 +233,7 @@ static int enum_devices(struct impl *impl) auto cameras = impl->manager->cameras(); for (const std::shared_ptr &cam : cameras) { - impl->addCamera(cam); + impl->addCamera(cam); } return 0; } @@ -274,7 +274,7 @@ impl_device_add_listener(void *object, struct spa_hook *listener, { int res; struct impl *impl = (struct impl*) object; - struct spa_hook_list save; + struct spa_hook_list save; spa_return_val_if_fail(impl != NULL, -EINVAL); spa_return_val_if_fail(events != NULL, -EINVAL); @@ -283,7 +283,7 @@ impl_device_add_listener(void *object, struct spa_hook *listener, if (impl->manager == NULL) return -errno; - spa_hook_list_isolate(&impl->hooks, &save, listener, events, data); + spa_hook_list_isolate(&impl->hooks, &save, listener, events, data); emit_device_info(impl, true); @@ -293,7 +293,7 @@ impl_device_add_listener(void *object, struct spa_hook *listener, if ((res = start_monitor(impl)) < 0) return res; - spa_hook_list_join(&impl->hooks, &save); + spa_hook_list_join(&impl->hooks, &save); listener->removed = impl_hook_removed; listener->priv = impl; diff --git a/spa/plugins/libcamera/libcamera-source.cpp b/spa/plugins/libcamera/libcamera-source.cpp index 0d32b745b..a7b3c09dd 100644 --- a/spa/plugins/libcamera/libcamera-source.cpp +++ b/spa/plugins/libcamera/libcamera-source.cpp @@ -989,7 +989,7 @@ impl_init(const struct spa_handle_factory *factory, if (impl->manager == NULL) { res = -errno; spa_log_error(impl->log, "can't start camera manager: %s", spa_strerror(res)); - return res; + return res; } impl->camera = impl->manager->get(impl->props.device); diff --git a/spa/plugins/libcamera/libcamera-utils.cpp b/spa/plugins/libcamera/libcamera-utils.cpp index 99d067254..8cf7ff427 100644 --- a/spa/plugins/libcamera/libcamera-utils.cpp +++ b/spa/plugins/libcamera/libcamera-utils.cpp @@ -91,10 +91,10 @@ static int spa_libcamera_buffer_recycle(struct impl *impl, struct port *port, ui if (buffer_id >= impl->requestPool.size()) { spa_log_warn(impl->log, "invalid buffer_id %u >= %zu", buffer_id, impl->requestPool.size()); - return -EINVAL; - } + return -EINVAL; + } Request *request = impl->requestPool[buffer_id].get(); - Stream *stream = port->streamConfig.stream(); + Stream *stream = port->streamConfig.stream(); FrameBuffer *buffer = impl->allocator->buffers(stream)[buffer_id].get(); if ((res = request->addBuffer(stream, buffer)) < 0) { spa_log_warn(impl->log, "can't add buffer %u for request: %s", @@ -104,7 +104,7 @@ static int spa_libcamera_buffer_recycle(struct impl *impl, struct port *port, ui if (!impl->active) { impl->pendingRequests.push_back(request); return 0; - } else { + } else { if ((res = impl->camera->queueRequest(request)) < 0) { spa_log_warn(impl->log, "can't queue buffer %u: %s", buffer_id, spa_strerror(res)); @@ -119,7 +119,7 @@ static int allocBuffers(struct impl *impl, struct port *port, unsigned int count int res; if ((res = impl->allocator->allocate(port->streamConfig.stream())) < 0) - return res; + return res; for (unsigned int i = 0; i < count; i++) { std::unique_ptr request = impl->camera->createRequest(i); @@ -129,7 +129,7 @@ static int allocBuffers(struct impl *impl, struct port *port, unsigned int count } impl->requestPool.push_back(std::move(request)); } - return res; + return res; } static void freeBuffers(struct impl *impl, struct port *port) @@ -618,12 +618,12 @@ void Impl::requestComplete(libcamera::Request *request) spa_log_debug(impl->log, "request complete"); if ((request->status() == Request::RequestCancelled)) { - spa_log_debug(impl->log, "Request was cancelled"); - return; - } + spa_log_debug(impl->log, "Request was cancelled"); + return; + } FrameBuffer *buffer = request->findBuffer(stream); if (buffer == nullptr) { - spa_log_warn(impl->log, "unknown buffer"); + spa_log_warn(impl->log, "unknown buffer"); return; } const FrameMetadata &fmd = buffer->metadata(); @@ -679,10 +679,10 @@ static int spa_libcamera_stream_on(struct impl *impl) return res == -EACCES ? -EBUSY : res; for (Request *req : impl->pendingRequests) { - if ((res = impl->camera->queueRequest(req)) < 0) + if ((res = impl->camera->queueRequest(req)) < 0) return res == -EACCES ? -EBUSY : res; - } - impl->pendingRequests.clear(); + } + impl->pendingRequests.clear(); impl->source.func = libcamera_on_fd_events; impl->source.data = impl;