mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Send frame meta only if recording is enabled
The client needs the PTS for each frame only if recording is enabled. Otherwise, the PTS are not necessary, and the protocol is more straighforward.
This commit is contained in:
parent
22bf0c19d6
commit
345f8858d3
7 changed files with 75 additions and 29 deletions
|
|
@ -3,6 +3,7 @@ package com.genymobile.scrcpy;
|
|||
import android.graphics.Rect;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class Server {
|
||||
|
||||
|
|
@ -14,7 +15,7 @@ public final class Server {
|
|||
final Device device = new Device(options);
|
||||
boolean tunnelForward = options.isTunnelForward();
|
||||
try (DesktopConnection connection = DesktopConnection.open(device, tunnelForward)) {
|
||||
ScreenEncoder screenEncoder = new ScreenEncoder(options.getBitRate());
|
||||
ScreenEncoder screenEncoder = new ScreenEncoder(options.getSendFrameMeta(), options.getBitRate());
|
||||
|
||||
// asynchronous
|
||||
startEventController(device, connection);
|
||||
|
|
@ -71,6 +72,12 @@ public final class Server {
|
|||
Rect crop = parseCrop(args[3]);
|
||||
options.setCrop(crop);
|
||||
|
||||
if (args.length < 5) {
|
||||
return options;
|
||||
}
|
||||
boolean sendFrameMeta = Boolean.parseBoolean(args[4]);
|
||||
options.setSendFrameMeta(sendFrameMeta);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue