Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from thorikawa/main
Browse files Browse the repository at this point in the history
Fix Swift.Dictionary to NSMutableDictionary cast issue.
  • Loading branch information
sturmen authored Feb 14, 2024
2 parents 7d4e725 + 2a86f39 commit 394eb3a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/SpatialMediaKit/SpatialVideoMerger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class SpatialVideoMerger {
let heroEye =
leftIsPrimary ? kCMFormatDescriptionHeroEye_Left : kCMFormatDescriptionHeroEye_Right

let outputSettingsDict: [String: Any] = [
var outputSettingsDict: [String: Any] = [
AVVideoWidthKey: outputWidth,
AVVideoHeightKey: outputHeight,
AVVideoColorPropertiesKey: [
Expand All @@ -88,9 +88,11 @@ public class SpatialVideoMerger {
]

if let hDisparityAdj = hDisparityAdj {
let compressionProps =
outputSettingsDict[AVVideoCompressionPropertiesKey] as! NSMutableDictionary
compressionProps[kVTCompressionPropertyKey_HorizontalDisparityAdjustment] = hDisparityAdj
if let compressionPropsDict = outputSettingsDict[AVVideoCompressionPropertiesKey] as? [String: Any] {
let compressionProps = NSMutableDictionary(dictionary: compressionPropsDict)
compressionProps[kVTCompressionPropertyKey_HorizontalDisparityAdjustment] = hDisparityAdj
outputSettingsDict[AVVideoCompressionPropertiesKey] = compressionProps
}
}

let assetWriterInput = AVAssetWriterInput(
Expand Down

0 comments on commit 394eb3a

Please sign in to comment.