Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ DEPENDENCIES:

EXTERNAL SOURCES:
SCNVideoWriter:
:path: ../
:path: "../"

SPEC CHECKSUMS:
SCNVideoWriter: cc277dde2b4cc905d06f0a262f1f50b777e7a32d
SCNVideoWriter: 358dc7144310d4022b464abeabf9c6b1d5245294

PODFILE CHECKSUM: eaf2afc00a8480151634f3ef4607aaf4100137eb

COCOAPODS: 1.3.1
COCOAPODS: 1.5.3
62 changes: 9 additions & 53 deletions Example/SCNVideoWriter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
CF95C6A3368ED2E216860FD3 /* [CP] Embed Pods Frameworks */,
A8740CFFDF34B86691D49509 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -218,8 +217,6 @@
607FACE11AFB9204008FA782 /* Sources */,
607FACE21AFB9204008FA782 /* Frameworks */,
607FACE31AFB9204008FA782 /* Resources */,
0ADDD054D3268F1438B4A9C4 /* [CP] Embed Pods Frameworks */,
A1B699F35D66F0339FC0E592 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -238,7 +235,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
Expand Down Expand Up @@ -298,21 +295,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
0ADDD054D3268F1438B4A9C4 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SCNVideoWriter_Tests/Pods-SCNVideoWriter_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
34442463E1977BE1DF90A35F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -331,36 +313,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A1B699F35D66F0339FC0E592 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SCNVideoWriter_Tests/Pods-SCNVideoWriter_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A8740CFFDF34B86691D49509 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SCNVideoWriter_Example/Pods-SCNVideoWriter_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
CF95C6A3368ED2E216860FD3 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -461,12 +413,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -514,12 +468,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -563,7 +519,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "905ee6bd-d0b8-4820-ab2d-03b079ef72eb";
PROVISIONING_PROFILE_SPECIFIER = "noppelabs-*";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -582,7 +538,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "905ee6bd-d0b8-4820-ab2d-03b079ef72eb";
PROVISIONING_PROFILE_SPECIFIER = "noppelabs-*";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -607,7 +563,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -628,7 +584,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion Example/SCNVideoWriter/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
1 change: 1 addition & 0 deletions SCNVideoWriter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ And support video and overlay of ARKit.
s.source = { :git => 'https://github.com/noppefoxwolf/SCNVideoWriter.git', :tag => s.version.to_s }

s.ios.deployment_target = '10.0'
s.swift_version = '4.2'

s.source_files = 'SCNVideoWriter/Classes/**/*'
end
6 changes: 3 additions & 3 deletions SCNVideoWriter/Classes/SCNVideoWriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class SCNVideoWriter {
initialTime = CFAbsoluteTimeGetCurrent()
displayLink = CADisplayLink(target: self, selector: #selector(updateDisplayLink))
displayLink?.preferredFramesPerSecond = options.fps
displayLink?.add(to: .main, forMode: .commonModes)
displayLink?.add(to: .main, forMode: .common)
}

@objc private func updateDisplayLink() {
Expand All @@ -93,7 +93,7 @@ public class SCNVideoWriter {

private func startInputPipeline() {
writer.startWriting()
writer.startSession(atSourceTime: kCMTimeZero)
writer.startSession(atSourceTime: CMTime.zero)
input.requestMediaDataWhenReady(on: frameQueue, using: {})
}

Expand All @@ -104,7 +104,7 @@ public class SCNVideoWriter {
guard let croppedImage = image.fill(at: videoSize) else { return }
guard let pixelBuffer = PixelBufferFactory.make(with: videoSize, from: croppedImage, usingBuffer: pool) else { return }
let value: Int64 = Int64(currentTime * CFTimeInterval(options.timeScale))
let presentationTime = CMTimeMake(value, options.timeScale)
let presentationTime = CMTimeMake(value: value, timescale: options.timeScale)
pixelBufferAdaptor.append(pixelBuffer, withPresentationTime: presentationTime)
updateFrameHandler?(croppedImage, presentationTime)
}
Expand Down