flags: change flag macros

SPA_FLAG_CHECK -> SPA_FLAG_IS_SET
SPA_FLAG_UNSET -> SPA_FLAG_CLEAR
Add SPA_FLAG_UPDATE
This commit is contained in:
Wim Taymans 2019-10-02 17:58:04 +02:00
parent cc8e992cd1
commit 6e0ffb0c47
33 changed files with 91 additions and 92 deletions

@ -1 +1 @@
Subproject commit 274d616fa6adef0a917f16e1001cf66fdca88e64 Subproject commit 0bc34d53018af1e4194dfb08b6c1aea737c2afb0

@ -1 +1 @@
Subproject commit f269cb9e517124f27916d3964ce8169c06d7ed77 Subproject commit 694ae6dd84dc4f98add11474607d8e211bd4ae4a

View file

@ -142,14 +142,14 @@ static inline int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info,
size += SPA_ROUND_UP_N(metas[i].size, 8); size += SPA_ROUND_UP_N(metas[i].size, 8);
info->meta_size = size; info->meta_size = size;
if (SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_META)) if (SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_META))
target = &info->skel_size; target = &info->skel_size;
else else
target = &info->mem_size; target = &info->mem_size;
*target += info->meta_size; *target += info->meta_size;
info->chunk_size = n_datas * sizeof(struct spa_chunk); info->chunk_size = n_datas * sizeof(struct spa_chunk);
if (SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_CHUNK)) if (SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_CHUNK))
target = &info->skel_size; target = &info->skel_size;
else else
target = &info->mem_size; target = &info->mem_size;
@ -162,8 +162,8 @@ static inline int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info,
} }
info->data_size = size; info->data_size = size;
if (!SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_NO_DATA) && if (!SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_NO_DATA) &&
SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_DATA)) SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_DATA))
target = &info->skel_size; target = &info->skel_size;
else else
target = &info->mem_size; target = &info->mem_size;
@ -209,7 +209,7 @@ spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info,
skel = SPA_MEMBER(b->datas, info->n_datas * sizeof(struct spa_data), void); skel = SPA_MEMBER(b->datas, info->n_datas * sizeof(struct spa_data), void);
data = data_mem; data = data_mem;
if (SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_META)) if (SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_META))
dp = &skel; dp = &skel;
else else
dp = &data; dp = &data;
@ -222,7 +222,7 @@ spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info,
} }
size = info->n_datas * sizeof(struct spa_chunk); size = info->n_datas * sizeof(struct spa_chunk);
if (SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_CHUNK)) { if (SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_CHUNK)) {
cp = (struct spa_chunk*)skel; cp = (struct spa_chunk*)skel;
skel = SPA_MEMBER(skel, size, void); skel = SPA_MEMBER(skel, size, void);
} }
@ -231,7 +231,7 @@ spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info,
data = SPA_MEMBER(data, size, void); data = SPA_MEMBER(data, size, void);
} }
if (SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_DATA)) if (SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_INLINE_DATA))
dp = &skel; dp = &skel;
else else
dp = &data; dp = &data;
@ -241,7 +241,7 @@ spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info,
*d = info->datas[i]; *d = info->datas[i];
d->chunk = &cp[i]; d->chunk = &cp[i];
if (!SPA_FLAG_CHECK(info->flags, SPA_BUFFER_ALLOC_FLAG_NO_DATA)) { if (!SPA_FLAG_IS_SET(info->flags, SPA_BUFFER_ALLOC_FLAG_NO_DATA)) {
*dp = SPA_PTR_ALIGN(*dp, info->data_aligns[i], void); *dp = SPA_PTR_ALIGN(*dp, info->data_aligns[i], void);
d->data = *dp; d->data = *dp;
*dp = SPA_MEMBER(*dp, d->maxsize, void); *dp = SPA_MEMBER(*dp, d->maxsize, void);

View file

@ -67,7 +67,7 @@ spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, struct
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(info->channels), SPA_FORMAT_AUDIO_channels, SPA_POD_Int(info->channels),
0); 0);
if (!SPA_FLAG_CHECK(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED)) { if (!SPA_FLAG_IS_SET(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED)) {
spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0); spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0);
spa_pod_builder_array(builder, sizeof(uint32_t), SPA_TYPE_Id, spa_pod_builder_array(builder, sizeof(uint32_t), SPA_TYPE_Id,
info->channels, info->position); info->channels, info->position);

View file

@ -190,7 +190,7 @@ spa_pod_builder_primitive(struct spa_pod_builder *builder, const struct spa_pod
} else { } else {
data = p; data = p;
size = SPA_POD_SIZE(p); size = SPA_POD_SIZE(p);
SPA_FLAG_UNSET(builder->state.flags, SPA_POD_BUILDER_FLAG_FIRST); SPA_FLAG_CLEAR(builder->state.flags, SPA_POD_BUILDER_FLAG_FIRST);
} }
res = spa_pod_builder_raw(builder, data, size); res = spa_pod_builder_raw(builder, data, size);
if (builder->state.flags != SPA_POD_BUILDER_FLAG_BODY) if (builder->state.flags != SPA_POD_BUILDER_FLAG_BODY)

View file

@ -37,9 +37,10 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#define SPA_FLAG_MASK(field,mask,flag) (((field) & (mask)) == (flag)) #define SPA_FLAG_MASK(field,mask,flag) (((field) & (mask)) == (flag))
#define SPA_FLAG_CHECK(field,flag) SPA_FLAG_MASK(field,flag,flag) #define SPA_FLAG_IS_SET(field,flag) SPA_FLAG_MASK(field,flag,flag)
#define SPA_FLAG_SET(field,flag) ((field) |= (flag)) #define SPA_FLAG_SET(field,flag) ((field) |= (flag))
#define SPA_FLAG_UNSET(field,flag) ((field) &= ~(flag)) #define SPA_FLAG_CLEAR(field,flag) ((field) &= ~(flag))
#define SPA_FLAG_UPDATE(field,flag,val) ((val) ? SPA_FLAG_SET(field,flag) : SPA_FLAG_CLEAR(field,flag))
enum spa_direction { enum spa_direction {
SPA_DIRECTION_INPUT = 0, SPA_DIRECTION_INPUT = 0,

View file

@ -617,7 +617,7 @@ static int impl_node_process(void *object)
input->buffer_id < this->n_buffers) { input->buffer_id < this->n_buffers) {
struct buffer *b = &this->buffers[input->buffer_id]; struct buffer *b = &this->buffers[input->buffer_id];
if (!SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (!SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_log_warn(this->log, NAME " %p: buffer %u in use", spa_log_warn(this->log, NAME " %p: buffer %u in use",
this, input->buffer_id); this, input->buffer_id);
input->status = -EINVAL; input->status = -EINVAL;
@ -625,7 +625,7 @@ static int impl_node_process(void *object)
} }
spa_log_trace_fp(this->log, NAME " %p: queue buffer %u", this, input->buffer_id); spa_log_trace_fp(this->log, NAME " %p: queue buffer %u", this, input->buffer_id);
spa_list_append(&this->ready, &b->link); spa_list_append(&this->ready, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
input->buffer_id = SPA_ID_INVALID; input->buffer_id = SPA_ID_INVALID;
spa_alsa_write(this, 0); spa_alsa_write(this, 0);

View file

@ -337,10 +337,10 @@ static void recycle_buffer(struct state *this, uint32_t buffer_id)
{ {
struct buffer *b = &this->buffers[buffer_id]; struct buffer *b = &this->buffers[buffer_id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_log_trace_fp(this->log, NAME " %p: recycle buffer %u", this, buffer_id); spa_log_trace_fp(this->log, NAME " %p: recycle buffer %u", this, buffer_id);
spa_list_append(&this->free, &b->link); spa_list_append(&this->free, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
} }
} }

View file

@ -1099,7 +1099,7 @@ static void reset_buffers(struct state *this)
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
} else { } else {
spa_list_append(&this->free, &b->link); spa_list_append(&this->free, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
} }
} }
} }

View file

@ -380,11 +380,11 @@ int spa_alsa_seq_recycle_buffer(struct seq_state *state, struct seq_port *port,
{ {
struct buffer *b = &port->buffers[buffer_id]; struct buffer *b = &port->buffers[buffer_id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_log_trace_fp(state->log, NAME " %p: recycle buffer port:%p buffer-id:%u", spa_log_trace_fp(state->log, NAME " %p: recycle buffer port:%p buffer-id:%u",
state, port, buffer_id); state, port, buffer_id);
spa_list_append(&port->free, &b->link); spa_list_append(&port->free, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
} }
return 0; return 0;
} }
@ -758,7 +758,7 @@ static void reset_buffers(struct seq_state *this, struct seq_port *port)
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
} else { } else {
spa_list_append(&port->free, &b->link); spa_list_append(&port->free, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
} }
} }
} }

View file

@ -681,8 +681,8 @@ static int negotiate_buffers(struct impl *this)
slave_flags = this->slave_flags; slave_flags = this->slave_flags;
conv_flags = this->convert_flags; conv_flags = this->convert_flags;
slave_alloc = SPA_FLAG_CHECK(slave_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); slave_alloc = SPA_FLAG_IS_SET(slave_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
conv_alloc = SPA_FLAG_CHECK(conv_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); conv_alloc = SPA_FLAG_IS_SET(conv_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
flags = 0; flags = 0;
if (conv_alloc || slave_alloc) { if (conv_alloc || slave_alloc) {

View file

@ -322,9 +322,9 @@ static int negotiate_link_buffers(struct impl *this, struct link *link)
spa_pod_fixate(param); spa_pod_fixate(param);
in_alloc = SPA_FLAG_CHECK(link->in_flags, in_alloc = SPA_FLAG_IS_SET(link->in_flags,
SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
out_alloc = SPA_FLAG_CHECK(link->out_flags, out_alloc = SPA_FLAG_IS_SET(link->out_flags,
SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
flags = 0; flags = 0;

View file

@ -761,7 +761,7 @@ impl_node_port_use_buffers(void *object,
} }
b->datas[j] = d[j].data; b->datas[j] = d[j].data;
if (direction == SPA_DIRECTION_OUTPUT && if (direction == SPA_DIRECTION_OUTPUT &&
!SPA_FLAG_CHECK(d[j].flags, SPA_DATA_FLAG_DYNAMIC)) !SPA_FLAG_IS_SET(d[j].flags, SPA_DATA_FLAG_DYNAMIC))
this->is_passthrough = false; this->is_passthrough = false;
} }
if (direction == SPA_DIRECTION_OUTPUT) if (direction == SPA_DIRECTION_OUTPUT)
@ -803,9 +803,9 @@ static void recycle_buffer(struct impl *this, uint32_t id)
struct port *port = GET_OUT_PORT(this, 0); struct port *port = GET_OUT_PORT(this, 0);
struct buffer *b = &port->buffers[id]; struct buffer *b = &port->buffers[id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, id); spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, id);
} }
} }

View file

@ -376,7 +376,7 @@ static int port_enum_formats(void *object,
SPA_FORMAT_AUDIO_rate, SPA_POD_Int(info.info.raw.rate), SPA_FORMAT_AUDIO_rate, SPA_POD_Int(info.info.raw.rate),
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(info.info.raw.channels), SPA_FORMAT_AUDIO_channels, SPA_POD_Int(info.info.raw.channels),
0); 0);
if (!SPA_FLAG_CHECK(info.info.raw.flags, SPA_AUDIO_FLAG_UNPOSITIONED)) { if (!SPA_FLAG_IS_SET(info.info.raw.flags, SPA_AUDIO_FLAG_UNPOSITIONED)) {
qsort(info.info.raw.position, info.info.raw.channels, qsort(info.info.raw.position, info.info.raw.channels,
sizeof(uint32_t), int32_cmp); sizeof(uint32_t), int32_cmp);
spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0); spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0);
@ -703,7 +703,7 @@ impl_node_port_use_buffers(void *object,
} }
b->datas[j] = d[j].data; b->datas[j] = d[j].data;
if (direction == SPA_DIRECTION_OUTPUT && if (direction == SPA_DIRECTION_OUTPUT &&
!SPA_FLAG_CHECK(d[j].flags, SPA_DATA_FLAG_DYNAMIC)) !SPA_FLAG_IS_SET(d[j].flags, SPA_DATA_FLAG_DYNAMIC))
this->is_passthrough = false; this->is_passthrough = false;
} }
@ -750,9 +750,9 @@ static void recycle_buffer(struct impl *this, struct port *port, uint32_t id)
{ {
struct buffer *b = &port->buffers[id]; struct buffer *b = &port->buffers[id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, id); spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, id);
} }
} }

View file

@ -724,7 +724,7 @@ static void queue_buffer(struct impl *this, struct port *port, uint32_t id)
spa_log_trace_fp(this->log, NAME " %p: queue buffer %d on port %d %d", spa_log_trace_fp(this->log, NAME " %p: queue buffer %d on port %d %d",
this, id, port->id, b->flags); this, id, port->id, b->flags);
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_QUEUED)) if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_QUEUED))
return; return;
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
@ -740,7 +740,7 @@ static struct buffer *dequeue_buffer(struct impl *this, struct port *port)
b = spa_list_first(&port->queue, struct buffer, link); b = spa_list_first(&port->queue, struct buffer, link);
spa_list_remove(&b->link); spa_list_remove(&b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_QUEUED); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED);
spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d on port %d %u", spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d on port %d %u",
this, b->id, port->id, b->flags); this, b->id, port->id, b->flags);
@ -802,7 +802,7 @@ impl_node_port_use_buffers(void *object,
} }
b->datas[j] = d[j].data; b->datas[j] = d[j].data;
if (direction == SPA_DIRECTION_OUTPUT && if (direction == SPA_DIRECTION_OUTPUT &&
!SPA_FLAG_CHECK(d[j].flags, SPA_DATA_FLAG_DYNAMIC)) !SPA_FLAG_IS_SET(d[j].flags, SPA_DATA_FLAG_DYNAMIC))
this->is_passthrough = false; this->is_passthrough = false;
} }
@ -915,7 +915,7 @@ static inline int handle_monitor(struct impl *this, const void *data, int n_samp
spa_log_trace(this->log, "%p: io %p %08x", this, outport->io, dd->flags); spa_log_trace(this->log, "%p: io %p %08x", this, outport->io, dd->flags);
if (SPA_FLAG_CHECK(dd->flags, SPA_DATA_FLAG_DYNAMIC)) if (SPA_FLAG_IS_SET(dd->flags, SPA_DATA_FLAG_DYNAMIC))
dd->data = (void*)data; dd->data = (void*)data;
else else
memcpy(dd->data, data, size); memcpy(dd->data, data, size);

View file

@ -123,15 +123,15 @@ static void impl_native_update_rate(struct resample *r, double rate)
data->func = is_full ? do_resample_full_c : do_resample_inter_c; data->func = is_full ? do_resample_full_c : do_resample_inter_c;
#if defined (HAVE_SSE) #if defined (HAVE_SSE)
if (SPA_FLAG_CHECK(r->cpu_flags, SPA_CPU_FLAG_SSE)) if (SPA_FLAG_IS_SET(r->cpu_flags, SPA_CPU_FLAG_SSE))
data->func = is_full ? do_resample_full_sse : do_resample_inter_sse; data->func = is_full ? do_resample_full_sse : do_resample_inter_sse;
#endif #endif
#if defined (HAVE_SSSE3) #if defined (HAVE_SSSE3)
if (SPA_FLAG_CHECK(r->cpu_flags, SPA_CPU_FLAG_SSSE3 | SPA_CPU_FLAG_SLOW_UNALIGNED)) if (SPA_FLAG_IS_SET(r->cpu_flags, SPA_CPU_FLAG_SSSE3 | SPA_CPU_FLAG_SLOW_UNALIGNED))
data->func = is_full ? do_resample_full_ssse3 : do_resample_inter_ssse3; data->func = is_full ? do_resample_full_ssse3 : do_resample_inter_ssse3;
#endif #endif
#if defined(HAVE_AVX) && defined(HAVE_FMA) #if defined(HAVE_AVX) && defined(HAVE_FMA)
if (SPA_FLAG_CHECK(r->cpu_flags, SPA_CPU_FLAG_AVX | SPA_CPU_FLAG_FMA3)) if (SPA_FLAG_IS_SET(r->cpu_flags, SPA_CPU_FLAG_AVX | SPA_CPU_FLAG_FMA3))
data->func = is_full ? do_resample_full_avx : do_resample_inter_avx; data->func = is_full ? do_resample_full_avx : do_resample_inter_avx;
#endif #endif
} }

View file

@ -658,9 +658,9 @@ static void recycle_buffer(struct impl *this, uint32_t id)
struct port *port = GET_OUT_PORT(this, 0); struct port *port = GET_OUT_PORT(this, 0);
struct buffer *b = &port->buffers[id]; struct buffer *b = &port->buffers[id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, id); spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, id);
} }
} }

View file

@ -688,7 +688,7 @@ static void queue_buffer(struct impl *this, struct port *port, uint32_t id)
spa_log_trace_fp(this->log, NAME " %p: queue buffer %d on port %d %d", spa_log_trace_fp(this->log, NAME " %p: queue buffer %d on port %d %d",
this, id, port->id, b->flags); this, id, port->id, b->flags);
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_QUEUED)) if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_QUEUED))
return; return;
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
@ -704,7 +704,7 @@ static struct buffer *dequeue_buffer(struct impl *this, struct port *port)
b = spa_list_first(&port->queue, struct buffer, link); b = spa_list_first(&port->queue, struct buffer, link);
spa_list_remove(&b->link); spa_list_remove(&b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_QUEUED); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED);
spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d on port %d %u", spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d on port %d %u",
this, b->id, port->id, b->flags); this, b->id, port->id, b->flags);
@ -758,7 +758,7 @@ impl_node_port_use_buffers(void *object,
} }
b->datas[j] = d[j].data; b->datas[j] = d[j].data;
if (direction == SPA_DIRECTION_OUTPUT && if (direction == SPA_DIRECTION_OUTPUT &&
!SPA_FLAG_CHECK(d[j].flags, SPA_DATA_FLAG_DYNAMIC)) !SPA_FLAG_IS_SET(d[j].flags, SPA_DATA_FLAG_DYNAMIC))
this->is_passthrough = false; this->is_passthrough = false;
spa_log_debug(this->log, NAME " %p: buffer %d data %d flags:%08x %p", spa_log_debug(this->log, NAME " %p: buffer %d data %d flags:%08x %p",

View file

@ -618,9 +618,9 @@ impl_node_port_set_param(void *object,
static void recycle_buffer(struct impl *this, struct port *port, struct buffer *b) static void recycle_buffer(struct impl *this, struct port *port, struct buffer *b)
{ {
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, b->id); spa_log_trace_fp(this->log, NAME " %p: recycle buffer %d", this, b->id);
} }
} }

View file

@ -227,9 +227,9 @@ static inline void reuse_buffer(struct impl *this, struct port *port, uint32_t i
{ {
struct buffer *b = &port->buffers[id]; struct buffer *b = &port->buffers[id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id); spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
spa_list_append(&port->empty, &b->link); spa_list_append(&port->empty, &b->link);
} }
} }

View file

@ -127,10 +127,10 @@ static int spa_v4l2_buffer_recycle(struct impl *this, uint32_t buffer_id)
struct spa_v4l2_device *dev = &port->dev; struct spa_v4l2_device *dev = &port->dev;
int err; int err;
if (!SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUTSTANDING)) if (!SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUTSTANDING))
return 0; return 0;
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUTSTANDING); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUTSTANDING);
spa_log_trace(this->log, "v4l2 %p: recycle buffer %d", this, buffer_id); spa_log_trace(this->log, "v4l2 %p: recycle buffer %d", this, buffer_id);
if (xioctl(dev->fd, VIDIOC_QBUF, &b->v4l2_buffer) < 0) { if (xioctl(dev->fd, VIDIOC_QBUF, &b->v4l2_buffer) < 0) {
@ -158,15 +158,15 @@ static int spa_v4l2_clear_buffers(struct impl *this)
b = &port->buffers[i]; b = &port->buffers[i];
d = b->outbuf->datas; d = b->outbuf->datas;
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUTSTANDING)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUTSTANDING)) {
spa_log_info(this->log, "v4l2: queueing outstanding buffer %p", b); spa_log_info(this->log, "v4l2: queueing outstanding buffer %p", b);
spa_v4l2_buffer_recycle(this, i); spa_v4l2_buffer_recycle(this, i);
} }
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_MAPPED)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
munmap(SPA_MEMBER(b->ptr, -d[0].mapoffset, void), munmap(SPA_MEMBER(b->ptr, -d[0].mapoffset, void),
d[0].maxsize - d[0].mapoffset); d[0].maxsize - d[0].mapoffset);
} }
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_ALLOCATED)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_ALLOCATED)) {
spa_log_debug(this->log, "v4l2: close %d", (int) d[0].fd); spa_log_debug(this->log, "v4l2: close %d", (int) d[0].fd);
close(d[0].fd); close(d[0].fd);
} }
@ -1552,7 +1552,7 @@ static int spa_v4l2_stream_off(struct impl *this)
struct buffer *b; struct buffer *b;
b = &port->buffers[i]; b = &port->buffers[i];
if (!SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUTSTANDING)) { if (!SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUTSTANDING)) {
if (xioctl(dev->fd, VIDIOC_QBUF, &b->v4l2_buffer) < 0) if (xioctl(dev->fd, VIDIOC_QBUF, &b->v4l2_buffer) < 0)
spa_log_warn(this->log, "VIDIOC_QBUF: %s", strerror(errno)); spa_log_warn(this->log, "VIDIOC_QBUF: %s", strerror(errno));
} }

View file

@ -606,8 +606,8 @@ static int negotiate_buffers(struct impl *this)
slave_flags = this->slave_flags; slave_flags = this->slave_flags;
conv_flags = this->convert_flags; conv_flags = this->convert_flags;
slave_alloc = SPA_FLAG_CHECK(slave_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); slave_alloc = SPA_FLAG_IS_SET(slave_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
conv_alloc = SPA_FLAG_CHECK(conv_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS); conv_alloc = SPA_FLAG_IS_SET(conv_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
flags = 0; flags = 0;
if (conv_alloc || slave_alloc) { if (conv_alloc || slave_alloc) {

View file

@ -322,10 +322,10 @@ static inline void reuse_buffer(struct impl *this, struct port *port, uint32_t i
{ {
struct buffer *b = &port->buffers[id]; struct buffer *b = &port->buffers[id];
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_OUT)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_OUT)) {
spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id); spa_log_trace(this->log, NAME " %p: reuse buffer %d", this, id);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
spa_list_append(&port->empty, &b->link); spa_list_append(&port->empty, &b->link);
if (!this->props.live) if (!this->props.live)

View file

@ -84,7 +84,7 @@ inspect_node_params(struct data *data, struct spa_node *node,
for (i = 0; i < n_params; i++) { for (i = 0; i < n_params; i++) {
printf("enumerating: %s:\n", spa_debug_type_find_name(spa_type_param, params[i].id)); printf("enumerating: %s:\n", spa_debug_type_find_name(spa_type_param, params[i].id));
if (!SPA_FLAG_CHECK(params[i].flags, SPA_PARAM_INFO_READ)) if (!SPA_FLAG_IS_SET(params[i].flags, SPA_PARAM_INFO_READ))
continue; continue;
spa_zero(listener); spa_zero(listener);
@ -118,7 +118,7 @@ inspect_port_params(struct data *data, struct spa_node *node,
params[i].flags & SPA_PARAM_INFO_READ ? 'r' : '-', params[i].flags & SPA_PARAM_INFO_READ ? 'r' : '-',
params[i].flags & SPA_PARAM_INFO_WRITE ? 'w' : '-'); params[i].flags & SPA_PARAM_INFO_WRITE ? 'w' : '-');
if (!SPA_FLAG_CHECK(params[i].flags, SPA_PARAM_INFO_READ)) if (!SPA_FLAG_IS_SET(params[i].flags, SPA_PARAM_INFO_READ))
continue; continue;
printf("values:\n"); printf("values:\n");

View file

@ -366,7 +366,7 @@ static int add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32_
pi.flags = port->spa_flags; pi.flags = port->spa_flags;
pi.rate = SPA_FRACTION(0, 1); pi.rate = SPA_FRACTION(0, 1);
pi.props = &port->properties->dict; pi.props = &port->properties->dict;
SPA_FLAG_UNSET(pi.flags, SPA_PORT_FLAG_DYNAMIC_DATA); SPA_FLAG_CLEAR(pi.flags, SPA_PORT_FLAG_DYNAMIC_DATA);
pi.n_params = port->info.n_params; pi.n_params = port->info.n_params;
pi.params = port->info.params; pi.params = port->info.params;
} }

View file

@ -204,10 +204,7 @@ client_busy_changed(void *data, bool busy)
c->busy = busy; c->busy = busy;
if (busy) SPA_FLAG_UPDATE(mask, SPA_IO_IN, !busy);
SPA_FLAG_UNSET(mask, SPA_IO_IN);
else
SPA_FLAG_SET(mask, SPA_IO_IN);
pw_log_debug(NAME" %p: busy changed %d", client->protocol, busy); pw_log_debug(NAME" %p: busy changed %d", client->protocol, busy);
pw_loop_update_io(client->core->main_loop, c->source, mask); pw_loop_update_io(client->core->main_loop, c->source, mask);
@ -238,7 +235,7 @@ connection_data(void *data, int fd, uint32_t mask)
res = pw_protocol_native_connection_flush(this->connection); res = pw_protocol_native_connection_flush(this->connection);
if (res >= 0) { if (res >= 0) {
int mask = this->source->mask; int mask = this->source->mask;
SPA_FLAG_UNSET(mask, SPA_IO_OUT); SPA_FLAG_CLEAR(mask, SPA_IO_OUT);
pw_loop_update_io(client->protocol->core->main_loop, pw_loop_update_io(client->protocol->core->main_loop,
this->source, mask); this->source, mask);
} else if (res != EAGAIN) { } else if (res != EAGAIN) {
@ -540,7 +537,7 @@ on_remote_data(void *data, int fd, uint32_t mask)
res = pw_protocol_native_connection_flush(conn); res = pw_protocol_native_connection_flush(conn);
if (res >= 0) { if (res >= 0) {
int mask = impl->source->mask; int mask = impl->source->mask;
SPA_FLAG_UNSET(mask, SPA_IO_OUT); SPA_FLAG_CLEAR(mask, SPA_IO_OUT);
pw_loop_update_io(core->main_loop, pw_loop_update_io(core->main_loop,
impl->source, mask); impl->source, mask);
impl->flushing = false; impl->flushing = false;

View file

@ -100,7 +100,7 @@ pw_spa_device_new(struct pw_core *core,
pw_device_add_listener(this, &impl->device_listener, &device_events, impl); pw_device_add_listener(this, &impl->device_listener, &device_events, impl);
pw_device_set_implementation(this, impl->device); pw_device_set_implementation(this, impl->device);
if (!SPA_FLAG_CHECK(impl->flags, PW_SPA_DEVICE_FLAG_NO_REGISTER)) { if (!SPA_FLAG_IS_SET(impl->flags, PW_SPA_DEVICE_FLAG_NO_REGISTER)) {
if ((res = pw_device_register(this, NULL)) < 0) if ((res = pw_device_register(this, NULL)) < 0)
goto error_register; goto error_register;
} }

View file

@ -79,10 +79,10 @@ static void complete_init(struct impl *impl)
impl->init_pending = SPA_ID_INVALID; impl->init_pending = SPA_ID_INVALID;
if (SPA_FLAG_CHECK(impl->flags, PW_SPA_NODE_FLAG_ACTIVATE)) if (SPA_FLAG_IS_SET(impl->flags, PW_SPA_NODE_FLAG_ACTIVATE))
pw_node_set_active(this, true); pw_node_set_active(this, true);
if (!SPA_FLAG_CHECK(impl->flags, PW_SPA_NODE_FLAG_NO_REGISTER)) if (!SPA_FLAG_IS_SET(impl->flags, PW_SPA_NODE_FLAG_NO_REGISTER))
pw_node_register(this, NULL); pw_node_register(this, NULL);
else else
pw_node_initialized(this); pw_node_initialized(this);

View file

@ -436,7 +436,7 @@ static int clear_buffers(struct impl *this, struct port *port)
static int queue_buffer(struct impl *this, struct port *port, struct buffer *b) static int queue_buffer(struct impl *this, struct port *port, struct buffer *b)
{ {
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_QUEUED)) if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_QUEUED))
return -EINVAL; return -EINVAL;
spa_list_append(&port->queue, &b->link); spa_list_append(&port->queue, &b->link);
@ -454,7 +454,7 @@ static struct buffer *dequeue_buffer(struct impl *this, struct port *port)
b = spa_list_first(&port->queue, struct buffer, link); b = spa_list_first(&port->queue, struct buffer, link);
spa_list_remove(&b->link); spa_list_remove(&b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_QUEUED); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED);
spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d", this, b->id); spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d", this, b->id);
return b; return b;
} }
@ -730,7 +730,8 @@ static int impl_node_process(void *object)
(inio = inport->io) == NULL || (inio = inport->io) == NULL ||
inio->buffer_id >= inport->n_buffers || inio->buffer_id >= inport->n_buffers ||
inio->status != SPA_STATUS_HAVE_DATA) { inio->status != SPA_STATUS_HAVE_DATA) {
spa_log_trace_fp(this->log, NAME " %p: skip input %d %d %p %d %d %d", this, spa_log_trace_fp(this->log, NAME " %p: skip input idx:%d valid:%d "
"io:%p status:%d buf_id:%d n_buffers:%d", this,
i, inport->valid, inio, i, inport->valid, inio,
inio ? inio->status : -1, inio ? inio->status : -1,
inio ? inio->buffer_id : SPA_ID_INVALID, inio ? inio->buffer_id : SPA_ID_INVALID,

View file

@ -1637,7 +1637,7 @@ pw_node_find_port(struct pw_node *node, enum pw_direction direction, uint32_t po
break; break;
} }
/* We can use this port if it can multiplex */ /* We can use this port if it can multiplex */
if (SPA_FLAG_CHECK(p->mix_flags, PW_PORT_MIX_FLAG_MULTI)) if (SPA_FLAG_IS_SET(p->mix_flags, PW_PORT_MIX_FLAG_MULTI))
port = p; port = p;
} }
} }
@ -1659,12 +1659,12 @@ uint32_t pw_node_get_free_port_id(struct pw_node *node, enum pw_direction direct
max_ports = node->info.max_input_ports; max_ports = node->info.max_input_ports;
n_ports = node->info.n_input_ports; n_ports = node->info.n_input_ports;
portmap = &node->input_port_map; portmap = &node->input_port_map;
dynamic = SPA_FLAG_CHECK(node->spa_flags, SPA_NODE_FLAG_IN_DYNAMIC_PORTS); dynamic = SPA_FLAG_IS_SET(node->spa_flags, SPA_NODE_FLAG_IN_DYNAMIC_PORTS);
} else { } else {
max_ports = node->info.max_output_ports; max_ports = node->info.max_output_ports;
n_ports = node->info.n_output_ports; n_ports = node->info.n_output_ports;
portmap = &node->output_port_map; portmap = &node->output_port_map;
dynamic = SPA_FLAG_CHECK(node->spa_flags, SPA_NODE_FLAG_OUT_DYNAMIC_PORTS); dynamic = SPA_FLAG_IS_SET(node->spa_flags, SPA_NODE_FLAG_OUT_DYNAMIC_PORTS);
} }
pw_log_debug(NAME" %p: direction %s n_ports:%u max_ports:%u", pw_log_debug(NAME" %p: direction %s n_ports:%u max_ports:%u",
node, pw_direction_as_string(direction), n_ports, max_ports); node, pw_direction_as_string(direction), n_ports, max_ports);

View file

@ -384,9 +384,9 @@ struct pw_port *pw_port_new(enum pw_direction direction,
} }
if (info) { if (info) {
if (SPA_FLAG_CHECK(info->flags, SPA_PORT_FLAG_PHYSICAL)) if (SPA_FLAG_IS_SET(info->flags, SPA_PORT_FLAG_PHYSICAL))
pw_properties_set(properties, PW_KEY_PORT_PHYSICAL, "1"); pw_properties_set(properties, PW_KEY_PORT_PHYSICAL, "1");
if (SPA_FLAG_CHECK(info->flags, SPA_PORT_FLAG_TERMINAL)) if (SPA_FLAG_IS_SET(info->flags, SPA_PORT_FLAG_TERMINAL))
pw_properties_set(properties, PW_KEY_PORT_TERMINAL, "1"); pw_properties_set(properties, PW_KEY_PORT_TERMINAL, "1");
this->spa_flags = info->flags; this->spa_flags = info->flags;
} }
@ -850,7 +850,7 @@ static void pw_port_remove(struct pw_port *port)
pw_loop_invoke(port->node->data_loop, do_remove_port, pw_loop_invoke(port->node->data_loop, do_remove_port,
SPA_ID_INVALID, NULL, 0, true, port); SPA_ID_INVALID, NULL, 0, true, port);
if (SPA_FLAG_CHECK(port->flags, PW_PORT_FLAG_TO_REMOVE)) { if (SPA_FLAG_IS_SET(port->flags, PW_PORT_FLAG_TO_REMOVE)) {
if ((res = spa_node_remove_port(node->node, port->direction, port->port_id)) < 0) if ((res = spa_node_remove_port(node->node, port->direction, port->port_id)) < 0)
pw_log_warn(NAME" %p: can't remove: %s", port, spa_strerror(res)); pw_log_warn(NAME" %p: can't remove: %s", port, spa_strerror(res));
} }

View file

@ -222,7 +222,7 @@ static inline int push_queue(struct stream *stream, struct queue *queue, struct
{ {
uint32_t index; uint32_t index;
if (SPA_FLAG_CHECK(buffer->flags, BUFFER_FLAG_QUEUED)) if (SPA_FLAG_IS_SET(buffer->flags, BUFFER_FLAG_QUEUED))
return -EINVAL; return -EINVAL;
SPA_FLAG_SET(buffer->flags, BUFFER_FLAG_QUEUED); SPA_FLAG_SET(buffer->flags, BUFFER_FLAG_QUEUED);
@ -251,7 +251,7 @@ static inline struct buffer *pop_queue(struct stream *stream, struct queue *queu
buffer = &stream->buffers[id]; buffer = &stream->buffers[id];
queue->outcount += buffer->this.size; queue->outcount += buffer->this.size;
SPA_FLAG_UNSET(buffer->flags, BUFFER_FLAG_QUEUED); SPA_FLAG_CLEAR(buffer->flags, BUFFER_FLAG_QUEUED);
return buffer; return buffer;
} }
@ -304,7 +304,7 @@ do_call_process(struct spa_loop *loop,
static void call_process(struct stream *impl) static void call_process(struct stream *impl)
{ {
pw_log_trace(NAME" %p: call process", impl); pw_log_trace(NAME" %p: call process", impl);
if (SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_RT_PROCESS)) { if (SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_RT_PROCESS)) {
do_call_process(NULL, false, 1, NULL, 0, impl); do_call_process(NULL, false, 1, NULL, 0, impl);
} }
else { else {
@ -624,7 +624,7 @@ static void clear_buffers(struct pw_stream *stream)
pw_stream_emit_remove_buffer(stream, &b->this); pw_stream_emit_remove_buffer(stream, &b->this);
if (SPA_FLAG_CHECK(b->flags, BUFFER_FLAG_MAPPED)) { if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
for (j = 0; j < b->this.buffer->n_datas; j++) { for (j = 0; j < b->this.buffer->n_datas; j++) {
struct spa_data *d = &b->this.buffer->datas[j]; struct spa_data *d = &b->this.buffer->datas[j];
pw_log_debug(NAME" %p: clear buffer %d mem", pw_log_debug(NAME" %p: clear buffer %d mem",
@ -663,7 +663,7 @@ static int impl_port_use_buffers(void *object,
b->flags = 0; b->flags = 0;
b->id = i; b->id = i;
if (SPA_FLAG_CHECK(impl_flags, PW_STREAM_FLAG_MAP_BUFFERS)) { if (SPA_FLAG_IS_SET(impl_flags, PW_STREAM_FLAG_MAP_BUFFERS)) {
for (j = 0; j < buffers[i]->n_datas; j++) { for (j = 0; j < buffers[i]->n_datas; j++) {
struct spa_data *d = &buffers[i]->datas[j]; struct spa_data *d = &buffers[i]->datas[j];
if (d->type == SPA_DATA_MemFd || if (d->type == SPA_DATA_MemFd ||
@ -814,7 +814,7 @@ again:
} }
} }
if (!impl->draining && !SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_DRIVER)) { if (!impl->draining && !SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER)) {
call_process(impl); call_process(impl);
if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) >= MIN_QUEUED && if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) >= MIN_QUEUED &&
io->status == SPA_STATUS_NEED_DATA) io->status == SPA_STATUS_NEED_DATA)
@ -1056,7 +1056,7 @@ static int handle_connect(struct pw_stream *stream)
pw_node_set_implementation(slave, &impl->impl_node); pw_node_set_implementation(slave, &impl->impl_node);
if (!SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_INACTIVE)) if (!SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_INACTIVE))
pw_node_set_active(slave, true); pw_node_set_active(slave, true);
if (impl->media_type == SPA_MEDIA_TYPE_audio && if (impl->media_type == SPA_MEDIA_TYPE_audio &&
@ -1486,7 +1486,7 @@ pw_stream_connect(struct pw_stream *stream,
if (flags & PW_STREAM_FLAG_DONT_RECONNECT) if (flags & PW_STREAM_FLAG_DONT_RECONNECT)
pw_properties_set(stream->properties, PW_KEY_NODE_DONT_RECONNECT, "1"); pw_properties_set(stream->properties, PW_KEY_NODE_DONT_RECONNECT, "1");
impl->alloc_buffers = SPA_FLAG_CHECK(flags, PW_STREAM_FLAG_ALLOC_BUFFERS); impl->alloc_buffers = SPA_FLAG_IS_SET(flags, PW_STREAM_FLAG_ALLOC_BUFFERS);
pw_properties_setf(stream->properties, PW_KEY_MEDIA_CLASS, "Stream/%s/%s", pw_properties_setf(stream->properties, PW_KEY_MEDIA_CLASS, "Stream/%s/%s",
direction == PW_DIRECTION_INPUT ? "Input" : "Output", direction == PW_DIRECTION_INPUT ? "Input" : "Output",
@ -1669,7 +1669,7 @@ do_process(struct spa_loop *loop,
static inline int call_trigger(struct stream *impl) static inline int call_trigger(struct stream *impl)
{ {
int res = 0; int res = 0;
if (SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_DRIVER)) { if (SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER)) {
res = pw_loop_invoke(impl->core->data_loop, res = pw_loop_invoke(impl->core->data_loop,
do_process, 1, NULL, 0, false, impl); do_process, 1, NULL, 0, false, impl);
} }

View file

@ -289,7 +289,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
if (old != NULL && info->params[i].flags == old->params[i].flags) if (old != NULL && info->params[i].flags == old->params[i].flags)
continue; continue;
remove_params(data, info->params[i].id, 0); remove_params(data, info->params[i].id, 0);
if (!SPA_FLAG_CHECK(info->params[i].flags, SPA_PARAM_INFO_READ)) if (!SPA_FLAG_IS_SET(info->params[i].flags, SPA_PARAM_INFO_READ))
continue; continue;
pw_node_proxy_enum_params((struct pw_node_proxy*)data->proxy, pw_node_proxy_enum_params((struct pw_node_proxy*)data->proxy,
0, info->params[i].id, 0, 0, NULL); 0, info->params[i].id, 0, 0, NULL);
@ -349,7 +349,7 @@ static void port_event_info(void *object, const struct pw_port_info *info)
if (old != NULL && info->params[i].flags == old->params[i].flags) if (old != NULL && info->params[i].flags == old->params[i].flags)
continue; continue;
remove_params(data, info->params[i].id, 0); remove_params(data, info->params[i].id, 0);
if (!SPA_FLAG_CHECK(info->params[i].flags, SPA_PARAM_INFO_READ)) if (!SPA_FLAG_IS_SET(info->params[i].flags, SPA_PARAM_INFO_READ))
continue; continue;
pw_port_proxy_enum_params((struct pw_port_proxy*)data->proxy, pw_port_proxy_enum_params((struct pw_port_proxy*)data->proxy,
0, info->params[i].id, 0, 0, NULL); 0, info->params[i].id, 0, 0, NULL);
@ -528,7 +528,7 @@ static void device_event_info(void *object, const struct pw_device_info *info)
if (old != NULL && info->params[i].flags == old->params[i].flags) if (old != NULL && info->params[i].flags == old->params[i].flags)
continue; continue;
remove_params(data, info->params[i].id, 0); remove_params(data, info->params[i].id, 0);
if (!SPA_FLAG_CHECK(info->params[i].flags, SPA_PARAM_INFO_READ)) if (!SPA_FLAG_IS_SET(info->params[i].flags, SPA_PARAM_INFO_READ))
continue; continue;
pw_device_proxy_enum_params((struct pw_device_proxy*)data->proxy, pw_device_proxy_enum_params((struct pw_device_proxy*)data->proxy,
0, info->params[i].id, 0, 0, NULL); 0, info->params[i].id, 0, 0, NULL);