From 8f25081bbb549bf363d601cede490d83e66e9bd7 Mon Sep 17 00:00:00 2001 From: Acaki Date: Sat, 12 Jul 2025 03:25:17 +0800 Subject: [PATCH] fix: cleanup fps and resolution settings --- .../ViewControllers/SettingsViewController.m | 18 ++++++------------ .../StreamFrameViewController.m | 3 +-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index da5f28b7..a0ee91e9 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -149,7 +149,7 @@ static const int bitrateTable[] = { 500000, }; -const int RESOLUTION_TABLE_SIZE = 7; +const int RESOLUTION_TABLE_SIZE = 6; const int RESOLUTION_TABLE_CUSTOM_INDEX = RESOLUTION_TABLE_SIZE - 1; CGSize resolutionTable[RESOLUTION_TABLE_SIZE]; @@ -1171,11 +1171,10 @@ BOOL isCustomResolution(CGSize res) { resolutionTable[0] = CGSizeMake(1280, 720); resolutionTable[1] = CGSizeMake(1920, 1080); - resolutionTable[2] = CGSizeMake(2560, 1440); - resolutionTable[3] = CGSizeMake(3840, 2160); - resolutionTable[4] = CGSizeMake(safeAreaWidth, fullScreenHeight); - resolutionTable[5] = CGSizeMake(fullScreenWidth, fullScreenHeight); - resolutionTable[6] = CGSizeMake([currentSettings.width integerValue], [currentSettings.height integerValue]); // custom initial value + resolutionTable[2] = CGSizeMake(3840, 2160); + resolutionTable[3] = CGSizeMake(safeAreaWidth, fullScreenHeight); + resolutionTable[4] = CGSizeMake(fullScreenWidth, fullScreenHeight); + resolutionTable[5] = CGSizeMake([currentSettings.width integerValue], [currentSettings.height integerValue]); // custom initial value [self updateResolutionTable]; // Don't populate the custom entry unless we have a custom resolution @@ -1193,11 +1192,8 @@ BOOL isCustomResolution(CGSize res) { case 60: framerate = 1; break; - case 90: - framerate = 2; - break; case 120: - framerate = 3; + framerate = 2; break; } @@ -1840,8 +1836,6 @@ BOOL isCustomResolution(CGSize res) { case 1: return 60; case 2: - return 90; - case 3: return 120; default: abort(); diff --git a/VoidLink/ViewControllers/StreamFrameViewController.m b/VoidLink/ViewControllers/StreamFrameViewController.m index 97542259..a78bf2a5 100644 --- a/VoidLink/ViewControllers/StreamFrameViewController.m +++ b/VoidLink/ViewControllers/StreamFrameViewController.m @@ -411,7 +411,7 @@ if(_settings.externalDisplayMode.intValue == 2) _streamVideoRenderView = _streamView; else { //NSLog(@"renderView separated from streamView"); - _streamVideoRenderView = (StreamView*)[[UIView alloc] initWithFrame:self.view.frame]; + _streamVideoRenderView = [[StreamView alloc] initWithFrame:self.view.frame]; _streamVideoRenderView.bounds = _streamView.bounds; _streamVideoRenderView.userInteractionEnabled = false; // this will prevent renderView from intrecepting touchEvents which shall be interacting with streamView } @@ -457,7 +457,6 @@ // This is added to the _overlayView when displayed #endif - _streamView = [[StreamView alloc] initWithFrame:self.view.frame]; #if TARGET_OS_TV // we need to tell the other remote handler in RelativeTouchHandler to wait for our double-select RelativeTouchHandler *touchHandler = (RelativeTouchHandler *)[_streamView touchHandler];