mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Disable latency tracking due to performance problems
This commit is contained in:
parent
a639143e94
commit
3dd57e9f38
@ -28,10 +28,6 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
||||
private boolean needsSpsNumRefFixup;
|
||||
private VideoDepacketizer depacketizer;
|
||||
|
||||
private long totalTimeMs;
|
||||
private long decoderTimeMs;
|
||||
private int totalFrames;
|
||||
|
||||
private final static byte[] BITSTREAM_RESTRICTIONS = new byte[] {(byte) 0xF1, (byte) 0x83, 0x2A, 0x00};
|
||||
|
||||
public static final List<String> blacklistedDecoderPrefixes;
|
||||
@ -183,13 +179,6 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
||||
if (outIndex >= 0) {
|
||||
int lastIndex = outIndex;
|
||||
|
||||
// Add delta time to the totals (excluding probable outliers)
|
||||
long delta = System.currentTimeMillis()-info.presentationTimeUs;
|
||||
if (delta > 5 && delta < 300) {
|
||||
decoderTimeMs += delta;
|
||||
totalTimeMs += delta;
|
||||
}
|
||||
|
||||
// Get the last output buffer in the queue
|
||||
while ((outIndex = videoDecoder.dequeueOutputBuffer(info, 0)) >= 0) {
|
||||
videoDecoder.releaseOutputBuffer(lastIndex, false);
|
||||
@ -248,13 +237,6 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
||||
{
|
||||
ByteBuffer buf = videoDecoderInputBuffers[inputIndex];
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long delta = currentTime-decodeUnit.getReceiveTimestamp();
|
||||
if (delta >= 0 && delta < 300) {
|
||||
totalTimeMs += currentTime-decodeUnit.getReceiveTimestamp();
|
||||
totalFrames++;
|
||||
}
|
||||
|
||||
// Clear old input data
|
||||
buf.clear();
|
||||
|
||||
@ -327,7 +309,7 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
||||
|
||||
videoDecoder.queueInputBuffer(inputIndex,
|
||||
0, spsLength,
|
||||
currentTime, codecFlags);
|
||||
0, codecFlags);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -340,7 +322,7 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
||||
|
||||
videoDecoder.queueInputBuffer(inputIndex,
|
||||
0, decodeUnit.getDataLength(),
|
||||
currentTime, codecFlags);
|
||||
0, codecFlags);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -432,11 +414,11 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
||||
|
||||
@Override
|
||||
public int getAverageDecoderLatency() {
|
||||
return (int)(decoderTimeMs / totalFrames);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAverageEndToEndLatency() {
|
||||
return (int)(totalTimeMs / totalFrames);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user