<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    0x0502 is GL_INVALID_OPERATION which is interesting.<br>
    <br>
    Are you sure you your wrapped GL context is actually active?
    (gst_gl_context_activate() does not change anything about wrapped GL
    contexts, it only signals to GStreamer that some other code has
    activated the OpenGL context).  gst_gl_context_get_current_context
    (GST_GL_PLATFORM_EGL) must equal state->context.<br>
    <br>
    Second thing, you must not add a wrapped OpenGL context to the
    display with gst_gl_display_add_context().  That will cause weird
    failures.<br>
    <br>
    Cheers<br>
    -Matt<br>
    <br>
    <div class="moz-cite-prefix">On 24/9/21 3:36 am, Lusine Hayrapetyan
      via gstreamer-devel wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAO4TkMhAHtw7=c69SkbOJH15sYx+swrPZ+jwbcoo5BR4+dyKSg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Folks,
        <div><br>
        </div>
        <div>I'm getting the following error from <font size="1">gst_gl_context_fill_info
          </font>function:</div>
        <div><font size="1"><i> " glGetString error: 0x502"</i></font><br>
        </div>
        <div><font size="1"><i><br>
            </i></font></div>
        <div>This is my code:</div>
        <div><font size="1"> state->x_gst_display =
            gst_gl_display_x11_new_with_display(state->xdisplay);<br>
 gst_gl_display_filter_gl_api(GST_GL_DISPLAY(state->x_gst_display),
            GST_GL_API_GLES2);<br>
            <br>
             state->gl_context =<br>
                   
            gst_gl_context_new_wrapped(GST_GL_DISPLAY(state->x_gst_display),<br>
                    (guintptr)state->context, GST_GL_PLATFORM_EGL,
            GST_GL_API_GLES2);<br>
            <br>
                if (
            !gst_gl_display_add_context(GST_GL_DISPLAY(state->x_gst_display),
            state->gl_context))<br>
                    g_print("Failed to add gl_context to display\n");<br>
            <br>
                if (!gst_gl_context_activate(state->gl_context,
            TRUE))<br>
                    g_print("gst_gl_context_activate failed!");<br>
            <br>
                if (!gst_gl_context_fill_info(state->gl_context,
            &error)) // This line produces the error<br>
                {<br>
                    g_printerr ("Error received from
            gst_gl_context_fill_info %s\n", error->message);<br>
                    return -1;<br>
                }<i><br>
            </i></font></div>
        <div><br>
        </div>
        <div>Here is the output of gl*:7</div>
        <div><font size="1"><br>
          </font></div>
        <div><font size="1">0:00:01.485389528 687728 0x55a54a1e5380
            TRACE              gldisplay
            gstgldisplay.c:206:gst_gl_display_init: init 0x55a54abb3090<br>
            0:00:01.486088690 687728 0x55a54a1e5380 TRACE            
             gldisplay gstgldisplay.c:206:gst_gl_display_init: init
            0x55a54abf8100<br>
            0:00:01.486204108 687728 0x55a54a1e5380 TRACE            
             gldisplay
            gstgldisplay.c:508:gst_gl_display_filter_gl_api:<gldisplayx11-0>
            filtering with api gles2<br>
            0:00:01.486301157 687728 0x55a54a1e5380 DEBUG            
             gldisplay
            gstgldisplay.c:956:gst_gl_display_add_context:<gldisplayx11-0>
            Adding GL context <glwrappedcontext0><br>
            0:00:01.486334198 687728 0x55a54a1e5380 DEBUG            
             gldisplay
            gstgldisplay.c:963:gst_gl_display_add_context:<gldisplayx11-0>
            successfully inserted context <glwrappedcontext0><br>
            0:00:01.486354854 687728 0x55a54a1e5380 DEBUG            
             glcontext
            gstglcontext.c:783:gst_gl_context_activate:<glwrappedcontext0>
            activate:1<br>
            0:00:01.486572233 687728 0x55a54a1e5380 INFO              
            glcontext
            gstglcontext.c:1121:_create_context_info:<glwrappedcontext0>
            GL_VERSION: OpenGL ES 3.2 Mesa 21.0.1<br>
            0:00:01.486603926 687728 0x55a54a1e5380 INFO              
            glcontext
            gstglcontext.c:1123:_create_context_info:<glwrappedcontext0>
            GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 3.20<br>
            0:00:01.486635954 687728 0x55a54a1e5380 INFO              
            glcontext
            gstglcontext.c:1126:_create_context_info:<glwrappedcontext0>
            GL_VENDOR: Mesa/X.org<br>
            0:00:01.486668872 687728 0x55a54a1e5380 INFO              
            glcontext
            gstglcontext.c:1128:_create_context_info:<glwrappedcontext0>
            GL_RENDERER: llvmpipe (LLVM 11.0.1, 256 bits)<br>
            Error received from gst_gl_context_fill_info glGetString
            error: 0x502</font><br>
        </div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Lusine</div>
      </div>
    </blockquote>
    <br>
  </body>
</html>