I'm working on an app in which I create a CVPixelBuffer that I need to display as efficiently as possible. The fastest thing that seems work on a couple recent iPhones I've tested is to simply set the ViewController's layer.contents to the CVPixelBuffer. I was actually surprised this works as googling it would indicate that you can't just do this. However... upon testing this same piece of code on an old iPad Air 2, it didn't display anything. I did succeed in making it work on the iPad Air 2 by creating a CIImage from the CVPixelBuffer and then turning that into a CGImage and setting that to the layer's contents. I'm reluctant to use this in the application as it's considerably less efficient on the iPhone (I'm assuming that this entails some unnecessary extra uploads/downloads to the GPU). I'm trying to figure out which bit of code works on which hardware so I can fall back to the more CPU-intensive function for older hardware, but I'm not sure how to determine which hardware supports setting that CALayer contents to a CVPixelBuffer and which does not. Is there any documentation that would shed light on this?
Thanks!
Michael
Thanks!
Michael