forked from VideoFlint/Cabbage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a52e64
commit 6d31495
Showing
34 changed files
with
166 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// swift-tools-version:5.1 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Cabbage", | ||
products: [ | ||
// Products define the executables and libraries produced by a package, and make them visible to other packages. | ||
.library( | ||
name: "Cabbage", | ||
targets: ["Cabbage"]), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages which this package depends on. | ||
.target( | ||
name: "Cabbage", | ||
dependencies: ["AVFoundation", "CoreGraphics", "CoreMedia", "CoreImage", "Accelerate"]), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/AVAssetReaderImageResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/AVAssetReverseImageResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/AVAssetTrackResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Audio/AudioMixer.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Audio/AudioProcessingChain.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Audio/AudioProcessingTapHolder.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Model/AudioTransition.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/CGMathFunctions.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/CMTimeExtensition.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/CompositionGenerator.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Model/CompositionProvider.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/CoreImageExtension.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/ImageCompositionGroupProvider.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/ImageGeneratorExtension.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/ImageOverlayItem.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/ImageResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Configuration/KeyframeVideoConfiguration.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/Log.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/PHAssetImageResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/PHAssetLivePhotoResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/PHAssetTrackResource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Resource/Resource.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/TimeRangeExtension.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Model/Timeline.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Uitl/TimingFunctionFactory.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/Configuration/TrackConfiguration.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Track/TrackItem.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Video/VideoCompositionInstruction.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Video/VideoCompositor.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../Cabbage/Sources/Core/Model/VideoTransition.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/usr/bin/swift | ||
// | ||
// package-spm.swift | ||
// scripts | ||
// | ||
// Created by Krunoslav Zaher on 12/26/15. | ||
// Copyright © 2015 Krunoslav Zaher. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/** | ||
This script packages normal Rx* structure into `Sources` directory. | ||
|
||
* creates and updates links to normal project structure | ||
* builds unit tests `main.swift` | ||
|
||
Unfortunately, Swift support for Linux, libdispatch and package manager are still quite unstable, | ||
so certain class of unit tests is excluded for now. | ||
|
||
*/ | ||
|
||
// It is kind of ironic that we need to additionally package for package manager :/ | ||
|
||
let fileManager = FileManager.default | ||
|
||
let allowedExtensions = [ | ||
".swift", | ||
".h", | ||
".m", | ||
".c", | ||
] | ||
|
||
func isExtensionAllowed(_ path: String) -> Bool { | ||
return (allowedExtensions.map { path.hasSuffix($0) }).reduce(false) { $0 || $1 } | ||
} | ||
|
||
func checkExtension(_ path: String) throws { | ||
if !isExtensionAllowed(path) { | ||
throw NSError(domain: "Security", code: -1, userInfo: ["path" : path]) | ||
} | ||
} | ||
|
||
func packageRelativePath(_ paths: [String], targetDirName: String, excluded: [String] = []) throws { | ||
let targetPath = "Sources/\(targetDirName)" | ||
|
||
print("Checking " + targetPath) | ||
|
||
for file in try fileManager.contentsOfDirectory(atPath: targetPath).sorted { $0 < $1 } { | ||
if file != "include" && file != ".DS_Store" { | ||
print("Checking extension \(file)") | ||
try checkExtension(file) | ||
|
||
print("Cleaning \(file)") | ||
try fileManager.removeItem(atPath: "\(targetPath)/\(file)") | ||
} | ||
} | ||
|
||
for sourcePath in paths { | ||
var isDirectory: ObjCBool = false | ||
print("loop sourcePath: \(sourcePath)") | ||
fileManager.fileExists(atPath: sourcePath, isDirectory: &isDirectory) | ||
|
||
let files: [String] = isDirectory.boolValue ? fileManager.subpaths(atPath: sourcePath)! | ||
: [sourcePath] | ||
|
||
for file in files { | ||
if !isExtensionAllowed(file) { | ||
print("Skipping \(file)") | ||
continue | ||
} | ||
|
||
if excluded.contains(file) { | ||
print("Skipping \(file)") | ||
continue | ||
} | ||
|
||
let fileRelativePath = isDirectory.boolValue ? "\(sourcePath)/\(file)" : file | ||
|
||
let destinationURL = NSURL(string: "../../\(fileRelativePath)")! | ||
|
||
let fileName = (file as NSString).lastPathComponent | ||
let atURL = NSURL(string: "file:///\(fileManager.currentDirectoryPath)/\(targetPath)/\(fileName)")! | ||
|
||
if fileName.hasSuffix(".h") { | ||
let sourcePath = NSURL(string: "file:///" + fileManager.currentDirectoryPath + "/" + sourcePath + "/" + file)! | ||
//throw NSError(domain: sourcePath.description, code: -1, userInfo: nil) | ||
try fileManager.copyItem(at: sourcePath as URL, to: atURL as URL) | ||
} | ||
else { | ||
print("Linking \(fileName) [\(atURL)] -> \(destinationURL)") | ||
try fileManager.createSymbolicLink(at: atURL as URL, withDestinationURL: destinationURL as URL) | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
try packageRelativePath([ | ||
"Cabbage/Sources" | ||
], targetDirName: "Cabbage") |