Cortado in LWJGL

Yeah not having LWJGL as an applet but rather adding some applet to it.

I have this ongoing quest of getting video playback to work properly; now Cortado is an applet that plays theora.

public class VideoPlayerCortado extends JFrame
 {
    private Cortado cortado;

    public VideoPlayerCortado()
    {
        cortado = new Cortado();
        cortado.setBounds(0, 0, this.getWidth(), this.getHeight());        
        
        cortado.setVisible(true);
        cortado.init();
        cortado.restart();

        this.getContentPane().add((Panel)cortado);

        setIgnoreRepaint(true);
        
        cortado.doPlay();
    }
	..
}

Deleted everything thats not important: This is how I add an applet to a JFrame.
Can I add an applet to a LWJGL Display, and if so, how ?

What you’re essentially asking is if you can embed an AWT/Swing component inside LWJGL’s Display (i.e. an OpenGL Context) to which I’d say its probably not possible. What you probably want to look at is how Cortado is drawing the video (to a texture/image of some sort?). Then you need to basically get this data and put it into an OpenGL texture, which can be drawn as you like in OpenGL/LWJGL.

I guess there was this thread: http://www.java-gaming.org/topics/cortado-works/21933/view.html

But the video playback in all of jME3 is now deprecated, so it seems like a failure and not sure if Cas got it working
dont remember video in ROTT, only played the demo though

I did get it working … a bit. It was strangely unreliable - most ogg streams simply didn’t work. I was waiting for someone to make the theora decoder more robust before I looked at it again.
As for decoding - it’s simple, just decode directly into a texture instead of a bufferedimage.

Cas :slight_smile:

Yeah I can’t even find it - the source is not too simple.
Do you still have that code from back then ?

No, I think I gave up on it and started looking at Xuggle, then sort of gave up on that for now too.

Cas :slight_smile:

actually Cortado is still being developed.
you get it nowhere but the git repository: http://git.xiph.org/?p=cortado.git;a=summary
but here you can see that last update was last month

and there is a examples/VideoDump.java

which, I’m sure, holds everything one would need to make a opengl texture out of the stream

VideoDump.java: http://git.xiph.org/?p=cortado.git;a=blob;f=src/com/fluendo/examples/DumpVideo.java;h=47f01dce253cddb60f7fa0287d519038bad4a9ae;hb=HEAD

If someone tries to get the latest git source running, a couple of things dont work right off

  • one audio class has problems, but since I will be using OpenAl and a seperate file for audio, it doesnt matter anyway (no audio makes cortado work pretty nicely), I just deleted the class, works fine
  • Configure and SourceInfo classes are missing, but you dont need them, its only for some info output