Hello all,
GStreamer 1.29.2, OpenGL/GLFW 3.3 Core Profile
I have a working OpenGL/GLFW bit of code that essentially renders RGBA to a GL_TEXTURE_2D with a framebuffer, which is in turn rendered onto the default window (created from window = glfwCreateWindow() and the context made current via glfwMakeContextCurrent(window). The code is very similar to what you would find in learnopengl.com.
What I would like to do next is to feed the contents of the framebuffer 2D texture to appsrc with caps video/x-raw(memory:GLMemory),width=W,height=H,etc., ideally to be sink-ed by nvh265enc or similar, at a controllable framerate.
How should I go about doing so?
I have read through the gst-gl docs and my take away is that gst_gl_context_new_wrapped() is needed to pass OpenGL context to GStreamer, but I’m not sure of the GstGLDisplay parameter to pass as I already have an OpenGL window created with my existing code.
Or am I completely off-target, and it is possible to use gst_gl_memory_copy_into() to copy the framebuffer 2D texture into a GstGLMemory, somehow wrap that into a GstBuffer and push it to appsrc?