Sharing EGL context with glimagesink

Jorge Fernandez Monteagudo jorgefm at
Tue Oct 6 05:52:17 PDT 2015


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.

Now I have the next vars initialized ok (I can paint using gl commands)

EGLDisplay dpy;
EGLSurface surface;
EGLContext context;

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.
  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 );
  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 at 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 at entry=0x37b2ec) at src/glcore/gc_es_fbo.c:998
#1  0x768cba1c in __glInitContextState (gc=gc at 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 at entry=0x262204, Context=Context at entry=0x37b1cc, Config=0x1b5f0c, Config at 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?


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.

More information about the gstreamer-devel mailing list