summaryrefslogtreecommitdiff
path: root/spa/tools
AgeCommit message (Collapse)AuthorFilesLines
2019-03-01interfaces: make events return voidWim Taymans1-6/+3
Events are dispatched with hooks and have no return value. Make it possible to get the last resource and proxy sender value for where we need it.
2019-03-01node: make add_listener methodWim Taymans1-20/+20
Make struct spa_node_events for events emited from the main thread and keep the spa_node_callbacks for the data thread callbacks. The add_listener method installs the events and it's possible to install multiple handles. Adding a listener first emits the info and port_info events when installed, similar to how the PipeWire proxy bind works. This removes the need for the spa_pending_queue and makes it easier to implement the _sync versions. Add some helpers to make it easier for plugins to emit all the info to new listeners. Use the listeners for devices as well.
2019-02-27node: add port and node paramsWim Taymans1-80/+70
Add a new struct spa_param_info that lists the available params on a node/port and if they are readable/writable/updated. We can use this to replace and improve the PARAM_List and also to notify property change and updates. Update elements and code to deal with this new param stuff. Add port and node info to most elements and signal changes. Use async enum_params in -inspect and use the param info to know which ones to enumerate. Use the port info to know what parameters to update in the remote-node.
2019-02-25Improve async handlingWim Taymans1-4/+18
Don't use special callback in node to receive the results. Instead, use a generic result callback to receive the result. This makes things a bit more symetric and generic again because then you can choose how to match the result to the request and you have a generic way to handle both the sync and async case. We can then also remove the wait method. This also makes the remote interface and spa interface to objects very similar. Make a helper object to receive and dispatch results. Use this in the helper for enum_params. Make device use the same result callbacks.
2019-02-21node: improve async handlingasyncWim Taymans1-8/+9
Remove the done and error callbacks. The error callback is in an error message. The done callback is replace with spa_pending. Make enum_params take a callback and data for the results. This allows us to push the results one after another to the app and avoids ownership issues of the passed data. We can then extend this to handle the async case by doing a _wait call with a spa_pending+callback+data that will be called when the _enum_params returns and async result. Add a sync method. All methods can now return SPA_RESULT_IS_ASYNC return values and you can use spa_node_wait() to register a callback when they complete with optional extra parameters. This makes it easier to sync and handle the reply. Make helper methods to simulate the sync enum_params behaviour for sync nodes. Let the transport generate the sequence number for pw_resource_sync() and pw_proxy_sync(). That way we don't need to keep track of numbers ourselves and we can match the reply to the request easily.
2019-02-18interfaces: improve remote APIWim Taymans2-4/+8
Add return values to events and method callbacks. This makes it possible to pass any error or async return value. Add sync/done/error in both directions so that both proxy and resource and perform/reply sync and produce errors. Return a SPA_ASYNC from remote method calls (and events), keep the sequence number in the connection. With the core sync/done we can remove the client-node done method and it's internal sequence number along with the seq number in method calls. We can also use the method/event async return value to perform a sync with as the unique sequence number for this method. Add sync method and done/error event to proxy and resource.
2019-02-14node: add max_ports to node infoWim Taymans1-0/+4
2019-02-14node: Add port_info eventWim Taymans1-34/+24
Add a port_info event. With this, we get updates to ports pushed to us, which is more convenient and also allows for better dynamic add/remove of ports. We don't need to the PortChanged event anymore We can remove the get_port_ids/get_n_ports/port_get_info methods. Update plugins
2019-02-13node: pass struct to info callback to make it more extensibleWim Taymans1-3/+5
2019-01-17spa-inspect: fix format object detectionWim Taymans1-1/+1
2019-01-16pod: improve the vararg pod builder and parserWim Taymans1-6/+6
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-07fix sign confusionWim Taymans1-1/+2
2018-11-26node: remove info from node interfaceWim Taymans1-4/+13
Replace with info event emited when callbacks are set. This makes it easier to implement dynamic changes.
2018-11-26monitor: remove enum_itemsWim Taymans1-18/+6
Make the monitor and device emit the info and items when the callbacks are set. This makes it easier to implement the monitor because there is much less state to keep around and invalidate etc. Rework the monitors Add bluez5 device
2018-11-05Relicense as MIT/X11Wim Taymans2-26/+36
Remove some obsolete files
2018-08-30debug: allow custom type rootWim Taymans2-5/+5
2018-08-27More type cleanupsWim Taymans2-9/+9
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-25More type fixesWim Taymans2-3/+3
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-24types: work on typesWim Taymans1-5/+5
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-23Remove dynamic typesWim Taymans2-71/+32
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-14debug: add specific format debugWim Taymans1-0/+1
2018-08-14remove spalibWim Taymans3-22/+15
2018-07-17clock: remove clock interfaceWim Taymans1-3/+0
Remove the clock interface, we need to get timing information with an io area to get the required precision and performance.
2018-04-09handle: make method to get sizeWim Taymans2-2/+2
2017-12-14inspect: Improve introspectionWim Taymans1-5/+22
List the factory interfaces that are provided. The interface id of the typemap is always 0 to avoid the chicken and the egg problem. Check debug env variable
2017-12-14monitor: fix return valuesWim Taymans1-2/+2
2017-11-21node: Add id to set_ioWim Taymans1-1/+1
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-20cleanupsWim Taymans1-1/+1
Follow the data/size argument order convention to make the api more consistent.
2017-11-13Improve enum_paramWim Taymans2-20/+19
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-13Use errno for result errorsWim Taymans2-40/+39
Make new enumeration for data transport status and use errno style error numbers for errors.
2017-11-10Reorganise SPA treeWim Taymans2-9/+12
Reorganise the SPA includes to make it more extensible later Simplify the naming of the buffer and meta params
2017-11-08clean up pod_builderWim Taymans1-4/+4
Remove the frame argument from the builder, we can use the builder allocated frames. Add deref function to builder to make it more flexible later. Add some more recursion depth checks in the parser. Improve props filter, also filter other types.
2017-11-08Various fixes and improvements to enum_paramsWim Taymans1-25/+62
2017-11-07Unify props, params and formatsWim Taymans2-27/+49
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-09-07Add more generic export-spa exampleWim Taymans1-0/+6
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-08-06CleanupsWim Taymans1-4/+3
Only pass data to callbacks. Rename some structs Provide methods to access structs
2017-06-18Add user_data to callbacksWim Taymans1-8/+4
Add user data to callbacks, it's more flexible and natural
2017-06-14Add versions to structuresWim Taymans2-7/+12
Use versions instead of size Remove user_data from callbacks, we can simply pass the callback struct.
2017-06-06Debug: remove loggerWim Taymans2-14/+24
Make a default logger and mapper in a .h file to be used by examples Remove logger and mapper from libs Make method to set the default mapper for the debug methods
2017-05-26indentWim Taymans2-357/+349
2017-05-25spa: don't use typedef for struct and enumWim Taymans2-73/+77
2017-05-23pinos -> pipewireWim Taymans2-2/+2
2017-05-22param: add more generic port paramsWim Taymans1-8/+14
Remove port properties and replace them with port params. Move the params from the PortInfo to enum_params. Use the Param ranges to specify possible sizes etc.
2017-03-31props: improve prop flagsWim Taymans1-0/+1
Only keep the READONLY prop flag. Work on test-mixer
2017-03-24format: improve format parsingWim Taymans2-14/+14
2017-03-24types: more work on typesWim Taymans2-29/+29
2017-03-23clean up typesWim Taymans2-10/+10
2017-03-23monitor: use dynamic typesWim Taymans1-32/+18
Make the monitor item a POD object and use dynamic types.
2017-03-22command: make commands dynamicWim Taymans1-0/+1
Ensure format object type.
2017-03-07Use types with known sizes where we can, easier to serializeWim Taymans2-9/+9
Add iterator for POD and use it to implement some demarshalling.