mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-10 10:08:52 +00:00
Rename "codec meta" to "stream meta"
The stream metadata will contain both: - the codec id at the start of the stream - the session metadata (video width and height) at the start of every "session" (typically on rotation)
This commit is contained in:
parent
d74cfd5711
commit
fa99c6bcdd
4 changed files with 14 additions and 15 deletions
|
@ -409,12 +409,11 @@ with any client which uses the same protocol.
|
|||
|
||||
For simplicity, some [server-specific options] have been added to produce raw
|
||||
streams easily:
|
||||
- `send_device_meta=false`: disable the device metata (in practice, the device
|
||||
- `send_device_meta=false`: disable device metadata (in practice, the device
|
||||
name) sent on the _first_ socket
|
||||
- `send_frame_meta=false`: disable the 12-byte header for each packet
|
||||
- `send_dummy_byte`: disable the dummy byte sent on forward connections
|
||||
- `send_codec_meta`: disable the codec information (and initial device size for
|
||||
video)
|
||||
- `send_stream_meta`: disable codec and video size metadata
|
||||
- `raw_stream`: disable all the above
|
||||
|
||||
[server-specific options]: https://github.com/Genymobile/scrcpy/blob/a3cdf1a6b86ea22786e1f7d09b9c202feabc6949/server/src/main/java/com/genymobile/scrcpy/Options.java#L309-L329
|
||||
|
|
|
@ -78,7 +78,7 @@ public class Options {
|
|||
private boolean sendDeviceMeta = true; // send device name and size
|
||||
private boolean sendFrameMeta = true; // send PTS so that the client may record properly
|
||||
private boolean sendDummyByte = true; // write a byte on start to detect connection issues
|
||||
private boolean sendCodecMeta = true; // write the codec metadata before the stream
|
||||
private boolean sendStreamMeta = true; // write the stream metadata (codec and session)
|
||||
|
||||
public Ln.Level getLogLevel() {
|
||||
return logLevel;
|
||||
|
@ -284,8 +284,8 @@ public class Options {
|
|||
return sendDummyByte;
|
||||
}
|
||||
|
||||
public boolean getSendCodecMeta() {
|
||||
return sendCodecMeta;
|
||||
public boolean getSendStreamMeta() {
|
||||
return sendStreamMeta;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MethodLength")
|
||||
|
@ -500,8 +500,8 @@ public class Options {
|
|||
case "send_dummy_byte":
|
||||
options.sendDummyByte = Boolean.parseBoolean(value);
|
||||
break;
|
||||
case "send_codec_meta":
|
||||
options.sendCodecMeta = Boolean.parseBoolean(value);
|
||||
case "send_stream_meta":
|
||||
options.sendStreamMeta = Boolean.parseBoolean(value);
|
||||
break;
|
||||
case "raw_stream":
|
||||
boolean rawStream = Boolean.parseBoolean(value);
|
||||
|
@ -509,7 +509,7 @@ public class Options {
|
|||
options.sendDeviceMeta = false;
|
||||
options.sendFrameMeta = false;
|
||||
options.sendDummyByte = false;
|
||||
options.sendCodecMeta = false;
|
||||
options.sendStreamMeta = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -126,7 +126,7 @@ public final class Server {
|
|||
audioCapture = new AudioPlaybackCapture(options.getAudioDup());
|
||||
}
|
||||
|
||||
Streamer audioStreamer = new Streamer(connection.getAudioFd(), audioCodec, options.getSendCodecMeta(), options.getSendFrameMeta());
|
||||
Streamer audioStreamer = new Streamer(connection.getAudioFd(), audioCodec, options.getSendStreamMeta(), options.getSendFrameMeta());
|
||||
AsyncProcessor audioRecorder;
|
||||
if (audioCodec == AudioCodec.RAW) {
|
||||
audioRecorder = new AudioRawRecorder(audioCapture, audioStreamer);
|
||||
|
@ -137,7 +137,7 @@ public final class Server {
|
|||
}
|
||||
|
||||
if (video) {
|
||||
Streamer videoStreamer = new Streamer(connection.getVideoFd(), options.getVideoCodec(), options.getSendCodecMeta(),
|
||||
Streamer videoStreamer = new Streamer(connection.getVideoFd(), options.getVideoCodec(), options.getSendStreamMeta(),
|
||||
options.getSendFrameMeta());
|
||||
SurfaceCapture surfaceCapture;
|
||||
if (options.getVideoSource() == VideoSource.DISPLAY) {
|
||||
|
|
|
@ -19,7 +19,7 @@ public final class Streamer {
|
|||
|
||||
private final FileDescriptor fd;
|
||||
private final Codec codec;
|
||||
private final boolean sendCodecMeta;
|
||||
private final boolean sendStreamMeta;
|
||||
private final boolean sendFrameMeta;
|
||||
|
||||
private final ByteBuffer headerBuffer = ByteBuffer.allocate(12);
|
||||
|
@ -27,7 +27,7 @@ public final class Streamer {
|
|||
public Streamer(FileDescriptor fd, Codec codec, boolean sendCodecMeta, boolean sendFrameMeta) {
|
||||
this.fd = fd;
|
||||
this.codec = codec;
|
||||
this.sendCodecMeta = sendCodecMeta;
|
||||
this.sendStreamMeta = sendCodecMeta;
|
||||
this.sendFrameMeta = sendFrameMeta;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public final class Streamer {
|
|||
}
|
||||
|
||||
public void writeAudioHeader() throws IOException {
|
||||
if (sendCodecMeta) {
|
||||
if (sendStreamMeta) {
|
||||
ByteBuffer buffer = ByteBuffer.allocate(4);
|
||||
buffer.putInt(codec.getId());
|
||||
buffer.flip();
|
||||
|
@ -45,7 +45,7 @@ public final class Streamer {
|
|||
}
|
||||
|
||||
public void writeVideoHeader(Size videoSize) throws IOException {
|
||||
if (sendCodecMeta) {
|
||||
if (sendStreamMeta) {
|
||||
ByteBuffer buffer = ByteBuffer.allocate(12);
|
||||
buffer.putInt(codec.getId());
|
||||
buffer.putInt(videoSize.getWidth());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue