mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
remote: use right io_position enum
This commit is contained in:
parent
06fe3af7fb
commit
f5c78cc2a2
3 changed files with 15 additions and 18 deletions
|
|
@ -861,18 +861,15 @@ client_node_set_io(void *object,
|
||||||
pw_log_debug("node %p: set io %s %p", proxy,
|
pw_log_debug("node %p: set io %s %p", proxy,
|
||||||
spa_debug_type_find_name(spa_type_io, id), ptr);
|
spa_debug_type_find_name(spa_type_io, id), ptr);
|
||||||
|
|
||||||
if (id == PW_IO_ClientNodePosition) {
|
if (id == SPA_IO_Position) {
|
||||||
if (ptr == NULL && data->position) {
|
if (ptr == NULL && data->position) {
|
||||||
m = find_mem_ptr(data, data->position);
|
m = find_mem_ptr(data, data->position);
|
||||||
if (m && --m->ref == 0)
|
if (m && --m->ref == 0)
|
||||||
clear_mem(data, m);
|
clear_mem(data, m);
|
||||||
}
|
}
|
||||||
data->position = ptr;
|
data->position = ptr;
|
||||||
data->node->rt.position = ptr;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pw_log_warn("unknown io id %u", id);
|
|
||||||
}
|
}
|
||||||
|
spa_node_set_io(data->node->node, id, ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void client_node_event(void *object, const struct spa_event *event)
|
static void client_node_event(void *object, const struct spa_event *event)
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ struct stream {
|
||||||
struct spa_io_buffers *io;
|
struct spa_io_buffers *io;
|
||||||
struct spa_io_sequence *io_control;
|
struct spa_io_sequence *io_control;
|
||||||
struct spa_io_sequence *io_notify;
|
struct spa_io_sequence *io_notify;
|
||||||
|
struct spa_io_position *position;
|
||||||
uint32_t io_notify_size;
|
uint32_t io_notify_size;
|
||||||
|
|
||||||
struct pw_array params;
|
struct pw_array params;
|
||||||
|
|
@ -247,6 +248,8 @@ static void call_process(struct stream *impl)
|
||||||
|
|
||||||
static int impl_set_io(struct spa_node *node, uint32_t id, void *data, size_t size)
|
static int impl_set_io(struct spa_node *node, uint32_t id, void *data, size_t size)
|
||||||
{
|
{
|
||||||
|
struct stream *impl = SPA_CONTAINER_OF(node, struct stream, impl_node);
|
||||||
|
impl->position = data;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -653,14 +656,16 @@ static int process_notify(struct stream *impl, struct spa_pod_sequence *sequence
|
||||||
|
|
||||||
static inline void copy_position(struct stream *impl, int64_t queued)
|
static inline void copy_position(struct stream *impl, int64_t queued)
|
||||||
{
|
{
|
||||||
struct spa_io_position *p = impl->node->rt.position;
|
struct spa_io_position *p = impl->position;
|
||||||
__atomic_add_fetch(&impl->seq, 1, __ATOMIC_SEQ_CST);
|
if (p != NULL) {
|
||||||
impl->time.now = p->clock.nsec;
|
__atomic_add_fetch(&impl->seq, 1, __ATOMIC_SEQ_CST);
|
||||||
impl->time.rate = p->clock.rate;
|
impl->time.now = p->clock.nsec;
|
||||||
impl->time.ticks = p->clock.position;
|
impl->time.rate = p->clock.rate;
|
||||||
impl->time.delay = p->clock.delay;
|
impl->time.ticks = p->clock.position;
|
||||||
impl->time.queued = queued;
|
impl->time.delay = p->clock.delay;
|
||||||
__atomic_add_fetch(&impl->seq, 1, __ATOMIC_SEQ_CST);
|
impl->time.queued = queued;
|
||||||
|
__atomic_add_fetch(&impl->seq, 1, __ATOMIC_SEQ_CST);
|
||||||
|
}
|
||||||
|
|
||||||
if (impl->io_control)
|
if (impl->io_control)
|
||||||
process_control(impl, &impl->io_control->sequence);
|
process_control(impl, &impl->io_control->sequence);
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ enum {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
|
||||||
PW_IO_BASE = PW_TYPE_FIRST,
|
|
||||||
PW_IO_ClientNodePosition,
|
|
||||||
};
|
|
||||||
|
|
||||||
#define PW_TYPE_BASE "PipeWire:"
|
#define PW_TYPE_BASE "PipeWire:"
|
||||||
|
|
||||||
#define PW_TYPE__Object PW_TYPE_BASE "Object"
|
#define PW_TYPE__Object PW_TYPE_BASE "Object"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue