12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #import "GPUImageTextureInput.h"
- @implementation GPUImageTextureInput
- #pragma mark -
- #pragma mark Initialization and teardown
- - (id)initWithTexture:(GLuint)newInputTexture size:(CGSize)newTextureSize;
- {
- if (!(self = [super init]))
- {
- return nil;
- }
- runSynchronouslyOnVideoProcessingQueue(^{
- [GPUImageContext useImageProcessingContext];
- });
-
- textureSize = newTextureSize;
- runSynchronouslyOnVideoProcessingQueue(^{
- outputFramebuffer = [[GPUImageFramebuffer alloc] initWithSize:newTextureSize overriddenTexture:newInputTexture];
- });
-
- return self;
- }
- #pragma mark -
- #pragma mark Image rendering
- - (void)processTextureWithFrameTime:(CMTime)frameTime;
- {
- runAsynchronouslyOnVideoProcessingQueue(^{
- for (id<GPUImageInput> currentTarget in targets)
- {
- NSInteger indexOfObject = [targets indexOfObject:currentTarget];
- NSInteger targetTextureIndex = [[targetTextureIndices objectAtIndex:indexOfObject] integerValue];
-
- [currentTarget setInputSize:textureSize atIndex:targetTextureIndex];
- [currentTarget setInputFramebuffer:outputFramebuffer atIndex:targetTextureIndex];
- [currentTarget newFrameReadyAtTime:frameTime atIndex:targetTextureIndex];
- }
- });
- }
- @end
|