More hacking

Add connection message for PORT_COMMAND
Add rtkit support to ask for realtime priority
work on stream states and improve negotiation
Rework of port linking works, keep separate state for realtime threads
and use message passing to update the state.
Don't try to link nodes that are removed.
Open the device in the ALSA monitor to detect source or sink
Implement send_command as async methods on the plugins, use async
replies to sync start and stop.
Work on alsa sink.
Implement async PAUSE/START on v4l2 src. move the STREAMON/OFF calls to
the mainloop because they have high latency, add the poll descriptors
from the data loop.
This commit is contained in:
Wim Taymans 2016-10-28 16:56:33 +02:00
parent 984375c0b2
commit 3f4ccaaea2
32 changed files with 1335 additions and 545 deletions

View file

@ -389,11 +389,9 @@ process_work_queue (PinosMainLoop *this)
for (item = priv->work.head, prev = NULL; item; prev = item, item = next) {
next = item->next;
g_debug ("main-loop %p: peek work queue item %p seq %d, prev %p next %p", this, item->obj, item->seq, prev, next);
if (item->seq != SPA_ID_INVALID)
continue;
g_debug ("main-loop %p: process work item %p", this, item->obj);
if (priv->work.tail == item)
priv->work.tail = prev;
if (prev == NULL)
@ -401,8 +399,10 @@ process_work_queue (PinosMainLoop *this)
else
prev->next = next;
if (item->func)
if (item->func) {
g_debug ("main-loop %p: process work item %p", this, item->obj);
item->func (item->obj, item->data, item->res, item->id);
}
if (item->notify)
item->notify (item->data);
@ -484,7 +484,7 @@ pinos_main_loop_defer_cancel (PinosMainLoop *loop,
priv->work_id = g_idle_add ((GSourceFunc) process_work_queue, loop);
}
void
gboolean
pinos_main_loop_defer_complete (PinosMainLoop *loop,
gpointer obj,
uint32_t seq,
@ -494,11 +494,9 @@ pinos_main_loop_defer_complete (PinosMainLoop *loop,
PinosMainLoopPrivate *priv;
gboolean have_work = FALSE;
g_return_if_fail (PINOS_IS_MAIN_LOOP (loop));
g_return_val_if_fail (PINOS_IS_MAIN_LOOP (loop), FALSE);
priv = loop->priv;
g_debug ("main-loop %p: async complete %d %d for object %p", loop, seq, res, obj);
for (item = priv->work.head; item; item = item->next) {
if (item->obj == obj && item->seq == seq) {
g_debug ("main-loop %p: found defered %d for object %p", loop, seq, obj);
@ -512,6 +510,8 @@ pinos_main_loop_defer_complete (PinosMainLoop *loop,
if (priv->work_id == 0 && have_work)
priv->work_id = g_idle_add ((GSourceFunc) process_work_queue, loop);
return have_work;
}
GMainLoop *