Commit graph

83 commits

Author SHA1 Message Date
Wim Taymans
cae971e106 improve error reporting
Move signals from core to the objects themselves
Use per object info to track object signals
Use periods in alsasink and source
2017-01-17 10:27:58 +01:00
Wim Taymans
fb69758251 Do cleanup of queues
Wait for async state changes to complete
2017-01-12 20:02:58 +01:00
Wim Taymans
474981ddda Refactor the work queue
Make a separate work queue to track async operations. Keep separate
work queues for links and nodes. This avoids lockups when some async
operation take a long time and the work queue has SYNC_WAIT operations.
2017-01-12 16:48:17 +01:00
Wim Taymans
6d4db64767 Use refcounting for async shutdown
fix some memory leaks
2017-01-12 15:13:15 +01:00
Wim Taymans
ee0aa6a2ac Implement access control
Move send and dispatch functions to the implementation. This makes it
possible to place an access check before sending and dispatching.
Add module-access that allows to bind and notify on globals owned by
the client.
2017-01-10 17:26:43 +01:00
Wim Taymans
85d375e4bb Implement subscription with a signal
Use a signal for subscription events
Work on handling OOM errors and other errors.
2016-12-22 16:50:01 +01:00
Wim Taymans
5b0b9c43d0 Improve upload
Only send a buffer when we have received a NEED_DATA message.
Add a signal to pulla buffer from the sink. Restructure the sink to use
a queue like the source and only push a buffer when we can.
Improve SpaData. Offset and size should be between 0 and maxsize, make
sure we clamp correctly when needed.
node_process_output completes the processing of the output after
receiving HAVE_OUTPUT for async elements. It instructs the node that
it now can produce more output.
2016-12-20 16:51:57 +01:00
Wim Taymans
8ce3f949e2 Add core introspection
Use global ids in info messages to refer to global objects.
2016-12-15 20:09:48 +01:00
Wim Taymans
5e8a3afe17 handle cleanup of remote proxies
Destroying a resource informs the client to destroy the proxy.
Destroying an object destroys all the bound resources on it.
2016-12-02 17:14:32 +01:00
Wim Taymans
b969623ec8 Work on introspection 2016-12-02 13:38:43 +01:00
David Svensson Fors
497febf2f1 node: check links list in get_free_port()
When searching for an unused port, look for an empty links list.
2016-11-28 15:46:09 +01:00
Wim Taymans
046c2b1cae remove last glib bits
Improve pinossink
2016-11-26 19:18:51 +01:00
Wim Taymans
1d61fd3696 Work on async cleanup
Track all async changes and only perform free of resources when all
previous async operations completed.
2016-11-25 13:06:23 +01:00
Wim Taymans
efae64a759 Mainloop: use PinosLoop
Implement the main-loop with pinos_loop except for the parts that still
need to go through glib mainloop.
Start working on native protocol
2016-11-22 13:06:22 +01:00
Wim Taymans
e7cae649aa Use mapper to make object id
Reuse object ids by using a mapper
Simpify the uri struct a little.
2016-11-21 16:29:15 +01:00
Wim Taymans
80deb6b387 node: remove unused code 2016-11-21 12:59:47 +01:00
Wim Taymans
3dcbf4b228 Move suspend on idle in module
Move suspend-on-idle code from the node to a module
Add some more SpaLoop API
2016-11-21 12:54:40 +01:00
Wim Taymans
ae93f15965 Work on event loop
Make a new epoll based event loop and use it for the data tranport.
Simplify the spa event api a little and rename to SpaLoop
2016-11-18 17:46:01 +01:00
Wim Taymans
0d2fa5ebc8 cleanups 2016-11-16 17:21:59 +01:00
Wim Taymans
dfbfb4c9ee Rework dbus handling
Remove the Daemon object and remove all dbus code from the main
objects. We can use the signals in a separate module to create and
destroy the DBus interfaces.
Move the dbus protocol in a module
Move the autolink policy to a module
2016-11-16 16:57:47 +01:00
Wim Taymans
1a48bccca0 cleanups
Remove hastables, use lists
Remove obsolete ringbuffer
some small cleanups
2016-11-15 20:12:31 +01:00
Wim Taymans
b6ad45bb74 track client resources 2016-11-15 17:06:09 +01:00
Wim Taymans
0d21d633c9 WIP object model change
Work on cleanup
2016-11-15 13:29:58 +01:00
Wim Taymans
c25ccbb4ba WIP change object model 2016-11-14 12:42:00 +01:00
Wim Taymans
190f01d88e WIP
Change object model
2016-11-10 15:42:14 +01:00
Wim Taymans
d0f95fc323 Remove SpaQueue, use SpaList instead 2016-11-09 12:57:51 +01:00
Wim Taymans
89bc235924 Cleanups
Hide GDBus from RTKit API
Remove register node from dbus API
Add signal
Add object and register objects in the registry
Add some preregistered types to the registry
Let the daemon listen to the registry
2016-11-08 18:00:52 +01:00
Wim Taymans
e88a376d7c Optimize transport some more
We can optimize the transport some more if we allow the host to
configure the area used for transfering buffers. We can then also place
the current status in the area and avoid calling get_status(). We can
also allocate this area in shared memory, avoiding a memcpy in the
client-node.
2016-11-07 18:23:09 +01:00
Wim Taymans
b774b99db5 Rework transport protocol
Use a more simple tranport protocol for the realtime data. Use a piece
of shared memory and a socket where we use a 1byte read/write to trigger
remote actions. Also use a ringbuffer for events.
2016-11-07 10:24:13 +01:00
Wim Taymans
7e46f9e3ad More hacking
Move array and map to pinos
Move more things to spa lib
ControlCmd -> Message
Make pinos log, use for plugins as well
work on ringbuffer in alsa and nodes
work on making registry with all objects
2016-11-03 19:41:53 +01:00
Wim Taymans
a1c0bef2ed node: fix pause 2016-10-28 17:24:03 +02:00
Wim Taymans
3f4ccaaea2 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.
2016-10-28 16:56:33 +02:00
Wim Taymans
4148e0ff78 cleanups:
Keep lock while doing recycle_buffer
Pass context to main loop
Recycle WorkItems in a free list
Push and pull from the node data loop
Do async start/pause in alsa
Add alsa fds right after open.
2016-10-25 11:21:53 +02:00
Wim Taymans
73e6272488 node: keep separate array of links
Keep a separate array with the links that we only access and update from
the data-thread.
2016-10-24 18:01:04 +02:00
Wim Taymans
d3dd90bb05 simplify events and commands 2016-10-24 15:30:15 +02:00
Wim Taymans
0373f73bac Add invoke method to schedule executing in a main loop 2016-10-24 12:20:44 +02:00
Wim Taymans
1bd751372e Cleanups
Remove unused events, drained and marker can be done with
ASYNC_COMPLETED messages
Handle result of idle callback to disable the poll item
Identify poll items with a unique id.
Remove set_state vfunc
push_event -> send_command, commands are to do something, events are the
result of something.
Add poll item in v4l2 as soon as we have the fd but disable the item
until streaming starts.
2016-10-21 15:03:32 +02:00
Wim Taymans
9b2b4b9b5c cancel pending defers 2016-10-20 19:36:26 +02:00
Wim Taymans
8fac22afdb Work on main loop
Make a main-loop object with associated helper functions to handle async
methods.
rtloop -> data_loop
Handle async results a lot better.
Remove REMOVE_MEM command. We don't need it.
Handle stream memory updates better.
2016-10-20 16:36:29 +02:00
Wim Taymans
98dbb6424d Cleanups
spa_serialize -> pinos_serialize
Improve PinosPort, move links to the object and make it part of
PinosNode
Work on improving signals to react to changes in the graph
Error when a client-node becomes unlinked, like when removing a camera.
2016-10-19 17:18:30 +02:00
Wim Taymans
82414810e8 avoid deref
We can avoid a deref when we use container_of to get from the interface
to the handle.
2016-10-12 17:27:29 +02:00
Wim Taymans
2905d91467 Add poll interface and remove poll events
Use an interface to change items in a poll loop.
2016-10-07 17:10:46 +02:00
Wim Taymans
fc4fd1424a Add mapper
Ger rid of static ids for interfaces and replace with something we can
register dynamically
Implement logger.
2016-10-07 13:19:50 +02:00
Wim Taymans
d828073bb8 Add port direction again
simplify port numbering again by using 0->max_ports for bot input ports
and output ports. This means we need to tall what direction the port is.
Add port_info serialize functions
Copy metadata and data when we are not sharing buffers.
Make pinossink work again.
2016-10-03 19:48:24 +02:00
Wim Taymans
b208e8b690 Plug some leaks
Add maxsize to bufferdata in case the memory size can be variable such
as with encoded formats. Copy new size in the proxy.
2016-09-30 19:56:41 +02:00
Wim Taymans
9d4048e73a Enable header metadata
Enable the header metadata so that we have timestamps again.
Rework allocation in the link a little. Reuse previously allocated
buffers when possible. Keep track of where the buffers was allocated.
Make some more convenience functions to initialize buffer headers. Make
it so that we move allocations to the app.
Make some helpers to make memfd memory in pinos now that we will be able
to do all allocation there.
2016-09-30 17:07:38 +02:00
Wim Taymans
24108e01c1 mem: remove memory stuff
Remove the memory stuff from the spa API, we can do thing more simple
and efficiently if we always allocate buffers outside of the plugins and
only implement an alloc function on the node when it can do something
clever.
Move serialize code to the props/format/buffer code
Make it possible to copy a format and properties.
2016-09-29 18:18:59 +02:00
Wim Taymans
fe37e2bc1b Make PinosPort struct
Keep track of the ports, their links and the allocated buffers in a
small struct managed by the node.
2016-09-28 10:42:36 +02:00
Wim Taymans
c6861845a7 pass the client object around
Pass the client object around, it's easier to deal with than the sender
id.
Fix the ASYNC return check
Don't overwrite the fds of a pollitem, instead keep an index of their
position in the global fd array.
2016-09-27 16:59:45 +02:00
Wim Taymans
7b53fa8685 rt-poll: make small poll helper object
Remove the event loop code into a separate object so that we can share
the same loop for multiple nodes.
Some cleanups
2016-09-26 17:27:04 +02:00