mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
jack: add midi format
Add midi format Handle ore requests Clean semaphore and socket names
This commit is contained in:
parent
1fc7c6de59
commit
12e2fae8ab
10 changed files with 71 additions and 11 deletions
|
|
@ -127,6 +127,7 @@ enum jack_notification_type {
|
|||
|
||||
#define kActivateClient_size (2*sizeof(int))
|
||||
#define kDeactivateClient_size (sizeof(int))
|
||||
#define kSetTimebaseCallback_size (sizeof(int) + sizeof(int))
|
||||
#define kRegisterPort_size (sizeof(int) + JACK_PORT_NAME_SIZE+1 + JACK_PORT_TYPE_SIZE+1 + 2*sizeof(unsigned int))
|
||||
#define kClientCheck_size (JACK_CLIENT_NAME_SIZE+1 + 4 * sizeof(int))
|
||||
#define kClientOpen_size (JACK_CLIENT_NAME_SIZE+1 + 2 * sizeof(int))
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ struct type {
|
|||
struct spa_type_media_subtype media_subtype;
|
||||
struct spa_type_format_audio format_audio;
|
||||
struct spa_type_audio_format audio_format;
|
||||
struct spa_type_media_subtype_audio media_subtype_audio;
|
||||
};
|
||||
|
||||
static inline void init_type(struct type *type, struct spa_type_map *map)
|
||||
|
|
@ -62,6 +63,7 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
|
|||
spa_type_media_subtype_map(map, &type->media_subtype);
|
||||
spa_type_format_audio_map(map, &type->format_audio);
|
||||
spa_type_audio_format_map(map, &type->audio_format);
|
||||
spa_type_media_subtype_audio_map(map, &type->media_subtype_audio);
|
||||
}
|
||||
|
||||
struct node_data {
|
||||
|
|
@ -372,7 +374,8 @@ static int port_enum_formats(void *data,
|
|||
PROP(&f[1], t->format_audio.channels, SPA_POD_TYPE_INT, 1));
|
||||
}
|
||||
else if (pd->port.jack_port->type_id == 1) {
|
||||
return SPA_RESULT_ENUM_END;
|
||||
spa_pod_builder_format(&b, &f[0], t->format,
|
||||
t->media_type.audio, t->media_subtype_audio.midi);
|
||||
}
|
||||
else
|
||||
return SPA_RESULT_ENUM_END;
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ struct jack_transport_engine {
|
|||
int time_base_master;
|
||||
bool pending_pos;
|
||||
bool network_sync;
|
||||
bool conditionnal;
|
||||
bool conditional;
|
||||
int32_t write_counter;
|
||||
} POST_PACKED_STRUCTURE;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,12 +34,22 @@ jack_synchro_init(struct jack_synchro *synchro,
|
|||
int value,
|
||||
bool promiscuous)
|
||||
{
|
||||
char cname[SYNC_MAX_NAME_SIZE+1];
|
||||
int i;
|
||||
for (i = 0; client_name[i] != '\0'; i++) {
|
||||
if (client_name[i] == '/' || client_name[i] == '\\')
|
||||
cname[i] = '_';
|
||||
else
|
||||
cname[i] = client_name[i];
|
||||
}
|
||||
cname[i] = client_name[i];
|
||||
|
||||
if (promiscuous)
|
||||
snprintf(synchro->name, sizeof(synchro->name),
|
||||
"jack_sem.%s_%s", server_name, client_name);
|
||||
"jack_sem.%s_%s", server_name, cname);
|
||||
else
|
||||
snprintf(synchro->name, sizeof(synchro->name),
|
||||
"jack_sem.%d_%s_%s", getuid(), server_name, client_name);
|
||||
"jack_sem.%d_%s_%s", getuid(), server_name, cname);
|
||||
|
||||
synchro->flush = false;
|
||||
if ((synchro->semaphore = sem_open(synchro->name, O_CREAT | O_RDWR, 0777, value)) == (sem_t*)SEM_FAILED) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue