1
0
Fork 0
forked from wry/wry

portal: ignore formats not supported by pipewire

This commit is contained in:
Julian Orth 2024-04-10 18:56:26 +02:00
parent e9ba7782a0
commit 3f39fa1f6f
5 changed files with 19 additions and 3 deletions

2
Cargo.lock generated
View file

@ -521,7 +521,7 @@ dependencies = [
[[package]] [[package]]
name = "jay-compositor" name = "jay-compositor"
version = "1.0.1" version = "1.0.2"
dependencies = [ dependencies = [
"ahash", "ahash",
"anyhow", "anyhow",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "jay-compositor" name = "jay-compositor"
version = "1.0.1" version = "1.0.2"
edition = "2021" edition = "2021"
build = "build/build.rs" build = "build/build.rs"
license = "GPL-3.0-only" license = "GPL-3.0-only"

View file

@ -1,5 +1,9 @@
# Unreleased # Unreleased
# 1.0.2
- Needs jay-compositor release.
# 1.0 # 1.0
- Needs jay-config release. - Needs jay-config release.

View file

@ -2,6 +2,10 @@
- Add support for wp-alpha-modifier. - Add support for wp-alpha-modifier.
# 1.0.2 (2024-04-10)
- Fixed a bug that caused the portal to fail.
# 1.0 (2024-04-07) # 1.0 (2024-04-07)
This is the first stable release of Jay. This is the first stable release of Jay.

View file

@ -71,11 +71,19 @@ static FORMATS_MAP: Lazy<AHashMap<u32, &'static Format>> = Lazy::new(|| {
static PW_FORMATS_MAP: Lazy<AHashMap<SpaVideoFormat, &'static Format>> = Lazy::new(|| { static PW_FORMATS_MAP: Lazy<AHashMap<SpaVideoFormat, &'static Format>> = Lazy::new(|| {
let mut map = AHashMap::new(); let mut map = AHashMap::new();
for format in FORMATS { for format in FORMATS {
assert!(map.insert(format.pipewire, format).is_none()); if format.pipewire != SPA_VIDEO_FORMAT_UNKNOWN {
assert!(map.insert(format.pipewire, format).is_none());
}
} }
map map
}); });
#[test]
fn formats_dont_panic() {
formats();
pw_formats();
}
pub fn formats() -> &'static AHashMap<u32, &'static Format> { pub fn formats() -> &'static AHashMap<u32, &'static Format> {
&FORMATS_MAP &FORMATS_MAP
} }