Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/limelight/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Enter landscape unless we're on a square screen
setPreferredOrientationForCurrentDisplay();

if (prefConfig.stretchVideo || shouldIgnoreInsetsForResolution(prefConfig.width, prefConfig.height)) {
if (prefConfig.stretchVideo || prefConfig.zoomVideo || shouldIgnoreInsetsForResolution(prefConfig.width, prefConfig.height)) {
// Allow the activity to layout under notches if the fill-screen option
// was turned on by the user or it's a full-screen native resolution
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Expand Down Expand Up @@ -943,7 +943,7 @@ else if (!isRefreshRateGoodMatch(candidate.getRefreshRate())) {
}
}

if (prefConfig.stretchVideo || aspectRatioMatch) {
if (prefConfig.stretchVideo || prefConfig.zoomVideo || aspectRatioMatch) {
// Set the surface to the size of the video
streamView.getHolder().setFixedSize(prefConfig.width, prefConfig.height);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,13 @@ else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
LimeLog.info("Input format: "+inputFormat);
}

videoDecoder.setVideoScalingMode(MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
// Use crop-to-fit when zoom to fill is enabled, otherwise scale to fit
if (prefs != null && prefs.zoomVideo && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
videoDecoder.setVideoScalingMode(MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
}
else {
videoDecoder.setVideoScalingMode(MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
}

// Start the decoder
videoDecoder.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum AnalogStickForScrolling {
private static final String BITRATE_PREF_OLD_STRING = "seekbar_bitrate";
private static final String STRETCH_PREF_STRING = "checkbox_stretch_video";
private static final String SOPS_PREF_STRING = "checkbox_enable_sops";
private static final String ZOOM_PREF_STRING = "checkbox_zoom_video";
private static final String DISABLE_TOASTS_PREF_STRING = "checkbox_disable_warnings";
private static final String HOST_AUDIO_PREF_STRING = "checkbox_host_audio";
private static final String DEADZONE_PREF_STRING = "seekbar_deadzone";
Expand Down Expand Up @@ -127,7 +128,7 @@ public enum AnalogStickForScrolling {
public FormatOption videoFormat;
public int deadzonePercentage;
public int oscOpacity;
public boolean stretchVideo, enableSops, playHostAudio, disableWarnings;
public boolean stretchVideo, zoomVideo, enableSops, playHostAudio, disableWarnings;
public String language;
public boolean smallIconMode, multiController, usbDriver, flipFaceButtons;
public boolean onscreenController;
Expand Down Expand Up @@ -574,6 +575,7 @@ else if (audioConfig.equals("51")) {
config.disableWarnings = prefs.getBoolean(DISABLE_TOASTS_PREF_STRING, DEFAULT_DISABLE_TOASTS);
config.enableSops = prefs.getBoolean(SOPS_PREF_STRING, DEFAULT_SOPS);
config.stretchVideo = prefs.getBoolean(STRETCH_PREF_STRING, DEFAULT_STRETCH);
config.zoomVideo = prefs.getBoolean(ZOOM_PREF_STRING, false);
config.playHostAudio = prefs.getBoolean(HOST_AUDIO_PREF_STRING, DEFAULT_HOST_AUDIO);
config.smallIconMode = prefs.getBoolean(SMALL_ICONS_PREF_STRING, getDefaultSmallMode(context));
config.multiController = prefs.getBoolean(MULTI_CONTROLLER_PREF_STRING, DEFAULT_MULTI_CONTROLLER);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<string name="summary_seekbar_bitrate">Increase for better image quality. Decrease to improve performance on slower connections.</string>
<string name="suffix_seekbar_bitrate_mbps">Mbps</string>
<string name="title_checkbox_stretch_video">Stretch video to full-screen</string>
<string name="title_checkbox_zoom_video">Zoom video to fill</string>
<string name="resolution_prefix_native">Native</string>
<string name="resolution_prefix_native_fullscreen">Native Full-Screen</string>
<string name="resolution_prefix_native_landscape">(Landscape)</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
android:key="checkbox_stretch_video"
android:title="@string/title_checkbox_stretch_video"
android:defaultValue="false" />
<CheckBoxPreference
android:key="checkbox_zoom_video"
android:title="@string/title_checkbox_zoom_video"
android:defaultValue="false" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/category_audio_settings">
<ListPreference
Expand Down