mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix codec display after streaming and restore polling behavior of non-direct submit decoders
This commit is contained in:
parent
36b248be4b
commit
732311c2a4
@ -424,7 +424,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
int videoFormat = conn.getActiveVideoFormat();
|
int videoFormat = decoderRenderer.getActiveVideoFormat();
|
||||||
|
|
||||||
displayedFailureDialog = true;
|
displayedFailureDialog = true;
|
||||||
stopConnection();
|
stopConnection();
|
||||||
|
@ -133,6 +133,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
return avcDecoder != null;
|
return avcDecoder != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getActiveVideoFormat() {
|
||||||
|
return this.videoFormat;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setup(int format, int width, int height, int redrawRate) {
|
public boolean setup(int format, int width, int height, int redrawRate) {
|
||||||
this.initialWidth = width;
|
this.initialWidth = width;
|
||||||
@ -274,7 +278,8 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
while (!isInterrupted()) {
|
while (!isInterrupted()) {
|
||||||
try {
|
try {
|
||||||
// Try to output a frame
|
// Try to output a frame
|
||||||
int outIndex = videoDecoder.dequeueOutputBuffer(info, 50000);
|
int outIndex = videoDecoder.dequeueOutputBuffer(info,
|
||||||
|
directSubmit ? 50000 : 0);
|
||||||
if (outIndex >= 0) {
|
if (outIndex >= 0) {
|
||||||
long presentationTimeUs = info.presentationTimeUs;
|
long presentationTimeUs = info.presentationTimeUs;
|
||||||
int lastIndex = outIndex;
|
int lastIndex = outIndex;
|
||||||
@ -301,6 +306,9 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
} else {
|
} else {
|
||||||
switch (outIndex) {
|
switch (outIndex) {
|
||||||
case MediaCodec.INFO_TRY_AGAIN_LATER:
|
case MediaCodec.INFO_TRY_AGAIN_LATER:
|
||||||
|
if (!directSubmit) {
|
||||||
|
Thread.yield();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MediaCodec.INFO_OUTPUT_FORMAT_CHANGED:
|
case MediaCodec.INFO_OUTPUT_FORMAT_CHANGED:
|
||||||
LimeLog.info("Output format changed");
|
LimeLog.info("Output format changed");
|
||||||
@ -328,7 +336,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
startTime = MediaCodecHelper.getMonotonicMillis();
|
startTime = MediaCodecHelper.getMonotonicMillis();
|
||||||
|
|
||||||
while (rendererThread.isAlive() && index < 0) {
|
while (rendererThread.isAlive() && index < 0) {
|
||||||
index = videoDecoder.dequeueInputBuffer(500);
|
index = videoDecoder.dequeueInputBuffer(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit e9b406c52e552dca6e3ad98771f5ea1b94363248
|
Subproject commit bda8e3b84ddb633d47b00ffc7ec4d5f20c7eecae
|
Loading…
x
Reference in New Issue
Block a user