What is the best way to render a series of frames coming from an external accessory using GPUImage? I am looking for the best performance I can get with a series of frames technically a series of UIImages but they are coming from an external accessory after processing. But the processing is not in GPUImage but I still need to get the best performance I can.
Since it has been a while, I thought I would answer my own question. Basically I wound up using GPUImageRawDataInput. Here is the code chunk that worked for me ->
unsigned char *dataBuffer = ... // 640X480X4 bytes RGBA data
if (!initialized) {
initialized = true;
self.rawDataInput = [[GPUImageRawDataInput alloc] initWithBytes:dataBuffer
size:CGSizeMake(640.0f, 480.0f) pixelFormat:GPUPixelFormatRGBA];
[self.imageView setTransform:CGAffineTransformMakeRotation(-M_PI_2)];
[self.rawDataInput addTarget:self.imageView];
}
else {
[self.rawDataInput updateDataFromBytes:dataBuffer size:CGSizeMake(640.0f, 480.0f)];
}
[self.rawDataInput processData];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With