GPUImageTextureOutput.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #import "GPUImageTextureOutput.h"
  2. @implementation GPUImageTextureOutput
  3. @synthesize delegate = _delegate;
  4. @synthesize texture = _texture;
  5. @synthesize enabled;
  6. #pragma mark -
  7. #pragma mark Initialization and teardown
  8. - (id)init;
  9. {
  10. if (!(self = [super init]))
  11. {
  12. return nil;
  13. }
  14. self.enabled = YES;
  15. return self;
  16. }
  17. - (void)doneWithTexture;
  18. {
  19. [firstInputFramebuffer unlock];
  20. }
  21. #pragma mark -
  22. #pragma mark GPUImageInput protocol
  23. - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex;
  24. {
  25. [_delegate newFrameReadyFromTextureOutput:self];
  26. }
  27. - (NSInteger)nextAvailableTextureIndex;
  28. {
  29. return 0;
  30. }
  31. // TODO: Deal with the fact that the texture changes regularly as a result of the caching
  32. - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex;
  33. {
  34. firstInputFramebuffer = newInputFramebuffer;
  35. [firstInputFramebuffer lock];
  36. _texture = [firstInputFramebuffer texture];
  37. }
  38. - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex;
  39. {
  40. }
  41. - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex;
  42. {
  43. }
  44. - (CGSize)maximumOutputSize;
  45. {
  46. return CGSizeZero;
  47. }
  48. - (void)endProcessing
  49. {
  50. }
  51. - (BOOL)shouldIgnoreUpdatesToThisTarget;
  52. {
  53. return NO;
  54. }
  55. - (BOOL)wantsMonochromeInput;
  56. {
  57. return NO;
  58. }
  59. - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue;
  60. {
  61. }
  62. @end