Commit graph

120 commits

Author SHA1 Message Date
Wim Taymans
80cfda89c1 pod: improve the vararg pod builder and parser
Automatically parse and build key/value when in objects without having
to prefix the key with ":"
Automatically build control/value when in sequence without the "."
prefix.
Remove the builder with key/pod, taking a reference to the stack built
temporary pods is not allowed in c++. We can use the varargs version
with the same convenient syntax.
Remove the parser "*" option, it is unused.
Improve spa_pod_builder_add_* and spa_pod_parser_get_* and make them
look similar.
2019-01-16 11:05:12 +01:00
Wim Taymans
b95584c312 plugins: fix warnings 2019-01-07 18:14:04 +01:00
Wim Taymans
7bc9c1ebfe node: remove info from node interface
Replace with info event emited when callbacks are set. This makes it
easier to implement dynamic changes.
2018-11-26 12:41:40 +01:00
Wim Taymans
aade499aae fix TIMESPEC_TO_NSEC 2018-11-07 10:07:48 +01:00
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01:00
Wim Taymans
66de372e9a add node set_io function
Also allow setting io areas on nodes. We need this to set the
graph clock and period size on the nodes.
2018-10-23 12:31:41 +02:00
Wim Taymans
940c8645d3 remove property flags
Remove the property flags, we will add info about properties
with the param interface.
2018-09-28 17:44:14 +02:00
Wim Taymans
cc842cbdc8 Type changes
Only allow properties inside objects, this makes it easier to
iterate the object, which is needed for efficiently processing
control streams.
Add a choice type to mark variable properties.
SPA_TYPE_Enum -> SPA_TYPE_Id to avoid confusion with choice enum
Make it easier to allocate and initialize properties on the stack
Make more efficient methods to make objects.
2018-09-05 16:41:07 +02:00
Wim Taymans
ff6a244d8f Make media type and subtype properties
This is easier to debug and we only want properties in objects
in the future.
2018-08-29 18:08:52 +02:00
Wim Taymans
514528f2c7 format: make helper functions to create formats
Use helper functions to create a fully specified format.
2018-08-29 15:53:26 +02:00
Wim Taymans
80de83f38a format: make helper function to parse media type 2018-08-29 14:50:58 +02:00
Wim Taymans
90c1a95eef More type cleanups
SPA_ID_* -> SPA_TYPE_*. We use 'type' for all registered types.
ID refers to either a registered type or an enum.
Improve introspection of object ids. Make 0 an invalid enum and
use it to look up the object id type.
Move some type-info files together.
Swap type and id of the object, we first specify the type and then
the id because the meaning of the id depends on the object type.
2018-08-27 15:03:11 +02:00
Wim Taymans
d26aecfef2 More type fixes
Param ids and IO ids are now simple enums.
Move some type info in one place, delete some type-info files
Fix type debug
Make audio layout an enum
Mark more enums as enums in types so they show us with their names in
the debug.
2018-08-25 12:08:29 +02:00
Wim Taymans
805e3bb6c1 types: work on types
Move static pod types to type system
work on type info for types
Move the event and command ids to an enum to make it easier to extend
later.
2018-08-24 10:53:09 +02:00
Wim Taymans
fca3e1d85d Remove dynamic types
Do not use dynamic types anymore. The reason is that it's difficult:

- to maintain a shared type database over a network.
- the extra overhead when translating between processes and for
  maintaining the translation tables.
- race conditions in translating in RT-threads, this is a problem
  because we want to make event streams.

We now have simple enums with types and extension points for all
types. This is also nicer to use in general.
We don't need the mapper anymore or pass strings around as types.
There is a parallel type info system to get more info about ids and
enums and their hierarchy. It can also be used for debugging.
2018-08-23 17:47:57 +02:00
Wim Taymans
3b1c40f17f pod: move compare and filter functions out of the library 2018-08-14 14:52:32 +02:00
Wim Taymans
fba00fb791 clock: remove clock interface
Remove the clock interface, we need to get timing information with an io
area to get the required precision and performance.
2018-07-17 09:50:51 +02:00
Wim Taymans
c98fbfe0a9 meta: make safer find_meta_data function 2018-07-09 12:04:23 +02:00
Wim Taymans
de36330917 handle: make method to get size 2018-04-09 10:06:17 +02:00
Wim Taymans
33a322b96e graph: new scheduling model
Make explicit links between elements that are used to activate the
next element in the graph.
Make subgraphs a special regular node. Make a link from the
subgraph children to the parent so that the subgraph completes when
all the children completed.
Implement a single process function in plugins
Remove many messages in the client node
2018-04-03 16:29:36 +02:00
Wim Taymans
0e5a1b6327 props: use macro for property alternatives 2018-02-20 09:36:05 +01:00
Wim Taymans
e5e360d5df props: improve property introspection
Make a new PropInfo parameter that allows us to iterate all
properties. Make some new fields to set labels and names for
properties. We will be able to add more things to describe the
properties this way.
Use the Props param to simply query or set properties.
We can now make int enum properties and describe all possible
values with labels, we don't need to register types anymore.
This then makes it possible to enumerate the v4l2 controls and make
them available as control params.
2017-12-15 16:30:56 +01:00
Wim Taymans
a092b9312a Add control properties to audiotestsrc
Add control properties to audiotestsrc for frequency and volume
and add a test program.
Add size parameter to set_io for additional checks and to make it
easy to know how much control data we can write.
2017-11-22 14:30:04 +01:00
Wim Taymans
8efea3e1ea node: Add id to set_io
Make it possible to configure multiple io areas on a port by giving
an id to set_io.
Add some types to enumerate the supported ids
Make an area to exchange buffers and one to specify pull ranges.
The idea is to make more area types for controlable properties.
Implement enumeration of IO areas in volume.
2017-11-21 19:38:48 +01:00
Wim Taymans
4288a634f4 buffer: don't use ringbuffer in chunk
We can't use a ringbuffer on the chunk because it implies the
consumer would write to it to update the read position, which we
can't do because the chunk is read-only and might even be shared.
Go back to offset/size pairs, which can sortof do the same thing
if we want later when we keep a non-shared read pointer in the
consumer.
Keep alsa timestamp around and filled state for future.
mmap the input port meta/data/chunk as read-only.
Only do clock update requests when asked.
2017-11-21 12:42:27 +01:00
Wim Taymans
5bebfe022b cleanups
Follow the data/size argument order convention to make the api
more consistent.
2017-11-20 15:26:44 +01:00
Wim Taymans
2923b623b3 Meta: rework ringbuffer meta
ringbuffer: remove size and mask from the ringbuffer, we have that
elsewhere in the user of the ringbuffer.
Remove the buffer data offset and size fields and replace with a
ringbuffer. We then have a ringbuffer in all buffer data, which
simplifies things.
We can now remove the ringbuffer metadata.
2017-11-15 17:25:36 +01:00
Wim Taymans
52e1dad93e Improve pod filter
Reset the builder when the filter failed.
Make the plugins create their params in a temporary buffer, we
don't want to do in-place filtering because that is not always
possible. Because the filter now resets on error, we can remove
the reset from the plugins.
2017-11-14 10:17:45 +01:00
Wim Taymans
440f681f4b Improve enum_param
Add an argument to pass the result param to the caller instead of
having the caller have to pick it up from the builder.
Improve docs for node, clock and monitor
Pass spa_pod everywhere instead of spa_pod_object.
Pass result argument to spa_pod_filter to make things a little
nicer.
2017-11-13 17:57:38 +01:00
Wim Taymans
cd5e697e9f builder: make methods to save and restore state 2017-11-13 12:30:48 +01:00
Wim Taymans
6fb0f580ea Use errno for result errors
Make new enumeration for data transport status and use errno
style error numbers for errors.
2017-11-13 09:41:41 +01:00
Wim Taymans
dda28b1589 cleaup up the result codes 2017-11-10 16:11:53 +01:00
Wim Taymans
caaeaff223 Reorganise SPA tree
Reorganise the SPA includes to make it more extensible later
Simplify the naming of the buffer and meta params
2017-11-10 13:36:14 +01:00
Wim Taymans
58451d626c Implement param filtering
Make a new pod filter function and use it in the plugins to filter
in enum_params.
Small tweaks to the pod_builder
2017-11-09 17:16:54 +01:00
Wim Taymans
30a4651c51 Various fixes and improvements to enum_params 2017-11-08 11:22:42 +01:00
Wim Taymans
4d890a2d98 small cleanups
Remove the temp storage for formats and props now that we get a builder
from the host to write into.
2017-11-07 20:28:07 +01:00
Wim Taymans
f3bca48398 Unify props, params and formats
Make enum_params and set_param to configure properties, format
and other parameters. This allows us to remove some duplicate
code and make the properties and parameters much more extensible.
Use the object id to mark the id of the parameter.
Remove the spa_format and spa_props.
We can now make the client-node easier by merging the various
format methods into the params.
Make the stream API more powerful now that we can pass params
around.
2017-11-07 17:48:40 +01:00
Wim Taymans
530caf35db *testsrc: async == live for now 2017-10-18 10:04:31 +02:00
Wim Taymans
24d80e5c00 Add new pod parser and builder
Add a new pod builder and parser that is less verbose and
a little more powerful.
2017-09-28 17:00:51 +02:00
Wim Taymans
dc85a79786 Add more generic export-spa example
Replace the v4l2 example with a more generic version that can add
any spa node to a remote graph
Make the dictionary items const
Add some info to nodes and factories. Add the node info to the node
properties. We can then set the media.class directly on the node,
instead of letting the monitor set it.
Debug node info in spa-inspect.
Do async operation on the audiotestsrc and videotestsrc differently.
2017-09-07 19:55:22 +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
6953642ed5 small cleanups 2017-08-27 09:16:03 +02:00
Wim Taymans
0602d76b9e Cleanups
Only pass data to callbacks.
Rename some structs
Provide methods to access structs
2017-08-06 06:42:26 +02:00
Wim Taymans
3d9f28c676 Use remote to join nodes on remote graphs
Make a new method that can take a local node and run it in a remote
pipeline. This basically replaces all functionality of the streams
and more.
Add 2 examples for exporting a sink and a v4l2 node
Make some more things const
Cleanups
Make it possible to do things when the node needs scheduling. The
default node will schedule the local pipeline but the remote node might
also schedule the remote pipeline.
2017-07-25 19:52:31 +02:00
Wim Taymans
3b5a308645 link: improve renegotiation
Only suspend an idle node when we need to configure a different format.
2017-06-20 16:22:25 +02:00
Wim Taymans
763bd1100e Add user_data to callbacks
Add user data to callbacks, it's more flexible and natural
2017-06-18 19:48:31 +02:00
Wim Taymans
c3b73ba47d Add versions to structures
Use versions instead of size
Remove user_data from callbacks, we can simply pass the callback struct.
2017-06-14 18:32:39 +02:00
Wim Taymans
0f6b3a7cab indent 2017-05-26 09:09:31 +02:00
Wim Taymans
d1a06ae247 indent -kr -i8 -l100 2017-05-25 16:23:13 +02:00
Wim Taymans
11f23a3ffa spa: don't use typedef for struct and enum 2017-05-25 13:28:15 +02:00