Skip to content

Commit

Permalink
Update pipewire-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
dimtpap committed Feb 16, 2024
1 parent 2ed3d72 commit 5c5f6b1
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 94 deletions.
85 changes: 62 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categories = ["gui", "multimedia"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
pipewire = {version = "*", git = "https://gitlab.freedesktop.org/dimtpap/pipewire-rs.git", rev = "7bd8b2d3c5d91f56b20c345e97244fff9e58ea0f"}
pipewire = {version = "*", git = "https://gitlab.freedesktop.org/dimtpap/pipewire-rs.git", rev = "605d15996f3258b3e1cc34e445dfbdf16a366c7e"}
egui_node_graph = {version = "*", git = "https://github.com/dimtpap/egui_node_graph.git", rev = "a2e93a2826f90c21f13fa8fecf9076da611432fd"}
eframe = {version = "0.26.2", features = ["wayland"]}
egui_plot = "0.26.2"
Expand Down
8 changes: 4 additions & 4 deletions src/backend/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use pipewire::{
self as pw,
proxy::{Proxy, ProxyT},
registry::GlobalObject,
spa::ForeignDict,
spa::utils::dict::DictRef,
types::ObjectType,
};

Expand Down Expand Up @@ -66,9 +66,9 @@ impl From<pw::Error> for Error {
}

impl BoundGlobal {
pub fn bind_to(
pub fn bind_to<P: AsRef<DictRef>>(
registry: &pw::registry::Registry,
global: &GlobalObject<ForeignDict>,
global: &GlobalObject<&P>,
sx: &std::sync::mpsc::Sender<Event>,
proxy_removed: impl Fn() + 'static,
) -> Result<Self, Error> {
Expand Down Expand Up @@ -135,7 +135,7 @@ impl BoundGlobal {
}
ObjectMethod::ClientUpdateProperties(props) => {
if let Global::Client(ref client) = self.global {
client.update_properties(&util::key_val_to_props(props.into_iter()));
client.update_properties(util::key_val_to_props(props.into_iter()).dict());
}
}
ObjectMethod::MetadataSetProperty {
Expand Down
14 changes: 7 additions & 7 deletions src/backend/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ impl From<ashpd::Error> for Error {
}

#[cfg(not(feature = "xdg_desktop_portals"))]
pub struct Connection(pw::Core);
pub struct Connection(pw::core::Core);
#[cfg(not(feature = "xdg_desktop_portals"))]
impl Connection {
pub fn connect(
context: &pw::Context,
context: &pw::context::Context,
context_properties: Vec<(String, String)>,
remote: RemoteInfo,
) -> Result<Self, Error> {
Expand All @@ -106,21 +106,21 @@ impl Connection {
)?))
}

pub const fn core(&self) -> &pw::Core {
pub const fn core(&self) -> &pw::core::Core {
&self.0
}
}

#[cfg(feature = "xdg_desktop_portals")]
pub enum Connection<'s> {
Simple(pw::Core),
PortalWithSession(pw::Core, Session<'s>),
Simple(pw::core::Core),
PortalWithSession(pw::core::Core, Session<'s>),
}

#[cfg(feature = "xdg_desktop_portals")]
impl<'s> Connection<'s> {
pub fn connect(
context: &pw::Context,
context: &pw::context::Context,
context_properties: Vec<(String, String)>,
remote: RemoteInfo,
) -> Result<Self, Error> {
Expand All @@ -147,7 +147,7 @@ impl<'s> Connection<'s> {
}
}

pub const fn core(&self) -> &pw::Core {
pub const fn core(&self) -> &pw::core::Core {
match self {
Self::Simple(core) | Self::PortalWithSession(core, _) => core,
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend/listeners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ pub fn port(port: pw::port::Port, id: u32, sx: std::sync::mpsc::Sender<Event>) -
.info({
move |info| {
let direction = match info.direction() {
pw::spa::Direction::Input => "Input",
pw::spa::Direction::Output => "Output",
pw::spa::utils::Direction::Input => "Input",
pw::spa::utils::Direction::Output => "Output",
_ => "Invalid",
}
.to_owned();
Expand Down
4 changes: 2 additions & 2 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub enum ObjectMethod {
index: u32,
num: u32,
},
ClientUpdatePermissions(Vec<pw::permissions::Permissions>),
ClientUpdatePermissions(Vec<pw::permissions::Permission>),
ClientUpdateProperties(std::collections::BTreeMap<String, String>),
MetadataSetProperty {
subject: u32,
Expand Down Expand Up @@ -66,7 +66,7 @@ pub enum Event {
GlobalRemoved(u32),
GlobalInfo(u32, Box<[(&'static str, String)]>),
GlobalProperties(u32, std::collections::BTreeMap<String, String>),
ClientPermissions(u32, u32, Vec<pw::permissions::Permissions>),
ClientPermissions(u32, u32, Vec<pw::permissions::Permission>),
ProfilerProfile(Vec<self::pods::profiler::Profiling>),
MetadataProperty {
id: u32,
Expand Down
Loading

0 comments on commit 5c5f6b1

Please sign in to comment.