Skip to content

Commit fa75522

Browse files
committed
vhost-device-sound: Add GStreamer audio backend support
Signed-off-by: nicholasdezai <[email protected]>
1 parent 1a4b5ec commit fa75522

File tree

9 files changed

+1184
-5
lines changed

9 files changed

+1184
-5
lines changed

Cargo.lock

Lines changed: 253 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vhost-device-sound/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
### Added
55

6+
- [[#876]](https://github.com/rust-vmm/vhost-device/pull/876) Add GStreamer audio backend support
67
- [[#806]](https://github.com/rust-vmm/vhost-device/pull/806) Add controls field in VirtioSoundConfig
78
- [[#746]](https://github.com/rust-vmm/vhost-device/pull/746) Add new sampling rates 12000Hz and 24000Hz
89

vhost-device-sound/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ edition = "2018"
1212

1313
[features]
1414
xen = ["vm-memory/xen", "vhost/xen", "vhost-user-backend/xen"]
15-
default = ["alsa-backend", "pw-backend"]
15+
default = ["alsa-backend", "pw-backend", "gst-backend"]
1616
alsa-backend = ["dep:alsa"]
1717
pw-backend = ["pw"]
18+
gst-backend = ["dep:gst", "dep:gst-app", "dep:gst-audio"]
1819

1920
[dependencies]
2021
clap = { version = "4.5", features = ["derive"] }
@@ -32,6 +33,9 @@ vmm-sys-util = "0.14"
3233
[target.'cfg(target_env = "gnu")'.dependencies]
3334
alsa = { version = "0.9", optional = true }
3435
pw = { package = "pipewire", version = "0.8", optional = true }
36+
gst = { package = "gstreamer", version = "0.22", optional = true, features = ["v1_20"] }
37+
gst-app = { package = "gstreamer-app", version = "0.22", optional = true, features = ["v1_20"] }
38+
gst-audio = {package = "gstreamer-audio", version = "0.22", optional = true, features = ["v1_20"] }
3539

3640
[dev-dependencies]
3741
rstest = "0.25.0"

vhost-device-sound/src/args.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ pub enum BackendType {
2525
Pipewire,
2626
#[cfg(all(feature = "alsa-backend", target_env = "gnu"))]
2727
Alsa,
28+
#[cfg(all(feature = "gst-backend", target_env = "gnu"))]
29+
#[value(name = "gstreamer")]
30+
GStreamer,
2831
}

0 commit comments

Comments
 (0)