Merge pull request #160 from Acaki/fix/Metal_AV1_SDR
Fix Metal AV1 SDR color range issue
This commit is contained in:
@@ -584,6 +584,29 @@
|
||||
<constraint firstAttribute="height" constant="31" id="8mE-tx-T8i"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="iPd-Rg-St7" userLabel="fullRangeStack">
|
||||
<rect key="frame" x="432" y="1901" width="280" height="31"/>
|
||||
<subviews>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Full Range" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iPd-Ra-Lbl" userLabel="fullRangeLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="130" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="iPd-Ra-Wdt"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iPd-Wt-Ch9" userLabel="fullRangeSwitch">
|
||||
<rect key="frame" x="150" y="0.0" width="132" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="iPd-Wt-Wdt"/>
|
||||
</constraints>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="31" id="iPd-Ht-Con"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="H8p-G9-pnl" userLabel="performanceGraphs Stack">
|
||||
<rect key="frame" x="440" y="1198" width="380" height="68"/>
|
||||
<subviews>
|
||||
@@ -1966,6 +1989,8 @@
|
||||
<outlet property="pinchSensitivityStack" destination="t6B-h4-iY7" id="vab-io-SzJ"/>
|
||||
<outlet property="pipStack" destination="12a-Wi-LlL" id="eTJ-0h-hRB"/>
|
||||
<outlet property="pipSwitch" destination="VTC-Z9-IYM" id="gzC-rU-DoP"/>
|
||||
<outlet property="fullRangeStack" destination="iPd-Rg-St7" id="iPd-Out-Let"/>
|
||||
<outlet property="fullRangeSwitch" destination="iPd-Wt-Ch9" id="iPd-Out-Swt"/>
|
||||
<outlet property="pitchSensitivitySlider" destination="HZZ-GL-j2Z" id="4ji-Jt-WdT"/>
|
||||
<outlet property="pitchSensitivityStack" destination="gSn-tW-p9e" id="Gbg-PK-dpf"/>
|
||||
<outlet property="pointerVelocityDividerStack" destination="b1U-nD-gYE" id="ep1-K3-rKj"/>
|
||||
|
||||
@@ -1739,6 +1739,29 @@
|
||||
<constraint firstAttribute="height" constant="31" id="DlE-MW-o6j"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="fRg-Rn-St7" userLabel="fullRangeStack">
|
||||
<rect key="frame" x="437" y="1659" width="280" height="31"/>
|
||||
<subviews>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Full Range" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fRl-Ra-Lbl" userLabel="fullRangeLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="130" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="fRl-Ra-Wdt"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fRs-Wt-Ch9" userLabel="fullRangeSwitch">
|
||||
<rect key="frame" x="150" y="0.0" width="132" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="fRs-Wt-Wdt"/>
|
||||
</constraints>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="31" id="fRg-Ht-Con"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="9eE-iu-W90" userLabel="backgroundSessionTimerStack">
|
||||
<rect key="frame" x="437" y="1397" width="380" height="55.5"/>
|
||||
<subviews>
|
||||
@@ -2823,6 +2846,8 @@
|
||||
<outlet property="pinchSensitivityStack" destination="ZAC-ju-Qfi" id="7t2-gm-BFk"/>
|
||||
<outlet property="pipStack" destination="hvN-TZ-ziV" id="6oL-0b-Bto"/>
|
||||
<outlet property="pipSwitch" destination="mgR-dj-4gu" id="b8b-7E-wrq"/>
|
||||
<outlet property="fullRangeStack" destination="fRg-Rn-St7" id="fRg-Out-Let"/>
|
||||
<outlet property="fullRangeSwitch" destination="fRs-Wt-Ch9" id="fRs-Out-Let"/>
|
||||
<outlet property="pitchSensitivitySlider" destination="4AR-S2-QX8" id="Ohj-qb-AUW"/>
|
||||
<outlet property="pitchSensitivityStack" destination="pYu-QR-UfH" id="bB1-70-SpJ"/>
|
||||
<outlet property="pointerVelocityDividerStack" destination="Jp2-5v-Zr0" id="0mB-RI-df8"/>
|
||||
|
||||
@@ -116,6 +116,7 @@ typedef NS_ENUM(NSInteger, WidgetSizeTransition) {
|
||||
preferredCodec:(uint32_t)preferredCodec
|
||||
enableYUV444:(BOOL)enableYUV444
|
||||
enablePIP:(BOOL)enablePIP
|
||||
fullRange:(BOOL)fullRange
|
||||
enableHdr:(BOOL)enableHdr
|
||||
btMouseSupport:(BOOL)btMouseSupport
|
||||
// absoluteTouchMode:(BOOL)absoluteTouchMode
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
preferredCodec:(uint32_t)preferredCodec
|
||||
enableYUV444:(BOOL)enableYUV444
|
||||
enablePIP:(BOOL)enablePIP
|
||||
fullRange:(BOOL)fullRange
|
||||
enableHdr:(BOOL)enableHdr
|
||||
btMouseSupport:(BOOL)btMouseSupport
|
||||
// absoluteTouchMode:(BOOL)absoluteTouchMode
|
||||
@@ -161,6 +162,7 @@
|
||||
settingsToSave.preferredCodec = preferredCodec;
|
||||
settingsToSave.enableYUV444 = enableYUV444;
|
||||
settingsToSave.enablePIP = enablePIP;
|
||||
settingsToSave.fullRange = fullRange;
|
||||
settingsToSave.enableHdr = enableHdr;
|
||||
settingsToSave.btMouseSupport = btMouseSupport;
|
||||
// settingsToSave.absoluteTouchMode = absoluteTouchMode;
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
} preferredCodec;
|
||||
@property (nonatomic) BOOL enableYUV444;
|
||||
@property (nonatomic) BOOL enablePIP;
|
||||
@property (nonatomic) BOOL fullRange;
|
||||
@property (nonatomic) BOOL reverseMouseWheelDirection;
|
||||
@property (nonatomic, retain) NSNumber * asyncNativeTouchPriority;
|
||||
@property (nonatomic) BOOL multiController;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
self.preferredCodec = (typeof(self.preferredCodec))[[NSUserDefaults standardUserDefaults] integerForKey:@"preferredCodec"];
|
||||
self.enableYUV444 = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableYUV444"];
|
||||
self.enablePIP = [[NSUserDefaults standardUserDefaults] boolForKey:@"enablePIP"];
|
||||
self.fullRange = [[NSUserDefaults standardUserDefaults] boolForKey:@"fullRange"];
|
||||
self.frameQueueSize = [NSNumber numberWithInteger:[[NSUserDefaults standardUserDefaults] integerForKey:@"frameQueueSize"]];
|
||||
self.playAudioOnPC = [[NSUserDefaults standardUserDefaults] boolForKey:@"audioOnPC"];
|
||||
self.enableHdr = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableHdr"];
|
||||
@@ -88,6 +89,7 @@
|
||||
self.preferredCodec = settings.preferredCodec;
|
||||
self.enableYUV444 = settings.enableYUV444;
|
||||
self.enablePIP = settings.enablePIP;
|
||||
self.fullRange = settings.fullRange;
|
||||
self.frameQueueSize = settings.frameQueueSize;
|
||||
self.playAudioOnPC = settings.playAudioOnPC;
|
||||
self.redirectMic = settings.redirectMic;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
- (void)toggleStatsOverlay;
|
||||
- (void)toggleMouseCapture;
|
||||
- (void)toggleMouseVisible;
|
||||
- (void)disconnectAndQuitApp;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -960,6 +960,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
case UIKeyboardHIDUsageKeyboardC:
|
||||
[interactionDelegate toggleMouseVisible];
|
||||
break;
|
||||
case UIKeyboardHIDUsageKeyboardD:
|
||||
[interactionDelegate disconnectAndQuitApp];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<attribute name="enablePinch" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="enablePIP" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="enableYUV444" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="fullRange" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="externalDisplayMode" optional="YES" attributeType="Integer 16" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="framePacingMode" optional="YES" attributeType="Integer 32" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="frameQueueSize" optional="YES" attributeType="Integer 32" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
|
||||
@@ -57,6 +57,7 @@ static AVAudioPCMBuffer *pcmBuffer;
|
||||
static AVAudioFormat *audioFormat;
|
||||
|
||||
static bool muteInBackground;
|
||||
static bool fullRange;
|
||||
|
||||
static VideoDecoderRenderer* renderer;
|
||||
|
||||
@@ -64,7 +65,7 @@ static BandwidthTracker *bwTracker;
|
||||
|
||||
int DrDecoderSetup(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags)
|
||||
{
|
||||
[renderer setupWithVideoFormat:videoFormat width:width height:height frameRate:redrawRate];
|
||||
[renderer setupWithVideoFormat:videoFormat width:width height:height frameRate:redrawRate fullRange:fullRange];
|
||||
lastFrameNumber = 0;
|
||||
activeVideoFormat = videoFormat;
|
||||
Log(LOG_I, @"Active video format: 0x%x", activeVideoFormat);
|
||||
@@ -591,7 +592,8 @@ void ClSetControllerLED(uint16_t controllerNumber, uint8_t r, uint8_t g, uint8_t
|
||||
_callbacks = callbacks;
|
||||
|
||||
LiInitializeStreamConfiguration(&_streamConfig);
|
||||
_streamConfig.colorRange = 1; // Full range
|
||||
_streamConfig.colorRange = config.fullRange ? 1 : 0;
|
||||
fullRange = config.fullRange;
|
||||
_streamConfig.width = config.width;
|
||||
_streamConfig.height = config.height;
|
||||
_streamConfig.fps = config.frameRate;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
@property int serverCodecModeSupport;
|
||||
@property BOOL enableYUV444;
|
||||
@property BOOL enablePIP;
|
||||
@property BOOL fullRange;
|
||||
@property int width;
|
||||
@property int height;
|
||||
@property int frameRate;
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
#import "StreamConfiguration.h"
|
||||
|
||||
@implementation StreamConfiguration
|
||||
@synthesize host, httpsPort, appID, width, height, frameRate, bitRate, riKeyId, riKey, gamepadMask, appName, optimizeGameSettings, playAudioOnPC, swapABXYButtons, buttonVisualFeedback, gyroMode, emulatedControllerType, audioConfiguration, supportedVideoFormats, multiController, serverCert, rtspSessionUrl, serverCodecModeSupport, enableYUV444, enablePIP, localVolume;
|
||||
@synthesize host, httpsPort, appID, width, height, frameRate, bitRate, riKeyId, riKey, gamepadMask, appName, optimizeGameSettings, playAudioOnPC, swapABXYButtons, buttonVisualFeedback, gyroMode, emulatedControllerType, audioConfiguration, supportedVideoFormats, multiController, serverCert, rtspSessionUrl, serverCodecModeSupport, enableYUV444, enablePIP, fullRange, localVolume;
|
||||
@end
|
||||
|
||||
@@ -205,6 +205,8 @@
|
||||
double avgVideoMbps = [_connection getBwTracker].averageMbps;
|
||||
double peakVideoMbps = [_connection getBwTracker].peakMbps;
|
||||
|
||||
NSString* colorRange = _config.fullRange ? @"Full" : @"Limited";
|
||||
|
||||
if(overlayLevel == 1) return [LocalizationHelper localizedStringForKey:@"simplifiedOsdText",
|
||||
fps,
|
||||
stats.networkDroppedFrames / interval,
|
||||
@@ -221,7 +223,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
return [LocalizationHelper localizedStringForKey:@"Video stream: %dx%d %.2f FPS (Codec: %@)\n"
|
||||
return [LocalizationHelper localizedStringForKey:@"Video stream: %dx%d %.2f FPS (Codec: %@, %@)\n"
|
||||
"Bitrate: %.1f Mbps, Peak: %.1f\n"
|
||||
"%@"
|
||||
"Renderer: %@\n"
|
||||
@@ -231,6 +233,7 @@
|
||||
_config.height,
|
||||
fps,
|
||||
[_connection getActiveCodecName],
|
||||
colorRange,
|
||||
avgVideoMbps, peakVideoMbps,
|
||||
hostProcessingString,
|
||||
rendererWithPacing,
|
||||
@@ -242,7 +245,7 @@
|
||||
rendererWithPacing = @"AVSampleBuffer (Queue Pacing)";
|
||||
}
|
||||
|
||||
return [LocalizationHelper localizedStringForKey:@"Video stream: %dx%d %.2f FPS (Codec: %@)\n"
|
||||
return [LocalizationHelper localizedStringForKey:@"Video stream: %dx%d %.2f FPS (Codec: %@, %@)\n"
|
||||
"Bitrate: %.1f Mbps, Peak: %.1f, Frames buffered: %.1f\n"
|
||||
"%@"
|
||||
"Renderer: %@\n"
|
||||
@@ -253,6 +256,7 @@
|
||||
_config.height,
|
||||
fps,
|
||||
[_connection getActiveCodecName],
|
||||
colorRange,
|
||||
avgVideoMbps, peakVideoMbps, stats.frameQueueMetrics.avg,
|
||||
hostProcessingString,
|
||||
rendererWithPacing,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
- (id)initWithView:(UIView*)view callbacks:(id<ConnectionCallbacks>)callbacks streamAspectRatio:(float)aspectRatio;
|
||||
|
||||
- (void)setupWithVideoFormat:(int)videoFormat width:(int)videoWidth height:(int)videoHeight frameRate:(int)frameRate;
|
||||
- (void)setupWithVideoFormat:(int)videoFormat width:(int)videoWidth height:(int)videoHeight frameRate:(int)frameRate fullRange:(BOOL)fullRange;
|
||||
- (void)renderFrame:(Frame *)frame atTime:(CMTime)targetTime;
|
||||
- (void)cleanup;
|
||||
- (void)setHdrMode:(BOOL)enabled;
|
||||
|
||||
@@ -42,6 +42,7 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
||||
AVSampleBufferDisplayLayer* _displayLayer;
|
||||
int _videoFormat;
|
||||
int _frameRate;
|
||||
BOOL _fullRange;
|
||||
|
||||
NSMutableArray *_parameterSetBuffers;
|
||||
NSData *_masteringDisplayColorVolume;
|
||||
@@ -150,10 +151,11 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
||||
|
||||
# pragma mark DisplayLink vsync callback
|
||||
|
||||
- (void)setupWithVideoFormat:(int)videoFormat width:(int)videoWidth height:(int)videoHeight frameRate:(int)frameRate
|
||||
- (void)setupWithVideoFormat:(int)videoFormat width:(int)videoWidth height:(int)videoHeight frameRate:(int)frameRate fullRange:(BOOL)fullRange
|
||||
{
|
||||
self->_videoFormat = videoFormat;
|
||||
self->_frameRate = frameRate;
|
||||
self->_fullRange = fullRange;
|
||||
|
||||
// reset plot data in case we've already used it for a previous renderer
|
||||
[[ImGuiPlots sharedInstance] clearData];
|
||||
@@ -222,10 +224,9 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
||||
#else
|
||||
NSNumber *pixelFormat = nil;
|
||||
if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) {
|
||||
pixelFormat = @(kCVPixelFormatType_444YpCbCr10BiPlanarFullRange);
|
||||
}
|
||||
else {
|
||||
pixelFormat = @(kCVPixelFormatType_420YpCbCr10BiPlanarFullRange);
|
||||
pixelFormat = self->_fullRange ? @(kCVPixelFormatType_444YpCbCr10BiPlanarFullRange) : @(kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange);
|
||||
} else {
|
||||
pixelFormat = self->_fullRange ? @(kCVPixelFormatType_420YpCbCr10BiPlanarFullRange) : @(kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange);
|
||||
}
|
||||
NSMutableDictionary *destinationPixelBufferAttributes = [@{
|
||||
(id)kCVPixelBufferPixelFormatTypeKey : pixelFormat
|
||||
|
||||
@@ -828,6 +828,9 @@ static NSMutableSet* hostList;
|
||||
_streamConfig.localVolume = streamSettings.localVolume.floatValue;
|
||||
_streamConfig.swapABXYButtons = streamSettings.swapABXYButtons;
|
||||
_streamConfig.buttonVisualFeedback = streamSettings.buttonVisualFeedback;
|
||||
_streamConfig.enableYUV444 = streamSettings.enableYUV444;
|
||||
_streamConfig.enablePIP = streamSettings.enablePIP;
|
||||
_streamConfig.fullRange = streamSettings.fullRange;
|
||||
_streamConfig.asyncNativeTouchPriority = streamSettings.asyncNativeTouchPriority; // new streamConfig segment
|
||||
_streamConfig.gyroMode = [streamSettings.gyroMode intValue];
|
||||
_streamConfig.emulatedControllerType = streamSettings.emulatedControllerType.intValue;
|
||||
@@ -1177,6 +1180,7 @@ static NSMutableSet* hostList;
|
||||
[settingsViewController.touchModeSelector2 setEnabled:settingsViewController.touchModeSelector1.enabled];
|
||||
[settingsViewController.codecSelector setEnabled:!_settingsExpandedInStreamView];
|
||||
[settingsViewController.yuv444Switch setEnabled:!_settingsExpandedInStreamView];
|
||||
[settingsViewController.fullRangeSwitch setEnabled:!_settingsExpandedInStreamView];
|
||||
[settingsViewController.hdrSwitch setEnabled:!_settingsExpandedInStreamView && [settingsViewController hdrSupported]];
|
||||
[settingsViewController.gyroModeSelector setEnabled:!_settingsExpandedInStreamView || ![streamFrameViewController shallDisableGyroHotSwitch]];
|
||||
[settingsViewController.emulatedControllerTypeSelector setEnabled:!_settingsExpandedInStreamView];
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *codecStack;
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *yuv444Stack;
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *pipStack;
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *fullRangeStack;
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *hdrStack;
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *reverseMouseWheelDirectionStack;
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *citrixX1MouseStack;
|
||||
@@ -78,6 +79,7 @@
|
||||
@property (strong, nonatomic) IBOutlet UISwitch *hdrSwitch;
|
||||
@property (strong, nonatomic) IBOutlet UISwitch *yuv444Switch;
|
||||
@property (strong, nonatomic) IBOutlet UISwitch *pipSwitch;
|
||||
@property (strong, nonatomic) IBOutlet UISwitch *fullRangeSwitch;
|
||||
@property (strong, nonatomic) IBOutlet UISegmentedControl *reverseMouseWheelDirectionSelector;
|
||||
@property (strong, nonatomic) IBOutlet UISegmentedControl *statsOverlaySelector;
|
||||
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
|
||||
|
||||
@@ -431,15 +431,18 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:NO];
|
||||
|
||||
|
||||
settingsViewJustExpanded = true;
|
||||
|
||||
|
||||
// Ensure codec-dependent switches are in correct state when view appears
|
||||
[self updateCodecDependentSwitches];
|
||||
|
||||
/*
|
||||
[self checkAndRequestMicPermission];
|
||||
self.micHandler = [MicHandler new];
|
||||
[self.micHandler startTapping];
|
||||
*/
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(deviceOrientationDidChange:) // handle orientation change since i made portrait mode available
|
||||
name:UIDeviceOrientationDidChangeNotification
|
||||
@@ -753,6 +756,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self addSetting:self.hdrStack ofId:@"hdrStack" withInfoTag:![self hdrSupported] withDynamicLabel:NO to:videoSection];
|
||||
[self addSetting:self.yuv444Stack ofId:@"yuv444Stack" withInfoTag:YES withDynamicLabel:NO to:videoSection];
|
||||
[self addSetting:self.pipStack ofId:@"pipStack" withInfoTag:YES withDynamicLabel:NO to:videoSection];
|
||||
[self addSetting:self.fullRangeStack ofId:@"fullRangeStack" withInfoTag:YES withDynamicLabel:NO to:videoSection];
|
||||
[self addSetting:self.framePacingStack ofId:@"framePacingStack" withInfoTag:YES withDynamicLabel:NO to:videoSection];
|
||||
[self addSetting:self.frameQueueSizeStack ofId:@"frameQueueSizeStack" withInfoTag:NO withDynamicLabel:YES to:videoSection];
|
||||
|
||||
@@ -1539,6 +1543,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[_parentStack removeFromSuperview];
|
||||
[self initParentStack];
|
||||
[self layoutSections];
|
||||
[self updateCodecDependentSwitches]; // Ensure switches are in correct state after layout
|
||||
[self updateTheme];
|
||||
//[self doneRemoveSettingItem];
|
||||
Settings *currentSettings = [dataMan retrieveSettings];
|
||||
@@ -1663,7 +1668,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self.rememberFoldStateSwitch setOn:self->tempSettings.rememberFoldState];// Load old setting
|
||||
MenuSectionView.overridePersistedFoldState = !self->tempSettings.rememberFoldState;
|
||||
[self.rememberFoldStateSwitch addTarget:self action:@selector(rememberFoldStateSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||
|
||||
|
||||
[self layoutSections];
|
||||
|
||||
|
||||
@@ -1784,14 +1789,19 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self.hdrSwitch setOn:self->tempSettings.enableHdr];
|
||||
}
|
||||
|
||||
[self.yuv444Switch setOn:self->tempSettings.enableYUV444];
|
||||
|
||||
[self.pipSwitch setOn:self->tempSettings.enablePIP];
|
||||
if(@available(iOS 15.0, *)) [self.pipSwitch setEnabled:true];
|
||||
else{
|
||||
if(@available(iOS 15.0, *)) {
|
||||
[self.pipSwitch setEnabled:true];
|
||||
} else{
|
||||
[self.pipSwitch setOn:false];
|
||||
[self.pipSwitch setEnabled:false];
|
||||
}
|
||||
|
||||
// Initialize codec-dependent switches together
|
||||
[self.yuv444Switch setOn:self->tempSettings.enableYUV444];
|
||||
[self.fullRangeSwitch setOn:self->tempSettings.fullRange];
|
||||
[self.codecSelector addTarget:self action:@selector(codecSelectorChanged:) forControlEvents:UIControlEventValueChanged];
|
||||
[self updateCodecDependentSwitches];
|
||||
|
||||
[self.statsOverlaySelector setSelectedSegmentIndex:self->tempSettings.statsOverlayLevel.intValue];
|
||||
|
||||
@@ -3305,6 +3315,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
uint32_t preferredCodec = [self getChosenCodecPreference];
|
||||
BOOL enableYUV444 = self.yuv444Switch.isOn;
|
||||
BOOL enablePIP = self.pipSwitch.isOn;
|
||||
BOOL fullRange = self.fullRangeSwitch.isOn;
|
||||
BOOL btMouseSupport = self.citrixX1MouseSwitch.isOn;
|
||||
NSInteger touchMode = [self isNotNativeTouchOnly] ? self.touchModeSelector1.selectedSegmentIndex : NativeTouchOnly;
|
||||
NSInteger statsOverlayLevel = [self.statsOverlaySelector selectedSegmentIndex];
|
||||
@@ -3376,6 +3387,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
preferredCodec:preferredCodec
|
||||
enableYUV444:enableYUV444
|
||||
enablePIP:enablePIP
|
||||
fullRange:fullRange
|
||||
enableHdr:enableHdr
|
||||
btMouseSupport:btMouseSupport
|
||||
touchMode:touchMode
|
||||
@@ -3425,4 +3437,45 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
}
|
||||
|
||||
- (void)codecSelectorChanged:(UISegmentedControl *)sender {
|
||||
[self updateCodecDependentSwitches];
|
||||
}
|
||||
|
||||
- (void)updateCodecDependentSwitches {
|
||||
uint32_t codec = [self getChosenCodecPreference];
|
||||
BOOL isAV1 = (codec == CODEC_PREF_AV1);
|
||||
BOOL isH264 = (codec == CODEC_PREF_H264);
|
||||
|
||||
if (isAV1) {
|
||||
// AV1 must use limited range, so disable fullRange and turn it off
|
||||
[self.fullRangeSwitch setOn:NO animated:NO];
|
||||
[self.fullRangeSwitch setEnabled:NO];
|
||||
[self.fullRangeSwitch setUserInteractionEnabled:NO];
|
||||
|
||||
// AV1 doesn't support YUV444, so disable it and turn it off
|
||||
[self.yuv444Switch setOn:NO animated:NO];
|
||||
[self.yuv444Switch setEnabled:NO];
|
||||
[self.yuv444Switch setUserInteractionEnabled:NO];
|
||||
} else {
|
||||
[self.fullRangeSwitch setEnabled:YES];
|
||||
[self.fullRangeSwitch setUserInteractionEnabled:YES];
|
||||
|
||||
[self.yuv444Switch setEnabled:YES];
|
||||
[self.yuv444Switch setUserInteractionEnabled:YES];
|
||||
}
|
||||
|
||||
// H264 doesn't support HDR, so disable it and turn it off
|
||||
if (isH264) {
|
||||
[self.hdrSwitch setOn:NO animated:NO];
|
||||
[self.hdrSwitch setEnabled:NO];
|
||||
[self.hdrSwitch setUserInteractionEnabled:NO];
|
||||
} else {
|
||||
// Only enable HDR if the device supports it
|
||||
if ([self hdrSupported]) {
|
||||
[self.hdrSwitch setEnabled:YES];
|
||||
[self.hdrSwitch setUserInteractionEnabled:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -2953,6 +2953,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"iPd-Ra-Lbl.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Full Range\"; ObjectID = \"iPd-Ra-Lbl\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Full Range"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"IvI-tw-APj.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Open Settings in Streaming\"; ObjectID = \"IvI-tw-APj\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
|
||||
@@ -2197,6 +2197,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"fRl-Ra-Lbl.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Full Range\"; ObjectID = \"fRl-Ra-Lbl\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Full Range"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"GbY-52-itv.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Local Volume\"; ObjectID = \"GbY-52-itv\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
|
||||
Reference in New Issue
Block a user