mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Fix surface sizing with scaling disabled on the CPU decoder
This commit is contained in:
parent
f892db6ee8
commit
8887401644
@ -610,9 +610,13 @@ public class Game extends Activity implements SurfaceHolder.Callback, OnGenericM
|
||||
|
||||
// Resize the surface to match the aspect ratio of the video
|
||||
// This must be done after the surface is created.
|
||||
if (!stretchToFit) {
|
||||
if (!stretchToFit && decoderRenderer.isHardwareAccelerated()) {
|
||||
resizeSurfaceWithAspectRatio((SurfaceView) findViewById(R.id.surfaceView), width, height);
|
||||
}
|
||||
else if (!decoderRenderer.isHardwareAccelerated()) {
|
||||
// Make sure the surface is the correct size since we render directly to it
|
||||
holder.setFixedSize(width, height);
|
||||
}
|
||||
|
||||
conn.start(PlatformBinding.getDeviceName(), holder, drFlags,
|
||||
PlatformBinding.getAudioRenderer(), decoderRenderer);
|
||||
|
@ -26,6 +26,10 @@ public class ConfigurableDecoderRenderer implements VideoDecoderRenderer {
|
||||
}
|
||||
return decoderRenderer.setup(width, height, redrawRate, renderTarget, drFlags);
|
||||
}
|
||||
|
||||
public boolean isHardwareAccelerated() {
|
||||
return (decoderRenderer instanceof MediaCodecDecoderRenderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean start(VideoDepacketizer depacketizer) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user