Display an error dialog if we can't find an H.264 decoder

This commit is contained in:
Cameron Gutman
2015-12-16 18:30:53 -08:00
parent 9bb91e1085
commit 3b1fcdfb10
3 changed files with 18 additions and 0 deletions

View File

@@ -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)