mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 02:53:05 +00:00
Display an error dialog if we can't find an H.264 decoder
This commit is contained in:
parent
9bb91e1085
commit
3b1fcdfb10
@ -204,6 +204,18 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
if (prefConfig.videoFormat == PreferenceConfiguration.FORCE_H265_ON && !decoderRenderer.isHevcSupported()) {
|
||||
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()
|
||||
.setResolution(prefConfig.width, prefConfig.height)
|
||||
|
@ -4,4 +4,5 @@ import com.limelight.nvstream.av.video.VideoDecoderRenderer;
|
||||
|
||||
public abstract class EnhancedDecoderRenderer extends VideoDecoderRenderer {
|
||||
public abstract boolean isHevcSupported();
|
||||
public abstract boolean isAvcSupported();
|
||||
}
|
||||
|
@ -116,6 +116,11 @@ public class MediaCodecDecoderRenderer extends EnhancedDecoderRenderer {
|
||||
return hevcDecoderName != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvcSupported() {
|
||||
return avcDecoderName != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setup(VideoDecoderRenderer.VideoFormat format, int width, int height, int redrawRate, Object renderTarget, int drFlags) {
|
||||
this.initialWidth = width;
|
||||
|
Loading…
x
Reference in New Issue
Block a user