Commit graph

45 commits

Author SHA1 Message Date
Wim Taymans
5825c62d6d types: more work on types 2017-03-24 11:40:58 +01:00
Wim Taymans
acedfe71c0 clean up types 2017-03-23 21:15:52 +01:00
Wim Taymans
4d9f2c5161 event: make events dynamic
Use uri for the events.
2017-03-21 20:39:20 +01:00
Wim Taymans
03292fd80f audio: make audio format an uri type 2017-03-21 16:50:44 +01:00
Wim Taymans
c951264fff spa: make events and commands as objects
So we can serialize and introspect them more easily
2017-03-15 16:21:05 +01:00
Wim Taymans
f92b68c3c3 Use types with known sizes where we can, easier to serialize
Add iterator for POD and use it to implement some demarshalling.
2017-03-07 11:56:43 +01:00
Wim Taymans
9dd826136d update properties 2017-02-28 10:48:53 +01:00
Wim Taymans
16b62de53a Rework formats
Use a POD for the format body. This allows us to more easily build
and copy the formats.
Remove obsolete code to make video and audio formats.
Use SpaVideo/AudioInfo to keep track of formats. Make functions to parse
the format into the structures.
Update plugins
2017-02-24 09:28:18 +01:00
Wim Taymans
fd5f0d96f3 improve states 2017-01-19 20:07:03 +01:00
Wim Taymans
0398f997d7 cleanups
Update some docs
Remove special structs for some events
Remove some unused flags
Update some plugins
2017-01-19 18:10:00 +01:00
Wim Taymans
7a9dc2c4fd optimize data transport
Remove queue and ringbuffer between nodes. transfer the buffer id
directly between the io areas when possible.
Let only pinos send push or pull requests for now.
Allow polling multiple fds, like how alsa wants it
Remove port_id from events.
2017-01-18 18:29:15 +01:00
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
f5dbdbc0df Improve process_output
process_output is now to finish processing of the output in async nodes,
which means we need to fill the io area before sending the HAVE_OUTPUT
event. This simplifies some things and improves performance because we
don't need to deal with queues and additional checks.
2016-12-20 18:10:50 +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
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
d0f95fc323 Remove SpaQueue, use SpaList instead 2016-11-09 12:57:51 +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
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
d3dd90bb05 simplify events and commands 2016-10-24 15:30:15 +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
06765a2dea Add fd to the data
Add the fd to the SpaData so that we can noth use the fd and the mmapped
memory when we want instead of needing to mmap again in the plugin.
various cleanups
2016-10-04 20:17:12 +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
27acab7532 Improve memory handling
Reserve 0,0 for stack allocated mem that we never free
Improve allocation in the link
Parse format and properties in-line, there is no need to allocate
memory.
Improve buffer cleanup in alsa
Add timestamps and offset to alsa
2016-09-20 19:52:05 +02:00
Wim Taymans
77f93e37ed Cleanups 2016-09-20 11:20:43 +02:00
Wim Taymans
4b83d6cfc8 videotestsrc: remove threads
Remove the threads from the element and use timerfd to schedule timeouts
Propagate live flag between node links
2016-09-19 19:17:59 +02:00
Wim Taymans
1e565a5f65 audiotestsrc: add live mode
Add a live mode to audiotestsrc by using a timerfd to push output.
Make a queue helper and use in alsa
Add live port flag
2016-09-19 13:14:14 +02:00
Wim Taymans
bd7009756c alsa: aad alsa source and monitor 2016-09-19 09:16:58 +02:00
Wim Taymans
36bcdaa4bc improve state change 2016-09-12 15:25:53 +02:00
Wim Taymans
8ada6736c0 Cleanups
Make events and command specific to the node
Remove some unused code
Improve state changes
Use easier fixate by just taking the element default value
Fix reuse buffer in the proxy
2016-09-06 16:43:37 +02:00
Wim Taymans
7aa79a2a0d Add audiotestsrc
Work on idle poll
Move node state to the node interface so that we can actually get it in
the sync case.
Add enabled field to the poll event
Work on audiotestsrc
2016-09-05 16:23:40 +02:00
Wim Taymans
9485bd77e7 Remove direction
Direction is tied to the port id.
Handle nodes with fixed ports.
2016-08-29 18:31:53 +02:00
Wim Taymans
a973007a49 Fix up audio formats as well 2016-08-26 19:22:50 +02:00
Wim Taymans
ca7d08c406 Work on sink
Remove _remove from properties, we can do the same with set of a NULL
value.
Add signals to the stream API to manage the buffers. Wrap those buffers
in a GstBuffer in the pinossrc and pinossink elements and pool them in a
bufferpool.
Remove SPA_EVENT_TYPE_PULL_INPUT, we can do the same with NEED_INPUT and
by using a ringbuffer.
Do more complete allocation of buffers in the link. Use the buffer
allocator if none of the nodes can allocate.
Follow the node state to trigger negotiation and allocation.
Remove offset and size when refering to buffers, we want to always deal
with the complete buffer and use a ringbuffer for ranges or change the
offset/size in the buffer data when needed.
Serialize port_info structures as part of the port_update
Print both the enum number and the name when debuging properties or
formats.
2016-08-24 16:38:51 +02:00
Wim Taymans
a03352353f work on sink 2016-08-18 12:43:25 +02:00
Wim Taymans
3ace7e9648 More work on implementing remote protocol
Rework things so that we negotiate buffer pools beforehand and only pass
buffer ids around We can then remove the refcount of buffers, events and
commands.
More work on buffer reuse
Use the node state changes to trigger the next step in the configuration
sequence.
Move most of the client-node to a plugin
Do buffer allocation in the port link.
2016-08-02 16:34:44 +02:00
Wim Taymans
05829f33e6 Work on memory allocation
We now only allow per port preallocated buffers. We exchange the index
into the array instead of passing the buffers around. We still use the
refcount to track when a buffer can be reused.
Improve API a little, allow passing the node as the first argument of
the interface call.
Implement alloc_buffer in v4l2 and improve the test.
2016-07-30 20:35:34 +02:00
Wim Taymans
61caf0e19c buffer: add ptr_type to the data
We can give more info about the memory or fd that way and we can also
pass other structures as data later if we need to.
2016-07-25 10:50:46 +02:00
Wim Taymans
5fa334a89b poll: remove threads from alsa-sink
Remove the thread from alsa sink and use the pollfd event.
Make it possible to pass multiple fds in one pollfd event
Add 3 callbacks to the pollfd event and add support for timeouts
2016-07-25 10:50:05 +02:00
Wim Taymans
a31eb56663 More hacking
Add beginnings of Xv plugin
Add Poll event
Clean up props handling
V4l2 add beginnings of poll event
2016-07-25 10:50:05 +02:00
Wim Taymans
a1a27328e2 v4l2: continue work on the capture device
Remove activate and deactivate commands.
Add STEP property range type for v4l2 frame sizes later
v4l2: implement negotiation and data capture
2016-07-25 10:50:05 +02:00
Wim Taymans
3c029cba53 more hacking
Move plugin API to separate directory for now
Add ringbuffer and way to get ringbuffer from a port
2016-07-25 10:50:05 +02:00