I would suggest that you use context sharing when you create your NSOpenGLViews.
Unfortunately, I do not have a lot of experience with the cocoa (NeXTSTEP) OpenGL window system interface (I use CGL/AGL), so I cannot tell you exactly how to do this. However, the API reference for initWithFormat:shareContext
may get you pointed in the correct direction.
The reason I suggest context sharing is because you can re-use the texture handle that CVOpenGLTextureRef
gives you in both NSOpenGLView
instances. Otherwise, you will probably have to get the CVOpenGLTextureRef
per-context (view).
The overhead of doing this per-context may not be as high as you think, Core Video does not have to copy the contents of the video through system memory to give you an OpenGL texture - it already has a surface on the GPU that it can copy/reference.