How to access GStreamer's OpenGL texture from CUDA without segfaults?
Andrey Sotnikov via gstreamer-devel <[email protected]>
| Newsgroups | gmane.comp.video.gstreamer.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, dear GStreamer community,
I am trying to write a CUDA kernel that will process video frames
received from glcolorconvert. This processing is supposed to happen
inside a rendering step of GtkGLArea. The OpenGL context was
successfully shared between GTK and GStreamer, and everything works
until I try to use the texture in CUDA.
Here is what I am trying to do:
auto res = cudaGraphicsResource_t{};
CubDebugExit(cudaGraphicsGLRegisterImage(&res, image, target,
cudaGraphicsRegisterFlagsReadOnly));
CubDebugExit(cudaGraphicsMapResources(1, &res));
auto texPtr = (void *){};
auto texSize = size_t{};
CubDebugExit(cudaGraphicsResourceGetMappedPointer(&texPtr, &texSize, res));
The last line causes a segmentation fault, there are no errors before
that. What secret sauce should I use?
Best.
Andrey.