rsvgoverlay with cairo gl back end

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

rsvgoverlay with cairo gl back end

pneves
Hello

I am trying to wrap my head around on how to use the cairo gl backend with opengl. I have hacked around an integration of cairo and Gstreamer Open GL constructs and a cairo surface. Basically it draws to an openGL texture.

 GstGLContext *context = GST_GL_BASE_FILTER(overlay)->context;
    GstGLDisplay *current_display = gst_gl_context_get_display(context);
    void* display_ptr = (void*) gst_gl_display_get_handle(current_display);
    if (display_ptr == NULL)
        return FALSE;
    //
    cairo_device_t* device = cairo_glx_device_create(display_ptr,
            *((GLXContext*) gst_gl_context_get_gl_context(context)));
    overlay->image_width = 1920;
    overlay->image_height = 1080;
    surface = cairo_gl_surface_create_for_texture(device,
            CAIRO_CONTENT_COLOR_ALPHA, texture, 1920, 1080);

    cairo_device_destroy(device);

The problem is I am a bit lost about how I can overlay this texture in a normal opengl stream. I have looked into gst_gl_filter_draw_fullscreen_quad and gstgldeinterlace's way of binding to a texture but I am not really sure of the correct way to do.

I think that I always need to do the cairo operations inside the rendering thread, and that is why most filtering functions point to a callback. Correct me if I am wrong but I cannot easily find documentation.

Best regards
Paulo Neves

Best regards
Paulo Neves