mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
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:
parent
7853c4c303
commit
af1f00bece
3 changed files with 14 additions and 6 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue