Simplify ScreenEncoder

Do not handle iFrameInterval field and parameter, it is never used
dynamically.
This commit is contained in:
Romain Vimont 2020-04-12 02:08:56 +02:00
parent ee2894779a
commit 927d655ff6

View file

@ -27,19 +27,13 @@ public class ScreenEncoder implements Device.RotationListener {
private int bitRate;
private int maxFps;
private int iFrameInterval;
private boolean sendFrameMeta;
private long ptsOrigin;
public ScreenEncoder(boolean sendFrameMeta, int bitRate, int maxFps, int iFrameInterval) {
public ScreenEncoder(boolean sendFrameMeta, int bitRate, int maxFps) {
this.sendFrameMeta = sendFrameMeta;
this.bitRate = bitRate;
this.maxFps = maxFps;
this.iFrameInterval = iFrameInterval;
}
public ScreenEncoder(boolean sendFrameMeta, int bitRate, int maxFps) {
this(sendFrameMeta, bitRate, maxFps, DEFAULT_I_FRAME_INTERVAL);
}
@Override
@ -55,7 +49,7 @@ public class ScreenEncoder implements Device.RotationListener {
Workarounds.prepareMainLooper();
Workarounds.fillAppInfo();
MediaFormat format = createFormat(bitRate, maxFps, iFrameInterval);
MediaFormat format = createFormat(bitRate, maxFps, DEFAULT_I_FRAME_INTERVAL);
device.setRotationListener(this);
boolean alive;
try {