ios - Render failed because a pixel format YCC420f is not supported -
i'm trying convert cvpixelbufferref uiimage using following snippet:
uiimage *image = nil; cmsamplebufferref samplebuffer = (cmsamplebufferref)cmbufferqueuedequeueandretain(_queue); if (samplebuffer) { cvpixelbufferref pixelbuffer = cmsamplebuffergetimagebuffer(samplebuffer); nsuinteger width = cvpixelbuffergetwidth(pixelbuffer); nsuinteger height = cvpixelbuffergetheight(pixelbuffer); ciimage *coreimage = [[ciimage alloc] initwithcvpixelbuffer:pixelbuffer options:nil]; cgimageref imageref = [_context createcgimage:coreimage fromrect:cgrectmake(0, 0, width, height)]; image = [uiimage imagewithcgimage:imageref]; cfrelease(samplebuffer); cfrelease(imageref); }
my problem works fine when run code on device fails render when run on simulator, console outputs following:
render failed because pixel format ycc420f not supported
any ideas?
Comments
Post a Comment