Commit graph

65 commits

Author SHA1 Message Date
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
d3dd90bb05 simplify events and commands 2016-10-24 15:30:15 +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
becae3e7fa use dictionary for extra port info 2016-10-14 10:42:02 +02:00
Wim Taymans
523868d6bd Remove description
Documentation should go somewhere else
2016-10-13 19:25:49 +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
49dae17dfb Add logger
Add logger interface
Make it possible to pass extra interfaces to the element at init time,
such as a logger.
2016-10-05 17:43:11 +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
b8f693ceea More work on memory
Add explicit DMABUF memory because we can't use it like an fd in v4l2.
mmap random fd memory and use userptr in v4l2 to use it.
Allocate buffer data memory in memfd when no node can allocate.
Improve debug some more
2016-10-04 16:26:06 +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
1ba10cf848 Remove some events
Remove port added and port removed, we can get that info by inspecting
the port ids.
Remove data from ringbuffer, we just need the ringbuffer to keep track
of the read and write positions.
Handle async-complete in the main thread
Work on async node initialization
Work on using a queue as the link between nodes
Make the daemon link things based on the node states
Use queue helper in v4l2
2016-09-23 17:08:20 +02:00
Wim Taymans
68148188fa Add support for async results
Add an async result code and an event to signal the completion.
Use async return values to signal completion of a method and potential
state change.
Add selected format to port update message.
Make it possible to parse into a custom copy of the command memory.
Remove state change events from the elements, we now just update the
state.
Implement async results in the proxy element
Add support for removing buffers in the client.
Fix up pinossink
Deal with async return in the links.
2016-09-22 09:08:44 +02:00
Wim Taymans
77f93e37ed Cleanups 2016-09-20 11:20:43 +02:00
Wim Taymans
9f53eda6cb Add monitor interface
Add an interface to monitor devices and helper program
Add v4l2 monitor
Add simple dictionary with key/value pairs
2016-09-15 11:49:34 +02:00
Wim Taymans
140f360cc0 v4l2: small cleanups 2016-09-14 09:45:51 +02:00
Wim Taymans
b75d9786d4 pinossrc: handle latency and liveness
Use NULL filter when the port format enumeration returns nothing.
Send clock update even when there is no clock.
Don't send data to a port when the node is not streaming
Add latency support to the clock update
Copy the unset_mask when copying the formats
2016-09-13 17:43:57 +02:00
Wim Taymans
021eccb8ad Fix stream restart
Make sure we always send a clock update before sending a start command.
Fix memory size.
Follow the state of the node to do allocation
Use the pinos node to control the state
When doing STREAMOFF, all buffers will be dequeued. requeue them buffers
for when we go to playing again.
2016-09-13 10:34:32 +02:00
Wim Taymans
f86b50d202 add clock
Add a gstreamer pinos clock that reports the time at the server
2016-09-12 12:28:51 +02:00
Wim Taymans
0b380dd43e Add suport for clocks
Add a clock interface to get raw clocking information from an element
Make events and commands to request and configure clock updates.
Add support for passing events and commands in control
Set the size of the buffers in pinossrc
2016-09-09 16:05:58 +02:00
Wim Taymans
a5f21576fa Cleanup audio format 2016-09-08 12:32:30 +02:00
Wim Taymans
829adbab59 Add h264 format
Improve format support
Remove the type from the value because we can find that from the
property info.
2016-09-07 16:25:31 +02:00
Wim Taymans
648e5a299b v4l2: fix negotiation with missing framerate in filter 2016-09-07 13:48:10 +02:00
Wim Taymans
64ad745437 v4l2: implement enum_formats with filter
Use the filter to query the device and return a filtered result.
2016-09-07 13:43:14 +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
7d3e46e7f9 Remove port
Remove the port object. We don't use it as a dbus object and we don't
need it, we can use the link and node object directy.
Move poll code and event handler to the node.
2016-09-02 19:51:23 +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
4cf6860752 cleanups
Remove old files
Use set/unset macros to change properties
2016-08-29 10:54:43 +02:00
David Svensson Fors
c8830adaa3 v4l2-utils: invert frame interval to get framerate 2016-08-29 10:22:53 +02:00
Wim Taymans
a3e75a1de3 fix compiler errors 2016-08-29 10:18:51 +02:00
Wim Taymans
ee17176faf improve format support 2016-08-26 20:26:34 +02:00
Wim Taymans
a973007a49 Fix up audio formats as well 2016-08-26 19:22:50 +02:00
Wim Taymans
b67c216a04 Make new USE_BUFFERS command
Make a new USE_BUFFERS command to atomically send a buffer array to the
remote client. We can use this to then clean up an old array and go to
the PAUSED state if possible.
Work on formats. Make one structure that can hold all video formats.
Work on pipeline suspend and resume.
Add jpeg support to v4l2.
Work on enum_formats with a filter in v4l2.
2016-08-26 17:43:48 +02:00
Wim Taymans
7e858ff694 Improve state handling
Improve the state handling in v4l2
Send buffers in one message
Update design doc
2016-08-25 17:07:40 +02:00
Wim Taymans
fbd6304663 Cleanups
Remove old code
Only depend on GStreamer for the plugins
Rename STOP to PAUSE because that's what it really does
Start working on format_fixate.
Remove default property value from props
Fix framerate
2016-08-25 14:10:38 +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
ab0537305f handle set_format with existing format
If one calls set-format with the current format, we return success
Remove some unused utils now
Work on cleanup of buffers
2016-08-11 11:20:12 +02:00
Wim Taymans
0d2f5a1386 work on port-update control message
Serialize format and properties.
Simplify the properties by moving the unset-mask inside the property
structure. We can then also just use the index of the property as the
bit in the mask.
Work on stopping on disconnect
2016-08-08 22:10:57 +02:00
Wim Taymans
de53315f6e Work on node creation
Implements the basics of the PORT_UPDATE control message
Add the ports to the proxy node with whe PORT_UPDATE control message.
Let the proxy node check the events and create dbus objects based on
added/removed ports.
2016-08-05 19:46:37 +02:00
Wim Taymans
ac5d22ec79 Work on negotiation
Add helpers to convert between pinos and gstreamer formats.
Use pinos formats in the API.
Work on removing some hardcoded stuff and instead use the real format
from the pinos server.
Use memfd and sealing.
2016-08-05 16:39:26 +02:00
Wim Taymans
dd1fbef28f work on memory references
Add a memory reference helper struct that we can use to track the memory
in buffers and formats.
Remove custom property get and set, the default ones will work fine.
Custom ones are problematic when we want to serialize properties in
formats etc.
Deserialized Formats are now tracked in the memory pool and can be freed
if needed.
2016-08-04 19:24:16 +02:00
Wim Taymans
8f9222bf9e implement set_format
Serialize the formats
Use SpaMemoryRef where we can
Add more debug
2016-08-04 17:33:49 +02:00
Wim Taymans
98679cbd53 make test app work again
Some cleanups and removal of unused code
2016-08-03 22:11:03 +02:00
Wim Taymans
1169c2419b Make buffer data point to memory blocks
Make buffer data point to a registered memory block by its mem_id.
Add some more helpers to allocate memfd backed memory.
Allocate buffers in memfd so that we easily share them between client
and server.
Update pts and seq in v4l2 now that this change will actually be visible
at the client.
2016-08-03 21:33:57 +02:00
Wim Taymans
98993c680b Make buffer structure sharable
Use stucture offsets instead of pointers so that we can share the buffer
structure between client and server.
We can then pass an fd wrapping the memory of the buffer to the client.
Add beginnings of a memory pool
2016-08-03 15:59:17 +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