mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +00:00
Ensure preview layer is accessed on main thread
This commit is contained in:
parent
04faa034e3
commit
a9746bf861
1 changed files with 4 additions and 1 deletions
|
|
@ -503,6 +503,9 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
flashView?.alpha = 0.85
|
flashView?.alpha = 0.85
|
||||||
previewLayer.addSubview(flashView!)
|
previewLayer.addSubview(flashView!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Must be fetched before on main thread
|
||||||
|
let previewOrientation = previewLayer.videoPreviewLayer.connection!.videoOrientation
|
||||||
|
|
||||||
sessionQueue.async { [unowned self] in
|
sessionQueue.async { [unowned self] in
|
||||||
if !movieFileOutput.isRecording {
|
if !movieFileOutput.isRecording {
|
||||||
|
|
@ -519,7 +522,7 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
movieFileOutputConnection?.isVideoMirrored = true
|
movieFileOutputConnection?.isVideoMirrored = true
|
||||||
}
|
}
|
||||||
|
|
||||||
movieFileOutputConnection?.videoOrientation = self.orientation.getVideoOrientation() ?? self.previewLayer.videoPreviewLayer.connection!.videoOrientation
|
movieFileOutputConnection?.videoOrientation = self.orientation.getVideoOrientation() ?? previewOrientation
|
||||||
|
|
||||||
// Start recording to a temporary file.
|
// Start recording to a temporary file.
|
||||||
let outputFileName = UUID().uuidString
|
let outputFileName = UUID().uuidString
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue