audioconvert: use some defines for the max ports

This commit is contained in:
Wim Taymans 2020-12-09 20:32:44 +01:00
parent 606d48a3e8
commit 7d73f0b8d0
7 changed files with 16 additions and 10 deletions

View file

@ -42,6 +42,8 @@
#define NAME "audioadapter"
#define MAX_PORTS SPA_AUDIO_MAX_CHANNELS
/** \cond */
struct impl {
@ -632,8 +634,8 @@ static void follower_info(void *data, const struct spa_node_info *info)
else
this->direction = SPA_DIRECTION_OUTPUT;
this->info.max_input_ports = this->direction == SPA_DIRECTION_INPUT ? 128 : 0;
this->info.max_output_ports = this->direction == SPA_DIRECTION_OUTPUT ? 128 : 0;
this->info.max_input_ports = this->direction == SPA_DIRECTION_INPUT ? MAX_PORTS : 0;
this->info.max_output_ports = this->direction == SPA_DIRECTION_OUTPUT ? MAX_PORTS : 0;
spa_log_debug(this->log, NAME" %p: follower info %s", this,
this->direction == SPA_DIRECTION_INPUT ?

View file

@ -44,6 +44,8 @@
#define NAME "audioconvert"
#define MAX_PORTS SPA_AUDIO_MAX_CHANNELS
struct buffer {
struct spa_list link;
#define BUFFER_FLAG_OUT (1 << 0)
@ -1239,8 +1241,8 @@ impl_init(const struct spa_handle_factory *factory,
this->info_all = SPA_NODE_CHANGE_MASK_FLAGS |
SPA_NODE_CHANGE_MASK_PARAMS;
this->info = SPA_NODE_INFO_INIT();
this->info.max_input_ports = 128;
this->info.max_output_ports = 128;
this->info.max_input_ports = MAX_PORTS;
this->info.max_output_ports = MAX_PORTS;
this->info.flags = SPA_NODE_FLAG_RT |
SPA_NODE_FLAG_IN_PORT_CONFIG |
SPA_NODE_FLAG_OUT_PORT_CONFIG |

View file

@ -49,7 +49,7 @@
#define DEFAULT_SAMPLES 8192
#define MAX_BUFFERS 32
#define MAX_DATAS 64
#define MAX_DATAS SPA_AUDIO_MAX_CHANNELS
#define DEFAULT_CONTROL_BUFFER_SIZE 32768

View file

@ -51,7 +51,7 @@
#define MAX_SAMPLES 8192
#define MAX_BUFFERS 32
#define MAX_ALIGN 16
#define MAX_DATAS 64
#define MAX_DATAS SPA_AUDIO_MAX_CHANNELS
#define PROP_DEFAULT_TRUNCATE false
#define PROP_DEFAULT_DITHER 0

View file

@ -54,8 +54,8 @@
#define MAX_SAMPLES 8192
#define MAX_ALIGN 16
#define MAX_BUFFERS 32
#define MAX_DATAS 64
#define MAX_PORTS 64
#define MAX_DATAS SPA_AUDIO_MAX_CHANNELS
#define MAX_PORTS SPA_AUDIO_MAX_CHANNELS
struct buffer {
uint32_t id;

View file

@ -994,6 +994,8 @@ impl_init(const struct spa_handle_factory *factory,
this->info = SPA_NODE_INFO_INIT();
this->info_all = SPA_NODE_CHANGE_MASK_FLAGS;
this->info.max_input_ports = 1;
this->info.max_output_ports = 1;
this->info.flags = SPA_NODE_FLAG_RT;
port = GET_OUT_PORT(this, 0);

View file

@ -53,8 +53,8 @@
#define MAX_SAMPLES 8192
#define MAX_ALIGN 16
#define MAX_BUFFERS 32
#define MAX_DATAS 64
#define MAX_PORTS 64
#define MAX_DATAS SPA_AUDIO_MAX_CHANNELS
#define MAX_PORTS SPA_AUDIO_MAX_CHANNELS
struct buffer {
uint32_t id;