mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Display an error dialog if we can't find an H.264 decoder
This commit is contained in:
parent
9bb91e1085
commit
3b1fcdfb10
@ -205,6 +205,18 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
Toast.makeText(this, "No H.265 decoder found.\nFalling back to H.264.", Toast.LENGTH_LONG).show();
|
Toast.makeText(this, "No H.265 decoder found.\nFalling back to H.264.", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!decoderRenderer.isAvcSupported()) {
|
||||||
|
if (spinner != null) {
|
||||||
|
spinner.dismiss();
|
||||||
|
spinner = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we can't find an AVC decoder, we can't proceed
|
||||||
|
Dialog.displayDialog(this, getResources().getString(R.string.conn_error_title),
|
||||||
|
"This device or ROM doesn't support hardware accelerated H.264 playback.", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
StreamConfiguration config = new StreamConfiguration.Builder()
|
StreamConfiguration config = new StreamConfiguration.Builder()
|
||||||
.setResolution(prefConfig.width, prefConfig.height)
|
.setResolution(prefConfig.width, prefConfig.height)
|
||||||
.setRefreshRate(prefConfig.fps)
|
.setRefreshRate(prefConfig.fps)
|
||||||
|
@ -4,4 +4,5 @@ import com.limelight.nvstream.av.video.VideoDecoderRenderer;
|
|||||||
|
|
||||||
public abstract class EnhancedDecoderRenderer extends VideoDecoderRenderer {
|
public abstract class EnhancedDecoderRenderer extends VideoDecoderRenderer {
|
||||||
public abstract boolean isHevcSupported();
|
public abstract boolean isHevcSupported();
|
||||||
|
public abstract boolean isAvcSupported();
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,11 @@ public class MediaCodecDecoderRenderer extends EnhancedDecoderRenderer {
|
|||||||
return hevcDecoderName != null;
|
return hevcDecoderName != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAvcSupported() {
|
||||||
|
return avcDecoderName != null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setup(VideoDecoderRenderer.VideoFormat format, int width, int height, int redrawRate, Object renderTarget, int drFlags) {
|
public boolean setup(VideoDecoderRenderer.VideoFormat format, int width, int height, int redrawRate, Object renderTarget, int drFlags) {
|
||||||
this.initialWidth = width;
|
this.initialWidth = width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user