Hello,
I am using mobile ffmpeg and trying to show progress using log delegate.
Works all fine but when I changed UI in main thread it will not work perfectly.
Because log delegate called immediately when I changed ui in main thread.
After all logs are completed then main thread is called and changed UI.
But I want to change my UI immediate when getting 1 log message.
Execution Code
I execute method in main thread
DispatchQueue.main.async {
let rc = MobileFFmpeg.execute(withArguments: [str])
if rc == RETURN_CODE_SUCCESS {
print("output file : " + outputFilePath.absoluteString)
print("Command execution completed successfully.\n")
} else if rc == RETURN_CODE_CANCEL {
print("Command execution cancelled by user.\n")
} else {
print("Command execution failed with rc=\(rc) and output=\(MobileFFmpegConfig.getLastCommandOutput() ?? "").\n")
}
}
Log Delegate Code
I am setting Label text like below
Here progress is calculating from log message time.
DispatchQueue.main.async {
//This part will not called till all logs are completed.
self.lblPercentageProgress.text = String(format: "%.2f", progress)
}
Hello, I am using mobile ffmpeg and trying to show progress using log delegate. Works all fine but when I changed UI in main thread it will not work perfectly. Because log delegate called immediately when I changed ui in main thread. After all logs are completed then main thread is called and changed UI. But I want to change my UI immediate when getting 1 log message.
Execution Code I execute method in main thread
Log Delegate Code I am setting Label text like below Here progress is calculating from log message time.
Any idea about these?