mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
monitor: return factory_name in the object_info
Pass a factory_name in the object_info of monitor and device. Restructure the factory name to mean something functionaly. With the factory to library mapping this then means that the implementation of certain factories can be configured in the config file.
This commit is contained in:
parent
89a86db0c4
commit
1d1f035e78
26 changed files with 218 additions and 168 deletions
|
|
@ -46,9 +46,6 @@
|
|||
|
||||
#define MAX_DEVICES 64
|
||||
|
||||
extern const struct spa_handle_factory spa_alsa_sink_factory;
|
||||
extern const struct spa_handle_factory spa_alsa_source_factory;
|
||||
|
||||
static const char default_device[] = "hw:0";
|
||||
|
||||
struct props {
|
||||
|
|
@ -112,9 +109,9 @@ static int emit_node(struct impl *this, snd_pcm_info_t *pcminfo, uint32_t id)
|
|||
info = SPA_DEVICE_OBJECT_INFO_INIT();
|
||||
info.type = SPA_TYPE_INTERFACE_Node;
|
||||
if (snd_pcm_info_get_stream(pcminfo) == SND_PCM_STREAM_PLAYBACK)
|
||||
info.factory = &spa_alsa_sink_factory;
|
||||
info.factory_name = "api.alsa.pcm.sink";
|
||||
else
|
||||
info.factory = &spa_alsa_source_factory;
|
||||
info.factory_name = "api.alsa.pcm.source";
|
||||
|
||||
info.change_mask = SPA_DEVICE_OBJECT_CHANGE_MASK_PROPS;
|
||||
snprintf(device_name, 128, "%s,%d", this->props.device, snd_pcm_info_get_device(pcminfo));
|
||||
|
|
@ -494,7 +491,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
|
|||
|
||||
const struct spa_handle_factory spa_alsa_device_factory = {
|
||||
SPA_VERSION_HANDLE_FACTORY,
|
||||
NAME,
|
||||
"api.alsa.device",
|
||||
NULL,
|
||||
impl_get_size,
|
||||
impl_init,
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@
|
|||
#define ACTION_CHANGE 1
|
||||
#define ACTION_REMOVE 2
|
||||
|
||||
extern const struct spa_handle_factory spa_alsa_device_factory;
|
||||
|
||||
struct impl {
|
||||
struct spa_handle handle;
|
||||
struct spa_monitor monitor;
|
||||
|
|
@ -111,7 +109,7 @@ static int emit_object_info(struct impl *this, uint32_t id, struct udev_device *
|
|||
info = SPA_MONITOR_OBJECT_INFO_INIT();
|
||||
|
||||
info.type = SPA_TYPE_INTERFACE_Device;
|
||||
info.factory = &spa_alsa_device_factory;
|
||||
info.factory_name = "api.alsa.device";
|
||||
info.change_mask = SPA_MONITOR_OBJECT_CHANGE_MASK_FLAGS |
|
||||
SPA_MONITOR_OBJECT_CHANGE_MASK_PROPS;
|
||||
info.flags = 0;
|
||||
|
|
@ -481,7 +479,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
|
|||
|
||||
const struct spa_handle_factory spa_alsa_monitor_factory = {
|
||||
SPA_VERSION_HANDLE_FACTORY,
|
||||
NAME,
|
||||
"api.alsa.monitor",
|
||||
NULL,
|
||||
impl_get_size,
|
||||
impl_init,
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ impl_node_port_use_buffers(void *object,
|
|||
spa_log_error(this->log, NAME " %p: need mapped memory", this);
|
||||
return -EINVAL;
|
||||
}
|
||||
spa_log_debug(this->log, "alsa-sink %p: %d %p data:%p", this, i, b->buf, d[0].data);
|
||||
spa_log_debug(this->log, NAME " %p: %d %p data:%p", this, i, b->buf, d[0].data);
|
||||
}
|
||||
this->n_buffers = n_buffers;
|
||||
|
||||
|
|
@ -801,7 +801,7 @@ static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items);
|
|||
|
||||
const struct spa_handle_factory spa_alsa_sink_factory = {
|
||||
SPA_VERSION_HANDLE_FACTORY,
|
||||
NAME,
|
||||
"api.alsa.pcm.sink",
|
||||
&info,
|
||||
impl_get_size,
|
||||
impl_init,
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items);
|
|||
|
||||
const struct spa_handle_factory spa_alsa_source_factory = {
|
||||
SPA_VERSION_HANDLE_FACTORY,
|
||||
NAME,
|
||||
"api.alsa.pcm.source",
|
||||
&info,
|
||||
impl_get_size,
|
||||
impl_init,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue