Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7589583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:11:50+00:00 2026-05-30T20:11:50+00:00

I tried google and stackoverflow but I cant seem to find the oficial documentation

  • 0

I tried google and stackoverflow but I cant seem to find the oficial documentation for functions that start with CVOpenGLESTexture. I can see they are from core Video, and I know they were added on iOS 5 but searching the documentation doesnt give me anything.

I am looking for the information about the parameters, what they do, how to use them etc. like in the other apple frameworks.

So far all I can do is command click on it to see the information but this feels super weird. Or is there a way to add this so it can be displayed on the quick help on the right on xcode?

Thanks and sorry if it is a stupid question.

PD: The core Video reference guide doesnt seem to explain these either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:11:52+00:00Added an answer on May 30, 2026 at 8:11 pm

    Unfortunately, there really isn’t any documentation on these new functions. The best you’re going to find right now is in the CVOpenGLESTextureCache.h header file, where you’ll see a basic description of the function parameters:

    /*!
        @function   CVOpenGLESTextureCacheCreate
        @abstract   Creates a new Texture Cache.
        @param      allocator The CFAllocatorRef to use for allocating the cache.  May be NULL.
        @param      cacheAttributes A CFDictionaryRef containing the attributes of the cache itself.   May be NULL.
        @param      eaglContext The OpenGLES 2.0 context into which the texture objects will be created.  OpenGLES 1.x contexts are not supported.
        @param      textureAttributes A CFDictionaryRef containing the attributes to be used for creating the CVOpenGLESTexture objects.  May be NULL.
        @param      cacheOut   The newly created texture cache will be placed here
        @result     Returns kCVReturnSuccess on success
    */
    CV_EXPORT CVReturn CVOpenGLESTextureCacheCreate(
                        CFAllocatorRef allocator,
                        CFDictionaryRef cacheAttributes,
                        void *eaglContext,
                        CFDictionaryRef textureAttributes,
                        CVOpenGLESTextureCacheRef *cacheOut) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
    

    The more difficult elements are the attributes dictionaries, which unfortunately you need to find examples of in order to use these functions properly. Apple has the GLCameraRipple and RosyWriter examples that show off how to use the fast texture upload path with BGRA and YUV input color formats. Apple also provided the ChromaKey example at WWDC (which may still be accessible along with the videos) that demonstrated how to use these texture caches to pull information from an OpenGL ES texture.

    I just got this fast texture uploading working in my GPUImage framework (the source code for which is available at that link), so I’ll lay out what I was able to parse out of this. First, I create a texture cache using the following code:

    CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, (__bridge void *)[[GPUImageOpenGLESContext sharedImageProcessingOpenGLESContext] context], NULL, &coreVideoTextureCache);
    if (err) 
    {
        NSAssert(NO, @"Error at CVOpenGLESTextureCacheCreate %d");
    }
    

    where the context referred to is an EAGLContext configured for OpenGL ES 2.0.

    I use this to keep video frames from the iOS device camera in video memory, and I use the following code to do this:

    CVPixelBufferLockBaseAddress(cameraFrame, 0);
    
    CVOpenGLESTextureRef texture = NULL;
    CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, coreVideoTextureCache, cameraFrame, NULL, GL_TEXTURE_2D, GL_RGBA, bufferWidth, bufferHeight, GL_BGRA, GL_UNSIGNED_BYTE, 0, &texture);
    
    if (!texture || err) {
        NSLog(@"CVOpenGLESTextureCacheCreateTextureFromImage failed (error: %d)", err);  
        return;
    }
    
    outputTexture = CVOpenGLESTextureGetName(texture);
    glBindTexture(GL_TEXTURE_2D, outputTexture);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    
    // Do processing work on the texture data here
    
    CVPixelBufferUnlockBaseAddress(cameraFrame, 0);
    
    CVOpenGLESTextureCacheFlush(coreVideoTextureCache, 0);
    CFRelease(texture);
    outputTexture = 0;
    

    This creates a new CVOpenGLESTextureRef, representing an OpenGL ES texture, from the texture cache. This texture is based on the CVImageBufferRef passed in by the camera. That texture is then retrieved from the CVOpenGLESTextureRef and appropriate parameters set for it (which seemed to be necessary in my processing). Finally, I do my work on the texture and clean up when I’m done.

    This fast upload process makes a real difference on the iOS devices. It took the upload and processing of a single 640×480 frame of video on an iPhone 4S from 9.0 ms to 1.8 ms.

    I’ve heard that this works in reverse, as well, which might allow for the replacement of glReadPixels() in certain situations, but I’ve yet to try this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched through stackoverflow and google's extension FAQ but could not seem to find
I've tried everything Google and StackOverflow have recommended (that I could find) including using
I've tried to google the subject but couldn't find anything useful. So, is it
I tried searching in google but could not find any useful answer, if(verifier.length() >
I have tried searching on Google and also read the documentation but no success.
I've searched all posts on google and stackoverflow but I simply can't solve this
This seemed to me like an easy one, but I can't seem to find
I was thinking this question for a while, and ever tried to google but
I've tried every example i could google, and every solution i could find on
I thought flush(); would work, at least from what Google/Stackoverflow tell me, but on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.