Use a streamer to send the audio stream

Send each encoded audio packet using a streamer.

PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
This commit is contained in:
Romain Vimont 2023-02-09 21:37:16 +01:00
parent 5eed2c52c2
commit 7cf5cf5875
4 changed files with 58 additions and 2 deletions

View file

@ -111,7 +111,8 @@ public final class Server {
}
if (audio) {
audioEncoder = new AudioEncoder();
Streamer audioStreamer = new Streamer(connection.getAudioFd(), AudioCodec.OPUS, options.getSendCodecId(), options.getSendFrameMeta());
audioEncoder = new AudioEncoder(audioStreamer);
audioEncoder.start();
}