<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body
style="font-family: Avenir;" bgcolor="#FFFFFF" text="#000000">
<div style="font-family: Avenir;"><span style="font-family: Avenir;">Hello,
<br><br>This is a newbie question and I already had a lot of help from
the IRC channel in compiling from cerbero, but I can't find a simple
solution for this problem.<br><br>My pipeline looks like this :
videotestsrc -> videoconvert -> glfilterapp -> appsink (with
callback)<br>I try to get a valid OpenGL texture from the appsink's
callback and to display it in an NSOpenGLView. <br><br>It looks like I
manage to get one via : <br><br>GstVideoFrame frame;<br>GstVideoInfo
info;<br> <br>gst_video_info_init(&info);<br>gst_video_info_from_caps(&info,
caps);<br><br>if (gst_video_frame_map(&frame, &info, buf,
(GstMapFlags)(GST_MAP_READ | GST_MAP_GL))) </span><span><span
style="font-family: Avenir;">// </span><span><span style="font-family:
Avenir;">(GST_MAP_FLAG_LAST << 1)</span> ?</span> </span><br><span
style="font-family: Avenir;">{ </span><br><span style="font-family:
Avenir;"> <br> GLuint tex = </span><span><span
style="font-family: Avenir;">(*(guint *) frame.data[0]);<br>
gst_video_frame_unmap(&frame);<br></span> <br>}</span><span
style="font-family: Avenir;"><br><br>It returns a texture ID between 5
and 8.<br><br>Actually I got this code from various places and I don't
really understand what I'm doing with the flags. <br>But when I'm
passing the texture to my NSOpenGLView it only display white. <br>The
OpenGL Profiler tool tells me that I have (obviously) 2 contexts
running. <br><br>So I tried to create a shared context via : <br><br>GstGLDisplay
*display = gst_gl_display_new();<br>GstGLContext *ctx =
gst_gl_context_new_wrapped(display, (guintptr)cgl_ctx,
GST_GL_PLATFORM_CGL, GST_GL_API_ANY);<br>gst_gl_context_create(context,
ctx, NULL); // to share the 2 contexts if I understand well<br><br>where
"cgl_ctx" is a CGLContextObj I get from my NSOpenGLView and "context"
the context I want to pass to the appsink.<br><br>First, I have this
error : [GLib-CRITICAL **: g_hash_table_insert_internal: assertion
'hash_table != NULL' failed].<br>When I play the pipeline, I have this
other error : [GStreamer-CRITICAL **: gst_object_unref: assertion
'object != NULL' failed]<br></span><span><span style="font-family:
Avenir;">The 2 errors disappear if I don't create the context.</span> </span><br><br>Second,
I don't know how to pass the context (if it is well created) to the
glfilterapp element in order (I guess) to have a texture from the
appsink in the shared context. <br><br>I know this is a usual question,
but any advice would really be great ! <br>Thank you. <br><br>Benoît.<span
style="font-family: Avenir;"></span><br><div class="moz-signature">
<br>
</div></div>
</body>
</html>