I have a GPUImageView object connected to video camera. When i add subview to it. Subview appears for millisecond and then disappears. I think it is redraw by next video frame !
I searched on web without result! And then i looked at GPUImageView inheritance:
GPUImageView on mac inherits from NSOpenGLView, so i look for how to add subview on NSOpenGLView. Apple provide example how to do this, it is called LayerBackedOpenGLView here is link : https://developer.apple.com/library/mac/samplecode/LayerBackedOpenGLView/Introduction/Intro.html.
They use : [openGLView setWantsLayer:YES]; and this make subview apear but on GPUImageView (video stream from camera) disapears and becomes with some mess.
Apple mention that :
Enabling the "wantsLayer" property of an NSOpenGLView activates layer-backed rendering of the OpenGL view. The layer-backed rendering mode uses its own NSOpenGLContext, which is distinct from the NSOpenGLContext that the view uses for drawing in non-layer-backed mode. AppKit, working in concert with CoreAnimation, automatically creates this context and assigns it to the view.
I am newbie on Mac, and don't know OpenGL, so maybe i am doing something wrong or missed something. I need a way to add subview on GPUImageView.
My question is: How can i add subview on GPUImageView object (on MAC) with condition that :
- Subview must be visible
- Content must be displayed too. (in my case video stream displayed on GPUImageView)