From f20e4763a29ae98896eb064ab7d52b2f6ca90f23 Mon Sep 17 00:00:00 2001 From: Joel Teply Date: Wed, 4 Feb 2015 16:42:54 -0600 Subject: [PATCH 01/32] Allow for luminance upload its hard coded to types and since pixelFormat directly maps to types including I believe my proposed addition of luminance, it needs to allow for all types. I am using luminance successfully with this approach. I am basically passing in a binary mask and RGB is overkill These types must all have support: GPUPixelFormatBGRA = GL_BGRA, GPUPixelFormatRGBA = GL_RGBA, GPUPixelFormatRGB = GL_RGB, GPUPixelFormatLuminance = GL_LUMINANCE --- framework/Source/GPUImageRawDataInput.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/Source/GPUImageRawDataInput.m b/framework/Source/GPUImageRawDataInput.m index 4b6bfa74a..cfa3b1287 100644 --- a/framework/Source/GPUImageRawDataInput.m +++ b/framework/Source/GPUImageRawDataInput.m @@ -72,7 +72,7 @@ - (void)uploadBytes:(GLubyte *)bytesToUpload; outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:uploadedImageSize textureOptions:self.outputTextureOptions onlyTexture:YES]; glBindTexture(GL_TEXTURE_2D, [outputFramebuffer texture]); - glTexImage2D(GL_TEXTURE_2D, 0, _pixelFormat==GPUPixelFormatRGB ? GL_RGB : GL_RGBA, (int)uploadedImageSize.width, (int)uploadedImageSize.height, 0, (GLint)_pixelFormat, (GLenum)_pixelType, bytesToUpload); + glTexImage2D(GL_TEXTURE_2D, 0, _pixelFormat, (int)uploadedImageSize.width, (int)uploadedImageSize.height, 0, (GLint)_pixelFormat, (GLenum)_pixelType, bytesToUpload); } - (void)updateDataFromBytes:(GLubyte *)bytesToUpload size:(CGSize)imageSize; From 7cf86947d1705d6ac4ef04aefed0170ab9a6272f Mon Sep 17 00:00:00 2001 From: WangYang Date: Mon, 21 Sep 2015 16:57:53 +0800 Subject: [PATCH 02/32] demo bug fix --- .../project.pbxproj | 13 ++ .../SimpleVideoFilterViewController.m | 21 ++ .../SimpleVideoFilterViewController.xib | 204 +++--------------- framework/GPUImage.xcodeproj/project.pbxproj | 4 + 4 files changed, 68 insertions(+), 174 deletions(-) diff --git a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj index 736b03314..57782a279 100755 --- a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj +++ b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ BCB5DDFF14E87783000AF3C2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */; }; BCB5DE0114E87789000AF3C2 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */; }; BCF867511725AB5300912E34 /* libGPUImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF8674C1725AB2100912E34 /* libGPUImage.a */; }; + D30ACF271BAFE43F00E9759C /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D30ACF261BAFE43F00E9759C /* AssetsLibrary.framework */; }; E5066F611855AC78008C7682 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5066F601855AC78008C7682 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ @@ -78,6 +79,7 @@ BCB5DDFB14E876ED000AF3C2 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + D30ACF261BAFE43F00E9759C /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; E5066F601855AC78008C7682 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -86,6 +88,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D30ACF271BAFE43F00E9759C /* AssetsLibrary.framework in Frameworks */, BCF867511725AB5300912E34 /* libGPUImage.a in Frameworks */, BCB5DE0114E87789000AF3C2 /* OpenGLES.framework in Frameworks */, BCB5DDFF14E87783000AF3C2 /* QuartzCore.framework in Frameworks */, @@ -122,6 +125,7 @@ BCB5DDCD14E86899000AF3C2 /* Frameworks */ = { isa = PBXGroup; children = ( + D30ACF261BAFE43F00E9759C /* AssetsLibrary.framework */, BCB5DDEA14E8756A000AF3C2 /* GPUImage.xcodeproj */, BCB5DE0014E87789000AF3C2 /* OpenGLES.framework */, BCB5DDFE14E87783000AF3C2 /* QuartzCore.framework */, @@ -202,6 +206,11 @@ attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Cell Phone"; + TargetAttributes = { + BCB5DDC914E86899000AF3C2 = { + DevelopmentTeam = V2DTUY5PQ8; + }; + }; }; buildConfigurationList = BCB5DDC414E86899000AF3C2 /* Build configuration list for PBXProject "SimpleVideoFilter" */; compatibilityVersion = "Xcode 3.2"; @@ -371,9 +380,11 @@ BCB5DDE314E86899000AF3C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFilter/SimpleVideoFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFilter/SimpleVideoFilter-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -382,9 +393,11 @@ BCB5DDE414E86899000AF3C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFilter/SimpleVideoFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFilter/SimpleVideoFilter-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.m b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.m index 7f30d620f..bbe0aaba4 100755 --- a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.m +++ b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.m @@ -1,4 +1,5 @@ #import "SimpleVideoFilterViewController.h" +#import @implementation SimpleVideoFilterViewController @@ -88,6 +89,26 @@ - (void)viewDidLoad [movieWriter finishRecording]; NSLog(@"Movie completed"); + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:movieURL]) + { + [library writeVideoAtPathToSavedPhotosAlbum:movieURL completionBlock:^(NSURL *assetURL, NSError *error) + { + dispatch_async(dispatch_get_main_queue(), ^{ + + if (error) { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Video Saving Failed" + delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + } else { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Video Saved" message:@"Saved To Photo Album" + delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + } + }); + }]; + } + // [videoCamera.inputCamera lockForConfiguration:nil]; // [videoCamera.inputCamera setTorchMode:AVCaptureTorchModeOff]; // [videoCamera.inputCamera unlockForConfiguration]; diff --git a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.xib b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.xib index 1213d5a75..5b6df9cd5 100755 --- a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.xib +++ b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter/SimpleVideoFilterViewController.xib @@ -1,174 +1,30 @@ - - - - 1280 - 11D50 - 2182 - 1138.32 - 568.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1179 - - - IBProxyObject - IBUIView - IBUISlider - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 266 - {{18, 418}, {284, 23}} - - - - _NS:623 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - {{0, 20}, {320, 460}} - - - - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - updateSliderValue: - - - 13 - - 6 - - - - - - 0 - - - - - - 1 - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - - - SimpleVideoFilterViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - GPUImageView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 6 - - - - - GPUImageView - UIView - - IBProjectSource - ./Classes/GPUImageView.h - - - - SimpleVideoFilterViewController - UIViewController - - updateSliderValue: - id - - - updateSliderValue: - - updateSliderValue: - id - - - - IBProjectSource - ./Classes/SimpleVideoFilterViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 1179 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/GPUImage.xcodeproj/project.pbxproj b/framework/GPUImage.xcodeproj/project.pbxproj index 08b6610b2..f8beab6dc 100644 --- a/framework/GPUImage.xcodeproj/project.pbxproj +++ b/framework/GPUImage.xcodeproj/project.pbxproj @@ -688,6 +688,7 @@ C04C8D1815F8059F00449601 /* GPUImageColorBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = C04C8D1615F8059F00449601 /* GPUImageColorBlendFilter.m */; }; C2EDA90615BB136D007CBA0F /* GPUImageHueFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EDA90415BB136D007CBA0F /* GPUImageHueFilter.h */; }; C2EDA90715BB136D007CBA0F /* GPUImageHueFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = C2EDA90515BB136D007CBA0F /* GPUImageHueFilter.m */; }; + D30ACF231BAFE3DD00E9759C /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D30ACF221BAFE3DD00E9759C /* AssetsLibrary.framework */; }; D443237A17C81C0C00204484 /* GPUImageMovieComposition.h in Headers */ = {isa = PBXBuildFile; fileRef = D443237817C81C0C00204484 /* GPUImageMovieComposition.h */; }; D443237B17C81C0C00204484 /* GPUImageMovieComposition.m in Sources */ = {isa = PBXBuildFile; fileRef = D443237917C81C0C00204484 /* GPUImageMovieComposition.m */; }; /* End PBXBuildFile section */ @@ -1033,6 +1034,7 @@ C04C8D1615F8059F00449601 /* GPUImageColorBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorBlendFilter.m; path = Source/GPUImageColorBlendFilter.m; sourceTree = SOURCE_ROOT; }; C2EDA90415BB136D007CBA0F /* GPUImageHueFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHueFilter.h; path = Source/GPUImageHueFilter.h; sourceTree = SOURCE_ROOT; }; C2EDA90515BB136D007CBA0F /* GPUImageHueFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHueFilter.m; path = Source/GPUImageHueFilter.m; sourceTree = SOURCE_ROOT; }; + D30ACF221BAFE3DD00E9759C /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; D443237817C81C0C00204484 /* GPUImageMovieComposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMovieComposition.h; path = Source/GPUImageMovieComposition.h; sourceTree = SOURCE_ROOT; }; D443237917C81C0C00204484 /* GPUImageMovieComposition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovieComposition.m; path = Source/GPUImageMovieComposition.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -1056,6 +1058,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D30ACF231BAFE3DD00E9759C /* AssetsLibrary.framework in Frameworks */, BCB5E77914E20BAF00701302 /* CoreMedia.framework in Frameworks */, BCB5E77714E20BA800701302 /* CoreVideo.framework in Frameworks */, BCB5E77514E20B9700701302 /* OpenGLES.framework in Frameworks */, @@ -1470,6 +1473,7 @@ BCF1A33614DDB1EC00852800 /* Frameworks */ = { isa = PBXGroup; children = ( + D30ACF221BAFE3DD00E9759C /* AssetsLibrary.framework */, BCB5E77814E20BAF00701302 /* CoreMedia.framework */, BCB5E77614E20BA800701302 /* CoreVideo.framework */, BCB5E77414E20B9700701302 /* OpenGLES.framework */, From 72750f03a49efbb528697976e86f66573bb9832e Mon Sep 17 00:00:00 2001 From: Michael Feldstein Date: Tue, 22 Sep 2015 15:53:50 -0500 Subject: [PATCH 03/32] Use NS_ENUM instead of typedef enum to eliminate 'ambiguous use' errors --- framework/Source/iOS/GPUImageContext.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/framework/Source/iOS/GPUImageContext.h b/framework/Source/iOS/GPUImageContext.h index 7e4fa0352..71142b886 100755 --- a/framework/Source/iOS/GPUImageContext.h +++ b/framework/Source/iOS/GPUImageContext.h @@ -4,7 +4,16 @@ #define GPUImageRotationSwapsWidthAndHeight(rotation) ((rotation) == kGPUImageRotateLeft || (rotation) == kGPUImageRotateRight || (rotation) == kGPUImageRotateRightFlipVertical || (rotation) == kGPUImageRotateRightFlipHorizontal) -typedef enum { kGPUImageNoRotation, kGPUImageRotateLeft, kGPUImageRotateRight, kGPUImageFlipVertical, kGPUImageFlipHorizonal, kGPUImageRotateRightFlipVertical, kGPUImageRotateRightFlipHorizontal, kGPUImageRotate180 } GPUImageRotationMode; +typedef NS_ENUM(NSUInteger, GPUImageRotationMode) { + kGPUImageNoRotation, + kGPUImageRotateLeft, + kGPUImageRotateRight, + kGPUImageFlipVertical, + kGPUImageFlipHorizonal, + kGPUImageRotateRightFlipVertical, + kGPUImageRotateRightFlipHorizontal, + kGPUImageRotate180 +}; @interface GPUImageContext : NSObject From ffbc0b4a8ff278d4eefd47f4ae0016eaf75641b1 Mon Sep 17 00:00:00 2001 From: Michael Feldstein Date: Tue, 6 Oct 2015 13:54:01 -0700 Subject: [PATCH 04/32] Update GPUImageFillModeType enum to use NS_ENUM --- framework/Source/iOS/GPUImageView.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/Source/iOS/GPUImageView.h b/framework/Source/iOS/GPUImageView.h index 03e12ee5e..b42651d3c 100755 --- a/framework/Source/iOS/GPUImageView.h +++ b/framework/Source/iOS/GPUImageView.h @@ -1,11 +1,13 @@ #import #import "GPUImageContext.h" -typedef enum { +typedef NS_ENUM(NSUInteger, GPUImageFillModeType) { kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio kGPUImageFillModePreserveAspectRatio, // Maintains the aspect ratio of the source image, adding bars of the specified background color kGPUImageFillModePreserveAspectRatioAndFill // Maintains the aspect ratio of the source image, zooming in on its center to fill the view -} GPUImageFillModeType; +}; + + /** UIView subclass to use as an endpoint for displaying GPUImage outputs From ebd035bd0c71519d9f9a529f37e8040d857c0099 Mon Sep 17 00:00:00 2001 From: Michael Feldstein Date: Tue, 6 Oct 2015 13:56:18 -0700 Subject: [PATCH 05/32] Use ios sdk 9.0, 7.0 is really old --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 999f66b65..399c72e2e 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -e -IOSSDK_VER="7.0" +IOSSDK_VER="9.0" # xcodebuild -showsdks From 5bae99bec2be6884610b8de8c4abe8fc46c0b985 Mon Sep 17 00:00:00 2001 From: Brandon Shelley Date: Wed, 29 Apr 2015 08:41:06 -0700 Subject: [PATCH 06/32] Added GPUImageWhiteBalanceFilter to Readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a487f368d..98323e40a 100755 --- a/README.md +++ b/README.md @@ -294,6 +294,10 @@ There are currently 125 built-in filters, divided into the following categories: - **GPUImageHueFilter**: Adjusts the hue of an image - *hue*: The hue angle, in degrees. 90 degrees by default +- **GPUImageWhiteBalanceFilter**: Adjusts the white balance of an image. + - *temperature*: The temperature to adjust the image by, in ºK. A value of 4000 is very cool and 7000 very warm. The default value is 5000. Note that the scale between 4000 and 5000 is nearly as visually significant as that between 5000 and 7000. + - *tint*: The tint to adjust the image by. A value of -200 is *very* green and 200 is *very* pink. The default value is 0. + - **GPUImageToneCurveFilter**: Adjusts the colors of an image based on spline curves for each color channel. - *redControlPoints*: - *greenControlPoints*: From a51daf389a576a482ea8ed16c50242bf0fa8a8fd Mon Sep 17 00:00:00 2001 From: Ryan Romanchuk Date: Fri, 22 May 2015 12:43:28 -0700 Subject: [PATCH 07/32] Fix leak from capturing self in block and adding observer --- framework/Source/GPUImageFramebufferCache.m | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/framework/Source/GPUImageFramebufferCache.m b/framework/Source/GPUImageFramebufferCache.m index 21925ad90..1d50d8d07 100644 --- a/framework/Source/GPUImageFramebufferCache.m +++ b/framework/Source/GPUImageFramebufferCache.m @@ -36,10 +36,13 @@ - (id)init; } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + __unsafe_unretained __typeof__ (self) weakSelf = self; memoryWarningObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - - [self purgeAllUnassignedFramebuffers]; - }]; + __typeof__ (self) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf purgeAllUnassignedFramebuffers]; + } + }]; #else #endif @@ -52,6 +55,14 @@ - (id)init; return self; } +- (void)dealloc; +{ +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + [[NSNotificationCenter defaultCenter] removeObserver:self]; +#else +#endif +} + #pragma mark - #pragma mark Framebuffer management From 42f3d5c0bdaff80dfbe62ae78a40e00f72db8841 Mon Sep 17 00:00:00 2001 From: Igor Shmakov Date: Mon, 13 Jul 2015 15:32:16 +0300 Subject: [PATCH 08/32] There is an issue in GPUImageMovie - when instance adds itself as AVPlayerItemVideoOutput delegate: [playerItemOutput setDelegate:self queue:videoProcessingQueue], playerItemOutput doesn't release its delegate when GPUImageMovie instance is deallocating. Later, this results in a method call from the deallocated object (outputSequenceWasFlushed:) and you get the crash. This was found with help of NSZombie detector and I fixed it by adding this in GPUImageMovie dealloc method: [playerItemOutput setDelegate:nil queue:nil]; --- framework/Source/GPUImageMovie.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/Source/GPUImageMovie.m b/framework/Source/GPUImageMovie.m index d096b03ee..9e9e98ea2 100755 --- a/framework/Source/GPUImageMovie.m +++ b/framework/Source/GPUImageMovie.m @@ -134,6 +134,8 @@ - (void)yuvConversionSetup; - (void)dealloc { + [playerItemOutput setDelegate:nil queue:nil]; + // Moved into endProcessing //if (self.playerItem && (displayLink != nil)) //{ From cbcb1181d5caf97be56270bd25d46f11f8167ce9 Mon Sep 17 00:00:00 2001 From: "huang.gang" Date: Fri, 24 Jul 2015 18:27:07 +0800 Subject: [PATCH 09/32] fix crash when use Voronoi filter in FilterShowCase example --- .../FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m b/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m index 5f5d5b648..d9ed42146 100755 --- a/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m +++ b/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m @@ -870,6 +870,7 @@ - (void)setupFilter; { self.title = @"Voronoi"; self.filterSettingsSlider.hidden = YES; + needsSecondImage = YES; GPUImageJFAVoronoiFilter *jfa = [[GPUImageJFAVoronoiFilter alloc] init]; [jfa setSizeInPixels:CGSizeMake(1024.0, 1024.0)]; From 8cb137fc1e62412a897d3c669246d06a4bed2a96 Mon Sep 17 00:00:00 2001 From: Graham McDermott Date: Wed, 19 Aug 2015 23:26:57 -0700 Subject: [PATCH 10/32] Added ability to override default YUV to RGB conversion matrices --- framework/Source/GPUImageVideoCamera.h | 11 ++++++-- framework/Source/GPUImageVideoCamera.m | 38 ++++++++++++++++++++------ 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/framework/Source/GPUImageVideoCamera.h b/framework/Source/GPUImageVideoCamera.h index 22ccb942b..9c46902a3 100755 --- a/framework/Source/GPUImageVideoCamera.h +++ b/framework/Source/GPUImageVideoCamera.h @@ -4,13 +4,18 @@ #import "GPUImageContext.h" #import "GPUImageOutput.h" -extern const GLfloat kColorConversion601[]; -extern const GLfloat kColorConversion601FullRange[]; -extern const GLfloat kColorConversion709[]; +extern GLfloat *kColorConversion601; +extern GLfloat *kColorConversion601FullRange; +extern GLfloat *kColorConversion709; extern NSString *const kGPUImageYUVVideoRangeConversionForRGFragmentShaderString; extern NSString *const kGPUImageYUVFullRangeConversionForLAFragmentShaderString; extern NSString *const kGPUImageYUVVideoRangeConversionForLAFragmentShaderString; +//Optionally override the YUV to RGB matrices +void setColorConversion601( GLfloat conversionMatrix[9] ); +void setColorConversion601FullRange( GLfloat conversionMatrix[9] ); +void setColorConversion709( GLfloat conversionMatrix[9] ); + //Delegate Protocal for Face Detection. @protocol GPUImageVideoCameraDelegate diff --git a/framework/Source/GPUImageVideoCamera.m b/framework/Source/GPUImageVideoCamera.m index b84f88aad..c0ce6a9d6 100644 --- a/framework/Source/GPUImageVideoCamera.m +++ b/framework/Source/GPUImageVideoCamera.m @@ -5,25 +5,47 @@ // Color Conversion Constants (YUV to RGB) including adjustment from 16-235/16-240 (video range) // BT.601, which is the standard for SDTV. -const GLfloat kColorConversion601[] = { +GLfloat kColorConversion601Default[] = { 1.164, 1.164, 1.164, 0.0, -0.392, 2.017, 1.596, -0.813, 0.0, }; +// BT.601 full range (ref: http://www.equasys.de/colorconversion.html) +GLfloat kColorConversion601FullRangeDefault[] = { + 1.0, 1.0, 1.0, + 0.0, -0.343, 1.765, + 1.4, -0.711, 0.0, +}; + // BT.709, which is the standard for HDTV. -const GLfloat kColorConversion709[] = { +GLfloat kColorConversion709Default[] = { 1.164, 1.164, 1.164, 0.0, -0.213, 2.112, 1.793, -0.533, 0.0, }; -// BT.601 full range (ref: http://www.equasys.de/colorconversion.html) -const GLfloat kColorConversion601FullRange[] = { - 1.0, 1.0, 1.0, - 0.0, -0.343, 1.765, - 1.4, -0.711, 0.0, -}; + +GLfloat *kColorConversion601 = kColorConversion601Default; +GLfloat *kColorConversion601FullRange = kColorConversion601FullRangeDefault; +GLfloat *kColorConversion709 = kColorConversion709Default; + +void setColorConversion601( GLfloat conversionMatrix[9] ) +{ + kColorConversion601 = conversionMatrix; +} + +void setColorConversion601FullRange( GLfloat conversionMatrix[9] ) +{ + kColorConversion601FullRange = conversionMatrix; +} + +void setColorConversion709( GLfloat conversionMatrix[9] ) +{ + kColorConversion709 = conversionMatrix; +} + + NSString *const kGPUImageYUVVideoRangeConversionForRGFragmentShaderString = SHADER_STRING ( From 9d51d2e6563a7d1e25885e9d2801ab1509d77134 Mon Sep 17 00:00:00 2001 From: Horace Ho Date: Fri, 18 Sep 2015 12:43:48 +0800 Subject: [PATCH 11/32] Fix for iOS 9 and Xcode 7 --- .../iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.m b/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.m index f154970e4..cc57485a3 100755 --- a/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.m +++ b/examples/iOS/FilterShowcase/FilterShowcase/ShowcaseAppDelegate.m @@ -12,12 +12,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window.backgroundColor = [UIColor whiteColor]; filterNavigationController = [[UINavigationController alloc] init]; - [self.window addSubview:filterNavigationController.view]; - filterListController = [[ShowcaseFilterListController alloc] initWithNibName:nil bundle:nil]; - [filterNavigationController pushViewController:filterListController animated:NO]; + [self.window setRootViewController:filterNavigationController]; [self.window makeKeyAndVisible]; return YES; From 5e9ac77f0d90f8655b6cfcf5fcfc640e5938d160 Mon Sep 17 00:00:00 2001 From: WangYang Date: Mon, 12 Oct 2015 19:10:55 +0800 Subject: [PATCH 12/32] crash fix --- .../SimpleVideoFileFilter.xcodeproj/project.pbxproj | 2 ++ .../SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.m | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/project.pbxproj b/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/project.pbxproj index 239163d54..2ccacccb0 100755 --- a/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/project.pbxproj +++ b/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter.xcodeproj/project.pbxproj @@ -383,6 +383,7 @@ BCB5DDE314E86899000AF3C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFileFilter/SimpleVideoFileFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFileFilter/SimpleVideoFileFilter-Info.plist"; @@ -394,6 +395,7 @@ BCB5DDE414E86899000AF3C2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SimpleVideoFileFilter/SimpleVideoFileFilter-Prefix.pch"; INFOPLIST_FILE = "SimpleVideoFileFilter/SimpleVideoFileFilter-Info.plist"; diff --git a/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.m b/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.m index 30a60aeaf..50b912b1d 100755 --- a/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.m +++ b/examples/iOS/SimpleVideoFileFilter/SimpleVideoFileFilter/SimpleVideoFileFilterAppDelegate.m @@ -19,7 +19,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( rootViewController = [[SimpleVideoFileFilterViewController alloc] initWithNibName:@"SimpleVideoFileFilterViewController" bundle:nil]; rootViewController.view.frame = [[UIScreen mainScreen] bounds]; - [self.window addSubview:rootViewController.view]; + self.window.rootViewController = rootViewController; +// [self.window addSubview:rootViewController.view]; [self.window makeKeyAndVisible]; return YES; From 3d2dc6615c1379aeea805d957ea20cdd0d858922 Mon Sep 17 00:00:00 2001 From: brandon Date: Sun, 6 Dec 2015 13:18:08 -0800 Subject: [PATCH 13/32] Fatal missing NS_ENUM for GPUImageSkinToneFilter --- framework/Source/GPUImageSkinToneFilter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/Source/GPUImageSkinToneFilter.h b/framework/Source/GPUImageSkinToneFilter.h index a66be10e0..0dd6f866c 100644 --- a/framework/Source/GPUImageSkinToneFilter.h +++ b/framework/Source/GPUImageSkinToneFilter.h @@ -10,7 +10,7 @@ typedef NS_ENUM(NSUInteger, GPUImageSkinToneUpperColor) { GPUImageSkinToneUpperColorGreen, - + GPUImageSkinToneUpperColorOrange }; extern NSString *const kGPUImageSkinToneFragmentShaderString; From 7b0bc3c285dc942d01f148169aaa065ab80dc85e Mon Sep 17 00:00:00 2001 From: Anton Sydorov Date: Fri, 8 Jan 2016 15:29:43 +0200 Subject: [PATCH 14/32] Default intensity is not properly set in Lookup filter --- framework/Source/GPUImageLookupFilter.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/Source/GPUImageLookupFilter.m b/framework/Source/GPUImageLookupFilter.m index c098392b5..1c3505eba 100644 --- a/framework/Source/GPUImageLookupFilter.m +++ b/framework/Source/GPUImageLookupFilter.m @@ -91,14 +91,14 @@ @implementation GPUImageLookupFilter - (id)init; { - intensityUniform = [filterProgram uniformIndex:@"intensity"]; - self.intensity = 1.0f; - if (!(self = [super initWithFragmentShaderFromString:kGPUImageLookupFragmentShaderString])) { return nil; } - + + intensityUniform = [filterProgram uniformIndex:@"intensity"]; + self.intensity = 1.0f; + return self; } From 8124a95e84765c09ef03ac51e540498acfb0faf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Augustyniak?= Date: Sat, 30 Jan 2016 18:04:41 +0100 Subject: [PATCH 15/32] Setting root view controller of the main window before `application:didFinishLaunchingWithOptions:` method finishes --- .../ColorObjectTracking/ColorTrackingAppDelegate.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingAppDelegate.m b/examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingAppDelegate.m index 3ee1d8e03..90d4cf733 100755 --- a/examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingAppDelegate.m +++ b/examples/iOS/ColorObjectTracking/ColorObjectTracking/ColorTrackingAppDelegate.m @@ -10,8 +10,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; - colorTrackingViewController = [[ColorTrackingViewController alloc] initWithNibName:nil bundle:nil]; - [self.window addSubview:colorTrackingViewController.view]; + self.window.rootViewController = [[ColorTrackingViewController alloc] initWithNibName:nil bundle:nil]; [self.window makeKeyAndVisible]; return YES; From 35e3230c170b0831687aea5da1a1c1e4e0e1aeb2 Mon Sep 17 00:00:00 2001 From: Doug Date: Sat, 20 Feb 2016 15:42:26 +0000 Subject: [PATCH 16/32] Adds texture input/output to the Mac framework --- framework/GPUImageMac.xcodeproj/project.pbxproj | 16 ++++++++++++++++ framework/Source/Mac/GPUImage.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/framework/GPUImageMac.xcodeproj/project.pbxproj b/framework/GPUImageMac.xcodeproj/project.pbxproj index 831448d92..3ce07ba7c 100644 --- a/framework/GPUImageMac.xcodeproj/project.pbxproj +++ b/framework/GPUImageMac.xcodeproj/project.pbxproj @@ -13,6 +13,10 @@ 574B5D921BEA3E7900F4EC5A /* GPUImageColorConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */; }; A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */; }; A4741D5B19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */; }; + A50607171C78BF7C0095D0BB /* GPUImageTextureOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A50607181C78BF7C0095D0BB /* GPUImageTextureOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */; }; + A506071B1C78BF8E0095D0BB /* GPUImageTextureInput.h in Headers */ = {isa = PBXBuildFile; fileRef = A50607191C78BF8E0095D0BB /* GPUImageTextureInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A506071C1C78BF8E0095D0BB /* GPUImageTextureInput.m in Sources */ = {isa = PBXBuildFile; fileRef = A506071A1C78BF8E0095D0BB /* GPUImageTextureInput.m */; }; A87E5E12177648F3007FD5B1 /* GPUImageRawDataOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; A87E5E13177648F3007FD5B1 /* GPUImageRawDataOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = A87E5E11177648F3007FD5B1 /* GPUImageRawDataOutput.m */; }; A87E5E1617764B16007FD5B1 /* GPUImageRawDataInput.h in Headers */ = {isa = PBXBuildFile; fileRef = A87E5E1417764B16007FD5B1 /* GPUImageRawDataInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -338,6 +342,10 @@ 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorConversion.m; path = Source/GPUImageColorConversion.m; sourceTree = SOURCE_ROOT; }; A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramEqualizationFilter.h; path = Source/GPUImageHistogramEqualizationFilter.h; sourceTree = SOURCE_ROOT; }; A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramEqualizationFilter.m; path = Source/GPUImageHistogramEqualizationFilter.m; sourceTree = SOURCE_ROOT; }; + A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTextureOutput.h; path = Source/GPUImageTextureOutput.h; sourceTree = SOURCE_ROOT; }; + A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTextureOutput.m; path = Source/GPUImageTextureOutput.m; sourceTree = SOURCE_ROOT; }; + A50607191C78BF8E0095D0BB /* GPUImageTextureInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageTextureInput.h; path = Source/GPUImageTextureInput.h; sourceTree = SOURCE_ROOT; }; + A506071A1C78BF8E0095D0BB /* GPUImageTextureInput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageTextureInput.m; path = Source/GPUImageTextureInput.m; sourceTree = SOURCE_ROOT; }; A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataOutput.h; path = Source/GPUImageRawDataOutput.h; sourceTree = SOURCE_ROOT; }; A87E5E11177648F3007FD5B1 /* GPUImageRawDataOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageRawDataOutput.m; path = Source/GPUImageRawDataOutput.m; sourceTree = SOURCE_ROOT; }; A87E5E1417764B16007FD5B1 /* GPUImageRawDataInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataInput.h; path = Source/GPUImageRawDataInput.h; sourceTree = SOURCE_ROOT; }; @@ -762,6 +770,8 @@ BCF8679C1727585D00912E34 /* GPUImageAVCamera.m */, BCF867541725AF9300912E34 /* GPUImagePicture.h */, BCF867551725AF9300912E34 /* GPUImagePicture.m */, + A50607191C78BF8E0095D0BB /* GPUImageTextureInput.h */, + A506071A1C78BF8E0095D0BB /* GPUImageTextureInput.m */, ); name = Sources; sourceTree = ""; @@ -804,6 +814,8 @@ BCF40F2417248836005AE36A /* GPUImageView.m */, BCF867521725AF9300912E34 /* GPUImageMovieWriter.h */, BCF867531725AF9300912E34 /* GPUImageMovieWriter.m */, + A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */, + A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */, ); name = Outputs; sourceTree = ""; @@ -1243,6 +1255,7 @@ BCA20B611746CFE60097C84A /* GPUImageThresholdSketchFilter.h in Headers */, BCA20B651746D3C30097C84A /* GPUImageSmoothToonFilter.h in Headers */, BCA20B691746D3DD0097C84A /* GPUImageTiltShiftFilter.h in Headers */, + A506071B1C78BF8E0095D0BB /* GPUImageTextureInput.h in Headers */, BCA20B6D1746D44B0097C84A /* GPUImageCGAColorspaceFilter.h in Headers */, BCA20B711746D4AC0097C84A /* GPUImagePosterizeFilter.h in Headers */, BCA20B751746DE850097C84A /* GPUImageKuwaharaRadius3Filter.h in Headers */, @@ -1273,6 +1286,7 @@ BCA20BC917471C4B0097C84A /* GPUImageVoronoiConsumerFilter.h in Headers */, 574B5D861BE9346800F4EC5A /* GPUImageMovie.h in Headers */, BCD8EB8E18D6AFC5005ED83C /* GPUImageFramebufferCache.h in Headers */, + A50607171C78BF7C0095D0BB /* GPUImageTextureOutput.h in Headers */, BC96A4F1176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1372,6 +1386,7 @@ BCF867F91728494C00912E34 /* GPUImageGaussianBlurFilter.m in Sources */, BCF867FD1728496E00912E34 /* GPUImageTwoPassTextureSamplingFilter.m in Sources */, BCF8680117284C4000912E34 /* GPUImageFilterGroup.m in Sources */, + A506071C1C78BF8E0095D0BB /* GPUImageTextureInput.m in Sources */, BCF8680517284CFC00912E34 /* GPUImageTransformFilter.m in Sources */, BCF8680917284D0B00912E34 /* GPUImageCropFilter.m in Sources */, BCF86811172853AA00912E34 /* GPUImageGaussianBlurPositionFilter.m in Sources */, @@ -1495,6 +1510,7 @@ A87E5E13177648F3007FD5B1 /* GPUImageRawDataOutput.m in Sources */, A87E5E1717764B16007FD5B1 /* GPUImageRawDataInput.m in Sources */, BC8A583318124ABD00E6B507 /* GPUImageSingleComponentGaussianBlurFilter.m in Sources */, + A50607181C78BF7C0095D0BB /* GPUImageTextureOutput.m in Sources */, BCD8EB8D18D6AFC5005ED83C /* GPUImageFramebuffer.m in Sources */, BCD8EB8F18D6AFC5005ED83C /* GPUImageFramebufferCache.m in Sources */, ); diff --git a/framework/Source/Mac/GPUImage.h b/framework/Source/Mac/GPUImage.h index 0760fc78a..f0124b699 100755 --- a/framework/Source/Mac/GPUImage.h +++ b/framework/Source/Mac/GPUImage.h @@ -12,6 +12,7 @@ #import #import #import +#import // Filters #import @@ -162,3 +163,4 @@ // Outputs #import #import +#import From 16afe14ec961288745c5d5f0016c400190593451 Mon Sep 17 00:00:00 2001 From: Janie Clayton Date: Sat, 5 Mar 2016 09:30:06 -0600 Subject: [PATCH 17/32] Added Solarize Filter --- .../project.pbxproj | 1 + .../FilterOperations.swift | 9 +++ framework/GPUImage.xcodeproj/project.pbxproj | 12 +++ .../GPUImageMac.xcodeproj/project.pbxproj | 8 ++ framework/Source/GPUImage.h | 1 + framework/Source/GPUImageSolarizeFilter.h | 14 ++++ framework/Source/GPUImageSolarizeFilter.m | 76 +++++++++++++++++++ framework/Source/Mac/GPUImage.h | 1 + 8 files changed, 122 insertions(+) create mode 100644 framework/Source/GPUImageSolarizeFilter.h create mode 100644 framework/Source/GPUImageSolarizeFilter.m diff --git a/examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift.xcodeproj/project.pbxproj b/examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift.xcodeproj/project.pbxproj index 09e483c97..09f107c26 100644 --- a/examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift.xcodeproj/project.pbxproj +++ b/examples/Mac/FilterShowcaseSwift/FilterShowcaseSwift.xcodeproj/project.pbxproj @@ -244,6 +244,7 @@ BC0B246E197DF612009AC707 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0600; ORGANIZATIONNAME = "Sunset Lake Software"; TargetAttributes = { diff --git a/examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperations.swift b/examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperations.swift index ecde15cd5..585a183a0 100644 --- a/examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperations.swift +++ b/examples/iOS/FilterShowcaseSwift/FilterShowcaseSwift/FilterOperations.swift @@ -352,6 +352,15 @@ let filterOperations: Array = [ }, filterOperationType:.SingleInput ), + FilterOperation ( + listName:"Solarize", + titleName:"Solarize", + sliderConfiguration:.Enabled(minimumValue:0.0, maximumValue:1.0, initialValue:0.5), + sliderUpdateCallback: {(filter, sliderValue) in + filter.threshold = sliderValue + }, + filterOperationType:.SingleInput + ), FilterOperation ( listName:"Pixellate", titleName:"Pixellate", diff --git a/framework/GPUImage.xcodeproj/project.pbxproj b/framework/GPUImage.xcodeproj/project.pbxproj index 828659af6..52ba2185e 100644 --- a/framework/GPUImage.xcodeproj/project.pbxproj +++ b/framework/GPUImage.xcodeproj/project.pbxproj @@ -37,6 +37,10 @@ 6D13DBE7151AA804000B23BA /* GPUImageHazeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */; }; 6EE27493150E8FC60040DDB6 /* GPUImageGrayscaleFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */; }; 6EE27494150E8FC60040DDB6 /* GPUImageGrayscaleFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */; }; + 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 79F8FD161C8B2A620095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; settings = {ASSET_TAGS = (); }; }; + 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; settings = {ASSET_TAGS = (); }; }; + 79F8FD181C8B2AA60095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; settings = {ASSET_TAGS = (); }; }; 83AE9F981540DFE500F7FC13 /* GPUImageSubtractBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */; }; 83AE9F991540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */; }; 83AE9FCD1540E92800F7FC13 /* GPUImageMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */; }; @@ -735,6 +739,8 @@ 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHazeFilter.m; path = Source/GPUImageHazeFilter.m; sourceTree = SOURCE_ROOT; }; 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageGrayscaleFilter.h; path = Source/GPUImageGrayscaleFilter.h; sourceTree = SOURCE_ROOT; }; 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageGrayscaleFilter.m; path = Source/GPUImageGrayscaleFilter.m; sourceTree = SOURCE_ROOT; }; + 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSolarizeFilter.h; path = Source/GPUImageSolarizeFilter.h; sourceTree = SOURCE_ROOT; }; + 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSolarizeFilter.m; path = Source/GPUImageSolarizeFilter.m; sourceTree = SOURCE_ROOT; }; 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSubtractBlendFilter.h; path = Source/GPUImageSubtractBlendFilter.h; sourceTree = SOURCE_ROOT; }; 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSubtractBlendFilter.m; path = Source/GPUImageSubtractBlendFilter.m; sourceTree = SOURCE_ROOT; }; 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageMaskFilter.h; path = Source/GPUImageMaskFilter.h; sourceTree = SOURCE_ROOT; }; @@ -1147,6 +1153,8 @@ BCC94ABA151E4FD6008554B4 /* GPUImageLuminanceThresholdFilter.m */, BCC1E5CA151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.h */, BCC1E5CB151EA6610006EFA5 /* GPUImageAdaptiveThresholdFilter.m */, + 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */, + 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */, BCB79E7815EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.h */, BCB79E7915EC2A8300965D92 /* GPUImageAverageLuminanceThresholdFilter.m */, BC6ED9C01549CA0600966798 /* GPUImageHistogramFilter.h */, @@ -1567,6 +1575,7 @@ BCD81E8D19440418007133DB /* GPUImageFramebuffer.h in Headers */, BCD81E8F19440425007133DB /* GPUImageOutput.h in Headers */, BCD81E9019440428007133DB /* GPUImageVideoCamera.h in Headers */, + 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */, BCD81E911944042B007133DB /* GPUImageStillCamera.h in Headers */, BCD81E921944042E007133DB /* GPUImagePicture.h in Headers */, BCD81E9319440430007133DB /* GPUImageMovie.h in Headers */, @@ -1807,6 +1816,7 @@ BCABED9015263CF20098A93E /* GPUImageStretchDistortionFilter.h in Headers */, BCF3D68B153CC124009A1FE5 /* GPUImageTextureInput.h in Headers */, BCF3D6DD153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h in Headers */, + 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */, BCF3D70A153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h in Headers */, BCF3D70F153DF9E7009A1FE5 /* GPUImageEmbossFilter.h in Headers */, BCF3D71D153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h in Headers */, @@ -2045,6 +2055,7 @@ BCD81F4B19440604007133DB /* GPUImageRGBFilter.m in Sources */, BCD81F4C19440604007133DB /* GPUImageHSBFilter.m in Sources */, BCD81F4D19440604007133DB /* GPUImageHueFilter.m in Sources */, + 79F8FD181C8B2AA60095AB3E /* GPUImageSolarizeFilter.m in Sources */, BCD81F4E19440604007133DB /* GPUImageMonochromeFilter.m in Sources */, BCD81F4F19440604007133DB /* GPUImageFalseColorFilter.m in Sources */, BCD81F5019440604007133DB /* GPUImageHazeFilter.m in Sources */, @@ -2347,6 +2358,7 @@ 84FFC80C1936408F00994258 /* GPUImagePicture+TextureSubimage.m in Sources */, BCBC604E16C58B0900B11741 /* GPUImageMotionBlurFilter.m in Sources */, BCBC605816C8527C00B11741 /* GPUImageZoomBlurFilter.m in Sources */, + 79F8FD161C8B2A620095AB3E /* GPUImageSolarizeFilter.m in Sources */, BCBF617B16E4F44700E2784A /* GPUImageKuwaharaRadius3Filter.m in Sources */, BC6C55411730679D00EB222D /* GPUImageLaplacianFilter.m in Sources */, BCB030BF173400BC001A1A20 /* GPUImageThreeInputFilter.m in Sources */, diff --git a/framework/GPUImageMac.xcodeproj/project.pbxproj b/framework/GPUImageMac.xcodeproj/project.pbxproj index 831448d92..91b83cffc 100644 --- a/framework/GPUImageMac.xcodeproj/project.pbxproj +++ b/framework/GPUImageMac.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 574B5D871BE9346800F4EC5A /* GPUImageMovie.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D851BE9346800F4EC5A /* GPUImageMovie.m */; }; 574B5D911BEA3E7900F4EC5A /* GPUImageColorConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 574B5D8F1BEA3E7900F4EC5A /* GPUImageColorConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; 574B5D921BEA3E7900F4EC5A /* GPUImageColorConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */; }; + 79840B831C8B29240079A83B /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 79840B841C8B29240079A83B /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */; settings = {ASSET_TAGS = (); }; }; A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */; }; A4741D5B19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */; }; A87E5E12177648F3007FD5B1 /* GPUImageRawDataOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -336,6 +338,8 @@ 574B5D851BE9346800F4EC5A /* GPUImageMovie.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageMovie.m; path = Source/GPUImageMovie.m; sourceTree = SOURCE_ROOT; }; 574B5D8F1BEA3E7900F4EC5A /* GPUImageColorConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageColorConversion.h; path = Source/GPUImageColorConversion.h; sourceTree = SOURCE_ROOT; }; 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageColorConversion.m; path = Source/GPUImageColorConversion.m; sourceTree = SOURCE_ROOT; }; + 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageSolarizeFilter.h; path = Source/GPUImageSolarizeFilter.h; sourceTree = SOURCE_ROOT; }; + 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageSolarizeFilter.m; path = Source/GPUImageSolarizeFilter.m; sourceTree = SOURCE_ROOT; }; A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageHistogramEqualizationFilter.h; path = Source/GPUImageHistogramEqualizationFilter.h; sourceTree = SOURCE_ROOT; }; A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUImageHistogramEqualizationFilter.m; path = Source/GPUImageHistogramEqualizationFilter.m; sourceTree = SOURCE_ROOT; }; A87E5E10177648F3007FD5B1 /* GPUImageRawDataOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUImageRawDataOutput.h; path = Source/GPUImageRawDataOutput.h; sourceTree = SOURCE_ROOT; }; @@ -873,6 +877,8 @@ BCC0DF6117359F42007C485F /* GPUImageLuminanceThresholdFilter.m */, BCC0DF5C173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.h */, BCC0DF5D173596B9007C485F /* GPUImageAverageLuminanceThresholdFilter.m */, + 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */, + 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */, BCE817A01735FDC60071D084 /* GPUImageHalftoneFilter.h */, BCE817A11735FDC60071D084 /* GPUImageHalftoneFilter.m */, BCE817A21735FDC60071D084 /* GPUImagePixellatePositionFilter.h */, @@ -1191,6 +1197,7 @@ BCF8689D1728862100912E34 /* GPUImageOpacityFilter.h in Headers */, BCF868A11728866400912E34 /* GPUImageAlphaBlendFilter.h in Headers */, BCB009E6172A1BBD00DB804C /* GPUImageGammaFilter.h in Headers */, + 79840B831C8B29240079A83B /* GPUImageSolarizeFilter.h in Headers */, BCB009EA172A1BE800DB804C /* GPUImageToneCurveFilter.h in Headers */, BCB009F0172A23AA00DB804C /* GPUImageHazeFilter.h in Headers */, BCB009F2172A23AA00DB804C /* GPUImageHighlightShadowFilter.h in Headers */, @@ -1357,6 +1364,7 @@ BCF867BA1727791200912E34 /* GPUImageLevelsFilter.m in Sources */, BCF867C01727794000912E34 /* GPUImageMonochromeFilter.m in Sources */, BCF867C21727794000912E34 /* GPUImageRGBFilter.m in Sources */, + 79840B841C8B29240079A83B /* GPUImageSolarizeFilter.m in Sources */, BCF867C81727872D00912E34 /* GPUImagePixellateFilter.m in Sources */, BCF867CC172788F100912E34 /* GPUImage3x3TextureSamplingFilter.m in Sources */, BCF867D0172789B200912E34 /* GPUImageSketchFilter.m in Sources */, diff --git a/framework/Source/GPUImage.h b/framework/Source/GPUImage.h index 1609edf40..3e91c29cd 100755 --- a/framework/Source/GPUImage.h +++ b/framework/Source/GPUImage.h @@ -72,6 +72,7 @@ #import "GPUImagePosterizeFilter.h" #import "GPUImageBoxBlurFilter.h" #import "GPUImageAdaptiveThresholdFilter.h" +#import "GPUImageSolarizeFilter.h" #import "GPUImageUnsharpMaskFilter.h" #import "GPUImageBulgeDistortionFilter.h" #import "GPUImagePinchDistortionFilter.h" diff --git a/framework/Source/GPUImageSolarizeFilter.h b/framework/Source/GPUImageSolarizeFilter.h new file mode 100644 index 000000000..ba01c15a9 --- /dev/null +++ b/framework/Source/GPUImageSolarizeFilter.h @@ -0,0 +1,14 @@ +#import "GPUImageFilter.h" + +/** Pixels with a luminance above the threshold will invert their color + */ +@interface GPUImageSolarizeFilter : GPUImageFilter +{ + GLint thresholdUniform; +} + +/** Anything above this luminance will be inverted, and anything below normal. Ranges from 0.0 to 1.0, with 0.5 as the default + */ +@property(readwrite, nonatomic) CGFloat threshold; + +@end \ No newline at end of file diff --git a/framework/Source/GPUImageSolarizeFilter.m b/framework/Source/GPUImageSolarizeFilter.m new file mode 100644 index 000000000..616cb5b21 --- /dev/null +++ b/framework/Source/GPUImageSolarizeFilter.m @@ -0,0 +1,76 @@ +#import "GPUImageSolarizeFilter.h" + +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +NSString *const kGPUImageSolarizeFragmentShaderString = SHADER_STRING +( + varying highp vec2 textureCoordinate; + + uniform sampler2D inputImageTexture; + uniform highp float threshold; + + const highp vec3 W = vec3(0.2125, 0.7154, 0.0721); + + void main() + { + highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); + highp float luminance = dot(textureColor.rgb, W); + highp float thresholdResult = step(luminance, threshold); + highp vec3 finalColor = abs(thresholdResult - textureColor.rgb); + + gl_FragColor = vec4(finalColor, textureColor.w); + } +); +#else +NSString *const kGPUImageSolarizeFragmentShaderString = SHADER_STRING +( + varying vec2 textureCoordinate; + + uniform sampler2D inputImageTexture; + uniform float threshold; + + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + + void main() + { + vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); + float luminance = dot(textureColor.rgb, W); + float thresholdResult = step(luminance, threshold); + vec3 finalColor = abs(thresholdResult - textureColor.rgb); + + gl_FragColor = vec4(vec3(finalColor), textureColor.w); + } +); +#endif + +@implementation GPUImageSolarizeFilter; + +@synthesize threshold = _threshold; + +#pragma mark - +#pragma mark Initialization + +- (id)init; +{ + if (!(self = [super initWithFragmentShaderFromString:kGPUImageSolarizeFragmentShaderString])) + { + return nil; + } + + thresholdUniform = [filterProgram uniformIndex:@"threshold"]; + self.threshold = 0.5; + + return self; +} + +#pragma mark - +#pragma mark Accessors + +- (void)setThreshold:(CGFloat)newValue; +{ + _threshold = newValue; + + [self setFloat:_threshold forUniform:thresholdUniform program:filterProgram]; +} + + +@end \ No newline at end of file diff --git a/framework/Source/Mac/GPUImage.h b/framework/Source/Mac/GPUImage.h index 0760fc78a..8bc072efb 100755 --- a/framework/Source/Mac/GPUImage.h +++ b/framework/Source/Mac/GPUImage.h @@ -101,6 +101,7 @@ #import #import #import +#import #import #import #import From 791089b402fdc301bfb2019271a003816f0660dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=97=BD?= Date: Sun, 6 Mar 2016 13:01:32 +0800 Subject: [PATCH 18/32] fix issue #2221 --- framework/Source/GPUImageMovie.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/Source/GPUImageMovie.m b/framework/Source/GPUImageMovie.m index beb013d3b..4da050f41 100755 --- a/framework/Source/GPUImageMovie.m +++ b/framework/Source/GPUImageMovie.m @@ -585,6 +585,10 @@ - (void)processMovieFrame:(CVPixelBufferRef)movieFrame withSampleTime:(CMTime)cu // if (captureAsYUV && [GPUImageContext deviceSupportsRedTextures]) if (CVPixelBufferGetPlaneCount(movieFrame) > 0) // Check for YUV planar inputs to do RGB conversion { + + // fix issue 2221 + CVPixelBufferLockBaseAddress(movieFrame,0); + if ( (imageBufferWidth != bufferWidth) && (imageBufferHeight != bufferHeight) ) { From d5f8f88496333c8b8e4b0b239fe9dff228e9c399 Mon Sep 17 00:00:00 2001 From: Stefano Acerbetti Date: Sun, 6 Mar 2016 08:14:40 -0800 Subject: [PATCH 19/32] =?UTF-8?q?removed=20=E2=80=98GPUImageMovie=E2=80=99?= =?UTF-8?q?=20from=20the=20excluded=20files=20for=20OS=20X=20since=20it?= =?UTF-8?q?=E2=80=99s=20now=20supported?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPUImage.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/GPUImage.podspec b/GPUImage.podspec index e5454d4d5..4e1961cbf 100644 --- a/GPUImage.podspec +++ b/GPUImage.podspec @@ -19,7 +19,6 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.6' s.osx.exclude_files = 'framework/Source/iOS', 'framework/Source/GPUImageFilterPipeline.*', - 'framework/Source/GPUImageMovie.*', 'framework/Source/GPUImageMovieComposition.*', 'framework/Source/GPUImageVideoCamera.*', 'framework/Source/GPUImageStillCamera.*', From df5210a187c66280b93b37a3848afd019d2d208e Mon Sep 17 00:00:00 2001 From: closure Date: Sat, 12 Mar 2016 18:09:08 +0800 Subject: [PATCH 20/32] add GPUImageDefaultQueueAttribute to fix memory leak that running on iOS9 device. --- .../SimpleVideoFilter.xcodeproj/project.pbxproj | 4 ++-- framework/Source/GPUImageFramebufferCache.m | 2 +- framework/Source/GPUImageOutput.h | 1 + framework/Source/GPUImageOutput.m | 11 +++++++++++ framework/Source/iOS/GPUImageContext.m | 4 +++- framework/Source/iOS/GPUImageMovieWriter.m | 4 ++-- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj index 736b03314..afc5c73c6 100755 --- a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj +++ b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj @@ -323,7 +323,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -356,7 +356,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", diff --git a/framework/Source/GPUImageFramebufferCache.m b/framework/Source/GPUImageFramebufferCache.m index 1d50d8d07..53faf2c31 100644 --- a/framework/Source/GPUImageFramebufferCache.m +++ b/framework/Source/GPUImageFramebufferCache.m @@ -50,7 +50,7 @@ - (id)init; framebufferCache = [[NSMutableDictionary alloc] init]; framebufferTypeCounts = [[NSMutableDictionary alloc] init]; activeImageCaptureList = [[NSMutableArray alloc] init]; - framebufferCacheQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.framebufferCacheQueue", NULL); + framebufferCacheQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.framebufferCacheQueue", GPUImageDefaultQueueAttribute()); return self; } diff --git a/framework/Source/GPUImageOutput.h b/framework/Source/GPUImageOutput.h index a1af54d70..c10121a93 100755 --- a/framework/Source/GPUImageOutput.h +++ b/framework/Source/GPUImageOutput.h @@ -17,6 +17,7 @@ typedef NS_ENUM(NSInteger, UIImageOrientation) { }; #endif +dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void); void runOnMainQueueWithoutDeadlocking(void (^block)(void)); void runSynchronouslyOnVideoProcessingQueue(void (^block)(void)); void runAsynchronouslyOnVideoProcessingQueue(void (^block)(void)); diff --git a/framework/Source/GPUImageOutput.m b/framework/Source/GPUImageOutput.m index 2817a4456..d9bdaefa3 100755 --- a/framework/Source/GPUImageOutput.m +++ b/framework/Source/GPUImageOutput.m @@ -3,6 +3,17 @@ #import "GPUImagePicture.h" #import +dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void) +{ +#if TARGET_OS_IPHONE + if ([[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] != NSOrderedAscending) + { + return dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); + } +#endif + return nil; +} + void runOnMainQueueWithoutDeadlocking(void (^block)(void)) { if ([NSThread isMainThread]) diff --git a/framework/Source/iOS/GPUImageContext.m b/framework/Source/iOS/GPUImageContext.m index 19546ba91..c167d15d2 100755 --- a/framework/Source/iOS/GPUImageContext.m +++ b/framework/Source/iOS/GPUImageContext.m @@ -4,6 +4,8 @@ #define MAXSHADERPROGRAMSALLOWEDINCACHE 40 +extern dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void); + @interface GPUImageContext() { NSMutableDictionary *shaderProgramCache; @@ -31,7 +33,7 @@ - (id)init; } openGLESContextQueueKey = &openGLESContextQueueKey; - _contextQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.openGLESContextQueue", NULL); + _contextQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.openGLESContextQueue", GPUImageDefaultQueueAttribute()); #if OS_OBJECT_USE_OBJC dispatch_queue_set_specific(_contextQueue, openGLESContextQueueKey, (__bridge void *)self, NULL); diff --git a/framework/Source/iOS/GPUImageMovieWriter.m b/framework/Source/iOS/GPUImageMovieWriter.m index 8ced0dfe9..04882b0ac 100755 --- a/framework/Source/iOS/GPUImageMovieWriter.m +++ b/framework/Source/iOS/GPUImageMovieWriter.m @@ -470,7 +470,7 @@ - (void)enableSynchronizationCallbacks; { [assetWriter startWriting]; } - videoQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.videoReadingQueue", NULL); + videoQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.videoReadingQueue", GPUImageDefaultQueueAttribute()); [assetWriterVideoInput requestMediaDataWhenReadyOnQueue:videoQueue usingBlock:^{ if( _paused ) { @@ -499,7 +499,7 @@ - (void)enableSynchronizationCallbacks; if (audioInputReadyCallback != NULL) { - audioQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioReadingQueue", NULL); + audioQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioReadingQueue", GPUImageDefaultQueueAttribute()); [assetWriterAudioInput requestMediaDataWhenReadyOnQueue:audioQueue usingBlock:^{ if( _paused ) { From 820a4e394a93fba6657a749d19f0105a52075d33 Mon Sep 17 00:00:00 2001 From: closure Date: Sat, 12 Mar 2016 18:09:08 +0800 Subject: [PATCH 21/32] add GPUImageDefaultQueueAttribute to fix memory leak that running on iOS9 device. --- .../SimpleVideoFilter.xcodeproj/project.pbxproj | 4 ++-- framework/Source/GPUImageFramebufferCache.m | 2 +- framework/Source/GPUImageOutput.h | 1 + framework/Source/GPUImageOutput.m | 11 +++++++++++ framework/Source/iOS/GPUImageContext.m | 4 +++- framework/Source/iOS/GPUImageMovieWriter.m | 4 ++-- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj index 736b03314..afc5c73c6 100755 --- a/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj +++ b/examples/iOS/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj @@ -323,7 +323,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -356,7 +356,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../framework/**"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", diff --git a/framework/Source/GPUImageFramebufferCache.m b/framework/Source/GPUImageFramebufferCache.m index 1d50d8d07..53faf2c31 100644 --- a/framework/Source/GPUImageFramebufferCache.m +++ b/framework/Source/GPUImageFramebufferCache.m @@ -50,7 +50,7 @@ - (id)init; framebufferCache = [[NSMutableDictionary alloc] init]; framebufferTypeCounts = [[NSMutableDictionary alloc] init]; activeImageCaptureList = [[NSMutableArray alloc] init]; - framebufferCacheQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.framebufferCacheQueue", NULL); + framebufferCacheQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.framebufferCacheQueue", GPUImageDefaultQueueAttribute()); return self; } diff --git a/framework/Source/GPUImageOutput.h b/framework/Source/GPUImageOutput.h index a1af54d70..c10121a93 100755 --- a/framework/Source/GPUImageOutput.h +++ b/framework/Source/GPUImageOutput.h @@ -17,6 +17,7 @@ typedef NS_ENUM(NSInteger, UIImageOrientation) { }; #endif +dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void); void runOnMainQueueWithoutDeadlocking(void (^block)(void)); void runSynchronouslyOnVideoProcessingQueue(void (^block)(void)); void runAsynchronouslyOnVideoProcessingQueue(void (^block)(void)); diff --git a/framework/Source/GPUImageOutput.m b/framework/Source/GPUImageOutput.m index 2817a4456..d9bdaefa3 100755 --- a/framework/Source/GPUImageOutput.m +++ b/framework/Source/GPUImageOutput.m @@ -3,6 +3,17 @@ #import "GPUImagePicture.h" #import +dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void) +{ +#if TARGET_OS_IPHONE + if ([[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] != NSOrderedAscending) + { + return dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0); + } +#endif + return nil; +} + void runOnMainQueueWithoutDeadlocking(void (^block)(void)) { if ([NSThread isMainThread]) diff --git a/framework/Source/iOS/GPUImageContext.m b/framework/Source/iOS/GPUImageContext.m index 19546ba91..c167d15d2 100755 --- a/framework/Source/iOS/GPUImageContext.m +++ b/framework/Source/iOS/GPUImageContext.m @@ -4,6 +4,8 @@ #define MAXSHADERPROGRAMSALLOWEDINCACHE 40 +extern dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void); + @interface GPUImageContext() { NSMutableDictionary *shaderProgramCache; @@ -31,7 +33,7 @@ - (id)init; } openGLESContextQueueKey = &openGLESContextQueueKey; - _contextQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.openGLESContextQueue", NULL); + _contextQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.openGLESContextQueue", GPUImageDefaultQueueAttribute()); #if OS_OBJECT_USE_OBJC dispatch_queue_set_specific(_contextQueue, openGLESContextQueueKey, (__bridge void *)self, NULL); diff --git a/framework/Source/iOS/GPUImageMovieWriter.m b/framework/Source/iOS/GPUImageMovieWriter.m index d5d22e123..addc0a79a 100755 --- a/framework/Source/iOS/GPUImageMovieWriter.m +++ b/framework/Source/iOS/GPUImageMovieWriter.m @@ -501,7 +501,7 @@ - (void)enableSynchronizationCallbacks; { [assetWriter startWriting]; } - videoQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.videoReadingQueue", NULL); + videoQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.videoReadingQueue", GPUImageDefaultQueueAttribute()); [assetWriterVideoInput requestMediaDataWhenReadyOnQueue:videoQueue usingBlock:^{ if( _paused ) { @@ -530,7 +530,7 @@ - (void)enableSynchronizationCallbacks; if (audioInputReadyCallback != NULL) { - audioQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioReadingQueue", NULL); + audioQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioReadingQueue", GPUImageDefaultQueueAttribute()); [assetWriterAudioInput requestMediaDataWhenReadyOnQueue:audioQueue usingBlock:^{ if( _paused ) { From 2c3b00d08ab93f5f1441aebe105b7658dc6ab316 Mon Sep 17 00:00:00 2001 From: closure Date: Sat, 12 Mar 2016 22:43:00 +0800 Subject: [PATCH 22/32] update traivs --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e757a110a..096067a2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: objective-c before_install: + - brew upgrade ruby - gem install cocoapods --pre --quiet - pod --version - pod setup --silent From 7238299d7635893bf9f728cdb18d5297ce5514a7 Mon Sep 17 00:00:00 2001 From: closure Date: Sat, 12 Mar 2016 22:47:56 +0800 Subject: [PATCH 23/32] update travis --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 096067a2d..c4a0a1c45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: objective-c before_install: - - brew upgrade ruby - - gem install cocoapods --pre --quiet + - gem install cocoapods --quiet - pod --version - pod setup --silent - pod repo update --silent From 809916d0835ed40f48ad51842f816b6782c90452 Mon Sep 17 00:00:00 2001 From: closure Date: Sat, 12 Mar 2016 23:54:38 +0800 Subject: [PATCH 24/32] update travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c4a0a1c45..eb328e5c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: objective-c before_install: - - gem install cocoapods --quiet - pod --version - pod setup --silent - pod repo update --silent From 0044e27489fd1c6cf172ed4fb3123ed2cae4c106 Mon Sep 17 00:00:00 2001 From: Ricky Tan Date: Fri, 1 Apr 2016 10:32:18 +0800 Subject: [PATCH 25/32] fix: rotateRightHorizontal bug fix --- framework/Source/iOS/GPUImageView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/Source/iOS/GPUImageView.m b/framework/Source/iOS/GPUImageView.m index 887f04b6b..e092b80ee 100755 --- a/framework/Source/iOS/GPUImageView.m +++ b/framework/Source/iOS/GPUImageView.m @@ -340,10 +340,10 @@ + (const GLfloat *)textureCoordinatesForRotation:(GPUImageRotationMode)rotationM }; static const GLfloat rotateRightHorizontalFlipTextureCoordinates[] = { - 1.0f, 1.0f, - 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, + 1.0f, 0.0f, }; static const GLfloat rotate180TextureCoordinates[] = { From 08f6d12a3f86720bb4f88f8816592f9faf09ec03 Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Sun, 3 Apr 2016 12:35:59 -0500 Subject: [PATCH 26/32] Correction per pull request #2213. --- .../iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.m b/examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.m index b714fc6d6..3089d1db9 100755 --- a/examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.m +++ b/examples/iOS/BenchmarkSuite/BenchmarkSuite/BenchmarkAppDelegate.m @@ -33,8 +33,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( mainTabBarController.viewControllers = arrayOfViewControllers; mainTabBarController.selectedViewController = imageFilteringBenchmarkController; - [self.window addSubview:mainTabBarController.view]; - + self.window.rootViewController = mainTabBarController; + [self.window makeKeyAndVisible]; return YES; } From bff9f45a685684f107585c3b743f7fab011f1bc6 Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Sun, 3 Apr 2016 12:46:57 -0500 Subject: [PATCH 27/32] Fix per pull request #2099. --- .../SimpleImageFilter/SimpleImageAppDelegate.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageAppDelegate.m b/examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageAppDelegate.m index 65019b6c8..8f63db4a7 100755 --- a/examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageAppDelegate.m +++ b/examples/iOS/SimpleImageFilter/SimpleImageFilter/SimpleImageAppDelegate.m @@ -11,7 +11,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window.backgroundColor = [UIColor whiteColor]; rootViewController = [[SimpleImageViewController alloc] initWithNibName:nil bundle:nil]; - [self.window addSubview:rootViewController.view]; + [self.window setRootViewController:rootViewController]; [self.window makeKeyAndVisible]; return YES; From ec0945e83126075a4db7a1422c991a0de45fc09f Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Tue, 5 Apr 2016 11:58:07 -0500 Subject: [PATCH 28/32] Fixed the solarize filter's location. --- framework/GPUImage.xcodeproj/project.pbxproj | 12 ++++++------ framework/GPUImageMac.xcodeproj/project.pbxproj | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework/GPUImage.xcodeproj/project.pbxproj b/framework/GPUImage.xcodeproj/project.pbxproj index b51e383c1..462f2f285 100644 --- a/framework/GPUImage.xcodeproj/project.pbxproj +++ b/framework/GPUImage.xcodeproj/project.pbxproj @@ -37,10 +37,10 @@ 6D13DBE7151AA804000B23BA /* GPUImageHazeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D13DBE5151AA804000B23BA /* GPUImageHazeFilter.m */; }; 6EE27493150E8FC60040DDB6 /* GPUImageGrayscaleFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE27491150E8FC50040DDB6 /* GPUImageGrayscaleFilter.h */; }; 6EE27494150E8FC60040DDB6 /* GPUImageGrayscaleFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE27492150E8FC50040DDB6 /* GPUImageGrayscaleFilter.m */; }; - 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 79F8FD161C8B2A620095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; settings = {ASSET_TAGS = (); }; }; - 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; settings = {ASSET_TAGS = (); }; }; - 79F8FD181C8B2AA60095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; settings = {ASSET_TAGS = (); }; }; + 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; }; + 79F8FD161C8B2A620095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; }; + 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FD131C8B2A620095AB3E /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 79F8FD181C8B2AA60095AB3E /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FD141C8B2A620095AB3E /* GPUImageSolarizeFilter.m */; }; 83AE9F981540DFE500F7FC13 /* GPUImageSubtractBlendFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9F961540DFE400F7FC13 /* GPUImageSubtractBlendFilter.h */; }; 83AE9F991540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83AE9F971540DFE500F7FC13 /* GPUImageSubtractBlendFilter.m */; }; 83AE9FCD1540E92800F7FC13 /* GPUImageMaskFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE9FCB1540E92800F7FC13 /* GPUImageMaskFilter.h */; }; @@ -1579,7 +1579,6 @@ BCD81E8D19440418007133DB /* GPUImageFramebuffer.h in Headers */, BCD81E8F19440425007133DB /* GPUImageOutput.h in Headers */, BCD81E9019440428007133DB /* GPUImageVideoCamera.h in Headers */, - 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */, BCD81E911944042B007133DB /* GPUImageStillCamera.h in Headers */, BCD81E921944042E007133DB /* GPUImagePicture.h in Headers */, BCD81E9319440430007133DB /* GPUImageMovie.h in Headers */, @@ -1739,6 +1738,7 @@ BCD81F2B194404F8007133DB /* GPUImageTextureOutput.h in Headers */, 574B5D8E1BEA3E5B00F4EC5A /* GPUImageColorConversion.h in Headers */, BCD81F2C194404F8007133DB /* GPUImageRawDataOutput.h in Headers */, + 79F8FD171C8B2AA00095AB3E /* GPUImageSolarizeFilter.h in Headers */, BC3AA4B21C11104B003B7561 /* GPUImageColourFASTFeatureDetector.h in Headers */, BC3AA4B31C11104E003B7561 /* GPUImageColourFASTSamplingOperation.h in Headers */, ); @@ -1749,6 +1749,7 @@ buildActionMask = 2147483647; files = ( BC8A583C1813060F00E6B507 /* GPUImageiOSBlurFilter.h in Headers */, + 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */, BCF866C8172589A500912E34 /* GPUImage.h in Headers */, BC245DCA14DDBED7009FE7EB /* GPUImageFilter.h in Headers */, BCB5E75C14E2086300701302 /* GPUImageView.h in Headers */, @@ -1820,7 +1821,6 @@ BCABED9015263CF20098A93E /* GPUImageStretchDistortionFilter.h in Headers */, BCF3D68B153CC124009A1FE5 /* GPUImageTextureInput.h in Headers */, BCF3D6DD153CFF61009A1FE5 /* GPUImageTiltShiftFilter.h in Headers */, - 79F8FD151C8B2A620095AB3E /* GPUImageSolarizeFilter.h in Headers */, BCF3D70A153DCC9A009A1FE5 /* GPUImage3x3ConvolutionFilter.h in Headers */, BCF3D70F153DF9E7009A1FE5 /* GPUImageEmbossFilter.h in Headers */, BCF3D71D153E06C3009A1FE5 /* GPUImageCannyEdgeDetectionFilter.h in Headers */, diff --git a/framework/GPUImageMac.xcodeproj/project.pbxproj b/framework/GPUImageMac.xcodeproj/project.pbxproj index af547e2af..d47a6b0da 100644 --- a/framework/GPUImageMac.xcodeproj/project.pbxproj +++ b/framework/GPUImageMac.xcodeproj/project.pbxproj @@ -12,8 +12,8 @@ 574B5D911BEA3E7900F4EC5A /* GPUImageColorConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 574B5D8F1BEA3E7900F4EC5A /* GPUImageColorConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; 574B5D921BEA3E7900F4EC5A /* GPUImageColorConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 574B5D901BEA3E7900F4EC5A /* GPUImageColorConversion.m */; }; 79840B831C8B29240079A83B /* GPUImageSolarizeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 79840B811C8B29240079A83B /* GPUImageSolarizeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 79840B841C8B29240079A83B /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */; settings = {ASSET_TAGS = (); }; }; - A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */; }; + 79840B841C8B29240079A83B /* GPUImageSolarizeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 79840B821C8B29240079A83B /* GPUImageSolarizeFilter.m */; }; + A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A4741D5819A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; A4741D5B19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A4741D5919A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.m */; }; A50607171C78BF7C0095D0BB /* GPUImageTextureOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A50607151C78BF7C0095D0BB /* GPUImageTextureOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; A50607181C78BF7C0095D0BB /* GPUImageTextureOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = A50607161C78BF7C0095D0BB /* GPUImageTextureOutput.m */; }; @@ -1150,7 +1150,6 @@ BCF867AF172778D500912E34 /* GPUImageExposureFilter.h in Headers */, BCF867B1172778D500912E34 /* GPUImageHueFilter.h in Headers */, BCF867B3172778D500912E34 /* GPUImageSaturationFilter.h in Headers */, - A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */, BCF867B5172778D500912E34 /* GPUImageWhiteBalanceFilter.h in Headers */, BCAA73B71C18E09100BC2D31 /* GPUImageFourInputFilter.h in Headers */, BCF867B91727791200912E34 /* GPUImageLevelsFilter.h in Headers */, @@ -1294,6 +1293,7 @@ 574B5D861BE9346800F4EC5A /* GPUImageMovie.h in Headers */, BCD8EB8E18D6AFC5005ED83C /* GPUImageFramebufferCache.h in Headers */, A50607171C78BF7C0095D0BB /* GPUImageTextureOutput.h in Headers */, + A4741D5A19A92098005EE1A4 /* GPUImageHistogramEqualizationFilter.h in Headers */, BC96A4F1176563C300F215A2 /* GPUImageNonMaximumSuppressionFilter.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; From b8285f5a583f234ba1db3b24cfa22a90e1b10f14 Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Fri, 8 Apr 2016 10:44:05 -0500 Subject: [PATCH 29/32] Fixed the broken SimpleVideoFilter example on the Mac. --- .../SimpleVideoFilter.xcodeproj/project.pbxproj | 6 +++--- ...wController.h => SLSSimpleVideoFilterWindowController.h} | 0 ...wController.m => SLSSimpleVideoFilterWindowController.m} | 0 ...troller.xib => SLSSimpleVideoFilterWindowController.xib} | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) rename examples/Mac/SimpleVideoFilter/SimpleVideoFilter/{SLSSimpleVideoFileFilterWindowController.h => SLSSimpleVideoFilterWindowController.h} (100%) rename examples/Mac/SimpleVideoFilter/SimpleVideoFilter/{SLSSimpleVideoFileFilterWindowController.m => SLSSimpleVideoFilterWindowController.m} (100%) rename examples/Mac/SimpleVideoFilter/SimpleVideoFilter/{SLSSimpleVideoFileFilterWindowController.xib => SLSSimpleVideoFilterWindowController.xib} (87%) diff --git a/examples/Mac/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj b/examples/Mac/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj index 3fdf2cf9b..9ad08db0d 100644 --- a/examples/Mac/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj +++ b/examples/Mac/SimpleVideoFilter/SimpleVideoFilter.xcodeproj/project.pbxproj @@ -55,9 +55,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 79C26E201A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLSSimpleVideoFilterWindowController.h; sourceTree = ""; }; - 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SLSSimpleVideoFilterWindowController.m; sourceTree = ""; }; - 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SLSSimpleVideoFilterWindowController.xib; sourceTree = ""; }; + 79C26E201A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SLSSimpleVideoFilterWindowController.h; path = SimpleVideoFilter/SLSSimpleVideoFilterWindowController.h; sourceTree = SOURCE_ROOT; }; + 79C26E211A5EDD1C0054857C /* SLSSimpleVideoFilterWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SLSSimpleVideoFilterWindowController.m; path = SimpleVideoFilter/SLSSimpleVideoFilterWindowController.m; sourceTree = SOURCE_ROOT; }; + 79C26E2D1A5F02B70054857C /* SLSSimpleVideoFilterWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = SLSSimpleVideoFilterWindowController.xib; path = SimpleVideoFilter/SLSSimpleVideoFilterWindowController.xib; sourceTree = SOURCE_ROOT; }; 79E8A5F41A5ED6A700E6A226 /* SimpleVideoFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleVideoFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 79E8A5F81A5ED6A700E6A226 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79E8A5F91A5ED6A700E6A226 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; diff --git a/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.h b/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.h similarity index 100% rename from examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.h rename to examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.h diff --git a/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.m b/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.m similarity index 100% rename from examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.m rename to examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.m diff --git a/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.xib b/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.xib similarity index 87% rename from examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.xib rename to examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.xib index f157a7915..90d66050c 100644 --- a/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFileFilterWindowController.xib +++ b/examples/Mac/SimpleVideoFilter/SimpleVideoFilter/SLSSimpleVideoFilterWindowController.xib @@ -1,7 +1,7 @@ - + - + @@ -16,7 +16,7 @@ - + From 4a72158e6bc70b97d0e884afa96c8378f1a5d07a Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Wed, 20 Apr 2016 15:23:34 -0500 Subject: [PATCH 30/32] Added the solarize filter to the iOS bridging header. --- framework/Source/iOS/Framework/GPUImageFramework.h | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/Source/iOS/Framework/GPUImageFramework.h b/framework/Source/iOS/Framework/GPUImageFramework.h index 1d43cc25f..3de78bf4b 100644 --- a/framework/Source/iOS/Framework/GPUImageFramework.h +++ b/framework/Source/iOS/Framework/GPUImageFramework.h @@ -174,3 +174,4 @@ FOUNDATION_EXPORT const unsigned char GPUImageFrameworkVersionString[]; #import #import #import +#import From 5f8219dd126e68b691303926b0169429c2ee5c79 Mon Sep 17 00:00:00 2001 From: chenliming Date: Thu, 26 May 2016 20:17:47 +0800 Subject: [PATCH 31/32] =?UTF-8?q?GPUImageFramebuffer=20=20add=20=20get=20?= =?UTF-8?q?=20=20CVPixelBufferRef=20=20method,=20=20VideoToolBox=20=20enco?= =?UTF-8?q?de=20=20need=20CVPixelBufferRef=20=20format=EF=BC=8Cotherwise?= =?UTF-8?q?=20=20need=20=20createPixelBuffer=20=20for=20=20bytes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/Source/GPUImageFramebuffer.h | 1 + framework/Source/GPUImageFramebuffer.m | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/framework/Source/GPUImageFramebuffer.h b/framework/Source/GPUImageFramebuffer.h index 5cf20dd3e..bdb6a1f10 100644 --- a/framework/Source/GPUImageFramebuffer.h +++ b/framework/Source/GPUImageFramebuffer.h @@ -54,5 +54,6 @@ typedef struct GPUTextureOptions { - (void)unlockAfterReading; - (NSUInteger)bytesPerRow; - (GLubyte *)byteBuffer; +- (CVPixelBufferRef)pixelBuffer; @end diff --git a/framework/Source/GPUImageFramebuffer.m b/framework/Source/GPUImageFramebuffer.m index 1d3d48fc8..ea55c2663 100644 --- a/framework/Source/GPUImageFramebuffer.m +++ b/framework/Source/GPUImageFramebuffer.m @@ -439,6 +439,15 @@ - (GLubyte *)byteBuffer; #endif } +- (CVPixelBufferRef )pixelBuffer; +{ +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + return renderTarget; +#else + return NULL; // TODO: do more with this on the non-texture-cache side +#endif +} + - (GLuint)texture; { // NSLog(@"Accessing texture: %d from FB: %@", _texture, self); From 6d038384fd14b388ca1886bc4a284e81f4d20cb5 Mon Sep 17 00:00:00 2001 From: zjx20 Date: Thu, 26 May 2016 22:33:14 +0800 Subject: [PATCH 32/32] Correct import file in GPUImageVibranceFilter.h --- framework/Source/GPUImageVibranceFilter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/Source/GPUImageVibranceFilter.h b/framework/Source/GPUImageVibranceFilter.h index 36cd4eae6..9daddd79c 100644 --- a/framework/Source/GPUImageVibranceFilter.h +++ b/framework/Source/GPUImageVibranceFilter.h @@ -6,7 +6,7 @@ // // -#import +#import "GPUImageFilter.h" @interface GPUImageVibranceFilter : GPUImageFilter {