stream: schedule process from main thread when asked

Use 2 lockfree queues so that we can queue and dequeue from different
threads.
Call the process function from the main thread when requested
Rework the data push and pull logic to go through the queues
Update the examples for this new feature, video-play does not need
to schedule the process in the main thread anymore and block for it
to complete, this avoid a deadlock between the data and mainloop when
shutting down.
This commit is contained in:
Wim Taymans 2018-07-11 17:51:57 +02:00
parent 67e567b9c7
commit bcddac6e2b
3 changed files with 253 additions and 173 deletions

View file

@ -235,7 +235,8 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
pw_stream_connect(data->stream,
PW_DIRECTION_OUTPUT,
NULL, PW_STREAM_FLAG_NONE,
NULL,
PW_STREAM_FLAG_DRIVER,
params, 1);
break;
}