Adding focus / exposure / whiteBalance / torch to iOS Video Grabber

Hi, given I got no feedback here (http://forum.openframeworks.cc/t/reaching-avfoundationvideograbber-from-ofvideograbber-api/10303/0) I started implementing the necessary changes to implement those features.

Now, the native grabber is wrapped under several layers inside ofVideoGrabber.
My approach is to expose it (right now it’s unreachable) through a couple of getter methods, one to be added at ofiPhoneVideoGrabber.mm and the other at AVFoundationVideoGrabber.mm, and then you can get a hold of it:

  
  
//getting myself a pointer to the real device grabber  
ofPtr<ofBaseVideoGrabber> grabberP = grabber.getGrabber();  
ofiPhoneVideoGrabber * iGrabber = (ofiPhoneVideoGrabber *)grabberP.get();  
AVFoundationVideoGrabber * avGrabber = iGrabber->getAvGrabber();  
iPhoneVideoGrabber * deviceGrabber = avGrabber->getGrabber(); //finally reach native grabber  
  

and then the user can call methods onto it (at iPhoneVideoGrabber* level, which is Obj-C):

  
  
// focus  
-(bool)setContinuousAutoFocus;  
-(bool)focusOnce;  
-(bool)lockFocus; //at curent focus  
-(bool)touchFocusAt:(CGPoint)focusPoint; // (0,0) bottom left, (1,1) top right, calls focusOnce  
  
// Exposure  
-(bool)setContinuousAutoExposure;  
-(bool)lockExposure;  
-(bool)autoExposureOnce;  
-(bool)touchExposeAt:(CGPoint)autoExposeHere; // (0,0) bottom left, (1,1) top right, calls autoExposreOnce  
  
// Torch  
-(float)currentTorchLevel; // [0..1]  
-(bool)startTorch;  
-(bool)setAutoTorch; //adjust torch intensity depending on scene darkness   
-(bool)stopTorch;  
  
//white balance  
-(bool)setContinuousAutoWhiteBalance;  
-(bool)lockWhiteBalance;  
-(bool)autoWhiteBalanceOnce;  
  

But maybe they should all be exposed at ofiPhoneVideoGrabber level… I’m just not a big fan of unnecessary wrapping. What do you think?

You can see what’s been done so far here: https://github.com/armadillu/openFrameworks/commit/7c6d4e28802a9bbfd47ed27651e7df10c1b78a1f

I also extended the iosVideoGrabber example to show all the features:

hey Oriol,
all this looks good.
give me some time to look over it properly and i’ll add it to the OF develop branch.
thx for your work.

also opened up an issue on github for this.
https://github.com/openframeworks/openFrameworks/issues/1413

Has this been implemented in any other project? I would love to use auto-focus functionality on ios in my project!