Skip to content

Commit

Permalink
GPUImageOutput added method for target on current queue
Browse files Browse the repository at this point in the history
  • Loading branch information
eluzix committed Nov 5, 2013
1 parent f2fae19 commit 11cc5a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/Source/GPUImageOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void reportAvailableMemoryForGPUImage(NSString *tag);
- (void)removeAllTargets;

- (void)addTargetOnCurrentQueue:(id<GPUImageInput>)newTarget;
- (void)addTargetOnCurrentQueue:(id<GPUImageInput>)newTarget atTextureLocation:(NSInteger)textureLocation;
- (void)removeTargetOnCurrentQueueWithoutReset:(id<GPUImageInput>)targetToRemove;
- (void)removeAllTargetsOnCurrentQueueWithoutReset;

Expand Down
19 changes: 18 additions & 1 deletion framework/Source/GPUImageOutput.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void runAsynchronouslyOnVideoProcessingQueue(void (^block)(void))
}
}

void reportAvailableMemoryForGPUImage(NSString *tag)
void reportAvailableMemoryForGPUImage(NSString *tag)
{
if (!tag)
tag = @"Default";
Expand Down Expand Up @@ -250,6 +250,23 @@ - (void)addTargetOnCurrentQueue:(id<GPUImageInput>)newTarget {
}
}

- (void)addTargetOnCurrentQueue:(id<GPUImageInput>)newTarget atTextureLocation:(NSInteger)textureLocation {
if([targets containsObject:newTarget])
{
return;
}

cachedMaximumOutputSize = CGSizeZero;
[self setInputTextureForTarget:newTarget atIndex:textureLocation];
[newTarget setTextureDelegate:self atIndex:textureLocation];
[targets addObject:newTarget];
[targetTextureIndices addObject:[NSNumber numberWithInteger:textureLocation]];

allTargetsWantMonochromeData = allTargetsWantMonochromeData && [newTarget wantsMonochromeInput];
}



- (void)removeTargetOnCurrentQueueWithoutReset:(id<GPUImageInput>)targetToRemove {
if(![targets containsObject:targetToRemove])
{
Expand Down

0 comments on commit 11cc5a4

Please sign in to comment.