Rename --bit-rate to --video-bit-rate

This prepares the introduction of --audio-bit-rate.
This commit is contained in:
Romain Vimont 2023-02-21 19:56:44 +01:00
commit 0c2e2b998d
14 changed files with 29 additions and 29 deletions

View file

@ -11,7 +11,7 @@ public class Options {
private boolean audio = true;
private int maxSize;
private VideoCodec videoCodec = VideoCodec.H264;
private int bitRate = 8000000;
private int videoBitRate = 8000000;
private int maxFps;
private int lockVideoOrientation = -1;
private boolean tunnelForward;
@ -74,12 +74,12 @@ public class Options {
this.videoCodec = videoCodec;
}
public int getBitRate() {
return bitRate;
public int getVideoBitRate() {
return videoBitRate;
}
public void setBitRate(int bitRate) {
this.bitRate = bitRate;
public void setVideoBitRate(int videoBitRate) {
this.videoBitRate = videoBitRate;
}
public int getMaxFps() {

View file

@ -35,18 +35,18 @@ public class ScreenEncoder implements Device.RotationListener {
private final Streamer streamer;
private final String encoderName;
private final List<CodecOption> codecOptions;
private final int bitRate;
private final int videoBitRate;
private final int maxFps;
private final boolean downsizeOnError;
private boolean firstFrameSent;
private int consecutiveErrors;
public ScreenEncoder(Device device, Streamer streamer, int bitRate, int maxFps, List<CodecOption> codecOptions, String encoderName,
public ScreenEncoder(Device device, Streamer streamer, int videoBitRate, int maxFps, List<CodecOption> codecOptions, String encoderName,
boolean downsizeOnError) {
this.device = device;
this.streamer = streamer;
this.bitRate = bitRate;
this.videoBitRate = videoBitRate;
this.maxFps = maxFps;
this.codecOptions = codecOptions;
this.encoderName = encoderName;
@ -65,7 +65,7 @@ public class ScreenEncoder implements Device.RotationListener {
public void streamScreen() throws IOException, ConfigurationException {
Codec codec = streamer.getCodec();
MediaCodec mediaCodec = createMediaCodec(codec, encoderName);
MediaFormat format = createFormat(codec.getMimeType(), bitRate, maxFps, codecOptions);
MediaFormat format = createFormat(codec.getMimeType(), videoBitRate, maxFps, codecOptions);
IBinder display = createDisplay();
device.setRotationListener(this);

View file

@ -117,7 +117,7 @@ public final class Server {
Streamer videoStreamer = new Streamer(connection.getVideoFd(), options.getVideoCodec(), options.getSendCodecId(),
options.getSendFrameMeta());
ScreenEncoder screenEncoder = new ScreenEncoder(device, videoStreamer, options.getBitRate(), options.getMaxFps(), codecOptions,
ScreenEncoder screenEncoder = new ScreenEncoder(device, videoStreamer, options.getVideoBitRate(), options.getMaxFps(), codecOptions,
options.getEncoderName(), options.getDownsizeOnError());
try {
// synchronous
@ -206,9 +206,9 @@ public final class Server {
int maxSize = Integer.parseInt(value) & ~7; // multiple of 8
options.setMaxSize(maxSize);
break;
case "bit_rate":
int bitRate = Integer.parseInt(value);
options.setBitRate(bitRate);
case "video_bit_rate":
int videoBitRate = Integer.parseInt(value);
options.setVideoBitRate(videoBitRate);
break;
case "max_fps":
int maxFps = Integer.parseInt(value);