5 Commits

Author SHA1 Message Date
AFathi b05e744dc6 minor performance improvements 2019-01-12 21:32:35 -05:00
AFathi c51fc0db85 iPhone X+ fixes 2018-12-17 12:02:01 -05:00
AFathi 61415aa9aa iPhone X+ fixes 2018-12-17 12:01:35 -05:00
AFathi b89bd27d59 few changes 2018-12-17 11:58:01 -05:00
Ahmed Bekhit 6037aa9619 Update README.md 2018-09-20 12:03:54 -04:00
5 changed files with 16 additions and 13 deletions
+2
View File
@@ -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 }
+9 -8
View File
@@ -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)
}
+2 -2
View File
@@ -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)",
+1 -1
View File
@@ -1,4 +1,4 @@
> An update for Swift 4.2 is coming soon :) -Ahmed
> Use [swift_4_2](https://github.com/AFathi/ARVideoKit/tree/swift_4_2) branch for projects written in Swift 4.2
![intro image](http://www.ahmedbekhit.com/projects/repo-header-arvideokit.png)