mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
✨ feat: Add streaming support (#125)
This adds: - [x] Keyboard and mouse handling on the frontend - [x] Video and audio streaming from the backend to the frontend - [x] Input server that works with Websockets Update - 17/11 - [ ] Master docker container to run this - [ ] Steam runtime - [ ] Entrypoint.sh --------- Co-authored-by: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com> Co-authored-by: Kristian Ollikainen <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
41
packages/server/src/args/device_args.rs
Normal file
41
packages/server/src/args/device_args.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
pub struct DeviceArgs {
|
||||
/// GPU vendor (e.g. "intel")
|
||||
pub gpu_vendor: String,
|
||||
/// GPU name (e.g. "a770")
|
||||
pub gpu_name: String,
|
||||
/// GPU index, if multiple same GPUs are present
|
||||
pub gpu_index: u32,
|
||||
/// GPU card/render path, sets card explicitly from such path
|
||||
pub gpu_card_path: String,
|
||||
}
|
||||
impl DeviceArgs {
|
||||
pub fn from_matches(matches: &clap::ArgMatches) -> Self {
|
||||
Self {
|
||||
gpu_vendor: matches
|
||||
.get_one::<String>("gpu-vendor")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
gpu_name: matches
|
||||
.get_one::<String>("gpu-name")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
gpu_index: matches
|
||||
.get_one::<String>("gpu-index")
|
||||
.unwrap()
|
||||
.parse::<u32>()
|
||||
.unwrap(),
|
||||
gpu_card_path: matches
|
||||
.get_one::<String>("gpu-card-path")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_print(&self) {
|
||||
println!("DeviceArgs:");
|
||||
println!("> gpu_vendor: {}", self.gpu_vendor);
|
||||
println!("> gpu_name: {}", self.gpu_name);
|
||||
println!("> gpu_index: {}", self.gpu_index);
|
||||
println!("> gpu_card_path: {}", self.gpu_card_path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user