node: improve position and transport

Reorganize some things, let the clients update the segment info
in their own activation, then let the server merge it. This avoids
clients stepping on eachother. When looping through the clients,
copy the segment info when we encounter its owner.

Remove the list of segment owners to the activation. This is better
than in the activation because we can then just keep one list of
owners.

Remove the NONBLOCK flag from the eventfd so that we can do blocking
reads as well.

Just keep a reposition owner in the driver activation. This points
to the node that has the reposition info. This avoid complicated
synchronization to keep multiple nodes from stepping on eachother.
Now they can just prepare the reposition info in their activation and
set themselves as the reposition owner. The last one who succeeds
wins.
This commit is contained in:
Wim Taymans 2019-09-02 12:05:05 +02:00
parent ca34a75173
commit faaf84286b
5 changed files with 97 additions and 86 deletions

View file

@ -1254,8 +1254,8 @@ static void node_initialized(void *data)
struct spa_system *data_system = impl->node.data_system;
size_t size;
impl->fds[0] = spa_system_eventfd_create(data_system, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
impl->fds[1] = spa_system_eventfd_create(data_system, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
impl->fds[0] = spa_system_eventfd_create(data_system, SPA_FD_CLOEXEC);
impl->fds[1] = spa_system_eventfd_create(data_system, SPA_FD_CLOEXEC);
impl->other_fds[0] = impl->fds[1];
impl->other_fds[1] = impl->fds[0];
node->data_source.fd = impl->fds[0];