Skip to content

Commit

Permalink
Added iOS module support for Xcode 6, so this can be used in a Swift …
Browse files Browse the repository at this point in the history
…application.
  • Loading branch information
BradLarson committed Jun 8, 2014
1 parent 9c85264 commit 056447b
Show file tree
Hide file tree
Showing 9 changed files with 1,252 additions and 203 deletions.
382 changes: 191 additions & 191 deletions README.md

Large diffs are not rendered by default.

790 changes: 784 additions & 6 deletions framework/GPUImage.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BCE209E41943F20C002FEED8"
BuildableName = "GPUImage.framework"
BlueprintName = "GPUImageFramework"
ReferencedContainer = "container:GPUImage.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugXPCServices = "NO"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
customArchiveName = "GPUImage"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
3 changes: 0 additions & 3 deletions framework/Source/Mac/GPUImage.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#import <OpenGL/OpenGL.h>
#import <OpenGL/gl.h>
#import <Cocoa/Cocoa.h>
#import <GPUImage/GLProgram.h>

// Base classes
#import <GPUImage/GLProgram.h>
Expand Down
165 changes: 165 additions & 0 deletions framework/Source/iOS/Framework/GPUImageFramework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
#import <UIKit/UIKit.h>

//! Project version number for GPUImageFramework.
FOUNDATION_EXPORT double GPUImageFrameworkVersionNumber;

//! Project version string for GPUImageFramework.
FOUNDATION_EXPORT const unsigned char GPUImageFrameworkVersionString[];

#import <GPUImage/GLProgram.h>

// Base classes
#import <GPUImage/GPUImageContext.h>
#import <GPUImage/GPUImageOutput.h>
#import <GPUImage/GPUImageView.h>
#import <GPUImage/GPUImageVideoCamera.h>
#import <GPUImage/GPUImageStillCamera.h>
#import <GPUImage/GPUImageMovie.h>
#import <GPUImage/GPUImagePicture.h>
#import <GPUImage/GPUImageRawDataInput.h>
#import <GPUImage/GPUImageRawDataOutput.h>
#import <GPUImage/GPUImageMovieWriter.h>
#import <GPUImage/GPUImageFilterPipeline.h>
#import <GPUImage/GPUImageTextureOutput.h>
#import <GPUImage/GPUImageFilterGroup.h>
#import <GPUImage/GPUImageTextureInput.h>
#import <GPUImage/GPUImageUIElement.h>
#import <GPUImage/GPUImageBuffer.h>
#import <GPUImage/GPUImageFramebuffer.h>
#import <GPUImage/GPUImageFramebufferCache.h>

// Filters
#import <GPUImage/GPUImageFilter.h>
#import <GPUImage/GPUImageTwoInputFilter.h>
#import <GPUImage/GPUImagePixellateFilter.h>
#import <GPUImage/GPUImagePixellatePositionFilter.h>
#import <GPUImage/GPUImageSepiaFilter.h>
#import <GPUImage/GPUImageColorInvertFilter.h>
#import <GPUImage/GPUImageSaturationFilter.h>
#import <GPUImage/GPUImageContrastFilter.h>
#import <GPUImage/GPUImageExposureFilter.h>
#import <GPUImage/GPUImageBrightnessFilter.h>
#import <GPUImage/GPUImageLevelsFilter.h>
#import <GPUImage/GPUImageSharpenFilter.h>
#import <GPUImage/GPUImageGammaFilter.h>
#import <GPUImage/GPUImageSobelEdgeDetectionFilter.h>
#import <GPUImage/GPUImageSketchFilter.h>
#import <GPUImage/GPUImageToonFilter.h>
#import <GPUImage/GPUImageSmoothToonFilter.h>
#import <GPUImage/GPUImageMultiplyBlendFilter.h>
#import <GPUImage/GPUImageDissolveBlendFilter.h>
#import <GPUImage/GPUImageKuwaharaFilter.h>
#import <GPUImage/GPUImageKuwaharaRadius3Filter.h>
#import <GPUImage/GPUImageVignetteFilter.h>
#import <GPUImage/GPUImageGaussianBlurFilter.h>
#import <GPUImage/GPUImageGaussianBlurPositionFilter.h>
#import <GPUImage/GPUImageGaussianSelectiveBlurFilter.h>
#import <GPUImage/GPUImageOverlayBlendFilter.h>
#import <GPUImage/GPUImageDarkenBlendFilter.h>
#import <GPUImage/GPUImageLightenBlendFilter.h>
#import <GPUImage/GPUImageSwirlFilter.h>
#import <GPUImage/GPUImageSourceOverBlendFilter.h>
#import <GPUImage/GPUImageColorBurnBlendFilter.h>
#import <GPUImage/GPUImageColorDodgeBlendFilter.h>
#import <GPUImage/GPUImageScreenBlendFilter.h>
#import <GPUImage/GPUImageExclusionBlendFilter.h>
#import <GPUImage/GPUImageDifferenceBlendFilter.h>
#import <GPUImage/GPUImageSubtractBlendFilter.h>
#import <GPUImage/GPUImageHardLightBlendFilter.h>
#import <GPUImage/GPUImageSoftLightBlendFilter.h>
#import <GPUImage/GPUImageColorBlendFilter.h>
#import <GPUImage/GPUImageHueBlendFilter.h>
#import <GPUImage/GPUImageSaturationBlendFilter.h>
#import <GPUImage/GPUImageLuminosityBlendFilter.h>
#import <GPUImage/GPUImageCropFilter.h>
#import <GPUImage/GPUImageGrayscaleFilter.h>
#import <GPUImage/GPUImageTransformFilter.h>
#import <GPUImage/GPUImageChromaKeyBlendFilter.h>
#import <GPUImage/GPUImageHazeFilter.h>
#import <GPUImage/GPUImageLuminanceThresholdFilter.h>
#import <GPUImage/GPUImagePosterizeFilter.h>
#import <GPUImage/GPUImageBoxBlurFilter.h>
#import <GPUImage/GPUImageAdaptiveThresholdFilter.h>
#import <GPUImage/GPUImageUnsharpMaskFilter.h>
#import <GPUImage/GPUImageBulgeDistortionFilter.h>
#import <GPUImage/GPUImagePinchDistortionFilter.h>
#import <GPUImage/GPUImageCrosshatchFilter.h>
#import <GPUImage/GPUImageCGAColorspaceFilter.h>
#import <GPUImage/GPUImagePolarPixellateFilter.h>
#import <GPUImage/GPUImageStretchDistortionFilter.h>
#import <GPUImage/GPUImagePerlinNoiseFilter.h>
#import <GPUImage/GPUImageJFAVoronoiFilter.h>
#import <GPUImage/GPUImageVoronoiConsumerFilter.h>
#import <GPUImage/GPUImageMosaicFilter.h>
#import <GPUImage/GPUImageTiltShiftFilter.h>
#import <GPUImage/GPUImage3x3ConvolutionFilter.h>
#import <GPUImage/GPUImageEmbossFilter.h>
#import <GPUImage/GPUImageCannyEdgeDetectionFilter.h>
#import <GPUImage/GPUImageThresholdEdgeDetectionFilter.h>
#import <GPUImage/GPUImageMaskFilter.h>
#import <GPUImage/GPUImageHistogramFilter.h>
#import <GPUImage/GPUImageHistogramGenerator.h>
#import <GPUImage/GPUImagePrewittEdgeDetectionFilter.h>
#import <GPUImage/GPUImageXYDerivativeFilter.h>
#import <GPUImage/GPUImageHarrisCornerDetectionFilter.h>
#import <GPUImage/GPUImageAlphaBlendFilter.h>
#import <GPUImage/GPUImageNormalBlendFilter.h>
#import <GPUImage/GPUImageNonMaximumSuppressionFilter.h>
#import <GPUImage/GPUImageRGBFilter.h>
#import <GPUImage/GPUImageMedianFilter.h>
#import <GPUImage/GPUImageBilateralFilter.h>
#import <GPUImage/GPUImageCrosshairGenerator.h>
#import <GPUImage/GPUImageToneCurveFilter.h>
#import <GPUImage/GPUImageNobleCornerDetectionFilter.h>
#import <GPUImage/GPUImageShiTomasiFeatureDetectionFilter.h>
#import <GPUImage/GPUImageErosionFilter.h>
#import <GPUImage/GPUImageRGBErosionFilter.h>
#import <GPUImage/GPUImageDilationFilter.h>
#import <GPUImage/GPUImageRGBDilationFilter.h>
#import <GPUImage/GPUImageOpeningFilter.h>
#import <GPUImage/GPUImageRGBOpeningFilter.h>
#import <GPUImage/GPUImageClosingFilter.h>
#import <GPUImage/GPUImageRGBClosingFilter.h>
#import <GPUImage/GPUImageColorPackingFilter.h>
#import <GPUImage/GPUImageSphereRefractionFilter.h>
#import <GPUImage/GPUImageMonochromeFilter.h>
#import <GPUImage/GPUImageOpacityFilter.h>
#import <GPUImage/GPUImageHighlightShadowFilter.h>
#import <GPUImage/GPUImageFalseColorFilter.h>
#import <GPUImage/GPUImageHSBFilter.h>
#import <GPUImage/GPUImageHueFilter.h>
#import <GPUImage/GPUImageGlassSphereFilter.h>
#import <GPUImage/GPUImageLookupFilter.h>
#import <GPUImage/GPUImageAmatorkaFilter.h>
#import <GPUImage/GPUImageMissEtikateFilter.h>
#import <GPUImage/GPUImageSoftEleganceFilter.h>
#import <GPUImage/GPUImageAddBlendFilter.h>
#import <GPUImage/GPUImageDivideBlendFilter.h>
#import <GPUImage/GPUImagePolkaDotFilter.h>
#import <GPUImage/GPUImageLocalBinaryPatternFilter.h>
#import <GPUImage/GPUImageLanczosResamplingFilter.h>
#import <GPUImage/GPUImageAverageColor.h>
#import <GPUImage/GPUImageSolidColorGenerator.h>
#import <GPUImage/GPUImageLuminosity.h>
#import <GPUImage/GPUImageAverageLuminanceThresholdFilter.h>
#import <GPUImage/GPUImageWhiteBalanceFilter.h>
#import <GPUImage/GPUImageChromaKeyFilter.h>
#import <GPUImage/GPUImageLowPassFilter.h>
#import <GPUImage/GPUImageHighPassFilter.h>
#import <GPUImage/GPUImageMotionDetector.h>
#import <GPUImage/GPUImageHalftoneFilter.h>
#import <GPUImage/GPUImageThresholdedNonMaximumSuppressionFilter.h>
#import <GPUImage/GPUImageHoughTransformLineDetector.h>
#import <GPUImage/GPUImageParallelCoordinateLineTransformFilter.h>
#import <GPUImage/GPUImageThresholdSketchFilter.h>
#import <GPUImage/GPUImageLineGenerator.h>
#import <GPUImage/GPUImageLinearBurnBlendFilter.h>
#import <GPUImage/GPUImageGaussianBlurPositionFilter.h>
#import <GPUImage/GPUImagePixellatePositionFilter.h>
#import <GPUImage/GPUImageTwoInputCrossTextureSamplingFilter.h>
#import <GPUImage/GPUImagePoissonBlendFilter.h>
#import <GPUImage/GPUImageMotionBlurFilter.h>
#import <GPUImage/GPUImageZoomBlurFilter.h>
#import <GPUImage/GPUImageLaplacianFilter.h>
#import <GPUImage/GPUImageiOSBlurFilter.h>
#import <GPUImage/GPUImageLuminanceRangeFilter.h>
26 changes: 26 additions & 0 deletions framework/Source/iOS/Framework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
6 changes: 6 additions & 0 deletions framework/Source/iOS/Framework/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module GPUImage {
umbrella header "GPUImageFramework.h"

export *
module * { export * }
}
15 changes: 14 additions & 1 deletion framework/Source/iOS/GPUImageMovieWriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,20 @@ - (void)setHasAudioTrack:(BOOL)newValue audioSettings:(NSDictionary *)audioOutpu
}
else if (audioOutputSettings == nil)
{
double preferredHardwareSampleRate = [[AVAudioSession sharedInstance] currentHardwareSampleRate];
AVAudioSession *sharedAudioSession = [AVAudioSession sharedInstance];
double preferredHardwareSampleRate;

if ([sharedAudioSession respondsToSelector:@selector(sampleRate)])
{
preferredHardwareSampleRate = [sharedAudioSession sampleRate];
}
else
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
preferredHardwareSampleRate = [[AVAudioSession sharedInstance] currentHardwareSampleRate];
#pragma clang diagnostic pop
}

AudioChannelLayout acl;
bzero( &acl, sizeof(acl));
Expand Down
7 changes: 5 additions & 2 deletions framework/Source/iOS/GPUImagePicture.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoot
}

GLubyte *imageData = NULL;
CFDataRef dataFromImageDataProvider;
CFDataRef dataFromImageDataProvider = NULL;
GLenum format = GL_BGRA;

if (!shouldRedrawUsingCoreGraphics) {
Expand Down Expand Up @@ -206,7 +206,10 @@ - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoot
}
else
{
CFRelease(dataFromImageDataProvider);
if (dataFromImageDataProvider)
{
CFRelease(dataFromImageDataProvider);
}
}

return self;
Expand Down

0 comments on commit 056447b

Please sign in to comment.