mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Do not create control socket if no control
If --no-control is enabled, then it is not necessary to create a second communication socket between the client and the server. This also facilitates the use of the server alone (without the client) to receive only the raw video stream.
This commit is contained in:
parent
80fe12a95f
commit
cabcbc2b15
3 changed files with 51 additions and 32 deletions
|
|
@ -66,14 +66,15 @@ public final class Server {
|
|||
Thread initThread = startInitThread(options);
|
||||
|
||||
boolean tunnelForward = options.isTunnelForward();
|
||||
boolean control = options.getControl();
|
||||
|
||||
try (DesktopConnection connection = DesktopConnection.open(device, tunnelForward)) {
|
||||
try (DesktopConnection connection = DesktopConnection.open(device, tunnelForward, control)) {
|
||||
ScreenEncoder screenEncoder = new ScreenEncoder(options.getSendFrameMeta(), options.getBitRate(), options.getMaxFps(), codecOptions,
|
||||
options.getEncoderName());
|
||||
|
||||
Thread controllerThread = null;
|
||||
Thread deviceMessageSenderThread = null;
|
||||
if (options.getControl()) {
|
||||
if (control) {
|
||||
final Controller controller = new Controller(device, connection, options.getClipboardAutosync());
|
||||
|
||||
// asynchronous
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue