Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mm-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fn compile_shader(
let mut compile_request = session.create_compile_request();

compile_request
.add_search_path("../shader-common")
.set_codegen_target(slang::CompileTarget::Spirv)
.set_optimization_level(slang::OptimizationLevel::Maximal)
.set_target_profile(session.find_profile("glsl_460"));
Expand Down
1 change: 1 addition & 0 deletions mm-client/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ where

if frames_remaining < frames_needed {
out.fill(Default::default());

trace!("audio buffer underrun");
return;
}
Expand Down
19 changes: 17 additions & 2 deletions mm-client/src/bin/mmclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ struct Cli {
/// resizes.
#[arg(long, required = false, default_value = "auto")]
resolution: Resolution,
/// Request 10-bit video output from the server. This will only work if
/// both your display and the application in question support rendering
/// HDR color.
#[arg(long, required = false)]
hdr: bool,
/// The UI scale to communicate to the server. If not specified, this will
/// be determined from the client-side window scale factor.
#[arg(long)]
#[arg(long, required = false)]
ui_scale: Option<f64>,
/// Video codec to use.
#[arg(long, default_value = "h265")]
Expand All @@ -121,6 +126,7 @@ struct MainLoop {
struct App {
configured_resolution: Resolution,
configured_codec: protocol::VideoCodec,
configured_profile: protocol::VideoProfile,
configured_framerate: u32,

window: Arc<winit::window::Window>,
Expand Down Expand Up @@ -621,6 +627,7 @@ impl App {
session_id: self.session_id,
streaming_resolution: self.remote_display_params.resolution.clone(),
video_codec: self.configured_codec.into(),
video_profile: self.configured_profile.into(),
..Default::default()
},
None,
Expand Down Expand Up @@ -815,6 +822,12 @@ fn main() -> Result<()> {
Some(v) => bail!("invalid codec: {:?}", v),
};

let configured_profile = if args.hdr {
protocol::VideoProfile::Hdr10
} else {
protocol::VideoProfile::Hd
};

// TODO: anyhow errors are garbage for end-users.
debug!("establishing connection to {:}", &args.host);
let mut conn = Conn::new(&args.host).context("failed to establish connection")?;
Expand Down Expand Up @@ -927,7 +940,7 @@ fn main() -> Result<()> {
window.clone(),
cfg!(debug_assertions),
)?);
let renderer = Renderer::new(vk.clone(), window.clone())?;
let renderer = Renderer::new(vk.clone(), window.clone(), args.hdr)?;

debug!("attaching session {:?}", session.session_id);
let attachment_sid = conn.send(
Expand All @@ -937,6 +950,7 @@ fn main() -> Result<()> {
session_id: session.session_id,
streaming_resolution: Some(streaming_resolution),
video_codec: configured_codec.into(),
video_profile: configured_profile.into(),
..Default::default()
},
None,
Expand Down Expand Up @@ -964,6 +978,7 @@ fn main() -> Result<()> {
configured_codec,
configured_framerate: args.framerate,
configured_resolution: args.resolution,
configured_profile,

window,
_proxy: proxy.clone(),
Expand Down
Loading