@desklink/host 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -310,7 +310,7 @@ fn print_input_setup() {
310
310
  println!(
311
311
  "To undo it: remove the rule, remove the user from the group, reload the rules."
312
312
  );
313
- println!("Without it the engine still captures the desktop and reports view-only.");
313
+ println!("Without it the engine still captures the desktop; input actions are refused with input-unavailable.");
314
314
  }
315
315
  }
316
316
  }
@@ -645,7 +645,6 @@ async fn dispatch(
645
645
  let open = session::OpenRequest {
646
646
  source: params.source,
647
647
  cursor: params.cursor,
648
- permissions: params.permissions,
649
648
  max_width: params.max_width,
650
649
  max_height: params.max_height,
651
650
  bitrate_kbps: params.bitrate_kbps,
@@ -680,6 +679,7 @@ async fn dispatch(
680
679
  },
681
680
  "geometry": session.geometry(),
682
681
  "cursor": session.cursor_info(),
682
+ "agentIndicator": session.agent_indicator(),
683
683
  });
684
684
  *current = Some(session);
685
685
  Ok(result)
@@ -5,10 +5,10 @@
5
5
  //! module never assumes anything about that channel, which is what keeps the
6
6
  //! engine usable by an application that is not this one.
7
7
  //!
8
- //! Input and clipboard ride the session's data channel rather than the local
9
- //! protocol. The channel is inside the DTLS/SRTP session the engine created for
10
- //! one authorized grant, so it inherits that session's identity and dies with
11
- //! it — a revoked session cannot be driven by a client that kept a socket open.
8
+ //! Remote input and clipboard ride the session's data channel; co-located
9
+ //! consumers can also use the local clipboard protocol. The channel is inside
10
+ //! the DTLS/SRTP session opened by a paired consumer and dies with it — a revoked
11
+ //! session cannot be driven by a client that kept a socket open.
12
12
 
13
13
  use anyhow::{Context, Result};
14
14
  use rtc::interceptor::{
@@ -1120,6 +1120,12 @@ impl VideoPeer {
1120
1120
  }
1121
1121
 
1122
1122
  pub async fn close(&self) {
1123
+ let _ = tokio::time::timeout(Duration::from_millis(500), async {
1124
+ while self.control.outstanding_bytes().await.unwrap_or(0) > 0 {
1125
+ tokio::time::sleep(Duration::from_millis(5)).await;
1126
+ }
1127
+ })
1128
+ .await;
1123
1129
  self.feedback.abort();
1124
1130
  let _ = self.control.close().await;
1125
1131
  let _ = self.peer.close().await;
@@ -53,14 +53,6 @@ pub struct HelloParams {
53
53
  pub protocol: u32,
54
54
  }
55
55
 
56
- #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
57
- #[serde(rename_all = "snake_case")]
58
- pub enum Permission {
59
- View,
60
- Control,
61
- Clipboard,
62
- }
63
-
64
56
  #[derive(Debug, Clone, Deserialize)]
65
57
  pub struct IceServerParam {
66
58
  #[serde(default)]
@@ -126,8 +118,6 @@ pub struct OpenParams {
126
118
  /// Absent means "the portal, with the user's consent".
127
119
  #[serde(default)]
128
120
  pub source: Option<SourceRequest>,
129
- #[serde(default)]
130
- pub permissions: Vec<Permission>,
131
121
  #[serde(default = "default_max_width")]
132
122
  pub max_width: usize,
133
123
  #[serde(default = "default_max_height")]
@@ -539,6 +529,13 @@ mod tests {
539
529
 
540
530
  #[test]
541
531
  fn open_defaults_keep_the_desktops_own_pixels_up_to_4k() {
532
+ for payload in [
533
+ r#"{}"#,
534
+ r#"{"permissions":["view"]}"#,
535
+ r#"{"permissions":["view","unknown-legacy-scope"]}"#,
536
+ ] {
537
+ let _: OpenParams = serde_json::from_str(payload).unwrap();
538
+ }
542
539
  let params: OpenParams =
543
540
  serde_json::from_str(r#"{"permissions":["view","control"]}"#).unwrap();
544
541
  assert_eq!(params.max_width, 3840);