libcamera: work on rewrite

Use manager to hotplug devices
Use StreamConfig to enumerate formats
This commit is contained in:
Wim Taymans 2021-11-02 17:24:19 +01:00
parent b0e3e43c42
commit b2c38a2b3b
11 changed files with 1545 additions and 1212 deletions

View file

@ -27,6 +27,15 @@
#include <linux/media.h>
#include <spa/support/log.h>
#include <spa/support/system.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern const struct spa_handle_factory spa_libcamera_source_factory;
extern const struct spa_handle_factory spa_libcamera_manager_factory;
extern const struct spa_handle_factory spa_libcamera_device_factory;
#undef SPA_LOG_TOPIC_DEFAULT
#define SPA_LOG_TOPIC_DEFAULT libcamera_log_topic
@ -37,18 +46,6 @@ static inline void libcamera_log_topic_init(struct spa_log *log)
spa_log_topic_init(log, libcamera_log_topic);
}
#include "libcamera_wrapper.h"
struct spa_libcamera_device {
struct spa_log *log;
int fd;
struct media_device_info dev_info;
unsigned int active:1;
unsigned int have_format:1;
LibCamera *camera;
};
int spa_libcamera_open(struct spa_libcamera_device *dev);
int spa_libcamera_close(struct spa_libcamera_device *dev);
int spa_libcamera_is_capture(struct spa_libcamera_device *dev);
int get_dev_fd(struct spa_libcamera_device *dev);
#ifdef __cplusplus
}
#endif /* __cplusplus */