GL plugin SDL example

Arnaud Loonstra arnaud at sphaero.org
Thu Oct 30 02:00:44 PDT 2014


On 10/30/2014 09:17 AM, Matthew Waters wrote:
> On 30/10/14 05:11, Arnaud Loonstra wrote:
>> Hi all,
>>
>> I'm testing the new gl plugins of 1.4. The generic example runs fine
>> even in Python. Now I'm trying to run the SDL example:
>>
>> http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/tests/examples/gl/sdl/sdlshare.c
>>
>
> Basically the sdl examples fail because of
> http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/tests/examples/gl/sdl/sdlshare.c#n291
>
> That is, SDL uses a different X Display connection to initialize the
> OpenGL context.  It is required (at least on intel) that the X Display
> connections for SDL and gstgl be the same for GL context sharing to
> occur.  If they aren't and the program references an object in another
> GL context that's not shared, you will get the error:
>
> intel_do_flush_locked failed: No such file or directory
>
> Now, it just so happens that the information is available and the
> example was doing the wrong thing :).  That following commit fixes the
> error and displays the triangle and textured rectangle correctly on intel.
>
> http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?h=1.4&id=8d41da18848ff4f56af283496179106e163bcba8
>
> It still needs more work to avoid displaying the black screen on my
> nvidia card though.

I tried the fix but to no avail. I still get the intel_do_flush_locked 
failed error.

 From what I understand is that the generic example creates the 
glcontext thus you can operate on it using gl commands.
The SDL example uses a different approach in which SDL creates the GL 
context which you pass to gstreamer through the gleffects element's 
other-context property. Then a fakesink is used to pass a GstBuffer from 
the fakesink to SDL. (Does the buffer remain in GPU mem that way?)

So the challenge now is to get gl context sharing working on Linux?

Rg,

Arnaud
-- 
w: http://www.sphaero.org
t: http://twitter.com/sphaero
g: http://github.com/sphaero
i: freenode: sphaero_z25


More information about the gstreamer-devel mailing list