mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-20 07:24:42 +00:00
Update moonlight-common-c
This commit is contained in:
1 parent
9221a0ca3a
commit
0dc4c4fe67
6 files changed
+22
-11
No files matched your search
@@ -113,6 +113,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
|
||||
private long lastTimestampUs;
|
||||
private int lastFrameNumber;
|
||||
private long baseTimestampUs;
|
||||
private int refreshRate;
|
||||
private PreferenceConfiguration prefs;
|
||||
|
||||
@@ -1396,7 +1397,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
@Override
|
||||
public int submitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
|
||||
int frameNumber, int frameType, char frameHostProcessingLatency,
|
||||
long receiveTimeMs, long enqueueTimeMs) {
|
||||
long receiveTimeUs, long enqueueTimeUs) {
|
||||
if (stopping) {
|
||||
// Don't bother if we're stopping
|
||||
return MoonBridge.DR_OK;
|
||||
@@ -1695,7 +1696,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
// Count time from first packet received to enqueue time as receive time
|
||||
// We will count DU queue time as part of decoding, because it is directly
|
||||
// caused by a slow decoder.
|
||||
activeWindowVideoStats.totalTimeMs += enqueueTimeMs - receiveTimeMs;
|
||||
activeWindowVideoStats.totalTimeMs += (enqueueTimeUs - receiveTimeUs) / 1000;
|
||||
}
|
||||
|
||||
if (!fetchNextInputBuffer()) {
|
||||
@@ -1721,7 +1722,12 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
}
|
||||
}
|
||||
|
||||
long timestampUs = enqueueTimeMs * 1000;
|
||||
// The frame timestamps use an undefined epoch, so normalize them to uptime microseconds.
|
||||
if (baseTimestampUs == 0) {
|
||||
baseTimestampUs = (SystemClock.uptimeMillis() * 1000) - enqueueTimeUs;
|
||||
}
|
||||
|
||||
long timestampUs = baseTimestampUs + enqueueTimeUs;
|
||||
if (timestampUs <= lastTimestampUs) {
|
||||
// We can't submit multiple buffers with the same timestamp
|
||||
// so bump it up by one before queuing
|
||||
|
||||
@@ -11,7 +11,7 @@ public abstract class VideoDecoderRenderer {
|
||||
// for an IDR frame which contains several parameter sets and the I-frame data.
|
||||
public abstract int submitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
|
||||
int frameNumber, int frameType, char frameHostProcessingLatency,
|
||||
long receiveTimeMs, long enqueueTimeMs);
|
||||
long receiveTimeUs, long enqueueTimeUs);
|
||||
|
||||
public abstract void cleanup();
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ public class MoonBridge {
|
||||
public static final byte LI_CTYPE_XBOX = 0x01;
|
||||
public static final byte LI_CTYPE_PS = 0x02;
|
||||
public static final byte LI_CTYPE_NINTENDO = 0x03;
|
||||
public static final byte LI_CTYPE_STEAM = 0x04;
|
||||
|
||||
public static final short LI_CCAP_ANALOG_TRIGGERS = 0x01;
|
||||
public static final short LI_CCAP_RUMBLE = 0x02;
|
||||
@@ -111,6 +112,7 @@ public class MoonBridge {
|
||||
public static final short LI_CCAP_GYRO = 0x20;
|
||||
public static final short LI_CCAP_BATTERY_STATE = 0x40;
|
||||
public static final short LI_CCAP_RGB_LED = 0x80;
|
||||
public static final short LI_CCAP_DUAL_TOUCHPAD = 0x100;
|
||||
|
||||
public static final byte LI_MOTION_TYPE_ACCEL = 0x01;
|
||||
public static final byte LI_MOTION_TYPE_GYRO = 0x02;
|
||||
@@ -217,10 +219,10 @@ public class MoonBridge {
|
||||
|
||||
public static int bridgeDrSubmitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
|
||||
int frameNumber, int frameType, char frameHostProcessingLatency,
|
||||
long receiveTimeMs, long enqueueTimeMs) {
|
||||
long receiveTimeUs, long enqueueTimeUs) {
|
||||
if (videoRenderer != null) {
|
||||
return videoRenderer.submitDecodeUnit(decodeUnitData, decodeUnitLength,
|
||||
decodeUnitType, frameNumber, frameType, frameHostProcessingLatency, receiveTimeMs, enqueueTimeMs);
|
||||
decodeUnitType, frameNumber, frameType, frameHostProcessingLatency, receiveTimeUs, enqueueTimeUs);
|
||||
}
|
||||
else {
|
||||
return DR_OK;
|
||||
|
||||
Reference in new issue
Block a user