Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Cortado in LWJGL  (Read 2194 times)
0 Members and 1 Guest are viewing this topic.
Offline Cero
« Posted 2011-09-28 15:38:12 »

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.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
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 ?

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 50
Projects: 15


★★★★★


« Reply #1 - Posted 2011-09-28 15:59:25 »

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.
Offline Cero
« Reply #2 - Posted 2011-09-28 16:28:09 »

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

Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Online princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #3 - Posted 2011-09-28 20:50:42 »

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 Smiley

Offline Cero
« Reply #4 - Posted 2011-09-28 23:51:51 »

As for decoding - it's simple, just decode directly into a texture instead of a bufferedimage.

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

Online princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #5 - Posted 2011-09-29 00:23:01 »

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

Cas Smiley

Offline Cero
« Reply #6 - Posted 2012-02-21 02:32:17 »

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

Offline Cero
« Reply #7 - Posted 2012-02-21 02:53:26 »

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

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (87 views)
2013-05-17 21:29:12

alaslipknot (95 views)
2013-05-16 21:24:48

gouessej (127 views)
2013-05-16 00:53:38

gouessej (121 views)
2013-05-16 00:17:58

theagentd (129 views)
2013-05-15 15:01:13

theagentd (117 views)
2013-05-15 15:00:54

StreetDoggy (160 views)
2013-05-14 15:56:26

kutucuk (183 views)
2013-05-12 17:10:36

kutucuk (184 views)
2013-05-12 15:36:09

UnluckyDevil (190 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.116 seconds with 20 queries.