From e9c075b5088dc05823b83e306fffa4d3ee556116 Mon Sep 17 00:00:00 2001 From: Guillaume Louel Date: Sat, 12 Oct 2019 12:41:23 +0200 Subject: [PATCH 1/4] Tentative fix for customvideos inserting 4K videos crashing with HDR. --- Aerial.xcodeproj/project.pbxproj | 8 ++++---- Aerial/Source/Models/ErrorLog.swift | 2 +- Aerial/Source/Models/ManifestLoader.swift | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index 3c75c3cf..36fc4e33 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -1185,7 +1185,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.2; + CURRENT_PROJECT_VERSION = 1.6.3test2; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1193,7 +1193,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3test2; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1214,7 +1214,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.2; + CURRENT_PROJECT_VERSION = 1.6.3test2; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1222,7 +1222,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3test2; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Aerial/Source/Models/ErrorLog.swift b/Aerial/Source/Models/ErrorLog.swift index 5f880764..77cb9e3a 100644 --- a/Aerial/Source/Models/ErrorLog.swift +++ b/Aerial/Source/Models/ErrorLog.swift @@ -55,7 +55,7 @@ func Log(level: ErrorLevel, message: String) { if #available(OSX 10.12, *) { // This is faster when available let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Screensaver") - os_log("AerialError: %@", log: log, type: .error, message) + os_log("AerialError: %{public}@", log: log, type: .error, message) } else { NSLog("AerialError: \(message)") } diff --git a/Aerial/Source/Models/ManifestLoader.swift b/Aerial/Source/Models/ManifestLoader.swift index 72956f9b..84d74e42 100644 --- a/Aerial/Source/Models/ManifestLoader.swift +++ b/Aerial/Source/Models/ManifestLoader.swift @@ -455,10 +455,10 @@ class ManifestLoader { type: "video", timeOfDay: asset.time, url1080pH264: url1080p, - url1080pHEVC: "", - url1080pHDR: "", + url1080pHEVC: url1080p, + url1080pHDR: url1080p, url4KHEVC: url4K, - url4KHDR: "", + url4KHDR: url4K, manifest: .customVideos, poi: [:], communityPoi: asset.pointsOfInterest) @@ -765,7 +765,7 @@ class ManifestLoader { } } } catch { - errorLog("Error retrieving content listing") + errorLog("Error retrieving content listing (new)") return } } @@ -850,7 +850,7 @@ class ManifestLoader { } } } catch { - errorLog("Error retrieving content listing") + errorLog("Error retrieving content listing (old)") return } } From 056624bd914608a5b55694389132a9ee7377d5d6 Mon Sep 17 00:00:00 2001 From: Guillaume Louel Date: Thu, 24 Oct 2019 14:01:12 +0200 Subject: [PATCH 2/4] 1.6.3 --- Aerial.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index 36fc4e33..c610575f 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -995,7 +995,7 @@ INFOPLIST_FILE = Aerial/App/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.0; + MARKETING_VERSION = 1.6.3; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1018,7 +1018,7 @@ INFOPLIST_FILE = Aerial/App/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.0; + MARKETING_VERSION = 1.6.3; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1185,7 +1185,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.3test2; + CURRENT_PROJECT_VERSION = 1.6.3; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1193,7 +1193,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.3test2; + MARKETING_VERSION = 1.6.3; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1214,7 +1214,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.3test2; + CURRENT_PROJECT_VERSION = 1.6.3; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1222,7 +1222,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.3test2; + MARKETING_VERSION = 1.6.3; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; From e50ca6e7edb2e1c2ceb9acae641d23a7d270be7d Mon Sep 17 00:00:00 2001 From: Guillaume Louel Date: Fri, 1 Nov 2019 11:51:19 +0100 Subject: [PATCH 3/4] - Clarify what HDR means with a popup and clearly say that those are separate files and not just a rendering mode - Fix cache size detection that still looked in the read only cache folder in Catalina instead of appSupport - Fix an incorrect tooltip for Video Sets --- .../Controllers/PWC Tabs/PWC+Cache.swift | 4 +- .../Controllers/PWC Tabs/PWC+Videos.swift | 11 +++ .../PreferencesWindowController.swift | 3 +- Resources/PreferencesWindow.xib | 82 ++++++++++++++++--- 4 files changed, 84 insertions(+), 16 deletions(-) diff --git a/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift b/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift index 33790bcc..28e7a88f 100644 --- a/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift +++ b/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift @@ -30,8 +30,8 @@ extension PreferencesWindowController { } func updateCacheSize() { - // get your directory url - let documentsDirectoryURL = URL(fileURLWithPath: VideoCache.cacheDirectory!) + // get your directory url, we now use App support + let documentsDirectoryURL = URL(fileURLWithPath: VideoCache.appSupportDirectory!) // FileManager.default.urls(for: VideoCache.cacheDirectory, in: .userDomainMask).first! diff --git a/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift b/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift index a8c59df8..8c02742f 100644 --- a/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift +++ b/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift @@ -187,6 +187,10 @@ extension PreferencesWindowController { popoverPower.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY) } + @IBAction func helpHDRButtonClick(_ button: NSButton) { + popoverHDR.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY) + } + @IBAction func fadeInOutModePopupChange(_ sender: NSPopUpButton) { debugLog("UI fadeInOutMode: \(sender.indexOfSelectedItem)") preferences.fadeMode = sender.indexOfSelectedItem @@ -241,6 +245,13 @@ extension PreferencesWindowController { } } + // MARK: Wikipedia popup link + @IBAction func linkToWikipediaDolbyVisionClick(_ sender: Any) { + let workspace = NSWorkspace.shared + let url = URL(string: "https://en.wikipedia.org/wiki/Dolby_Laboratories#Video_processing")! + workspace.open(url) + } + // MARK: Video playback // Rewind preview video when reaching end diff --git a/Aerial/Source/Controllers/PreferencesWindowController.swift b/Aerial/Source/Controllers/PreferencesWindowController.swift index 9f7a2ddd..757b6a23 100644 --- a/Aerial/Source/Controllers/PreferencesWindowController.swift +++ b/Aerial/Source/Controllers/PreferencesWindowController.swift @@ -34,6 +34,8 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo @IBOutlet var popoverHEVCLabel: NSTextField! @IBOutlet var secondProjectPageLink: NSButton! + @IBOutlet var popoverHDR: NSPopover! + @IBOutlet var popoverTime: NSPopover! @IBOutlet var linkTimeWikipediaButton: NSButton! @@ -252,7 +254,6 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo return formatter }() - // MARK: - Init required init?(coder decoder: NSCoder) { self.fontManager = NSFontManager.shared debugLog("pwc init1") diff --git a/Resources/PreferencesWindow.xib b/Resources/PreferencesWindow.xib index eb5e35d4..bbbd87a4 100644 --- a/Resources/PreferencesWindow.xib +++ b/Resources/PreferencesWindow.xib @@ -1,9 +1,9 @@ - + - - + + @@ -111,6 +111,7 @@ + @@ -175,7 +176,7 @@ - + @@ -514,15 +515,15 @@ is disabled - + - + @@ -1773,7 +1785,7 @@ Shift, but macOS 10.12.4 or above and a compatible Mac are required) - + @@ -2289,7 +2301,7 @@ Gw - + @@ -2804,7 +2816,7 @@ Unless you want to manually manage your updates, we highly recommand you leave t - + @@ -2982,6 +2994,50 @@ After changing the folder, please close System Preferences for this to be taken + + + + + + + + + + + + + + + + + + + + + If you enable HDR, Aerial will download new versions of the videos. This option is only available starting with macOS Catalina. + +These videos are using Dolby Vision to represent a Higher Dynamic Range of colors and lighting. + +In practice, this means you will see wilder colors which may or may not look pleasing or realistic to you. + +Please note that all 4K videos are encoded in 10 bit per color component, whether you are using HDR or not. Those files will be played appropriately whether your screen is 10 bit (iMac) or 8 bit (Macbook Pro). + + + + + + + From f41e9097c4d15387e0e0a22b04e6adbffdaf1a4e Mon Sep 17 00:00:00 2001 From: Guillaume Louel Date: Fri, 1 Nov 2019 12:30:45 +0100 Subject: [PATCH 4/4] 1.6.4 Fix old files estimation, move/trash old videos features that would always delete HDR files, and would look in the wrong folder in Catalina. --- Aerial.xcodeproj/project.pbxproj | 12 ++--- .../PreferencesWindowController.swift | 2 + Aerial/Source/Models/ManifestLoader.swift | 46 +++++++++++++++++-- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index c610575f..76834896 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -995,7 +995,7 @@ INFOPLIST_FILE = Aerial/App/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1018,7 +1018,7 @@ INFOPLIST_FILE = Aerial/App/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1185,7 +1185,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.3; + CURRENT_PROJECT_VERSION = 1.6.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1193,7 +1193,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1214,7 +1214,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.3; + CURRENT_PROJECT_VERSION = 1.6.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1222,7 +1222,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Aerial/Source/Controllers/PreferencesWindowController.swift b/Aerial/Source/Controllers/PreferencesWindowController.swift index 757b6a23..641b6ac1 100644 --- a/Aerial/Source/Controllers/PreferencesWindowController.swift +++ b/Aerial/Source/Controllers/PreferencesWindowController.swift @@ -501,6 +501,8 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo self.outlineView.reloadData() self.outlineView.expandItem(nil, expandChildren: true) } + + // We update the info in the advanced tab let (description, total) = ManifestLoader.instance.getOldFilesEstimation() videoVersionsLabel.stringValue = description if total > 0 { diff --git a/Aerial/Source/Models/ManifestLoader.swift b/Aerial/Source/Models/ManifestLoader.swift index 84d74e42..ea0fdf50 100644 --- a/Aerial/Source/Models/ManifestLoader.swift +++ b/Aerial/Source/Models/ManifestLoader.swift @@ -902,7 +902,7 @@ class ManifestLoader { warnLog("We have no videos in the manifest") return ("Can't estimate duplicates", 0) } - guard let cacheDirectory = VideoCache.cacheDirectory else { + guard let cacheDirectory = VideoCache.appSupportDirectory else { warnLog("No cache directory") return ("Can't estimate duplicates", 0) } @@ -915,7 +915,7 @@ class ManifestLoader { let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil) let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" } - // We check the 3 fields + // We check the 5 fields for fileURL in videoFileURLs { var found = false for video in loadedManifest { @@ -931,12 +931,24 @@ class ManifestLoader { break } } + if video.url1080pHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent { + found = true + break + } + } if video.url4KHEVC != "" { if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent { found = true break } } + if video.url4KHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent { + found = true + break + } + } } if !found { @@ -992,7 +1004,7 @@ class ManifestLoader { let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil) let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" } - // We check the 3 fields + // We check the 5 fields for fileURL in videoFileURLs { var found = false for video in loadedManifest { @@ -1008,12 +1020,24 @@ class ManifestLoader { break } } + if video.url1080pHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent { + found = true + break + } + } if video.url4KHEVC != "" { if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent { found = true break } } + if video.url4KHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent { + found = true + break + } + } } if !found { @@ -1034,7 +1058,7 @@ class ManifestLoader { // swiftlint:disable:next cyclomatic_complexity func trashOldVideos() { debugLog("trash old videos") - let cacheDirectory = VideoCache.cacheDirectory! + let cacheDirectory = VideoCache.appSupportDirectory! var cacheResourcesString = cacheDirectory let dateFormatter = DateFormatter() @@ -1067,7 +1091,7 @@ class ManifestLoader { let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil) let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" } - // We check the 3 fields + // We check the 5 fields for fileURL in videoFileURLs { var found = false for video in loadedManifest { @@ -1083,12 +1107,24 @@ class ManifestLoader { break } } + if video.url1080pHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent { + found = true + break + } + } if video.url4KHEVC != "" { if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent { found = true break } } + if video.url4KHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent { + found = true + break + } + } } if !found {