BradLarson/GPUImage — pull request #1291 by karlvr (2013-11-02 19:13:15+00:00)
Title: Create GPUImageCoreVideoInput as a refactor out of GPUImageVideoCamera

Hi Brad,

I've had a requirement to use an AVCapture stack that I've created myself, not using GPUImageVideoCamera. But I still want to process samples using GPUImage. I have investigated a few different ways of doing this integration and I decided that I could refactor the pixel buffer / sample buffer handling out of GPUImageVideoCamera into a new base-class, GPUImageCoreVideoInput.

This has been created almost exclusively using copy-and-paste. It's a reasonably large refactor so I stuck to copy-and-paste almost everywhere so there aren't any hidden changes! There is one place where the changes are more than copy-and-paste, and that is in the outputImageOrientation and updateOrientationSendToTargets implementation - I created a helper method in the GPUImageCoreVideoInput class to determine the correct orientation given a device position etc.

There should also be no compile issues or behaviour issues for any existing code.

I also added @private and @protected around the ivars that I moved into the new base class, to be sure that I'd moved all relevant code down.

I hope you don't mind such a drastic refactoring! And I hope this is acceptable and you find it beneficial for the project.

One thing currently sticks out, and that is the name of the delegate protocol, which still references the video camera even though it is now set on the new base class. Perhaps we could rename the delegate protocol and #define the old name to the new. I've left it for the moment but happy to make changes based on your thoughts.

Best regards,
Karl