Commit graph

47 commits

Author SHA1 Message Date
Wim Taymans
085fd536be daemon: make flags parse like an array 2021-02-08 17:30:26 +01:00
Wim Taymans
579e8a4ea6 json: allocate one extra byte for the \0 2021-01-19 16:56:55 +01:00
Wim Taymans
23fd40df94 daemon: support containers as arguments
so that

ags = "foo=bar baz=5"

can be written as:

args = { foo = bar baz = 5 }
2021-01-17 14:56:23 +01:00
Wim Taymans
7eac9874f0 daemon: add nofail option to the modules section
Use nofail on rtkit when it's not available.
2021-01-14 15:06:24 +01:00
Wim Taymans
5f66650f7c daemon: don't pass (null) as argument 2021-01-11 20:40:26 +01:00
Wim Taymans
49d11acde0 daemon: rework config parsing
Replace config parsing for something more flexible based on json.
2020-12-31 16:44:35 +01:00
Wim Taymans
6a244592a0 main: set PIPEWIRE_INTERNAL env
So that we can detect if we running in the daemon
2020-11-19 12:36:14 +01:00
Wim Taymans
3586f918c5 main: make the default remote if nothing is specified 2020-07-24 17:23:00 +02:00
Wim Taymans
141238d88b core: always use explicitly configured properties first
First use the configured properties, then use the env variables.
Make the daemon use the env variable by default.

This makes it possible to start servers with PIPEWIRE_CORE env variable
names but still override with the command option.

Makes it possible to make apps connect to PIPEWIRE_REMOTE env by
default and allows you to override with the command option.
2020-07-23 13:40:02 +02:00
Wim Taymans
00d61d958e add pw_deinit() to cleanup resources
Add and use pw_deinit() to avoid leaking the support plugins and
use this in the main daemon. Makes valgrind output better.
2020-06-02 17:16:46 +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
c4b2be2aad use true and false for boolean properties
So that it's easier to convert them to booleans in introspection
code later.
2020-03-03 18:17:46 +01:00
Wim Taymans
aa36a72427 main: handle execv failure
Log an error, exit daemon
2020-01-08 12:38:46 +01:00
Wim Taymans
698ab911c3 loop: pass spa_dict to *_loop_new
Make the thread_loop alloc its own loop by default to simplify
some core. Add extra new_full method to pass a custom pw_loop.
Make other loop implementations ready to support custom loops
if we want that later.
2019-12-13 11:34:25 +01:00
Wim Taymans
a1451fd820 keys: rename key for the module profile 2019-12-12 16:32:44 +01:00
Wim Taymans
d70a47b7fe move proxy implementations in their own file
Rearrange headers
2019-12-11 10:58:51 +01:00
Wim Taymans
8ea78c2e3f pw_core -> pw_context
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.
2019-12-10 18:19:56 +01:00
Wim Taymans
1ba5a17236 core: add PW_KEY_CORE_PROFILE_MODULES
Let the core load a set of default modules.
Add a key to control what default set to load, falling back to a
reasonable set. Make the daemon not load any set and rely on the
config script to load modules.
2019-12-05 16:17:42 +01:00
Wim Taymans
9ffec214b8 fix includes 2019-10-25 15:01:02 +02:00
Wim Taymans
6a8fe43a0c improve debug 2019-08-14 11:44:16 +02:00
Wim Taymans
03eeb945f3 daemon: add support for properties in the config file
Make a set-prop command to set a property from the config file
into a pw_properties. Pass this to the pw_core_new() and the
main-loop to tweak some stuff.

Move some warns to errors
2019-06-20 15:19:28 +02:00
Wim Taymans
5850044599 improve error handling 2019-06-18 16:55:37 +02:00
Wim Taymans
92d7da0103 daemon: only use properties on core 2019-06-06 15:05:37 +02:00
Wim Taymans
3ad73f0532 keys: add keys.h with defines and docs
Add a keys.h file that lists and documents all keys available to
be used in properties.
2019-05-24 15:47:48 +02:00
George Kiagiadakis
27e997a032 daemon: getopt returns int, declare it as such to avoid comparison issues
On some toolchains/architectures, a char with -1 value is not equal
to the integer -1, resulting in this code to think that it got
an unrecognized command line option
2019-02-13 11:23:18 +01:00
Wim Taymans
979d155382 core: add user_data to core 2019-01-08 17:32:37 +01:00
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01:00
Wim Taymans
f287cea9e8 daemon: add some options 2018-08-16 18:25:30 +02:00
Wim Taymans
4d6ac37398 Use int instead of bool as result
Prefer to use an int return from a function instead of bool because
it can contain more info about failures.
2017-12-18 11:38:30 +01:00
Wim Taymans
93a52f4837 Simplify node activation
Don't directly expose the state change methods. Only expose an activate
method for nodes that indicates if the node should be scheduled or not.
Let the link automatically negotiate two active nodes.
Make some defines for properties.
Use link property to make passive links. Passive links don't activate
the nodes.
Make sure the mainloop quits when quit is called before run.
2017-09-18 20:42:55 +02:00
Wim Taymans
21cd5a2918 Add example to play sine wave
Various build fixes and cleanups
Move port_add to private and make node ports based on implementation.
Improve pull based scheduling on remote nodes
2017-09-07 10:22:32 +02:00
Wim Taymans
c25834a692 Work on cleanup
Add signal handlers for daemon to shut down
Add destroy listeners for modules and do cleanup
Fix some leaks
Simplify port registration in new nodes
Hide some more data structures
Let the node implementation take care of the reuse_buffer signal because
then we can get to the graph nodes to find the destination port.
Destroy modules in core cleanup. Modules should undo everything they
have done.
Activate the link after we negotiated format and buffers.
2017-08-22 18:30:10 +02:00
Wim Taymans
eeda53dbef Fix leaks
Add some docs
Add properties to loop objects for future use
2017-08-08 18:24:15 +02:00
Wim Taymans
b898eb46cd Make structure private
Make structs private. Expose methods for things we need.
Signals only work on exposed structures so make a new callback helper to
signal events.
2017-08-04 10:18:54 +02:00
Wim Taymans
83b4eaca53 Pass some more properties around
Only start listener when core is a daemon.
2017-07-11 20:38:48 +02:00
Wim Taymans
d1655196c3 move things around 2017-07-11 16:08:22 +02:00
Wim Taymans
cdb2028f9b src -> pinos and fix include paths
Rename src to pinos and fix all the include paths so that they contain
pinos/ to avoid conflicts
2016-02-01 15:40:48 +01:00
Wim Taymans
31da833069 properties: pass PinosProperties around
Pass PinosProperties around instead of GVariant. This is much easier to
deal with.
2015-07-17 16:57:01 +02:00
Wim Taymans
a3505fb880 more rename PV -> PINOS, Pv -> Pinos, pv -> pinos 2015-07-07 16:46:23 +02:00
Wim Taymans
4b72848a1a Rename pulsevideo to pinos 2015-06-30 18:06:36 +02:00
Wim Taymans
f50d1548d5 Add more generic gst source manager object
Use device manager to add/remove all video providers dynamically, remove
v4l2 specific code.

Get the client proxy from subscribe instead of waiting for the
subscription callback. This way we can actually make an error on
failure.

Clean up the objects when the server disappears.

Remove subscription from the server, we don't need it. Install server
objects in bus_acquired.
2015-05-21 16:49:26 +02:00
Wim Taymans
d9444ab360 Make source and source-output server side only
Move source and source-output to the server side again.
Make the daemon track objects per sender so that we can remove them
when the sender disappears.
2015-05-05 18:20:32 +02:00
Wim Taymans
592e99a317 Add gstreamer source element
Add a source gstreamer element
Expose error in context
Make it possible to set the source in the error state
Add properties to a stream and use those to get a source-output
Fix signal for new-buffer
Attach the socket source to the thread default mainloop
Make subscribe cancellable.
Propagate state and error in context.
Add bus handler for v4l2 source
Use negotiated properties to set capsfilter in v4l2
Fix subscribe in test-client
2015-04-28 17:36:44 +02:00
Wim Taymans
417cd76f3e subscribe: rework some more
Track senders in the subscribe object and aggregate events from all
connected clients. This allows each client to get a complete view of all
the objects of pulsevideo. With all the source objects available, we can
then to the selection of the source on each client.

Remove the CreatSourceOutput on the Client1 object but let the client
select a good source and call CreateSourceOutput directly on the source.
This avoid going through the server to get a connection and the client
can just as well select a source.
Add a state property to the source and make it such that it can do async
state changes.

Remove the source provider object, each client can now directly see the
objects of another clients so there is no need for intermediate objects
in the server.
2015-04-27 09:05:14 +02:00
Wim Taymans
09de2d3db9 handle remote and local sources better
Track remote and local sources separately and make SourceProvider1
interfaces for remote objects so that we get the subscription right.

Move disconnect from the Manager1 to Client1 interface and implement
in the context.
2015-04-20 17:24:58 +02:00
Wim Taymans
8b02c9040a pulsevideo: add gstreamer elements
Add custom gstreamer elements to pad/depay
Add pv_init() to register new elements
2015-04-16 19:45:26 +02:00
Wim Taymans
3fba92fb74 Initial commit 2015-04-16 16:58:33 +02:00