feat(client): Add no_audio_playback flag to Config struct

Enable audio playback on the client.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2025-04-08 14:19:07 +04:00 committed by Benoît Cortier
parent 5dcc526f51
commit 9f0edcc4c9
7 changed files with 13 additions and 1 deletions

View file

@ -320,6 +320,7 @@ impl Config {
license_cache: None,
no_server_pointer: args.no_server_pointer,
autologon: args.autologon,
no_audio_playback: false,
request_data: None,
pointer_software_rendering: true,
performance_flags: PerformanceFlags::default(),

View file

@ -729,7 +729,6 @@ fn create_client_info_pdu(config: &Config, routing_addr: &SocketAddr) -> rdp::Cl
| ClientInfoFlags::DISABLE_CTRL_ALT_DEL
| ClientInfoFlags::LOGON_NOTIFY
| ClientInfoFlags::LOGON_ERRORS
| ClientInfoFlags::NO_AUDIO_PLAYBACK
| ClientInfoFlags::VIDEO_DISABLE
| ClientInfoFlags::ENABLE_WINDOWS_KEY
| ClientInfoFlags::MAXIMIZE_SHELL;
@ -742,6 +741,10 @@ fn create_client_info_pdu(config: &Config, routing_addr: &SocketAddr) -> rdp::Cl
flags |= ClientInfoFlags::PASSWORD_IS_SC_PIN;
}
if config.no_audio_playback {
flags |= ClientInfoFlags::NO_AUDIO_PLAYBACK;
}
let client_info = ClientInfo {
credentials: Credentials {
username: config.credentials.username().unwrap_or("").to_owned(),

View file

@ -177,6 +177,9 @@ pub struct Config {
pub request_data: Option<NegoRequestData>,
/// If true, the INFO_AUTOLOGON flag is set in the [`ClientInfoPdu`](ironrdp_pdu::rdp::ClientInfoPdu)
pub autologon: bool,
/// If true, the INFO_NOAUDIOPLAYBACK flag is set in the [`ClientInfoPdu`](ironrdp_pdu::rdp::ClientInfoPdu)
pub no_audio_playback: bool,
pub license_cache: Option<Arc<dyn LicenseCache>>,
// FIXME(@CBenoit): these are client-only options, not part of the connector.

View file

@ -296,6 +296,7 @@ fn default_client_config() -> connector::Config {
hardware_id: None,
request_data: None,
autologon: false,
no_audio_playback: false,
license_cache: None,
no_server_pointer: true,
pointer_software_rendering: true,

View file

@ -860,6 +860,7 @@ fn build_config(
platform: ironrdp::pdu::rdp::capability_sets::MajorPlatformType::UNSPECIFIED,
no_server_pointer: false,
autologon: false,
no_audio_playback: true,
request_data: None,
pointer_software_rendering: false,
performance_flags: PerformanceFlags::default(),

View file

@ -209,6 +209,7 @@ fn build_config(username: String, password: String, domain: Option<String>) -> c
no_server_pointer: true,
request_data: None,
autologon: false,
no_audio_playback: true,
pointer_software_rendering: true,
performance_flags: PerformanceFlags::default(),
desktop_scale_factor: 0,

View file

@ -39,6 +39,7 @@ pub mod ffi {
pub platform: Option<MajorPlatformType>,
pub no_server_pointer: Option<bool>,
pub autologon: Option<bool>,
pub no_audio_playback: Option<bool>,
pub pointer_software_rendering: Option<bool>,
pub performance_flags: Option<ironrdp::pdu::rdp::client_info::PerformanceFlags>,
}
@ -192,6 +193,7 @@ pub mod ffi {
no_server_pointer: self.no_server_pointer.unwrap_or(false),
autologon: self.autologon.unwrap_or(false),
no_audio_playback: self.no_audio_playback.unwrap_or(false),
request_data: None,
pointer_software_rendering: self.pointer_software_rendering.unwrap_or(false),
performance_flags: self.performance_flags.ok_or("performance flag is missing")?,