Add audioconvert2

This commit is contained in:
Wim Taymans 2022-02-23 17:14:14 +01:00
parent 2d060a5a72
commit 7f9ddd0f15
7 changed files with 1865 additions and 12 deletions

View file

@ -484,7 +484,7 @@ static int configure_convert(struct impl *this, uint32_t mode)
return spa_node_set_param(this->convert, SPA_PARAM_PortConfig, 0, param);
}
extern const struct spa_handle_factory spa_audioconvert_factory;
extern const struct spa_handle_factory spa_audioconvert2_factory;
static const struct spa_node_events follower_node_events;
@ -494,7 +494,7 @@ static int reconfigure_mode(struct impl *this, bool passthrough,
int res = 0;
struct spa_hook l;
spa_log_debug(this->log, "%p: passthrough mode %d", this, passthrough);
spa_log_info(this->log, "%p: passthrough mode %d", this, passthrough);
if (this->passthrough != passthrough) {
if (passthrough) {
@ -852,6 +852,12 @@ static void convert_node_info(void *data, const struct spa_node_info *info)
uint32_t idx;
switch (info->params[i].id) {
case SPA_PARAM_EnumPortConfig:
idx = IDX_EnumPortConfig;
break;
case SPA_PARAM_PortConfig:
idx = IDX_PortConfig;
break;
case SPA_PARAM_PropInfo:
idx = IDX_PropInfo;
break;
@ -1516,7 +1522,7 @@ impl_get_size(const struct spa_handle_factory *factory,
{
size_t size;
size = spa_handle_factory_get_size(&spa_audioconvert_factory, params);
size = spa_handle_factory_get_size(&spa_audioconvert2_factory, params);
size += sizeof(struct impl);
return size;
@ -1565,7 +1571,7 @@ impl_init(const struct spa_handle_factory *factory,
&impl_node, this);
this->hnd_convert = SPA_PTROFF(this, sizeof(struct impl), struct spa_handle);
spa_handle_factory_init(&spa_audioconvert_factory,
spa_handle_factory_init(&spa_audioconvert2_factory,
this->hnd_convert,
info, support, n_support);