mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-07-29 12:19:15 +00:00
Move screen encoder initialization
This prepares further refactors.
This commit is contained in:
parent
e37f9a4d7c
commit
46759d3f63
1 changed files with 3 additions and 3 deletions
|
@ -90,8 +90,6 @@ public final class Server {
|
||||||
Size videoSize = device.getScreenInfo().getVideoSize();
|
Size videoSize = device.getScreenInfo().getVideoSize();
|
||||||
connection.sendDeviceMeta(Device.getDeviceName(), videoSize.getWidth(), videoSize.getHeight());
|
connection.sendDeviceMeta(Device.getDeviceName(), videoSize.getWidth(), videoSize.getHeight());
|
||||||
}
|
}
|
||||||
ScreenEncoder screenEncoder = new ScreenEncoder(codec.getMimeType(), options.getBitRate(), options.getMaxFps(), codecOptions,
|
|
||||||
options.getEncoderName(), options.getDownsizeOnError());
|
|
||||||
|
|
||||||
Controller controller = null;
|
Controller controller = null;
|
||||||
if (control) {
|
if (control) {
|
||||||
|
@ -102,9 +100,11 @@ public final class Server {
|
||||||
device.setClipboardListener(text -> controllerRef.getSender().pushClipboardText(text));
|
device.setClipboardListener(text -> controllerRef.getSender().pushClipboardText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VideoStreamer videoStreamer = new VideoStreamer(connection.getVideoFd(), codec, options.getSendCodecId(), options.getSendFrameMeta());
|
||||||
|
ScreenEncoder screenEncoder = new ScreenEncoder(codec.getMimeType(), options.getBitRate(), options.getMaxFps(), codecOptions,
|
||||||
|
options.getEncoderName(), options.getDownsizeOnError());
|
||||||
try {
|
try {
|
||||||
// synchronous
|
// synchronous
|
||||||
VideoStreamer videoStreamer = new VideoStreamer(connection.getVideoFd(), codec, options.getSendCodecId(), options.getSendFrameMeta());
|
|
||||||
screenEncoder.streamScreen(device, videoStreamer);
|
screenEncoder.streamScreen(device, videoStreamer);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// this is expected on close
|
// this is expected on close
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue