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 7836781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:18:34+00:00 2026-06-02T14:18:34+00:00

i know that apple offers a sample called GLCameraRipple which is using CVOpenGLESTextureCacheCreateTextureFromImage to

  • 0

i know that apple offers a sample called GLCameraRipple which is using CVOpenGLESTextureCacheCreateTextureFromImage to achieve this. But when i changed to glTexImage2D, it displays nothing, what’s wrong with my code?

if (format == kCVPixelFormatType_32BGRA) {
CVPixelBufferRef pixelBuf = CMSampleBufferGetImageBuffer(sampleBuffer);
CVPixelBufferLockBaseAddress(pixelBuf, 0);
void *baseaddress = CVPixelBufferGetBaseAddress(pixelBuf);

glGenTextures(1, &textureID);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureID);

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, baseaddress);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

CVPixelBufferUnlockBaseAddress(pixelBuf, 0);
}

thank you very much for any help!

  • 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-06-02T14:18:38+00:00Added an answer on June 2, 2026 at 2:18 pm

    There are a couple of problems here. First, the GLCameraRipple example was built to take in YUV camera data, not BGRA. Your above code is only uploading one texture of BGRA data, rather than the separate Y and UV planes expected by the application. It uses a colorspace conversion shader to merge these planes as a first stage, and that needs the YUV data to work.

    Second, you are allocating a new texture for each uploaded frame, which is a really bad idea. This is particularly bad if you don’t delete that texture when done, because you will chew up resources this way. You should allocate a texture once for each plane you’ll upload, then keep that texture around as you upload each video frame, deleting it only when you’re done processing video.

    You’ll either need to rework the above to upload the separate Y and UV planes, or remove / rewrite their color processing shader. If you go the BGRA route, you’ll also need to be sure that the camera is now giving you BGRA frames instead of YUV ones.

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

Sidebar

Related Questions

I know that Apple's terms for apps disallows downloading and executing code, but there
I know that Apple hasn't given access to voice recognition, but do we have
From Apple sample PageControl we can know that UIPageControl can be used to control
I know that I should understand Apple's documentation for NSTimer, but I don't! I
I know that apple knows when you touch the locked screen (iPod shortcut, call),
Beyond the regular boring difference between Cast and As if i know that apple
I want to know that does apple's Push Notification Server generate new device token
How can I know that my iPhone is connected to the Apple Push Notification
I know nothing about Xcode, except it's a Developer interface from Apple that actually
I know that it's a subject that can raise a lot of debate, but

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.