<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 06/10/15 23:52, Jorge Fernandez Monteagudo wrote:<br>
    <blockquote
cite="mid:%3C6A230045C5A9854B97A1D40971AC8BE1520222C6@NTMBOX.central.cirsa.com%3E"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">Hi,

I'm trying to share the main EGL context from my application and the glimagesink element
from the pipeline I'm implementing, using the 'other-context' field. I'm trying to paint the
texture with the video frame with my code.
</pre>
      </div>
    </blockquote>
    <br>
    glimagesink in 1.6 does not have an 'other-context' property anymore
    and so that information needs to be provided with GstContext. See <a
href="http://ystreet00.blogspot.com.au/2015/09/gstreamer-16-and-opengl-contexts.html"><a class="moz-txt-link-freetext" href="http://ystreet00.blogspot.com.au/2015/09/gstreamer-16-and-opengl-contexts.html">http://ystreet00.blogspot.com.au/2015/09/gstreamer-16-and-opengl-contexts.html</a></a>
    for the details.<br>
    <br>
    <blockquote
cite="mid:%3C6A230045C5A9854B97A1D40971AC8BE1520222C6@NTMBOX.central.cirsa.com%3E"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">Now I have the next vars initialized ok (I can paint using gl commands)

EGLDisplay dpy;
EGLSurface surface;
EGLContext context;
</pre>
      </div>
    </blockquote>
    <br>
    The question is if you can actually simply use the EGLDisplay
    without first going through the winsys, wayland/X11/dispmanx/etc. 
    Android is the only platform that I know of that will allow using
    the EGLDisplay natively without first having an existing display
    connection.  Essentially you must pass the winsys display handle if
    you have it over the EGLDisplay handle.<br>
    <br>
    <blockquote
cite="mid:%3C6A230045C5A9854B97A1D40971AC8BE1520222C6@NTMBOX.central.cirsa.com%3E"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">and the 'eglMakeCurrent(dpy, surface, surface, context)' call returns success.
Then I set up the pipeline and the glimagesink with:

  GstGLDisplay *glDisplay;
  GstGLContext *glContext;
 ...

  // Set glimagesink gl context.
  eglMakeCurrent( dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
  glDisplay = (GstGLDisplay *)gst_gl_display_egl_new_with_egl_display( dpy );
  glContext = gst_gl_context_new_wrapped( glDisplay, (guintptr) context, GST_GL_PLATFORM_EGL, GST_GL_API_GLES1 );</pre>
      </div>
    </blockquote>
    <br>
    Just a note that we don't actually support the GST_GL_API_GLES1
    API.  If you're actually using GLES1-only api calls I'm afraid this
    will not work at all.<br>
    <br>
    That should help you along the way.<br>
    <br>
    Cheers<br>
    -Matt<br>
    <br>
    <blockquote
cite="mid:%3C6A230045C5A9854B97A1D40971AC8BE1520222C6@NTMBOX.central.cirsa.com%3E"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">  g_object_set( G_OBJECT(glimagesink), "other-context", glContext, NULL );
  eglMakeCurrent( dpy, surface, surface, context );
  printf( "glDisplay=%p   glContext=%p\n", glDisplay, glContext );

When I run the code I see the printf trace

glDisplay=0x24c78   glContext=0x255848

and the backtrace

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x713fc460 (LWP 15929)]
__glInitFramebufferStates (gc=gc@entry=0x37b2ec) at src/glcore/gc_es_fbo.c:998
998     src/glcore/gc_es_fbo.c: No such file or directory.
(gdb) bt
#0  __glInitFramebufferStates (gc=gc@entry=0x37b2ec) at src/glcore/gc_es_fbo.c:998
#1  0x768cba1c in __glInitContextState (gc=gc@entry=0x37b2ec) at src/glcore/gc_es_context.c:702
#2  0x768cc048 in __glCreateContext (clientVersion=<optimized out>, imports=0x713fbc88, sharedCtx=0x22e974) at src/glcore/gc_es_context.c:1043
#3  0x76d1b504 in _CreateApiContext (Thread=Thread@entry=0x262204, Context=Context@entry=0x37b1cc, Config=0x1b5f0c, Config@entry=0x31be, SharedContext=0x22e974)
    at gc_egl_context.c:593
#4  0x76d1bdf4 in eglCreateContext (Dpy=0x1b4204, config=<optimized out>, SharedContext=0x1b77dc, attrib_list=0x713fbd6c) at gc_egl_context.c:1385
Backtrace stopped: Cannot access memory at address 0x302a


Any hint?

Regards


Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o CONFIDENCIAL. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.

This message is intended exclusively for its addressee and may contain information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.
</pre>
      </div>
    </blockquote>
    <br>
  </body>
</html>