tags:

views:

52

answers:

1

Hi,

I want to draw some OpenGL ES context above the camera's video in iOS 4.

I am using this tutorial from Apple to get the video frames from the camera: http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html

Works like a charm. I am able to get video frames from the camera, and display them.

But - I want to display some OpenGL ES drawing above the video. That context should have a transparent background, and display only what I draw.

The code used to display the video:

 AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session1];

UIView *aView = [self view]; previewLayer.frame = aView.bounds; // Assume you want the preview layer to fill the view. [aView.layer addSublayer:previewLayer];

The code used to display the OpenGL drawing:

  glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);

[context presentRenderbuffer:GL_RENDERBUFFER_OES];

Problem is - I can only draw a full OpenGL layer (meaning, with a background, say black) and cannot only draw some artifacts of opengl, with a transparent background (so that the user can see the video below the opengl context).

Thanks alot, fiod

A: 

I'm facing the same issue.Can anyone tell me how to display openGLES drawings on live camera view?

whocares