Crate pipewire_wrapper
source ·Expand description
Overview
The crate structure is close to the PipeWire API structure, so PipeWire Documentation can be used to clarify some aspects of the bindings.
Examples
use pipewire_wrapper::core_api::main_loop::MainLoop;
use std::time::Duration;
let main_loop = MainLoop::default();
let callback = |_expirations| {
main_loop.quit().unwrap();
};
let timer = main_loop.get_loop().add_timer(Box::new(callback)).unwrap();
main_loop
.get_loop()
.update_timer(&timer, Duration::from_secs(1), Duration::ZERO, false)
.unwrap();
main_loop.run().unwrap();More examples can be found in examples folder.
Modules
- Bindings for PipeWire Core API
- Common Error types used across the library.
- PipeWire Filter bindings
- PipeWire Implementation API bindings.
- Listeners storage
- Macro rules
- PipeWire Simple Plugin API bindings.
- PipeWire Stream bindings.
- Wrappers for the external types
Macros
- Wrap the given
key: valuepairs to struct with constants. - Implement
buildmethod for Events struct builder. - Implement
buildmethod for Events struct channel builder. - Create const TypeInfo with the TypeKind::Interface and given short name
- Call the method on SPA Interface.
Constants
- Invalid ID value
Type Definitions
- Result type used in the library
Attribute Macros
- Implement SpaInterface and Proxied traits.
- Add an *Info and *Builder structures after the enum definition. For each enum variant will be added optional struct fields with value and flags.
- Implement Wrapper trait for structure with the
ref_: Proxy<'c>field. Macros parameter will be used as target type to cast underlying proxy. - Implement SpaInterface
Derive Macros
- Implement RawWrapper trait.
#[raw]attribute must be added before field with wrapped raw value. - Implement Wrapper trait.
#[raw_wrapper]attribute must be added before field withNonNull<impl RawWrapper>pointer to *Ref struct, that implements RawWrapper