Skip to content

Commit

Permalink
Merge pull request BradLarson#2228 from RetVal/master
Browse files Browse the repository at this point in the history
fix issue BradLarson#2093
  • Loading branch information
BradLarson committed Apr 3, 2016
2 parents 08f6d12 + 809916d commit d63c232
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
language: objective-c

before_install:
- gem install cocoapods --pre --quiet
- pod --version
- pod setup --silent
- pod repo update --silent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,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",
Expand Down Expand Up @@ -365,7 +365,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",
Expand Down
2 changes: 1 addition & 1 deletion framework/Source/GPUImageFramebufferCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions framework/Source/GPUImageOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
11 changes: 11 additions & 0 deletions framework/Source/GPUImageOutput.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
#import "GPUImagePicture.h"
#import <mach/mach.h>

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])
Expand Down
4 changes: 3 additions & 1 deletion framework/Source/iOS/GPUImageContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#define MAXSHADERPROGRAMSALLOWEDINCACHE 40

extern dispatch_queue_attr_t GPUImageDefaultQueueAttribute(void);

@interface GPUImageContext()
{
NSMutableDictionary *shaderProgramCache;
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions framework/Source/iOS/GPUImageMovieWriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit d63c232

Please sign in to comment.