Skip to content

Commit 121daab

Browse files
committed
vhost-device-sound: Add GStreamer audio backend support
Add gstreamer backend. Signed-off-by: nicholasdezai <[email protected]>
1 parent 3d36191 commit 121daab

File tree

8 files changed

+1301
-2
lines changed

8 files changed

+1301
-2
lines changed

vhost-device-i2c/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ struct I2cArgs {
6767
socket_count: usize,
6868

6969
/// List of I2C bus and clients in format
70-
/// `<bus-name>:<client_addr>[:<client_addr>][,<bus-name>:<client_addr>[:<client_addr>]]`.
70+
/// `<bus-name>:<client_addr>[:<client_addr>][,<bus-name>:<client_addr>[:
71+
/// <client_addr>]]`.
7172
#[clap(short = 'l', long)]
7273
device_list: String,
7374
}

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/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
}

vhost-device-sound/src/audio_backends.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ mod null;
88
#[cfg(all(feature = "pw-backend", target_env = "gnu"))]
99
mod pipewire;
1010

11+
#[cfg(all(feature = "gst-backend", target_env = "gnu"))]
12+
mod gstreamer;
13+
1114
use std::sync::{Arc, RwLock};
1215

1316
#[cfg(all(feature = "alsa-backend", target_env = "gnu"))]
1417
use self::alsa::AlsaBackend;
18+
#[cfg(all(feature = "gst-backend", target_env = "gnu"))]
19+
use self::gstreamer::GStreamerBackend;
1520
use self::null::NullBackend;
1621
#[cfg(all(feature = "pw-backend", target_env = "gnu"))]
1722
use self::pipewire::PwBackend;
@@ -61,6 +66,8 @@ pub fn alloc_audio_backend(
6166
}
6267
#[cfg(all(feature = "alsa-backend", target_env = "gnu"))]
6368
BackendType::Alsa => Ok(Box::new(AlsaBackend::new(streams))),
69+
#[cfg(all(feature = "gst-backend", target_env = "gnu"))]
70+
BackendType::GStreamer => Ok(Box::new(GStreamerBackend::new(streams))),
6471
}
6572
}
6673

0 commit comments

Comments
 (0)