From 84086a115ad1d0b133e9eefdd5e3be1f2fe54d7f Mon Sep 17 00:00:00 2001 From: metashamone Date: Tue, 30 May 2023 18:57:18 +0200 Subject: [PATCH] added disable proximity option to the streaming screen, added more copy and set the defaults to Quest 2 --- .../stream-options/stream-options.component.html | 8 ++++++-- .../app/stream-options/stream-options.component.ts | 13 ++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/desktop-app/src/app/stream-options/stream-options.component.html b/desktop-app/src/app/stream-options/stream-options.component.html index a93f382..9bb1211 100644 --- a/desktop-app/src/app/stream-options/stream-options.component.html +++ b/desktop-app/src/app/stream-options/stream-options.component.html @@ -3,6 +3,7 @@
Start Stream
Oculus Casting
+
Disable Proximity Sensor
@@ -37,14 +38,17 @@ Crop
Crop the device screen on the server. The values are expressed in the device natural orientation (typically, - portrait for a phone, landscape for a tablet). Any MaxSize value is computed on the cropped size. + portrait for a phone, landscape for a tablet). Any MaxSize value is computed on the cropped size. The format is width:height:left:top.
-
Quest 1 Crop
Quest 2 Crop
+
Quest 1 Crop
+
+ Please note the Quest Pro uses two slightly angled screens and therefore there isn't a crop setting that works out of the box, since the video would need to be corrected after the fact. +
Fullscreen diff --git a/desktop-app/src/app/stream-options/stream-options.component.ts b/desktop-app/src/app/stream-options/stream-options.component.ts index 11fbaad..40b6957 100644 --- a/desktop-app/src/app/stream-options/stream-options.component.ts +++ b/desktop-app/src/app/stream-options/stream-options.component.ts @@ -12,7 +12,7 @@ export class StreamOptionsComponent implements OnInit { scrcpy_options: any = { always_on_top: false, bit_rate: '8000000', - crop: '1280:720:1500:350', + crop: '1600:900:2017:510', no_control: true, fullscreen: false, max_size: '0', @@ -35,4 +35,15 @@ export class StreamOptionsComponent implements OnInit { .then(() => this.statusService.showStatus('Stream closed.')) .catch(e => this.statusService.showStatus('ScrCpy Error: ' + JSON.stringify(e), true)); } + + disableProximity(shouldEnable) { + this.runAdbCommand('am broadcast -a com.oculus.vrpowermanager.' + (shouldEnable ? 'automation_disable' : 'prox_close')) + .then(() => { + this.statusService.showStatus((shouldEnable ? 'Enable' : 'Disable') + ' proximity message sent OK!!'); + }) + .catch(e => this.statusService.showStatus(e, true)); + } + runAdbCommand(command: string) { + return this.adbService.adbCommand('shell', { command, serial: this.adbService.deviceSerial }); + } }