Skip to content

Commit

Permalink
Merge pull request BradLarson#1502 from mvarie/master
Browse files Browse the repository at this point in the history
updated iOS version reference to avoid explicit release of semaphores on iOS6
  • Loading branch information
BradLarson committed Apr 28, 2014
2 parents 38357d3 + 86ec94a commit 2040d53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion framework/Source/GPUImageFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShad
backgroundColorGreen = 0.0;
backgroundColorBlue = 0.0;
backgroundColorAlpha = 0.0;
imageCaptureSemaphore = dispatch_semaphore_create(1);
imageCaptureSemaphore = dispatch_semaphore_create(0);
dispatch_semaphore_signal(imageCaptureSemaphore);

runSynchronouslyOnVideoProcessingQueue(^{
[GPUImageContext useImageProcessingContext];
Expand Down
8 changes: 5 additions & 3 deletions framework/Source/iOS/GPUImagePicture.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoot

hasProcessedImage = NO;
self.shouldSmoothlyScaleOutput = smoothlyScaleOutput;
imageUpdateSemaphore = dispatch_semaphore_create(1);

imageUpdateSemaphore = dispatch_semaphore_create(0);
dispatch_semaphore_signal(imageUpdateSemaphore);


// TODO: Dispatch this whole thing asynchronously to move image loading off main thread
CGFloat widthOfImage = CGImageGetWidth(newImageSource);
CGFloat heightOfImage = CGImageGetHeight(newImageSource);
Expand Down Expand Up @@ -296,4 +298,4 @@ - (void)addTarget:(id<GPUImageInput>)newTarget atTextureLocation:(NSInteger)text
}
}

@end
@end

0 comments on commit 2040d53

Please sign in to comment.