Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b05e744dc6 | |||
| c51fc0db85 | |||
| 61415aa9aa | |||
| b89bd27d59 | |||
| 6037aa9619 |
@@ -93,7 +93,9 @@ struct RenderAR {
|
||||
} else {
|
||||
renderedFrame = renderEngine.snapshot(atTime: time, with: size, antialiasingMode: .none)
|
||||
}
|
||||
|
||||
guard let buffer = renderedFrame!.buffer else { return nil }
|
||||
|
||||
return buffer
|
||||
} else if view is ARSKView {
|
||||
guard let size = bufferSize else { return nil }
|
||||
|
||||
@@ -33,9 +33,9 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {
|
||||
do {
|
||||
assetWriter = try AVAssetWriter(outputURL: output, fileType: AVFileType.mp4)
|
||||
} catch {
|
||||
// FIXME: handle when failed to allocate AVAssetWriter.
|
||||
return
|
||||
fatalError("An error occurred while intializing an AVAssetWriter")
|
||||
}
|
||||
|
||||
if audioEnabled {
|
||||
if allowMix {
|
||||
let audioOptions: AVAudioSessionCategoryOptions = [.mixWithOthers , .allowBluetooth, .defaultToSpeaker, .interruptSpokenAudioAndMixWithOthers]
|
||||
@@ -57,15 +57,15 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {
|
||||
AVVideoHeightKey: height as AnyObject
|
||||
]
|
||||
|
||||
let attributes: [String: Bool] = [
|
||||
kCVPixelBufferCGImageCompatibilityKey as String: true,
|
||||
kCVPixelBufferCGBitmapContextCompatibilityKey as String: true
|
||||
]
|
||||
// let attributes: [String: Bool] = [
|
||||
// kCVPixelBufferCGImageCompatibilityKey as String: true,
|
||||
// kCVPixelBufferCGBitmapContextCompatibilityKey as String: true
|
||||
// ]
|
||||
videoInput = AVAssetWriterInput(mediaType: .video, outputSettings: videoOutputSettings)
|
||||
|
||||
videoInput.expectsMediaDataInRealTime = true
|
||||
pixelBufferInput = AVAssetWriterInputPixelBufferAdaptor(assetWriterInput: videoInput, sourcePixelBufferAttributes: attributes)
|
||||
|
||||
pixelBufferInput = AVAssetWriterInputPixelBufferAdaptor(assetWriterInput: videoInput, sourcePixelBufferAttributes: nil)
|
||||
|
||||
var angleEnabled: Bool {
|
||||
for v in orientaions {
|
||||
if UIDevice.current.orientation.rawValue == v.rawValue {
|
||||
@@ -141,6 +141,7 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {
|
||||
if session.canAddInput(audioDeviceInput!) {
|
||||
session.addInput(audioDeviceInput!)
|
||||
}
|
||||
|
||||
if session.canAddOutput(audioDataOutput) {
|
||||
session.addOutput(audioDataOutput)
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@ private var renderer: RenderAR!
|
||||
/**
|
||||
An object that passes the AR recorder errors and status in the protocol methods.
|
||||
*/
|
||||
@objc public var delegate: RecordARDelegate?
|
||||
@objc public weak var delegate: RecordARDelegate?
|
||||
/**
|
||||
An object that passes the AR rendered content in the protocol method.
|
||||
*/
|
||||
@objc public var renderAR: RenderARDelegate?
|
||||
@objc public weak var renderAR: RenderARDelegate?
|
||||
/**
|
||||
An object that returns the AR recorder current status.
|
||||
*/
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = P5DZ3XQ9FJ;
|
||||
DEVELOPMENT_TEAM = LXD85S9DW4;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)",
|
||||
@@ -440,7 +440,7 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = P5DZ3XQ9FJ;
|
||||
DEVELOPMENT_TEAM = LXD85S9DW4;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)",
|
||||
|
||||
Reference in New Issue
Block a user