Pass all args to ScreenEncoder constructor

There is no good reason to pass some of them in the constructor and some
others as parameters of the streamScreen() method.
This commit is contained in:
Romain Vimont 2023-02-06 13:46:19 +01:00
parent ae9b08b905
commit c226797991
3 changed files with 14 additions and 6 deletions

View file

@ -101,11 +101,11 @@ public final class Server {
}
VideoStreamer videoStreamer = new VideoStreamer(connection.getVideoFd(), codec, options.getSendCodecId(), options.getSendFrameMeta());
ScreenEncoder screenEncoder = new ScreenEncoder(codec.getMimeType(), options.getBitRate(), options.getMaxFps(), codecOptions,
ScreenEncoder screenEncoder = new ScreenEncoder(device, videoStreamer, options.getBitRate(), options.getMaxFps(), codecOptions,
options.getEncoderName(), options.getDownsizeOnError());
try {
// synchronous
screenEncoder.streamScreen(device, videoStreamer);
screenEncoder.streamScreen();
} catch (IOException e) {
// Broken pipe is expected on close, because the socket is closed by the client
if (!IO.isBrokenPipe(e)) {