My employer, Priologic Software, was kind enough to let me release the code for this functionality.
You can find it at
https://gist.github.com/EricDavies/860c9a73d53649f7399e2a4a02fcb9daIt was cobbled together from other peoples code where-ever I could find it.
It comes with no guarantees of any sort, but I will try to answer any questions that I can.
Note: it is much easier to grab a frame from Objc because that api provides a method to get an i420 frame that actually has yuv fields you can directly access.
Eric.