Skip to content

Commit 9f0edcc

Browse files
elmarcoCBenoit
authored andcommitted
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>
1 parent 5dcc526 commit 9f0edcc

7 files changed

Lines changed: 13 additions & 1 deletion

File tree

crates/ironrdp-client/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ impl Config {
320320
license_cache: None,
321321
no_server_pointer: args.no_server_pointer,
322322
autologon: args.autologon,
323+
no_audio_playback: false,
323324
request_data: None,
324325
pointer_software_rendering: true,
325326
performance_flags: PerformanceFlags::default(),

crates/ironrdp-connector/src/connection.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,6 @@ fn create_client_info_pdu(config: &Config, routing_addr: &SocketAddr) -> rdp::Cl
729729
| ClientInfoFlags::DISABLE_CTRL_ALT_DEL
730730
| ClientInfoFlags::LOGON_NOTIFY
731731
| ClientInfoFlags::LOGON_ERRORS
732-
| ClientInfoFlags::NO_AUDIO_PLAYBACK
733732
| ClientInfoFlags::VIDEO_DISABLE
734733
| ClientInfoFlags::ENABLE_WINDOWS_KEY
735734
| ClientInfoFlags::MAXIMIZE_SHELL;
@@ -742,6 +741,10 @@ fn create_client_info_pdu(config: &Config, routing_addr: &SocketAddr) -> rdp::Cl
742741
flags |= ClientInfoFlags::PASSWORD_IS_SC_PIN;
743742
}
744743

744+
if config.no_audio_playback {
745+
flags |= ClientInfoFlags::NO_AUDIO_PLAYBACK;
746+
}
747+
745748
let client_info = ClientInfo {
746749
credentials: Credentials {
747750
username: config.credentials.username().unwrap_or("").to_owned(),

crates/ironrdp-connector/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ pub struct Config {
177177
pub request_data: Option<NegoRequestData>,
178178
/// If true, the INFO_AUTOLOGON flag is set in the [`ClientInfoPdu`](ironrdp_pdu::rdp::ClientInfoPdu)
179179
pub autologon: bool,
180+
/// If true, the INFO_NOAUDIOPLAYBACK flag is set in the [`ClientInfoPdu`](ironrdp_pdu::rdp::ClientInfoPdu)
181+
pub no_audio_playback: bool,
182+
180183
pub license_cache: Option<Arc<dyn LicenseCache>>,
181184

182185
// FIXME(@CBenoit): these are client-only options, not part of the connector.

crates/ironrdp-testsuite-extra/tests/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ fn default_client_config() -> connector::Config {
296296
hardware_id: None,
297297
request_data: None,
298298
autologon: false,
299+
no_audio_playback: false,
299300
license_cache: None,
300301
no_server_pointer: true,
301302
pointer_software_rendering: true,

crates/ironrdp-web/src/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ fn build_config(
860860
platform: ironrdp::pdu::rdp::capability_sets::MajorPlatformType::UNSPECIFIED,
861861
no_server_pointer: false,
862862
autologon: false,
863+
no_audio_playback: true,
863864
request_data: None,
864865
pointer_software_rendering: false,
865866
performance_flags: PerformanceFlags::default(),

crates/ironrdp/examples/screenshot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ fn build_config(username: String, password: String, domain: Option<String>) -> c
209209
no_server_pointer: true,
210210
request_data: None,
211211
autologon: false,
212+
no_audio_playback: true,
212213
pointer_software_rendering: true,
213214
performance_flags: PerformanceFlags::default(),
214215
desktop_scale_factor: 0,

ffi/src/connector/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub mod ffi {
3939
pub platform: Option<MajorPlatformType>,
4040
pub no_server_pointer: Option<bool>,
4141
pub autologon: Option<bool>,
42+
pub no_audio_playback: Option<bool>,
4243
pub pointer_software_rendering: Option<bool>,
4344
pub performance_flags: Option<ironrdp::pdu::rdp::client_info::PerformanceFlags>,
4445
}
@@ -192,6 +193,7 @@ pub mod ffi {
192193

193194
no_server_pointer: self.no_server_pointer.unwrap_or(false),
194195
autologon: self.autologon.unwrap_or(false),
196+
no_audio_playback: self.no_audio_playback.unwrap_or(false),
195197
request_data: None,
196198
pointer_software_rendering: self.pointer_software_rendering.unwrap_or(false),
197199
performance_flags: self.performance_flags.ok_or("performance flag is missing")?,

0 commit comments

Comments
 (0)