From f2dd7a1801e1176a3dec4e7cd9baa7231f8213de Mon Sep 17 00:00:00 2001 From: Don Hartman Date: Wed, 25 Nov 2026 13:41:30 -0600 Subject: [PATCH 1/2] Fix xHome stream startup and building with Xcode 27 - Decode StreamStateResponse leniently: xHome /state replies include "errorDetails":{"code":null,"message":null} on healthy sessions, which failed decoding with "State poll error: Decode failed". - xHome sessions go Provisioning -> Provisioned without passing through ReadyToConnect, so the home path timed out waiting for it. Accept either state, and perform the /connect auth step if ReadyToConnect is reported and an MSA token is available. - Xcode 27's tvOS SDK marks MTLFXSpatialScaler APIs as tvOS 27.1+, so the tvOS 26 target no longer compiled. Gate MetalFX use behind #available(tvOS 27.1); older tvOS falls back through the existing "MetalFX unavailable" path. - Add tests for the null errorDetails decode and a Provisioned-only xHome connect. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ETMULew4xpK5YpbnhMkSUb --- .../WebRTC/MetalVideoRenderer.swift | 9 +++- .../MetalVideoRendererDrawPipeline.swift | 2 +- ...alVideoRendererPresentationResources.swift | 15 ++++-- .../Streaming/StreamingProtocol.swift | 23 ++++++++ .../StratixModelsTests.swift | 23 ++++++++ .../Runtime/StreamingRuntime.swift | 10 +++- .../StreamingSessionTests.swift | 54 +++++++++++++++++++ .../LiveUpscaleCapabilityProbe.swift | 11 ++-- 8 files changed, 136 insertions(+), 11 deletions(-) diff --git a/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRenderer.swift b/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRenderer.swift index f96315e..656ae54 100644 --- a/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRenderer.swift +++ b/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRenderer.swift @@ -70,7 +70,14 @@ final class MetalVideoRenderer: NSObject, RTCVideoRenderer, MTKViewDelegate, @un var outputTexture: MTLTexture? var outputSize: MTLSize = MTLSize(width: 0, height: 0, depth: 1) #if canImport(MetalFX) - var spatialScaler: (any MTLFXSpatialScaler)? + /// Untyped storage: MTLFXSpatialScaler is tvOS 27.1+ in the current SDK and + /// stored properties can't carry availability. + var spatialScalerStorage: AnyObject? + @available(tvOS 27.1, *) + var spatialScaler: (any MTLFXSpatialScaler)? { + get { spatialScalerStorage as? any MTLFXSpatialScaler } + set { spatialScalerStorage = newValue } + } var spatialScalerOutputTexture: MTLTexture? var spatialScalerInputSize: MTLSize = MTLSize(width: 0, height: 0, depth: 1) var spatialScalerOutputSize: MTLSize = MTLSize(width: 0, height: 0, depth: 1) diff --git a/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererDrawPipeline.swift b/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererDrawPipeline.swift index 237efad..5354414 100644 --- a/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererDrawPipeline.swift +++ b/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererDrawPipeline.swift @@ -88,7 +88,7 @@ extension MetalVideoRenderer { let presentationTexture: MTLTexture #if canImport(MetalFX) - if let spatialScaler, let spatialScalerOutputTexture { + if #available(tvOS 27.1, *), let spatialScaler, let spatialScalerOutputTexture { spatialScaler.colorTexture = outputTexture spatialScaler.outputTexture = spatialScalerOutputTexture spatialScaler.encode(commandBuffer: commandBuffer) diff --git a/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererPresentationResources.swift b/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererPresentationResources.swift index 0b68cf9..be23f38 100644 --- a/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererPresentationResources.swift +++ b/Apps/Stratix/Sources/Stratix/Integration/WebRTC/MetalVideoRendererPresentationResources.swift @@ -39,7 +39,7 @@ extension MetalVideoRenderer { guard let requestedRung else { mtkView.drawableSize = CGSize(width: sourceWidth, height: sourceHeight) - spatialScaler = nil + spatialScalerStorage = nil spatialScalerOutputTexture = nil spatialScalerInputSize = MTLSize(width: 0, height: 0, depth: 1) spatialScalerOutputSize = MTLSize(width: 0, height: 0, depth: 1) @@ -52,7 +52,7 @@ extension MetalVideoRenderer { switch requestedRung { case .passthrough: mtkView.drawableSize = CGSize(width: sourceWidth, height: sourceHeight) - spatialScaler = nil + spatialScalerStorage = nil spatialScalerOutputTexture = nil spatialScalerInputSize = MTLSize(width: 0, height: 0, depth: 1) spatialScalerOutputSize = MTLSize(width: 0, height: 0, depth: 1) @@ -67,7 +67,7 @@ extension MetalVideoRenderer { processingOutputHeight = targetHeight default: mtkView.drawableSize = CGSize(width: sourceWidth, height: sourceHeight) - spatialScaler = nil + spatialScalerStorage = nil spatialScalerOutputTexture = nil spatialScalerInputSize = MTLSize(width: 0, height: 0, depth: 1) spatialScalerOutputSize = MTLSize(width: 0, height: 0, depth: 1) @@ -81,11 +81,18 @@ extension MetalVideoRenderer { || targetHeight != spatialScalerOutputSize.height || sourceWidth != spatialScalerInputSize.width || sourceHeight != spatialScalerInputSize.height - || spatialScaler == nil + || spatialScalerStorage == nil else { return } + guard #available(tvOS 27.1, *) else { + spatialScalerStorage = nil + spatialScalerOutputTexture = nil + notifyCandidateFailedIfNeeded(requestedRung, reason: "MetalFX spatial scaler requires tvOS 27.1") + return + } + let descriptor = MTLFXSpatialScalerDescriptor() descriptor.inputWidth = sourceWidth descriptor.inputHeight = sourceHeight diff --git a/Packages/StratixModels/Sources/StratixModels/Streaming/StreamingProtocol.swift b/Packages/StratixModels/Sources/StratixModels/Streaming/StreamingProtocol.swift index 697a0dc..090d8fb 100644 --- a/Packages/StratixModels/Sources/StratixModels/Streaming/StreamingProtocol.swift +++ b/Packages/StratixModels/Sources/StratixModels/Streaming/StreamingProtocol.swift @@ -42,6 +42,29 @@ public struct StreamStateResponse: Codable, Sendable, Equatable { self.state = state self.errorDetails = errorDetails } + + private enum CodingKeys: String, CodingKey { + case state + case errorDetails + } + + private struct LenientErrorDetails: Decodable { + let code: String? + let message: String? + } + + /// The server sends `"errorDetails":{"code":null,"message":null}` on healthy + /// sessions; treat a null code as "no error" instead of failing the decode. + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + state = try container.decode(String.self, forKey: .state) + if let details = try container.decodeIfPresent(LenientErrorDetails.self, forKey: .errorDetails), + let code = details.code { + errorDetails = ErrorDetails(code: code, message: details.message ?? "") + } else { + errorDetails = nil + } + } } public struct SdpExchangeResponse: Codable, Sendable, Equatable { diff --git a/Packages/StratixModels/Tests/StratixModelsTests/StratixModelsTests.swift b/Packages/StratixModels/Tests/StratixModelsTests/StratixModelsTests.swift index 735e90b..e34a0c4 100644 --- a/Packages/StratixModels/Tests/StratixModelsTests/StratixModelsTests.swift +++ b/Packages/StratixModels/Tests/StratixModelsTests/StratixModelsTests.swift @@ -164,3 +164,26 @@ struct CloudLibraryProductDetailTests { #expect(summary.unlockPercent == 35) } } + +@Suite("StreamStateResponse") +struct StreamStateResponseTests { + + @Test func nullErrorDetailsDecodesAsNoError() throws { + let json = #"{"state":"Provisioned","detailedSessionState":0,"errorDetails":{"code":null,"message":null}}"# + let decoded = try JSONDecoder().decode(StreamStateResponse.self, from: Data(json.utf8)) + #expect(decoded.state == "Provisioned") + #expect(decoded.errorDetails == nil) + } + + @Test func populatedErrorDetailsDecode() throws { + let json = #"{"state":"Failed","errorDetails":{"code":"ConsoleUnavailable","message":"Console is offline"}}"# + let decoded = try JSONDecoder().decode(StreamStateResponse.self, from: Data(json.utf8)) + #expect(decoded.errorDetails == .init(code: "ConsoleUnavailable", message: "Console is offline")) + } + + @Test func missingErrorDetailsDecodesAsNoError() throws { + let json = #"{"state":"ReadyToConnect"}"# + let decoded = try JSONDecoder().decode(StreamStateResponse.self, from: Data(json.utf8)) + #expect(decoded.errorDetails == nil) + } +} diff --git a/Packages/StreamingCore/Sources/StreamingCore/Runtime/StreamingRuntime.swift b/Packages/StreamingCore/Sources/StreamingCore/Runtime/StreamingRuntime.swift index e95a468..fa93770 100644 --- a/Packages/StreamingCore/Sources/StreamingCore/Runtime/StreamingRuntime.swift +++ b/Packages/StreamingCore/Sources/StreamingCore/Runtime/StreamingRuntime.swift @@ -126,7 +126,15 @@ actor StreamingRuntime { ) } } else { - try await streamSession.waitUntilReady() + // xHome sessions go Provisioning -> Provisioned without passing through + // ReadyToConnect, so accept either; if the server does ask for the + // /connect auth step, perform it the same way the cloud path does. + let initialHomeState = try await streamSession.waitUntilReadyOrProvisioned() + if initialHomeState == .readyToConnect, + let connectUserToken = msaUserToken, !connectUserToken.isEmpty { + try await streamSession.sendMSALAuth(userToken: connectUserToken) + try await streamSession.waitUntilProvisioned() + } await notifyLifecycle(.readyToConnect) } diff --git a/Packages/StreamingCore/Tests/StreamingCoreTests/StreamingSessionTests.swift b/Packages/StreamingCore/Tests/StreamingCoreTests/StreamingSessionTests.swift index a073539..ff0708c 100644 --- a/Packages/StreamingCore/Tests/StreamingCoreTests/StreamingSessionTests.swift +++ b/Packages/StreamingCore/Tests/StreamingCoreTests/StreamingSessionTests.swift @@ -80,6 +80,60 @@ struct StreamingSessionTests { #expect(requests.contains(where: { $0.httpMethod == "DELETE" && $0.url?.path.hasSuffix("/test-session") == true })) } + @MainActor + @Test + func homeConnect_acceptsProvisionedStateWithNullErrorDetails() async { + // Real xHome sessions go Provisioning -> Provisioned (never ReadyToConnect) + // and report an all-null errorDetails object while healthy. + let bridge = RecordingBridge( + offerSDP: makeLocalOfferSDP(), + localCandidates: [ + IceCandidatePayload( + candidate: "a=end-of-candidates", + sdpMLineIndex: 0, + sdpMid: "0" + ) + ], + connectionState: .connected + ) + let client = makeClient( + responses: [ + .json(statusCode: 200, pathSuffix: "/play", body: [ + "sessionPath": "v5/sessions/home/test-session", + "sessionId": "session-provisioned", + "state": "Provisioning" + ]), + .json(statusCode: 200, pathSuffix: "/state", body: [ + "state": "Provisioned", + "detailedSessionState": 0, + "errorDetails": ["code": NSNull(), "message": NSNull()] + ]), + .json(statusCode: 200, pathSuffix: "/sdp", body: [ + "sdp": makeRemoteAnswerSDP() + ]), + .empty(statusCode: 204, pathSuffix: "/ice"), + .json(statusCode: 200, pathSuffix: "/ice", body: [ + "iceCandidates": [ + [ + "candidate": "a=candidate:2 1 udp 2122260223 20.0.0.1 6000 typ host", + "sdpMLineIndex": 0, + "sdpMid": "0" + ] + ] + ]), + .empty(statusCode: 200, pathSuffix: "/test-session") + ] + ) + let session = StreamingSession(apiClient: client, bridge: bridge) + + await session.connect(type: .home, targetId: "console-1") + + #expect(session.lifecycle == .connected) + #expect(bridge.didSetRemoteDescription == true) + + await session.disconnect() + } + @MainActor @Test func cloudConnect_missingMSATokenFailsBeforeWebRTCStarts() async { diff --git a/Packages/VideoRenderingKit/Sources/VideoRenderingKit/LiveUpscaleCapabilityProbe.swift b/Packages/VideoRenderingKit/Sources/VideoRenderingKit/LiveUpscaleCapabilityProbe.swift index bf675e4..13f6243 100644 --- a/Packages/VideoRenderingKit/Sources/VideoRenderingKit/LiveUpscaleCapabilityProbe.swift +++ b/Packages/VideoRenderingKit/Sources/VideoRenderingKit/LiveUpscaleCapabilityProbe.swift @@ -25,7 +25,7 @@ public struct LiveUpscaleCapabilityProbe: UpscaleCapabilityProbing { public func supportsMetal4FXSpatial(device: any MTLDevice) -> Bool { #if canImport(MetalFX) - if #available(tvOS 26, macOS 26, *) { + if #available(tvOS 27.1, macOS 26, *) { let supported = MTLFXSpatialScalerDescriptor.supportsMetal4FX(device) log.debug("Metal4FX spatial supported: \(supported)") return supported @@ -88,9 +88,12 @@ public struct LiveUpscaleCapabilityProbe: UpscaleCapabilityProbing { public func supportsMetalFXSpatial(device: any MTLDevice) -> Bool { #if canImport(MetalFX) - let supported = MTLFXSpatialScalerDescriptor.supportsDevice(device) - log.debug("MetalFX spatial supported: \(supported)") - return supported + if #available(tvOS 27.1, macOS 26, *) { + let supported = MTLFXSpatialScalerDescriptor.supportsDevice(device) + log.debug("MetalFX spatial supported: \(supported)") + return supported + } + return false #else return false #endif From 1f5c8de4029472c192b3d16378af783a589ad7be Mon Sep 17 00:00:00 2001 From: Don Hartman Date: Wed, 25 Nov 2026 14:00:20 -0600 Subject: [PATCH 2/2] Skip frame-interpolation upscaling in Low Latency Mode VTLowLatencyFrameInterpolation buffers a frame (~33 ms at 60 fps), and on a 1080p -> 4K display it is eligible as a fallback upscaler even when Low Latency Mode is on. Thread the low-latency setting through RenderLadderPlanner into UpscaleCapabilityResolver and exclude LLFI when it is enabled; toggling the setting re-plans the render ladder. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ETMULew4xpK5YpbnhMkSUb --- .../RendererAttachmentCoordinator.swift | 11 +++++++- .../RenderLadderPlanner.swift | 6 +++-- .../UpscaleCapabilityResolver.swift | 25 ++++++++++++------- .../UpscaleCapabilityResolverTests.swift | 11 ++++++++ 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/Apps/Stratix/Sources/Stratix/Features/Streaming/Rendering/RendererAttachmentCoordinator.swift b/Apps/Stratix/Sources/Stratix/Features/Streaming/Rendering/RendererAttachmentCoordinator.swift index db145d0..8ae6111 100644 --- a/Apps/Stratix/Sources/Stratix/Features/Streaming/Rendering/RendererAttachmentCoordinator.swift +++ b/Apps/Stratix/Sources/Stratix/Features/Streaming/Rendering/RendererAttachmentCoordinator.swift @@ -41,6 +41,7 @@ final class RendererAttachmentCoordinator: NSObject { /// Configuration bundle derived from live settings and passed into the renderer pipeline. struct Configuration { var upscalingEnabled: Bool + var lowLatencyMode: Bool var frameProbeEnabled: Bool var hdrEnabled: Bool var floorBehavior: RenderLadderFloorBehavior @@ -61,6 +62,7 @@ final class RendererAttachmentCoordinator: NSObject { } return Self( upscalingEnabled: settingsStore.stream.upscalingEnabled, + lowLatencyMode: settingsStore.stream.lowLatencyMode, frameProbeEnabled: settingsStore.diagnostics.frameProbe, hdrEnabled: settingsStore.stream.hdrEnabled, floorBehavior: floorBehavior, @@ -121,9 +123,11 @@ final class RendererAttachmentCoordinator: NSObject { private var sampleRendererSnapshot: StreamSurfaceModel.RendererTelemetrySnapshot = .cleared private var metalRendererSnapshot: StreamSurfaceModel.RendererTelemetrySnapshot = .cleared private var upscalingEnabled = true + private var lowLatencyMode = true private var floorBehavior: RenderLadderFloorBehavior = .sampleFloor private var lastAppliedTrackIdentity: ObjectIdentifier? private var lastAppliedUpscalingEnabled: Bool? + private var lastAppliedLowLatencyMode: Bool? private var lastAppliedFloorBehavior: RenderLadderFloorBehavior? private var lastAppliedFrameProbeEnabled: Bool? private var lastAppliedContainerBounds: CGSize? @@ -263,6 +267,7 @@ final class RendererAttachmentCoordinator: NSObject { hasReportedRendererDecodeFailure = false lastAppliedTrackIdentity = nil lastAppliedUpscalingEnabled = nil + lastAppliedLowLatencyMode = nil lastAppliedFloorBehavior = nil lastAppliedFrameProbeEnabled = nil lastAppliedContainerBounds = nil @@ -273,6 +278,7 @@ final class RendererAttachmentCoordinator: NSObject { private func applyConfiguration(_ configuration: Configuration) { callbacks = configuration.callbacks upscalingEnabled = configuration.upscalingEnabled + lowLatencyMode = configuration.lowLatencyMode floorBehavior = configuration.floorBehavior setFrameProbeEnabled(configuration.frameProbeEnabled) sampleBufferRenderer.hdrEnabled = configuration.hdrEnabled @@ -536,7 +542,8 @@ final class RendererAttachmentCoordinator: NSObject { targetW: target.width, targetH: target.height, upscalingEnabled: upscalingEnabled, - floorBehavior: floorBehavior + floorBehavior: floorBehavior, + lowLatencyMode: lowLatencyMode ) let planChanged = ladderPlan != nextPlan ladderPlan = nextPlan @@ -618,6 +625,7 @@ final class RendererAttachmentCoordinator: NSObject { let trackChanged = attachedTrack !== newTrack let frameProbeChanged = lastAppliedFrameProbeEnabled != frameProbeEnabled let settingsChanged = lastAppliedUpscalingEnabled != upscalingEnabled + || lastAppliedLowLatencyMode != lowLatencyMode || lastAppliedFloorBehavior != floorBehavior || frameProbeChanged || lastAppliedContainerBounds != containerBounds @@ -640,6 +648,7 @@ final class RendererAttachmentCoordinator: NSObject { guard trackChanged || settingsChanged else { return } lastAppliedTrackIdentity = newTrack.map(ObjectIdentifier.init) lastAppliedUpscalingEnabled = upscalingEnabled + lastAppliedLowLatencyMode = lowLatencyMode lastAppliedFloorBehavior = floorBehavior lastAppliedFrameProbeEnabled = frameProbeEnabled lastAppliedContainerBounds = containerBounds diff --git a/Packages/VideoRenderingKit/Sources/VideoRenderingKit/RenderLadderPlanner.swift b/Packages/VideoRenderingKit/Sources/VideoRenderingKit/RenderLadderPlanner.swift index e443821..0d60076 100644 --- a/Packages/VideoRenderingKit/Sources/VideoRenderingKit/RenderLadderPlanner.swift +++ b/Packages/VideoRenderingKit/Sources/VideoRenderingKit/RenderLadderPlanner.swift @@ -94,7 +94,8 @@ public struct RenderLadderPlanner: Sendable { targetW: Int, targetH: Int, upscalingEnabled: Bool, - floorBehavior: RenderLadderFloorBehavior + floorBehavior: RenderLadderFloorBehavior, + lowLatencyMode: Bool = false ) -> RenderLadderPlan { let sourceDimensions = RenderLadderDimensions( width: max(1, sourceW), @@ -127,7 +128,8 @@ public struct RenderLadderPlanner: Sendable { sourceW: sourceDimensions.width, sourceH: sourceDimensions.height, targetW: desiredProcessingTarget.width, - targetH: desiredProcessingTarget.height + targetH: desiredProcessingTarget.height, + excludeFrameInterpolation: lowLatencyMode ) let floorRung: RenderLadderRung = floorBehavior == .metalFloor && device != nil ? .passthrough : .sampleBuffer diff --git a/Packages/VideoRenderingKit/Sources/VideoRenderingKit/UpscaleCapabilityResolver.swift b/Packages/VideoRenderingKit/Sources/VideoRenderingKit/UpscaleCapabilityResolver.swift index d628301..37b09a0 100644 --- a/Packages/VideoRenderingKit/Sources/VideoRenderingKit/UpscaleCapabilityResolver.swift +++ b/Packages/VideoRenderingKit/Sources/VideoRenderingKit/UpscaleCapabilityResolver.swift @@ -77,7 +77,8 @@ public struct UpscaleCapabilityResolver: Sendable { sourceW: Int, sourceH: Int, targetW: Int, - targetH: Int + targetH: Int, + excludeFrameInterpolation: Bool = false ) -> UpscaleCandidateResolution { guard sourceW > 0, sourceH > 0, targetW > 0, targetH > 0 else { return invalidDimensionsResolution() @@ -105,14 +106,20 @@ public struct UpscaleCapabilityResolver: Sendable { candidates: &candidates, skippedRungReasons: &skippedRungReasons ) - appendFrameInterpolationCandidate( - sourceW: sourceW, - sourceH: sourceH, - targetW: targetW, - targetH: targetH, - candidates: &candidates, - skippedRungReasons: &skippedRungReasons - ) + if excludeFrameInterpolation { + // LLFI buffers a frame (~33 ms at 60 fps); never trade that latency for upscaling + // when the user has asked for low latency. + skippedRungReasons["llfi"] = "excluded: low latency mode adds no buffered-frame upscalers" + } else { + appendFrameInterpolationCandidate( + sourceW: sourceW, + sourceH: sourceH, + targetW: targetW, + targetH: targetH, + candidates: &candidates, + skippedRungReasons: &skippedRungReasons + ) + } appendMetalCandidate( device: device, candidate: .metalFXSpatial, diff --git a/Packages/VideoRenderingKit/Tests/VideoRenderingKitTests/UpscaleCapabilityResolverTests.swift b/Packages/VideoRenderingKit/Tests/VideoRenderingKitTests/UpscaleCapabilityResolverTests.swift index 09689df..5ed89ba 100644 --- a/Packages/VideoRenderingKit/Tests/VideoRenderingKitTests/UpscaleCapabilityResolverTests.swift +++ b/Packages/VideoRenderingKit/Tests/VideoRenderingKitTests/UpscaleCapabilityResolverTests.swift @@ -77,6 +77,17 @@ struct MockUpscaleCapabilityProbe: UpscaleCapabilityProbing { #expect(result == .vtFrameInterpolation) } + @Test func llfiExcludedInLowLatencyMode() { + let resolver = makeResolver(MockUpscaleCapabilityProbe(vtFrameInterpolation: true, metalFX: true)) + let resolution = resolver.resolveCandidateResolution( + device: device, sourceW: 1920, sourceH: 1080, targetW: 3840, targetH: 2160, + excludeFrameInterpolation: true + ) + #expect(!resolution.candidates.contains(.vtFrameInterpolation)) + #expect(resolution.candidates.first == .metalFXSpatial) + #expect(resolution.skippedRungReasons["llfi"] != nil) + } + @Test func llsrBeatsLLFIOnTrueTwoXTarget() { let resolver = makeResolver(MockUpscaleCapabilityProbe(scaleFactors: [2.0], vtFrameInterpolation: true)) let result = resolver.resolve(device: device, sourceW: 1920, sourceH: 1080, targetW: 3840, targetH: 2160)