Created
October 19, 2014 14:12
-
-
Save avesus/d81e68b2b0ca7e74558e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to convert a CVImageBufferRef to an OpenGL texture | |
outputImageProviderFromTextureWithPixelFormat:pixelsWide:pixelsHigh:name:flipped:releaseCallback:releaseContext:colorSpace:shouldColorMatch | |
CVImageBufferRef imageBuffer = CVBufferRetain(mCurrentImageBuffer); | |
GLuint texture = CVOpenGLTextureGetName(imageBuffer); | |
id provider= [context outputImageProviderFromTextureWithPixelFormat:QCPlugInPixelFormatARGB8 | |
pixelsWide:CVPixelBufferGetWidth(imageBuffer) | |
pixelsHigh:CVPixelBufferGetHeight(imageBuffer) | |
name:texture | |
flipped:NO | |
releaseCallback:_TextureReleaseCallback | |
releaseContext:NULL | |
colorSpace:CVImageBufferGetColorSpace(imageBuffer) | |
shouldColorMatch:YES]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment