spa: libcamera: indent with tabs instead of spaces

This commit is contained in:
Barnabás Pőcze 2022-09-03 19:03:11 +02:00 committed by Wim Taymans
parent fdccc10bc7
commit 9370fbee3d
4 changed files with 26 additions and 26 deletions

View file

@ -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);

View file

@ -80,10 +80,10 @@ typedef struct impl {
CameraManager *manager;
void addCamera(std::shared_ptr<libcamera::Camera> camera);
void removeCamera(std::shared_ptr<libcamera::Camera> camera);
void removeCamera(std::shared_ptr<libcamera::Camera> 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> 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<Camera> &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;

View file

@ -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);

View file

@ -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> 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;