Commit graph

2202 commits

Author SHA1 Message Date
Michael Tretter
fd00d16361 gst: add properties for limits of negotiated buffers
By default, the pipewiresrc tries to negotiate 16 buffers. This value is
hard coded in the pipewiresrc. If the buffers are large, this could lead
to an undesirably high memory usage. Applications that know about the
buffer size and that fewer buffers are sufficient should be able to
configure the limits for the number of buffers that are negotiated.

Therefore, add the min-buffers and max-buffers properties to the
pipewiresrc to enable applications to configure limits for the number of
negotiated buffers.
2020-04-13 07:42:35 +00:00
Wim Taymans
bfefd76055 stream: only call process when we have a dequeued buffer 2020-04-12 20:46:14 +02:00
Wim Taymans
b18dacde9a spa: improve draining
Make a new DRAINED status.
Place the DRAINED status on an input IO when a stream is out of
buffers and draining.
All nodes that don't have HAVE_DATA on the input io need to copy
it to the output io and return the status. This makes sure the
DRAINED is forwarded and nodes return DRAINED from _process()
DRAINED on the resampler flushes out the last queued samples and then
forwards the DRAINED in the next iteration.
Emit a new drained signal from the context when a node returns
DRAINED. Use this to trigger the drained signal in the stream.
2020-04-07 17:58:43 +02:00
Wim Taymans
fdb5911e86 resample: use a 0 sized buffer to drain 2020-04-06 18:01:38 +02:00
Wim Taymans
7927a66fdd tools: improve error reporting 2020-04-04 20:23:42 +02:00
Wim Taymans
a5b0553328 Fix some -Wenum-conversion errors
Make pw_direction and spa_direction the same
Explicitly cast some enums or use the right enums
2020-04-04 20:03:08 +02:00
Wim Taymans
ab3a6d3441 Fix some compiler warnings on arm 2020-04-03 13:18:02 +02:00
Wim Taymans
22e590c7cc stream: somewhat implement drain better
Abuse the xrun callback in the adapter to emit the drained signal until
almost all data left the resampler. This needs more work with a proper
signal and a buffer flag to signal the drain.
2020-04-02 17:46:50 +02:00
Wim Taymans
02dc407752 node: improve debug of activation area 2020-04-02 15:43:36 +02:00
Wim Taymans
c5be7642a3 context: don't recalculate graph for exported nodes
Exported nodes are managed by the remote end so we don't have to.
2020-04-02 15:42:21 +02:00
Wim Taymans
d1091462ab transport: init io_buffers with SPA_IO_BUFFERS_INIT 2020-04-02 15:36:56 +02:00
Wim Taymans
74ab04af26 client-node: use BUFFER_INIT to reset io_buffers 2020-04-02 15:31:58 +02:00
Wim Taymans
c20100eabb media-session: Add method to destroy a global
Destroy the stream when it is disconnected and it was marked as
DONT_RECONNECT.
2020-04-02 15:27:23 +02:00
Wim Taymans
a86f70c13d protocol-native: avoid destroying NULL source
The source might have been destroyed before.
2020-04-02 15:25:13 +02:00
Wim Taymans
b87c0a9270 clean up options
make sure we can use -v for verbose mode
2020-04-02 14:34:02 +02:00
Wim Taymans
7a29c15628 enable more warnings
Fix some warnings
2020-04-01 12:51:42 +02:00
Wim Taymans
b3bddb853f context: improve debug of quantum 2020-03-31 13:54:11 +02:00
Gleb Popov
b552863ec9 Don't include alloca.h on FreeBSD. 2020-03-31 12:16:45 +02:00
Wim Taymans
afb93eb6ea conf: add comment 2020-03-30 15:27:54 +02:00
Wim Taymans
2b7f01f5af media-session: add getopt support
Add options to media-session
Add an option to enable or disable modules
Add an option to set properties for later use
2020-03-30 14:09:44 +02:00
George Kiagiadakis
e00c0ffd2d tests: add endpoint unit test
This tests exporting a PW_TYPE_INTERFACE_Endpoint and binding
a proxy for it through the registry, verifying that info and params
are propagated properly from one to the other
2020-03-27 14:56:07 +00:00
George Kiagiadakis
e918d60959 session-manager: implement factories for session, endpoint-stream & endpoint-link
Heavily based on the endpoint factory
2020-03-27 14:56:07 +00:00
George Kiagiadakis
444d180218 session-manager: endpoint: implement caching info & params
The info structure needs to be cached because there is no way to
request it from the implementation, unless we hack the add_listener
API to be used for making info requests or add a new method that
will be used just in the implementation (both are bad ideas).

The params are cached because
1) a client doing enum_params + sync will not work correctly, since
 the sync call syncs with the server and not the implementation...
 we could block the client to solve that, but then there is also #2
2) the implementation is not aware of the clients and therefore
 it cannot keep track of who is subscribed and who is not, this
 needs to happen in the server. Then if we only keep track of the
 subscriptions in the server and keep requesting params from the
 impl, there is no way to know if a param event coming from the
 impl matches a call to enum_params or to subscribe or if it's
 just an update that needs to be forwarded to subscribers.
2020-03-27 14:56:07 +00:00
George Kiagiadakis
74718d6def session-manager: add update/free functions for the info structures 2020-03-27 14:56:07 +00:00
George Kiagiadakis
df66edd9ab session-manager: implement 'endpoint' factory
This is modeled after the 'metadata' factory and provides
a way to use the pw_endpoint interface directly to implement
an endpoint object in a client.
2020-03-27 14:56:07 +00:00
George Kiagiadakis
0a8ec0380b session-manager: check error code when registering the marshallers 2020-03-27 14:56:07 +00:00
George Kiagiadakis
e971a79fce session-manager: implement export functions for session-manager objects 2020-03-27 14:56:07 +00:00
George Kiagiadakis
234c642746 session-manager: move files into client-endpoint / client-session subdirs
To clean up space for the new implementation.
The existing code is exclusively for use with the client-endpoint
and client-session factories.
2020-03-27 14:56:07 +00:00
George Kiagiadakis
bc3a92e950 session-manager: add impl marshallers for endpoint, -stream, -link and session 2020-03-27 14:56:07 +00:00
Wim Taymans
b3d0aa6f8c pw-cat: allow latency=none 2020-03-26 11:34:59 +01:00
Wim Taymans
125f1f109c context: allow quantum up to configured max
Clip the quantum values between absolute min and max.
If a client selected a quantum, allow this to exceed the default
quantum up to the max-quantum.
If a client doesn't select a quantum, use the default.
2020-03-26 11:27:36 +01:00
Wim Taymans
7693834a81 pw-profiler: report error when we can't bind 2020-03-26 10:24:14 +01:00
Wim Taymans
413bda908a pw-cli: continue after parsed options 2020-03-25 18:00:50 +01:00
Wim Taymans
c292a6d54e pw-cli: add non-interactive mode
You can now pass a command to pw-cli and it will execute immediately
and exit.

Fixes #195
2020-03-25 11:17:02 +01:00
Wim Taymans
646088b90c tools: add getopt argument parsing
Add some help, version, remote options for tools
Add option for output filename in pw-profiler
Add option to start pw-cli as daemon or not, make it connect to the
default PipeWire instance by default (instead of local instance)
2020-03-24 16:36:48 +01:00
Wim Taymans
4c80656a7b examples: small improvements
Don't set EXCLUSIVE flag on video-play
2020-03-20 11:24:29 +01:00
Wim Taymans
67eb89689d stream: only warn about mlock when in RT mode
Only warn about mlock failure when the stream is configured to
operate in REALTIME mode.
2020-03-20 11:21:44 +01:00
Wim Taymans
0d3aa1fd30 Fix export type prototype
Pass the type as provided by the export type. This way we can
look up the owner of the export type later.
2020-03-19 18:12:07 +01:00
Wim Taymans
2948d504c8 example: fix v4l2 example
We need to emit a port param update to notify of new Buffer
parameters.
2020-03-19 18:08:34 +01:00
Wim Taymans
acccccd2c0 Use SPA_IO_BUFFERS_INIT when we can
We should not have to initialize the state to NEED_DATA, anything
that is not HAVE_DATA is good. Also we need to set the buffer to
INVALID because else it might be recycled.
2020-03-19 13:09:21 +01:00
Wim Taymans
6d673cc77c conf: update defaults 2020-03-18 17:53:46 +01:00
Wim Taymans
c4708f97ff examples: don't use lrintf for each sample 2020-03-18 17:40:26 +01:00
Wim Taymans
13d66df2df example: fix buffer size calculation 2020-03-18 17:23:14 +01:00
Wim Taymans
8a2af908a7 small optimizations
Add some SPA_LIKELY
Enable FASTPATH by default
2020-03-18 15:43:29 +01:00
Wim Taymans
72d70b0f48 Add and fix some more warnings
Fixes #216
2020-03-17 11:37:56 +01:00
Wim Taymans
cb7bfdf98a sprinkly SPA_LIKELY/UNLIKELY around 2020-03-16 12:52:28 +01:00
Wim Taymans
d762d57665 impl-node: the mix output port is always 0 2020-03-16 11:11:35 +01:00
Wim Taymans
e13e81881f examples: use dataType mask
Set the dataType mask to MemFd because that is what we can
produce. Check the negotiated buffer data types.
2020-03-09 18:05:51 +01:00
Wim Taymans
f94c24af97 buffers: negotiate dataType in buffers
Use the dataType in the Buffers param. It contains a bitmask
of compatible types between ports.
2020-03-09 17:44:42 +01:00
Wim Taymans
c66d60fbdb buffers: handle param enum errors
When filtering parameters, return an error when something went
wrong as opposed to 0. This way we can see if there was an error
or just no parameters.  Fail when there was an error negotiating
the buffer size because that means incompatible values.
2020-03-09 17:04:00 +01:00