spa: libcamera: remove unnecessary typedef

This commit is contained in:
Barnabás Pőcze 2022-09-09 18:50:58 +02:00 committed by Wim Taymans
parent 02f2d6b48d
commit f9796fc024
3 changed files with 11 additions and 11 deletions

View file

@ -61,7 +61,7 @@ struct device {
std::shared_ptr<Camera> camera; std::shared_ptr<Camera> camera;
}; };
typedef struct impl { struct impl {
struct spa_handle handle; struct spa_handle handle;
struct spa_device device = {}; struct spa_device device = {};
@ -80,7 +80,7 @@ typedef struct impl {
uint32_t n_devices = 0; uint32_t n_devices = 0;
impl(spa_log *log); impl(spa_log *log);
} Impl; };
} }
@ -168,7 +168,7 @@ static int emit_object_info(struct impl *impl, struct device *device)
return 1; return 1;
} }
void Impl::addCamera(std::shared_ptr<Camera> camera) void impl::addCamera(std::shared_ptr<Camera> camera)
{ {
struct impl *impl = this; struct impl *impl = this;
struct device *device; struct device *device;
@ -184,7 +184,7 @@ void Impl::addCamera(std::shared_ptr<Camera> camera)
emit_object_info(impl, device); emit_object_info(impl, device);
} }
void Impl::removeCamera(std::shared_ptr<Camera> camera) void impl::removeCamera(std::shared_ptr<Camera> camera)
{ {
struct impl *impl = this; struct impl *impl = this;
struct device *device; struct device *device;
@ -198,16 +198,16 @@ void Impl::removeCamera(std::shared_ptr<Camera> camera)
static int start_monitor(struct impl *impl) static int start_monitor(struct impl *impl)
{ {
impl->manager->cameraAdded.connect(impl, &Impl::addCamera); impl->manager->cameraAdded.connect(impl, &impl::addCamera);
impl->manager->cameraRemoved.connect(impl, &Impl::removeCamera); impl->manager->cameraRemoved.connect(impl, &impl::removeCamera);
return 0; return 0;
} }
static int stop_monitor(struct impl *impl) static int stop_monitor(struct impl *impl)
{ {
if (impl->manager) { if (impl->manager) {
impl->manager->cameraAdded.disconnect(impl, &Impl::addCamera); impl->manager->cameraAdded.disconnect(impl, &impl::addCamera);
impl->manager->cameraRemoved.disconnect(impl, &Impl::removeCamera); impl->manager->cameraRemoved.disconnect(impl, &impl::removeCamera);
} }
clear_devices (impl); clear_devices (impl);
return 0; return 0;

View file

@ -136,7 +136,7 @@ struct port {
} }
}; };
typedef struct impl { struct impl {
struct spa_handle handle; struct spa_handle handle;
struct spa_node node = {}; struct spa_node node = {};
@ -180,7 +180,7 @@ typedef struct impl {
impl(spa_log *log, spa_loop *data_loop, spa_system *system, impl(spa_log *log, spa_loop *data_loop, spa_system *system,
std::shared_ptr<CameraManager> manager, std::shared_ptr<Camera> camera, std::string device_id); std::shared_ptr<CameraManager> manager, std::shared_ptr<Camera> camera, std::string device_id);
} Impl; };
} }

View file

@ -604,7 +604,7 @@ spa_libcamera_alloc_buffers(struct impl *impl, struct port *port,
} }
void Impl::requestComplete(libcamera::Request *request) void impl::requestComplete(libcamera::Request *request)
{ {
struct impl *impl = this; struct impl *impl = this;
struct port *port = &impl->out_ports[0]; struct port *port = &impl->out_ports[0];