Skip to content

Commit

Permalink
Require macOS 10.13 or later
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 16, 2020
1 parent 42fea9b commit 46743b5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Aperture.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Aperture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/wulkano/Aperture.git', :tag => "v#{s.version}" }
s.source_files = 'Sources/**/*.swift'
s.swift_version = '5.3'
s.platform = :macos, '10.12'
s.platform = :macos, '10.13'
end
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackageDescription
let package = Package(
name: "Aperture",
platforms: [
.macOS(.v10_12)
.macOS(.v10_13)
],
products: [
.library(
Expand Down
11 changes: 5 additions & 6 deletions Sources/Aperture/Aperture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public final class Aperture: NSObject {
destination: URL,
input: AVCaptureInput,
output: AVCaptureMovieFileOutput,
audioDevice: AVCaptureDevice?,
videoCodec: String?
audioDevice: AVCaptureDevice? = nil,
videoCodec: AVVideoCodecType? = nil
) throws {
self.destination = destination
self.session = AVCaptureSession()
Expand Down Expand Up @@ -63,7 +63,7 @@ public final class Aperture: NSObject {
throw Error.couldNotAddOutput
}

// TODO: Default to HEVC when on 10.13 or newer and encoding is hardware supported. Without hardware encoding I got 3 FPS full screen recording.
// TODO: Default to HEVC when encoding is hardware supported. Without hardware encoding I got 3 FPS full screen recording.
// TODO: Find a way to detect hardware encoding support.
// Hardware encoding is supported on 6th gen Intel processor or newer.
if let videoCodec = videoCodec {
Expand All @@ -73,7 +73,6 @@ public final class Aperture: NSObject {
super.init()
}

// TODO: When targeting macOS 10.13, make the `videoCodec` option the type `AVVideoCodecType`.
/**
Start a capture session with the given screen ID.

Expand All @@ -96,7 +95,7 @@ public final class Aperture: NSObject {
highlightClicks: Bool = false,
screenId: CGDirectDisplayID = .main,
audioDevice: AVCaptureDevice? = .default(for: .audio),
videoCodec: String? = nil
videoCodec: AVVideoCodecType? = nil
) throws {
let input = try AVCaptureScreenInput(displayID: screenId).unwrapOrThrow(Error.invalidScreen)

Expand Down Expand Up @@ -138,7 +137,7 @@ public final class Aperture: NSObject {
destination: URL,
iosDevice: AVCaptureDevice,
audioDevice: AVCaptureDevice? = nil,
videoCodec: String? = nil
videoCodec: AVVideoCodecType? = nil
) throws {
let input = try AVCaptureDeviceInput(device: iosDevice)

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Requirements

- macOS 10.12+
- macOS 10.13+
- Xcode 12+
- Swift 5.3+

Expand Down

0 comments on commit 46743b5

Please sign in to comment.