GNOME Bugzilla – Bug 749734
gltransformation: black screen (or crash) on Windows
Last modified: 2015-08-16 13:38:36 UTC
With today's gst master, using this pipeline: gst-launch-1.0 playbin uri=<some h264 mp4> video_sink="glupload ! glcolorconvert ! gltransformation ! glimagesink" On linux I get a black screen. On windows I get a crash. If I remove gltransformation from the pipeline then it works perfectly on both linux and windows.
Backtrance on windows: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1052.0x87c] 0x00000001800bca78 in ?? () from /cygdrive/c/Windows/system32/ig4icd64.dll (gdb) bt
+ Trace 235082
Using this pipeline has the same effect: gst-launch-1.0 videotestsrc ! glupload ! glcolorconvert ! gltransformation ! glimagesink The backtrance in previous comment was corrupted. I debugged it step by step in gdb on windows, and here is where it really crash:
+ Trace 235083
This is a regression introduced by commit 7f7a9dd3ec5851cc52b719317573bc70d0e91fbf. I'm suspecting we are in a case where triangles doesn't get created and then gl->DrawElements is called with indices that doesn't reffer to anything.
Created attachment 303840 [details] [review] gltransformation: fix black image
I'm not sure why, but this fix the problem :P
commit 9dcefacb3d30280ea25d74c30807d397ebac72a1 Author: Matthew Waters <matthew@centricular.com> Date: Mon May 25 17:27:58 2015 +1000 gltransformation: fix DrawElements call for element array buffers https://bugzilla.gnome.org/show_bug.cgi?id=749734
Actually, with your patch it still crash. If I revert it and apply mine, it works fine.
Created attachment 306313 [details] [review] gltransformation: Fix crash on win32 with intel driver
I'm not sure to understand how it works, but this patch fix my problem. I copied what's done in other modules like glfiltercube and gloverlay, so it's probably the right thing to do.
Oops, I believe I already fixed it before seeing your patch commit 2b9dddbafe89e05e715b0dce74f2f5e130830968 Author: Matthew Waters <matthew@centricular.com> Date: Tue Jul 7 15:30:17 2015 +1000 gltransformation: correct vao usage keep the vao bound after uploading the new vertex data fixes a mesa GL error "no vertex array object bound" on caps changes
When I compare with code in gstglcubefilter.c, it makes sure to unbind everything before leaving if (!cube_filter->vertex_buffer) {} block, then re-bind them. With your patch in gstgltransformation it doesn't unbind stuff before re-binding them, is it fine? For example, it's fine to call gl->BindVertexArray (transformation->vao); twice without doing gl->BindVertexArray (0) between the 2 calls?
Yes, GL is a big state machine. As long as the correct state is in place then everything will work.