Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configurable qos #44

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rromanchuk
Copy link
Collaborator

This is a bit ugly, but PoC test to resolve priority inversion warnings

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 22258, TID: 26715793

This is probably more relevant in an async/await context.

Example reproduction where callee uses qos of .userInitiated

Task(priority: .userInitiated) {
   try? await model.process()
}
    @MainActor
    class ViewModel: ObservableObject {
        @Published var proccessedVideo: URL?
        init() {}
        
       func process() async throws {
            let nl = NextLevelSessionExporter(withAsset: mixComposition)
            // nl.videoComposition = videoComposition
            // nl.videoOutputConfiguration = self.videoSettings
            // nl.audioOutputConfiguration = self.audioSettings
            // nl.outputURL = watermarkedFilepath
            
            
            try await withCheckedThrowingContinuation { continuation in
                nl.export(completionHandler:  { result in
                    switch result {
                    case .success:
                        continuation.resume()
                    case let .failure(error):
                        continuation.resume(throwing: error)
                    }
                })
            }
            
            self.proccessedVideo = watermarkedFilepath       

       }
    }

Confirmed warnings went away with let nl = NextLevelSessionExporter(withAsset: mixComposition, qos: .userInitiated),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants