Commit graph

71 commits

Author SHA1 Message Date
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
Wim Taymans
67dd3adb87 port to meson 2016-09-26 12:15:52 +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
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
49cfe41c94 audiotestsrc: add timestamps 2016-09-19 19:29:35 +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
Linus Svensson
fc7b4a9009 videotestsrc: Draw smpte test pattern + snow 2016-09-19 09:25:18 +02:00
David Svensson Fors
68e81198ed Add videotestsrc 2016-09-19 09:21:08 +02:00
Wim Taymans
bd7009756c alsa: aad alsa source and monitor 2016-09-19 09:16:58 +02:00
Wim Taymans
2bf322ee71 Handle error cases
Add a link state
Add error quark
Track the state of node we create and error when it is in error.
Handle stream error states when negotiating
Make the node error when a link is in error
2016-09-16 13:13:41 +02:00
Wim Taymans
6497c82a7d Use v4l2 monitor
Use the v4l2 monitor to dynamically add and remove nodes.
Use the info from the monitor as parameter for the factory init and use
it to configure the new node.
Add info to the node.
Use info from the factory as properties on the PinosNode
2016-09-15 17:51:34 +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
36bcdaa4bc improve state change 2016-09-12 15:25:53 +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
463954a299 cleanups
Remove some unused things.
Work on shutdown.
2016-09-01 10:04:25 +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
55c3262a6a add node-update support 2016-08-09 16:58:41 +02:00
Wim Taymans
45ee7b4490 remove more unused stuff 2016-08-09 16:46:59 +02:00
Wim Taymans
ad71c82159 remove hardcoded negotiation
Remove the hardcoded negotiation and replace by filtering accepted and
possible formats. Not quite correct yet because v4l2 doesn't actually do
filtering yet.
2016-08-09 15:53: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