Login  Register

Re: TextureNames creation failed when calling GLMediaPlayer.initGL with multiple players

Posted by asambol on Jan 20, 2016; 11:54am
URL: https://forum.jogamp.org/TextureNames-creation-failed-when-calling-GLMediaPlayer-initGL-tp4033009p4036054.html

I managed to reproduce it in MovieSimple after a lot of code cutting. At first, I couldn't get MovieSimple demo to spawn four windows within 1 millisecond (usually 20+ ms per window), whereas in our framework all windows take a total of 1 millisecond to initialise (not sure how something built with Jogl can be faster than raw demo itself, using the same jars, but I'll take that as a compliment :)). The problem only occurrs if initStream() is called within a few milliseconds multiple times for multiple GLMediaPlayers.

The only way I could get MovieSimple to load them that fast was turning off NEWT window initialisation and rendering completely.

The following piece of code gives GLMediaPlayers stuck in Uninitialised state roughly 50% of the time, with the same threads deadlocked as in post above:
        for(int i=0; i<windowCount; i++) {
            mss[i] = new MovieSimpleDeadlock(null);
            mss[i].initStream(defURI, vid, aid, textureCount);
            System.out.println("Init stream " + System.currentTimeMillis());
        }
       
        while (true) {
        for(int i=0; i<windowCount; i++) {
            System.out.println(mss[i].mPlayer.getState());
        }
        }

Should I submit a bug report?

Whole modified MovieSimple runnable demo:
<nabble_a href="MovieSimpleDeadlock.java">MovieSimpleDeadlock.java

EDIT: Seems like attaching files doesn't work, here it is again: http://pastebin.com/2n6r81vf