Post

Replies

Boosts

Views

Activity

Access to Final Cut Pro files through extension
Hi, I am developing a Final Cut Pro workflow extension. I would like to upload a Final Cut Pro video with the extension. As far as I understand both the macOS app and the extension are sandboxed and the user doesn't have a direct access to the Final Cut Pro folders. Here there is a described way to receive media through a custom share destination. So far I have been able to parse the XML describing the video after dragging the video from FCP and dropping it in the extension. I have the URL of the video but no access to it - permissions denied. Can I programmatically acquire access to the folder/ file in question? Or have the user allow access at the beginning and use it later? Or should I use custom shared destination for that purpose? Thank you in advance!
0
0
897
Mar ’22
NSOperationQueue - dependency not respected
I am using an NSOperationQueue for an upload task. self.operationQueue = [[NSOperationQueue alloc] init]; self.operationQueue.maxConcurrentOperationCount = 5; There are two types of tasks - UploadChunkTask and FinalTask (NSOperation subclasses). I'd like the FinalTask to start after all the UploadChunkTasks are finished. So I add the tasks for chunk uploads as dependencies to the final task: FinalTask *finalOperation = [[FinalTask alloc] init]; for (int i = 0; i < self.file.numberOfChunks; i++) { &#9;&#9;UploadChunkTask *uploadOperation = [[UploadChunkTask alloc] initWithFile:self.file andChunkNumber:i+1]; &#9;&#9;[uploadOperations addObject:uploadOperation]; &#9;&#9;[finalOperation addDependency:uploadOperation]; } [uploadOperations addObject:finalOperation]; And finally I add the tasks to an NSOperationQueue: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ &#9;&#9; &#9;&#9;[self.operationQueue addOperations:uploadOperations waitUntilFinished:YES]; &#9;&#9; &#9;&#9;dispatch_async(dispatch_get_main_queue(), ^{ &#9;&#9;&#9;&#9;completion(); &#9;&#9;}); }); The problem is that the final task does not respect the dependency and gets executed with the other tasks (instead of waiting for them to finish first). This happens even if there is just one upload task. The final task is sometimes executed before the upload task. I noticed this issue disappears if maxConcurrentOperationCount is set to 1, but I need it to be set to 5. Thank you in advance.
0
0
362
Aug ’20