Results 1 to 1 of 1
  1. #1
    vlad1918 is offline Member
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Default Using Cortado in a JFrame

    Hello,

    I have a problem that has been bugging me for days. So I decided to post my problem here. I have a client-server project to do. In a nutshell the server has a database of .ogg(or .ogv) files that can be streamed directly through HTTP. So for example if I go to http://localhost/Server?movie_id=1234 I get a response of content type video/ogg and the corresponding stream of bytes.
    My problem comes in constructing the client application. I've chosen to use Cortado which is an Applet that can play ogg file formats. My idea was to extend the applet and put it in a JPanel and then in a JFrame. Code:
    Java Code:
    package foo;
    
    import com.fluendo.player.Cortado;
    
    //Cortado extends java Applet
    public class MyCortado extends Cortado {
    
    	MyCortado(String file) {		
    	    setParam("url", file);		
    	    setParam("local", "false");
    	    setParam("preBuffer", "false");
    	}
    	
    	public void playOgg() {		
    		init();	
    		start();		
    	}
    	
    	public void stopOgg() {
    		stop();
    		destroy();
    	}	
    }
    I've then added MyCortado to a JFrame and it all works fine. Screenshot:



    As you can see the Server is tacking up 91% of CPU but it's ok since it is outputting a movie which is 150 MiB in size to the client that has requested it.
    My problem comes when I press the Stop button which calls the stopOgg() method (see code snippet above). This calls the Applet's stop() and destroy() methods but my server is still tacking up more then 90% of CPU and it's killing my application.
    Here is a screenshot after I press the Stop button:



    So the application has stopped. I even close the client. BUT my server is still using more then 90% of my CPU. The server is still outputting the big file. After 1 or 2 minutes the CPU load suddenly drops. This means that the server has finished outputting.
    So my question is this: Why is my server still outputting the file even after the Applet's stop() and destroy() methods were called? What can I do to kill the outputting of the file after I press the stop button?
    Last edited by vlad1918; 12-22-2010 at 10:49 AM.

Similar Threads

  1. Replies: 5
    Last Post: 06-14-2010, 06:10 PM
  2. JFrame from a JFrame in project
    By anah in forum AWT / Swing
    Replies: 2
    Last Post: 04-19-2010, 06:20 PM
  3. Replies: 6
    Last Post: 04-12-2010, 11:33 AM
  4. Passing data from one JFrame to another JFrame
    By tarami in forum New To Java
    Replies: 3
    Last Post: 08-06-2009, 05:44 PM
  5. Replies: 4
    Last Post: 04-22-2009, 11:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •