[MPlayer-dev-eng] Help about JNI invoking mplayer

Hu, Yu yhu at cti.depaul.edu
Thu Oct 21 00:12:22 CEST 2004


Hi, 

  I am doing some work to to find a wmv decoder working with java code
under mac.

  So far I think the best solution is to invoke mplayer by JNI.

  Thus I changed the mplayer source code, made the main() function as a
mplayer(string file) function and compiled the whole mplayer as a
jnilib.

  It can work pretty well when I am using java application.

  Since my original code is java applet, I tried to invoke mplayer in
java signed applet.

  This time I got some trouble. 

  The program crashed every time when it just got started.

  The err output by mplayer is:

  (Actually I have already shielded the signal 10 in mplayer code using
signal(SIGBUS,SIG_IGN) but it seems that the signal is caught by system)

"

  Playing mms://aaa/bbb.wmv

  Resolving aaa for AF_INET6...

  Couldn't resolve name for AF_INET6:aaa

  Resolving aaa for AF_INET...

  Connecting to server aaa[111.222.333.444]:1755...

  Connected

 

******

  Another exception has been detected while we were handling last error.

Dumping information about last error:

Error REPORT FILE=xxxx.log

PC =...

SIGNAL= 10

FUNCTION NAME= (N/A)

OFFSET=0xFFFFFF

LIBRARY NAME=libSample.jnilib

 

Trace/BPT trap"

 

My applet code :

 

 

 

import java.awt.*;

import java.io.*;

import java.lang.*;

import java.applet.*;

 

public class Sample extends Applet {

         

         public native int play(String playfile);

 

 

  public void init() {

    

  }

 

  public void paint(Graphics g) {

         try {

                   System.loadLibrary("Sample");

                   Sample sample= new Sample();

                   sample.play("mms://aaaa/bbbb.wmv");

                g.drawString("Successfully wrote to the file named  --
go take a look at it!", 10, 10);

         }

 

 

         catch (SecurityException e) {

           g.drawString("writeFile: caught security exception"+e, 10,
10);

        }

   }

}

 

included in htm code:

 

<applet code=Sample.class archive="signedjni.jar" width=500 height=50>

</applet>

 

Thanks for your help

 

Yu

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20041020/99b7577f/attachment.htm>


More information about the MPlayer-dev-eng mailing list