Merge branch 'Integration' into stylus3

full color range switch
This commit is contained in:
TrueZhuanjia committed 2025-12-03 13:24:22 +08:00
commit 573ed07b4f
20 files changed
+211 -21

No files matched your search

+25
View File
@@ -584,6 +584,29 @@
<constraint firstAttribute="height" constant="31" id="8mE-tx-T8i"/> <constraint firstAttribute="height" constant="31" id="8mE-tx-T8i"/>
</constraints> </constraints>
</stackView> </stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="iPd-Rg-St7" userLabel="fullColorRangeStack">
<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 Color 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"> <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"/> <rect key="frame" x="440" y="1198" width="380" height="68"/>
<subviews> <subviews>
@@ -1962,6 +1985,8 @@
<outlet property="frameQueueSizeSlider" destination="oZa-8Y-icz" id="Jo1-Fx-UMw"/> <outlet property="frameQueueSizeSlider" destination="oZa-8Y-icz" id="Jo1-Fx-UMw"/>
<outlet property="frameQueueSizeStack" destination="MML-c1-D5j" id="82B-r7-Zbh"/> <outlet property="frameQueueSizeStack" destination="MML-c1-D5j" id="82B-r7-Zbh"/>
<outlet property="framerateSelector" destination="8hF-kb-2uV" id="dfT-hb-csE"/> <outlet property="framerateSelector" destination="8hF-kb-2uV" id="dfT-hb-csE"/>
<outlet property="fullColorRangeStack" destination="iPd-Rg-St7" id="iPd-Out-Let"/>
<outlet property="fullColorRangeSwitch" destination="iPd-Wt-Ch9" id="iPd-Out-Swt"/>
<outlet property="graphOpacityStack" destination="P6m-Zv-R4H" id="QEV-kA-A3a"/> <outlet property="graphOpacityStack" destination="P6m-Zv-R4H" id="QEV-kA-A3a"/>
<outlet property="graphOpacityStepper" destination="DQq-4U-avd" id="Nwr-0I-Q8G"/> <outlet property="graphOpacityStepper" destination="DQq-4U-avd" id="Nwr-0I-Q8G"/>
<outlet property="gyroModeSelector" destination="aa5-3y-I4d" id="FsX-kH-h7w"/> <outlet property="gyroModeSelector" destination="aa5-3y-I4d" id="FsX-kH-h7w"/>
+25
View File
@@ -1739,6 +1739,29 @@
<constraint firstAttribute="height" constant="31" id="DlE-MW-o6j"/> <constraint firstAttribute="height" constant="31" id="DlE-MW-o6j"/>
</constraints> </constraints>
</stackView> </stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="fRg-Rn-St7" userLabel="fullColorRangeStack">
<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 Color 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"> <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"/> <rect key="frame" x="437" y="1397" width="380" height="55.5"/>
<subviews> <subviews>
@@ -2775,6 +2798,8 @@
<outlet property="frameQueueSizeSlider" destination="thv-JE-onX" id="gKD-6c-5tw"/> <outlet property="frameQueueSizeSlider" destination="thv-JE-onX" id="gKD-6c-5tw"/>
<outlet property="frameQueueSizeStack" destination="IHx-FO-ctr" id="gob-Ea-Avh"/> <outlet property="frameQueueSizeStack" destination="IHx-FO-ctr" id="gob-Ea-Avh"/>
<outlet property="framerateSelector" destination="dAN-Gy-Eg7" id="tMv-Va-PhO"/> <outlet property="framerateSelector" destination="dAN-Gy-Eg7" id="tMv-Va-PhO"/>
<outlet property="fullColorRangeStack" destination="fRg-Rn-St7" id="fRg-Out-Let"/>
<outlet property="fullColorRangeSwitch" destination="fRs-Wt-Ch9" id="fRs-Out-Let"/>
<outlet property="graphOpacityStack" destination="Dfy-4R-t2l" id="GSD-WX-VF1"/> <outlet property="graphOpacityStack" destination="Dfy-4R-t2l" id="GSD-WX-VF1"/>
<outlet property="graphOpacityStepper" destination="TIF-tB-E8s" id="qIa-PX-8PS"/> <outlet property="graphOpacityStepper" destination="TIF-tB-E8s" id="qIa-PX-8PS"/>
<outlet property="gyroModeSelector" destination="PIo-LV-9Gt" id="6Mc-5v-dmJ"/> <outlet property="gyroModeSelector" destination="PIo-LV-9Gt" id="6Mc-5v-dmJ"/>
+1
View File
@@ -123,6 +123,7 @@ typedef NS_ENUM(NSInteger, PencilTickMode) {
preferredCodec:(uint32_t)preferredCodec preferredCodec:(uint32_t)preferredCodec
enableYUV444:(BOOL)enableYUV444 enableYUV444:(BOOL)enableYUV444
enablePIP:(BOOL)enablePIP enablePIP:(BOOL)enablePIP
fullRange:(BOOL)fullRange
enableHdr:(BOOL)enableHdr enableHdr:(BOOL)enableHdr
btMouseSupport:(BOOL)btMouseSupport btMouseSupport:(BOOL)btMouseSupport
// absoluteTouchMode:(BOOL)absoluteTouchMode // absoluteTouchMode:(BOOL)absoluteTouchMode
+2
View File
@@ -89,6 +89,7 @@
preferredCodec:(uint32_t)preferredCodec preferredCodec:(uint32_t)preferredCodec
enableYUV444:(BOOL)enableYUV444 enableYUV444:(BOOL)enableYUV444
enablePIP:(BOOL)enablePIP enablePIP:(BOOL)enablePIP
fullRange:(BOOL)fullRange
enableHdr:(BOOL)enableHdr enableHdr:(BOOL)enableHdr
btMouseSupport:(BOOL)btMouseSupport btMouseSupport:(BOOL)btMouseSupport
// absoluteTouchMode:(BOOL)absoluteTouchMode // absoluteTouchMode:(BOOL)absoluteTouchMode
@@ -163,6 +164,7 @@
settingsToSave.preferredCodec = preferredCodec; settingsToSave.preferredCodec = preferredCodec;
settingsToSave.enableYUV444 = enableYUV444; settingsToSave.enableYUV444 = enableYUV444;
settingsToSave.enablePIP = enablePIP; settingsToSave.enablePIP = enablePIP;
settingsToSave.fullColorRange = fullRange;
settingsToSave.enableHdr = enableHdr; settingsToSave.enableHdr = enableHdr;
settingsToSave.btMouseSupport = btMouseSupport; settingsToSave.btMouseSupport = btMouseSupport;
// settingsToSave.absoluteTouchMode = absoluteTouchMode; // settingsToSave.absoluteTouchMode = absoluteTouchMode;
+1
View File
@@ -54,6 +54,7 @@
} preferredCodec; } preferredCodec;
@property (nonatomic) BOOL enableYUV444; @property (nonatomic) BOOL enableYUV444;
@property (nonatomic) BOOL enablePIP; @property (nonatomic) BOOL enablePIP;
@property (nonatomic) BOOL fullColorRange;
@property (nonatomic) BOOL reverseMouseWheelDirection; @property (nonatomic) BOOL reverseMouseWheelDirection;
@property (nonatomic, retain) NSNumber * asyncNativeTouchPriority; @property (nonatomic, retain) NSNumber * asyncNativeTouchPriority;
@property (nonatomic) BOOL multiController; @property (nonatomic) BOOL multiController;
+2
View File
@@ -42,6 +42,7 @@
self.preferredCodec = (typeof(self.preferredCodec))[[NSUserDefaults standardUserDefaults] integerForKey:@"preferredCodec"]; self.preferredCodec = (typeof(self.preferredCodec))[[NSUserDefaults standardUserDefaults] integerForKey:@"preferredCodec"];
self.enableYUV444 = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableYUV444"]; self.enableYUV444 = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableYUV444"];
self.enablePIP = [[NSUserDefaults standardUserDefaults] boolForKey:@"enablePIP"]; self.enablePIP = [[NSUserDefaults standardUserDefaults] boolForKey:@"enablePIP"];
self.fullRange = [[NSUserDefaults standardUserDefaults] boolForKey:@"fullRange"];
self.frameQueueSize = [NSNumber numberWithInteger:[[NSUserDefaults standardUserDefaults] integerForKey:@"frameQueueSize"]]; self.frameQueueSize = [NSNumber numberWithInteger:[[NSUserDefaults standardUserDefaults] integerForKey:@"frameQueueSize"]];
self.playAudioOnPC = [[NSUserDefaults standardUserDefaults] boolForKey:@"audioOnPC"]; self.playAudioOnPC = [[NSUserDefaults standardUserDefaults] boolForKey:@"audioOnPC"];
self.enableHdr = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableHdr"]; self.enableHdr = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableHdr"];
@@ -88,6 +89,7 @@
self.preferredCodec = settings.preferredCodec; self.preferredCodec = settings.preferredCodec;
self.enableYUV444 = settings.enableYUV444; self.enableYUV444 = settings.enableYUV444;
self.enablePIP = settings.enablePIP; self.enablePIP = settings.enablePIP;
self.fullColorRange = settings.fullColorRange;
self.frameQueueSize = settings.frameQueueSize; self.frameQueueSize = settings.frameQueueSize;
self.playAudioOnPC = settings.playAudioOnPC; self.playAudioOnPC = settings.playAudioOnPC;
self.redirectMic = settings.redirectMic; self.redirectMic = settings.redirectMic;
+1
View File
@@ -24,6 +24,7 @@
- (void)toggleStatsOverlay; - (void)toggleStatsOverlay;
- (void)toggleMouseCapture; - (void)toggleMouseCapture;
- (void)toggleMouseVisible; - (void)toggleMouseVisible;
- (void)disconnectAndQuitApp;
@end @end
+3
View File
@@ -978,6 +978,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
case UIKeyboardHIDUsageKeyboardC: case UIKeyboardHIDUsageKeyboardC:
[interactionDelegate toggleMouseVisible]; [interactionDelegate toggleMouseVisible];
break; break;
case UIKeyboardHIDUsageKeyboardD:
[interactionDelegate disconnectAndQuitApp];
break;
default: default:
break; break;
} }
@@ -50,6 +50,7 @@
<attribute name="framePacingMode" optional="YES" attributeType="Integer 32" 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"/> <attribute name="frameQueueSize" optional="YES" attributeType="Integer 32" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
<attribute name="framerate" attributeType="Integer 32" defaultValueString="60" usesScalarValueType="NO" syncable="YES"/> <attribute name="framerate" attributeType="Integer 32" defaultValueString="60" usesScalarValueType="NO" syncable="YES"/>
<attribute name="fullColorRange" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="graphOpacity" optional="YES" attributeType="Integer 32" defaultValueString="50" usesScalarValueType="NO" syncable="YES"/> <attribute name="graphOpacity" optional="YES" attributeType="Integer 32" defaultValueString="50" usesScalarValueType="NO" syncable="YES"/>
<attribute name="gyroBiasX" optional="YES" attributeType="Double" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/> <attribute name="gyroBiasX" optional="YES" attributeType="Double" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
<attribute name="gyroBiasY" optional="YES" attributeType="Double" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/> <attribute name="gyroBiasY" optional="YES" attributeType="Double" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
+4 -2
View File
@@ -57,6 +57,7 @@ static AVAudioPCMBuffer *pcmBuffer;
static AVAudioFormat *audioFormat; static AVAudioFormat *audioFormat;
static bool muteInBackground; static bool muteInBackground;
static bool fullColorRange;
static VideoDecoderRenderer* renderer; static VideoDecoderRenderer* renderer;
@@ -64,7 +65,7 @@ static BandwidthTracker *bwTracker;
int DrDecoderSetup(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags) 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:fullColorRange];
lastFrameNumber = 0; lastFrameNumber = 0;
activeVideoFormat = videoFormat; activeVideoFormat = videoFormat;
Log(LOG_I, @"Active video format: 0x%x", activeVideoFormat); 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; _callbacks = callbacks;
LiInitializeStreamConfiguration(&_streamConfig); LiInitializeStreamConfiguration(&_streamConfig);
_streamConfig.colorRange = 1; // Full range _streamConfig.colorRange = config.fullColorRange ? 1 : 0;
fullColorRange = config.fullColorRange;
_streamConfig.width = config.width; _streamConfig.width = config.width;
_streamConfig.height = config.height; _streamConfig.height = config.height;
_streamConfig.fps = config.frameRate; _streamConfig.fps = config.frameRate;
+1
View File
@@ -21,6 +21,7 @@
@property int serverCodecModeSupport; @property int serverCodecModeSupport;
@property BOOL enableYUV444; @property BOOL enableYUV444;
@property BOOL enablePIP; @property BOOL enablePIP;
@property BOOL fullColorRange;
@property int width; @property int width;
@property int height; @property int height;
@property int frameRate; @property int frameRate;
+1 -1
View File
@@ -9,5 +9,5 @@
#import "StreamConfiguration.h" #import "StreamConfiguration.h"
@implementation StreamConfiguration @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, fullColorRange, localVolume;
@end @end
+6 -2
View File
@@ -205,6 +205,8 @@
double avgVideoMbps = [_connection getBwTracker].averageMbps; double avgVideoMbps = [_connection getBwTracker].averageMbps;
double peakVideoMbps = [_connection getBwTracker].peakMbps; double peakVideoMbps = [_connection getBwTracker].peakMbps;
NSString* colorRange = _config.fullColorRange ? @"Full" : @"Limited";
if(overlayLevel == 1) return [LocalizationHelper localizedStringForKey:@"simplifiedOsdText", if(overlayLevel == 1) return [LocalizationHelper localizedStringForKey:@"simplifiedOsdText",
fps, fps,
stats.networkDroppedFrames / interval, 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" "Bitrate: %.1f Mbps, Peak: %.1f\n"
"%@" "%@"
"Renderer: %@\n" "Renderer: %@\n"
@@ -231,6 +233,7 @@
_config.height, _config.height,
fps, fps,
[_connection getActiveCodecName], [_connection getActiveCodecName],
colorRange,
avgVideoMbps, peakVideoMbps, avgVideoMbps, peakVideoMbps,
hostProcessingString, hostProcessingString,
rendererWithPacing, rendererWithPacing,
@@ -242,7 +245,7 @@
rendererWithPacing = @"AVSampleBuffer (Queue Pacing)"; 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" "Bitrate: %.1f Mbps, Peak: %.1f, Frames buffered: %.1f\n"
"%@" "%@"
"Renderer: %@\n" "Renderer: %@\n"
@@ -253,6 +256,7 @@
_config.height, _config.height,
fps, fps,
[_connection getActiveCodecName], [_connection getActiveCodecName],
colorRange,
avgVideoMbps, peakVideoMbps, stats.frameQueueMetrics.avg, avgVideoMbps, peakVideoMbps, stats.frameQueueMetrics.avg,
hostProcessingString, hostProcessingString,
rendererWithPacing, rendererWithPacing,
+1 -1
View File
@@ -23,7 +23,7 @@
- (id)initWithView:(UIView*)view callbacks:(id<ConnectionCallbacks>)callbacks streamAspectRatio:(float)aspectRatio; - (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)renderFrame:(Frame *)frame atTime:(CMTime)targetTime;
- (void)cleanup; - (void)cleanup;
- (void)setHdrMode:(BOOL)enabled; - (void)setHdrMode:(BOOL)enabled;
+6 -5
View File
@@ -42,6 +42,7 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
AVSampleBufferDisplayLayer* _displayLayer; AVSampleBufferDisplayLayer* _displayLayer;
int _videoFormat; int _videoFormat;
int _frameRate; int _frameRate;
BOOL _fullRange;
NSMutableArray *_parameterSetBuffers; NSMutableArray *_parameterSetBuffers;
NSData *_masteringDisplayColorVolume; 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 # 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->_videoFormat = videoFormat;
self->_frameRate = frameRate; self->_frameRate = frameRate;
self->_fullRange = fullRange;
// reset plot data in case we've already used it for a previous renderer // reset plot data in case we've already used it for a previous renderer
[[ImGuiPlots sharedInstance] clearData]; [[ImGuiPlots sharedInstance] clearData];
@@ -222,10 +224,9 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
#else #else
NSNumber *pixelFormat = nil; NSNumber *pixelFormat = nil;
if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) { if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) {
pixelFormat = @(kCVPixelFormatType_444YpCbCr10BiPlanarFullRange); pixelFormat = self->_fullRange ? @(kCVPixelFormatType_444YpCbCr10BiPlanarFullRange) : @(kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange);
} } else {
else { pixelFormat = self->_fullRange ? @(kCVPixelFormatType_420YpCbCr10BiPlanarFullRange) : @(kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange);
pixelFormat = @(kCVPixelFormatType_420YpCbCr10BiPlanarFullRange);
} }
NSMutableDictionary *destinationPixelBufferAttributes = [@{ NSMutableDictionary *destinationPixelBufferAttributes = [@{
(id)kCVPixelBufferPixelFormatTypeKey : pixelFormat (id)kCVPixelBufferPixelFormatTypeKey : pixelFormat
@@ -828,6 +828,9 @@ static NSMutableSet* hostList;
_streamConfig.localVolume = streamSettings.localVolume.floatValue; _streamConfig.localVolume = streamSettings.localVolume.floatValue;
_streamConfig.swapABXYButtons = streamSettings.swapABXYButtons; _streamConfig.swapABXYButtons = streamSettings.swapABXYButtons;
_streamConfig.buttonVisualFeedback = streamSettings.buttonVisualFeedback; _streamConfig.buttonVisualFeedback = streamSettings.buttonVisualFeedback;
_streamConfig.enableYUV444 = streamSettings.enableYUV444;
_streamConfig.enablePIP = streamSettings.enablePIP;
_streamConfig.fullColorRange = streamSettings.fullColorRange;
_streamConfig.asyncNativeTouchPriority = streamSettings.asyncNativeTouchPriority; // new streamConfig segment _streamConfig.asyncNativeTouchPriority = streamSettings.asyncNativeTouchPriority; // new streamConfig segment
_streamConfig.gyroMode = [streamSettings.gyroMode intValue]; _streamConfig.gyroMode = [streamSettings.gyroMode intValue];
_streamConfig.emulatedControllerType = streamSettings.emulatedControllerType.intValue; _streamConfig.emulatedControllerType = streamSettings.emulatedControllerType.intValue;
@@ -1175,9 +1178,15 @@ static NSMutableSet* hostList;
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.audioOnPcStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.audioOnPcStack];
[settingsViewController.touchModeSelector1 setEnabled:!_settingsExpandedInStreamView || !(settingsViewController.touchModeSelector1.selectedSegmentIndex == AbsoluteTouch && !settingsViewController.passthroughGesturesSwitch.isOn)]; [settingsViewController.touchModeSelector1 setEnabled:!_settingsExpandedInStreamView || !(settingsViewController.touchModeSelector1.selectedSegmentIndex == AbsoluteTouch && !settingsViewController.passthroughGesturesSwitch.isOn)];
[settingsViewController.touchModeSelector2 setEnabled:settingsViewController.touchModeSelector1.enabled]; [settingsViewController.touchModeSelector2 setEnabled:settingsViewController.touchModeSelector1.enabled];
[settingsViewController.codecSelector setEnabled:!_settingsExpandedInStreamView]; [settingsViewController.codecSelector setEnabled:!_settingsExpandedInStreamView];
[settingsViewController.yuv444Switch setEnabled:!_settingsExpandedInStreamView]; if(_settingsExpandedInStreamView){
[settingsViewController.hdrSwitch setEnabled:!_settingsExpandedInStreamView && [settingsViewController hdrSupported]]; [settingsViewController.yuv444Switch setEnabled:NO];
[settingsViewController.fullColorRangeSwitch setEnabled:NO];
[settingsViewController.hdrSwitch setEnabled:NO];
}
else [settingsViewController updateCodecDependentSwitches];
[settingsViewController.gyroModeSelector setEnabled:!_settingsExpandedInStreamView || ![streamFrameViewController shallDisableGyroHotSwitch]]; [settingsViewController.gyroModeSelector setEnabled:!_settingsExpandedInStreamView || ![streamFrameViewController shallDisableGyroHotSwitch]];
[settingsViewController.emulatedControllerTypeSelector setEnabled:!_settingsExpandedInStreamView]; [settingsViewController.emulatedControllerTypeSelector setEnabled:!_settingsExpandedInStreamView];
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.citrixX1MouseStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.citrixX1MouseStack];
@@ -49,6 +49,7 @@
@property (strong, nonatomic) IBOutlet UIStackView *codecStack; @property (strong, nonatomic) IBOutlet UIStackView *codecStack;
@property (strong, nonatomic) IBOutlet UIStackView *yuv444Stack; @property (strong, nonatomic) IBOutlet UIStackView *yuv444Stack;
@property (strong, nonatomic) IBOutlet UIStackView *pipStack; @property (strong, nonatomic) IBOutlet UIStackView *pipStack;
@property (strong, nonatomic) IBOutlet UIStackView *fullColorRangeStack;
@property (strong, nonatomic) IBOutlet UIStackView *hdrStack; @property (strong, nonatomic) IBOutlet UIStackView *hdrStack;
@property (strong, nonatomic) IBOutlet UIStackView *reverseMouseWheelDirectionStack; @property (strong, nonatomic) IBOutlet UIStackView *reverseMouseWheelDirectionStack;
@property (strong, nonatomic) IBOutlet UIStackView *citrixX1MouseStack; @property (strong, nonatomic) IBOutlet UIStackView *citrixX1MouseStack;
@@ -78,6 +79,7 @@
@property (strong, nonatomic) IBOutlet UISwitch *hdrSwitch; @property (strong, nonatomic) IBOutlet UISwitch *hdrSwitch;
@property (strong, nonatomic) IBOutlet UISwitch *yuv444Switch; @property (strong, nonatomic) IBOutlet UISwitch *yuv444Switch;
@property (strong, nonatomic) IBOutlet UISwitch *pipSwitch; @property (strong, nonatomic) IBOutlet UISwitch *pipSwitch;
@property (strong, nonatomic) IBOutlet UISwitch *fullColorRangeSwitch;
@property (strong, nonatomic) IBOutlet UISegmentedControl *reverseMouseWheelDirectionSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *reverseMouseWheelDirectionSelector;
@property (strong, nonatomic) IBOutlet UISegmentedControl *statsOverlaySelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *statsOverlaySelector;
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView; @property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@@ -269,5 +271,6 @@
- (void)updateTheme; - (void)updateTheme;
- (void)hideDynamicLabelsWhenOverlapped:(UIView* )view; - (void)hideDynamicLabelsWhenOverlapped:(UIView* )view;
- (void)setHidden:(BOOL)hidden forStack:(UIStackView* )stack; - (void)setHidden:(BOOL)hidden forStack:(UIStackView* )stack;
- (void)updateCodecDependentSwitches;
@end @end
@@ -431,15 +431,18 @@ BOOL isCustomResolution(int resolutionSelected) {
- (void)viewWillAppear:(BOOL)animated{ - (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:NO]; [super viewWillAppear:NO];
settingsViewJustExpanded = true; settingsViewJustExpanded = true;
// Ensure codec-dependent switches are in correct state when view appears
// [self updateCodecDependentSwitches];
/* /*
[self checkAndRequestMicPermission]; [self checkAndRequestMicPermission];
self.micHandler = [MicHandler new]; self.micHandler = [MicHandler new];
[self.micHandler startTapping]; [self.micHandler startTapping];
*/ */
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(deviceOrientationDidChange:) // handle orientation change since i made portrait mode available selector:@selector(deviceOrientationDidChange:) // handle orientation change since i made portrait mode available
name:UIDeviceOrientationDidChangeNotification name:UIDeviceOrientationDidChangeNotification
@@ -756,6 +759,7 @@ BOOL isCustomResolution(int resolutionSelected) {
[self addSetting:self.codecStack ofId:@"codecStack" withInfoTag:NO withDynamicLabel:NO to:videoSection]; [self addSetting:self.codecStack ofId:@"codecStack" withInfoTag:NO withDynamicLabel:NO to:videoSection];
[self addSetting:self.hdrStack ofId:@"hdrStack" withInfoTag:![self hdrSupported] withDynamicLabel:NO to:videoSection]; [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.yuv444Stack ofId:@"yuv444Stack" withInfoTag:YES withDynamicLabel:NO to:videoSection];
[self addSetting:self.fullColorRangeStack ofId:@"fullRangeStack" withInfoTag:NO withDynamicLabel:NO to:videoSection];
[self addSetting:self.pipStack ofId:@"pipStack" withInfoTag:YES withDynamicLabel:NO to:videoSection]; [self addSetting:self.pipStack ofId:@"pipStack" withInfoTag:YES withDynamicLabel:NO to:videoSection];
[self addSetting:self.framePacingStack ofId:@"framePacingStack" 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]; [self addSetting:self.frameQueueSizeStack ofId:@"frameQueueSizeStack" withInfoTag:NO withDynamicLabel:YES to:videoSection];
@@ -1558,6 +1562,7 @@ BOOL isCustomResolution(int resolutionSelected) {
[_parentStack removeFromSuperview]; [_parentStack removeFromSuperview];
[self initParentStack]; [self initParentStack];
[self layoutSections]; [self layoutSections];
// [self updateCodecDependentSwitches]; // Ensure switches are in correct state after layout
[self updateTheme]; [self updateTheme];
//[self doneRemoveSettingItem]; //[self doneRemoveSettingItem];
Settings *currentSettings = [dataMan retrieveSettings]; Settings *currentSettings = [dataMan retrieveSettings];
@@ -1682,7 +1687,7 @@ BOOL isCustomResolution(int resolutionSelected) {
[self.rememberFoldStateSwitch setOn:self->tempSettings.rememberFoldState];// Load old setting [self.rememberFoldStateSwitch setOn:self->tempSettings.rememberFoldState];// Load old setting
MenuSectionView.overridePersistedFoldState = !self->tempSettings.rememberFoldState; MenuSectionView.overridePersistedFoldState = !self->tempSettings.rememberFoldState;
[self.rememberFoldStateSwitch addTarget:self action:@selector(rememberFoldStateSwitchFlipped:) forControlEvents:UIControlEventValueChanged]; [self.rememberFoldStateSwitch addTarget:self action:@selector(rememberFoldStateSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
[self layoutSections]; [self layoutSections];
@@ -1802,12 +1807,17 @@ BOOL isCustomResolution(int resolutionSelected) {
else { else {
[self.hdrSwitch setOn:self->tempSettings.enableHdr]; [self.hdrSwitch setOn:self->tempSettings.enableHdr];
} }
[self.yuv444Switch setOn:self->tempSettings.enableYUV444];
// Initialize codec-dependent switches together
[self.yuv444Switch setOn:self->tempSettings.enableYUV444];
[self.fullColorRangeSwitch setOn:self->tempSettings.fullColorRange];
[self.codecSelector addTarget:self action:@selector(codecSelectorChanged:) forControlEvents:UIControlEventValueChanged];
[self codecSelectorChanged:self.codecSelector];
[self.pipSwitch setOn:self->tempSettings.enablePIP]; [self.pipSwitch setOn:self->tempSettings.enablePIP];
if(@available(iOS 15.0, *)) [self.pipSwitch setEnabled:true]; if(@available(iOS 15.0, *)) {
else{ [self.pipSwitch setEnabled:true];
} else{
[self.pipSwitch setOn:false]; [self.pipSwitch setOn:false];
[self.pipSwitch setEnabled:false]; [self.pipSwitch setEnabled:false];
} }
@@ -2706,6 +2716,7 @@ BOOL isCustomResolution(int resolutionSelected) {
return 0; return 0;
} }
// a setEnabled method for low iOS version UISlider
- (void) widget:(UIView*)widget setEnabled:(bool)enabled{ - (void) widget:(UIView*)widget setEnabled:(bool)enabled{
if([widget isKindOfClass:[UISlider class]]){ if([widget isKindOfClass:[UISlider class]]){
UISlider* widgetPtr = (UISlider* )widget; UISlider* widgetPtr = (UISlider* )widget;
@@ -3357,6 +3368,7 @@ BOOL isCustomResolution(int resolutionSelected) {
uint32_t preferredCodec = [self getChosenCodecPreference]; uint32_t preferredCodec = [self getChosenCodecPreference];
BOOL enableYUV444 = self.yuv444Switch.isOn; BOOL enableYUV444 = self.yuv444Switch.isOn;
BOOL enablePIP = self.pipSwitch.isOn; BOOL enablePIP = self.pipSwitch.isOn;
BOOL fullRange = self.fullColorRangeSwitch.isOn;
BOOL btMouseSupport = self.citrixX1MouseSwitch.isOn; BOOL btMouseSupport = self.citrixX1MouseSwitch.isOn;
NSInteger touchMode = [self isNotNativeTouchOnly] ? self.touchModeSelector1.selectedSegmentIndex : NativeTouchOnly; NSInteger touchMode = [self isNotNativeTouchOnly] ? self.touchModeSelector1.selectedSegmentIndex : NativeTouchOnly;
NSInteger statsOverlayLevel = [self.statsOverlaySelector selectedSegmentIndex]; NSInteger statsOverlayLevel = [self.statsOverlaySelector selectedSegmentIndex];
@@ -3429,6 +3441,7 @@ BOOL isCustomResolution(int resolutionSelected) {
preferredCodec:preferredCodec preferredCodec:preferredCodec
enableYUV444:enableYUV444 enableYUV444:enableYUV444
enablePIP:enablePIP enablePIP:enablePIP
fullRange:fullRange
enableHdr:enableHdr enableHdr:enableHdr
btMouseSupport:btMouseSupport btMouseSupport:btMouseSupport
touchMode:touchMode touchMode:touchMode
@@ -3478,4 +3491,40 @@ BOOL isCustomResolution(int resolutionSelected) {
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - (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.fullColorRangeSwitch setOn:NO animated:NO];
[self.fullColorRangeSwitch setEnabled:NO];
// AV1 doesn't support YUV444, so disable it and turn it off
[self.yuv444Switch setOn:NO animated:NO];
[self.yuv444Switch setEnabled:NO];
} else {
[self.fullColorRangeSwitch setEnabled:YES];
[self.yuv444Switch setEnabled: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];
} else {
// Only enable HDR if the device supports it
if ([self hdrSupported]) {
[self.hdrSwitch setEnabled:YES];
}
}
if(![self hdrSupported]) [self.hdrSwitch setOn:NO animated:NO];
}
@end @end
+30
View File
@@ -2989,6 +2989,36 @@
} }
} }
}, },
"iPd-Ra-Lbl.text" : {
"comment" : "Class = \"UILabel\"; text = \"Full Color Range\"; ObjectID = \"iPd-Ra-Lbl\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Full Color Range"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "全色彩范围"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "全色彩範圍"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "全色彩範圍"
}
}
}
},
"IvI-tw-APj.text" : { "IvI-tw-APj.text" : {
"comment" : "Class = \"UILabel\"; text = \"Open Settings in Streaming\"; ObjectID = \"IvI-tw-APj\";", "comment" : "Class = \"UILabel\"; text = \"Open Settings in Streaming\"; ObjectID = \"IvI-tw-APj\";",
"extractionState" : "extracted_with_value", "extractionState" : "extracted_with_value",
+30
View File
@@ -2197,6 +2197,36 @@
} }
} }
}, },
"fRl-Ra-Lbl.text" : {
"comment" : "Class = \"UILabel\"; text = \"Full Color Range\"; ObjectID = \"fRl-Ra-Lbl\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Full Color Range"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "全色彩范围"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "全色彩範圍"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "全色彩範圍"
}
}
}
},
"GbY-52-itv.text" : { "GbY-52-itv.text" : {
"comment" : "Class = \"UILabel\"; text = \"Local Volume\"; ObjectID = \"GbY-52-itv\";", "comment" : "Class = \"UILabel\"; text = \"Local Volume\"; ObjectID = \"GbY-52-itv\";",
"extractionState" : "extracted_with_value", "extractionState" : "extracted_with_value",