The proxy API is the one that we would like to expose for applications
and the other API is used internally when implementing modules or
factories.
The current pw_core object is really a context for all objects so
name it that way. It also makes it possible to rename pw_core_proxy
to pw_proxy later.
The pw_remote object is really a wrapper around the pw_core_proxy.
The events it emits are also available in the core proxy and are
generally awkward to use.
With some clever new pw_core_proxy_* methods and a pw_core_connect
to create the core_proxy, we can convert all code away from pw_remote.
This is a first step in this conversion, using the pw_remote behind
the scenes. It leaks into some places because it really needs to become
its own struct in a next step.
Change node.priority to priority.session to indicate that this
is the priority that the session manager uses to select the node.
Add another priority.master that the core uses to select a master
driver. Keep the driver nodes sorted by master priority.
Let jack always prefer to connect to the master driver nodes.
Send suspend to the node when suspending. This is usually the same
as puse for all nodes.
Implement negotiation when we Start audioadapter. This makes it
easier that to track the ports that are negotiated for now.
Use Suspend to clear the audioadapter negotiation.
Reorganize some things, let the clients update the segment info
in their own activation, then let the server merge it. This avoids
clients stepping on eachother. When looping through the clients,
copy the segment info when we encounter its owner.
Remove the list of segment owners to the activation. This is better
than in the activation because we can then just keep one list of
owners.
Remove the NONBLOCK flag from the eventfd so that we can do blocking
reads as well.
Just keep a reposition owner in the driver activation. This points
to the node that has the reposition info. This avoid complicated
synchronization to keep multiple nodes from stepping on eachother.
Now they can just prepare the reposition info in their activation and
set themselves as the reposition owner. The last one who succeeds
wins.
When the node latency property is changed, trigger a graph recalc
to set the new quantum if needed.
Also update the driver quantum when unassigned nodes are assigned
to a driver.
This makes it easier to keep track of who is responsible for what.
Also remove the valid fields and move them to flags in the segment
info. That way, the owner can update the flags without having to
worry about concurrency.
Keep separate info for the reposition information. We need to do this
to make it possible to seek in other formats than the frame.
Clear out the owner field when the node is destroyed or removed from
the driver.
Place the requested sync and position update flag in the node
activation. This way we can use our existing loop to update the node
sync states and check if the node is ready.
Implement sync timeout, when the client can't start or seek within the
timeout, we start RUNNING anyway and hope the client catches up.
Sync is enabled when clients need time to move to a new location.
It's a bit like GStreamer preroll after a seek. Clients that need
time, increment the sync_total. Whenever a seek is done, the server
waits in the Starting state until the sync_pending is 0 (or timeout
later).
Improve atomic operations
Add an offset to apply to the clock time before we can compare to the
segment values. This way we can keep the segment start independent of the
clock values and we only need to adjust the offset when paused. It's
like the base_time in GStreamer to calculate the running time.
Move fields from the io_position to io_segment. The segment contains
the mapping between raw clock time and stream time in various
formats. We keep an array of pending segments available in the
io_position field so clients can anticipate changes.
Make looping a flag in the segment instead of a state.
Prepare for segment masters. These will be registered clients that
are responsible for updating parts of the extended segment info.
Add namespace to some defines.
Move some things around. Move the duration of the current cycle
to the clock. Also add the estimated next timeout to the clock.
Add a generic media specific counter to the clock.
Clean up the position_bar info. We can do with only a double beat
value and make the signature in floats.
Flesh out the io_position info. This has now the information needed
to convert a raw clock time into a stream time. It basically has
the same kind of features as GStreamer segments such as looping,
variable rate playback etc.. It also contains the state of the
timeline (paused/playing) and it can be used to update the position
and state from clients.
There is also extended information in the position field that
clients can update when they can.
Plugins basically only update the clock info they get (and use
the position info to check if they are slaved or not).
Before each cycle, check if there is a pending position update and
apply it.
Remove the parent_id from the global event. Remove the parent
and owner from the global object.
Use properties instead to mark parents and owners of objects.
Properties are easier to control for client exported objects and
usually a simple parent/child is not enough. For example, a client
exported node has the client as a parent but also the factory that
created the node.