-
Notifications
You must be signed in to change notification settings - Fork 69
vhost-device-sound: Add GStreamer audio backend support #876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
the build is failing because
|
right, I just did it at rust-vmm/rust-vmm-ci#190 |
@nicholasdezai we just merged #881 that should bring @MatiasVara changes to add GStreamer deps to our CI container, please rebase this PR. |
I submitted a PR to rust-vmm-container to add the missing GStreamer dependencies |
Please rebase this PR on |
Bumps rust-vmm-ci from e8117d1 to c0f5d4c. Signed-off-by: nicholasdezai <[email protected]>
d625287
to
121daab
Compare
Add gstreamer-related crates used in the vhost-device-sound module This affects only the vhost-device-sound module, and updates the following dependencies: - dependency-name: gstreamer dependency-version: 0.24.2 - dependency-name: gstreamer-app dependency-version: 0.24.2 - dependency-name: gstreamer-audio dependency-version: 0.24.2 Signed-off-by: nicholasdezai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for working on this and preparing the container for the CI!
I left some comments, in general I'd avoid unwrap()/expect()
. I mean t's fine for the lock or something that should not happen, but for example you have in some places .ok_or(Error::StreamWithIdNotFound(stream_id))?
and in others .expect("Can not find stream in stream_in.");
. Why? (I didn't look the entire code, so maybe there is a reason).
socket_count: usize, | ||
|
||
/// List of I2C bus and clients in format | ||
/// `<bus-name>:<client_addr>[:<client_addr>][,<bus-name>:<client_addr>[:<client_addr>]]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change, I guess happened while rebasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice it here, it has been rolled back in the new version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit 84c7fe5 can be squashed in the next one where you really need the dependencies.
|
||
pipeline | ||
.add_many([&autoaudiosrc, appsink.upcast_ref()]) | ||
.expect("Failed to add elements to input pipeline"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not returning an Err
?
let mut stream_in = self.stream_in.write().unwrap(); | ||
let pipeline_in = stream_in | ||
.get(&stream_id) | ||
.expect("Can not find stream in `stream_in`."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
Add gstreamer backend. Signed-off-by: nicholasdezai <[email protected]>
63c5f82
to
1e7e0fa
Compare
- Replace some unwrap/expect with proper Result handling - Add GstError to handle GstreamerBackend init fail Signed-off-by: nicholasdezai <[email protected]>
I have improved the error handling in the new commit. I hope the error handling makes more sense now |
Summary of the PR
This change adds GStreamer audio backend support.
Since the Rust bindings for GStreamer rely on the underlying C libraries, this change introduces additional build dependencies. On Debian/Ubuntu systems, at least libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev are required.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.