]> git.sesse.net Git - vlc/commitdiff
Make audio functions compliant with current libvlc
authorFilippo Carone <littlejohn@videolan.org>
Tue, 26 Dec 2006 16:41:21 +0000 (16:41 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Tue, 26 Dec 2006 16:41:21 +0000 (16:41 +0000)
bindings/java/README
bindings/java/TODO
bindings/java/VLCExample.java
bindings/java/org/videolan/jvlc/JVLC.java
bindings/java/src/audio-jni.cc

index 6b67ec99ff52346e07c4408ac059aa85f3021bb6..14f33aed03d7e59a83945fd1250fe6afee72d100 100644 (file)
@@ -7,34 +7,26 @@ Usage
 
  In order to use these bindings you have to compile vlc from source. I
 recommend you to take the latest version from videolan svn repository
-(or use at least revison 17559) by doing:
+(or use at least revison 18443) by doing:
 
 svn co svn://svn.videolan.org/vlc/trunk vlc-trunk
 
  bootstrap, clean, set environment variables, configure and build:
 
-./bootstrap && make distclean
+./bootstrap
 
 export JAVA_HOME=/path/to/jvm 
-(for example i have JAVA_HOME=/usr/lib/j2sdk1.5-sun)
+(for example i have JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun)
 
 ./configure --enable-java-bindings && make && make install
 
- If you give a prefix be sure to change the PREFIX variable in the Makefile
-from /usr/local to your prefix.
+ To run a Java VLC example issue (be sure you have an a.avi and a.mp3 files
+in your user.dir folder):
 
- Once you've done with vlc you can run make in jvlc directory. Be sure
-you have gcj, gcjh and if you want to use the SUN Java compiler,
-change the Makefile accordingly. You will probably need to change also 
+java -Djava.library.path=/usr/local/lib VLCExample
 
-JINCLUDES
-LIBJINCLUDES
-
- In the next releases I will automate this process.
-
- To run a Java VLC example issue:
-
-java -Djava.library.path=. VlcClient
+(if you have specified a prefix in configure, change /usr/local/lib to 
+PREFIX/lib)
 
  Be sure your ldconfig can find libjawt.so and libmawt.so or you will
 get linking errors when you run the program.
index 0c3a3f1aa93e03a6f0da22afbc14b03acb89ab74..6afc061e0ab159b29c7280e30857d3d5371b6fae 100644 (file)
@@ -1,21 +1,8 @@
-[MediaControl - in progress]
-* enums will be final classes with private constructor, for type safety
-
-[JNI]
-* mediacontrol
-
 [general]
 * JUnit testing
 
-* configure / make install 
-
-* find a good way to divide CNI and JNI versions (same Java classes,
-  different interfaces) maybe: two JVLC.java classes, one with the
-  System.loadLibray for jni and the other without
-
-[CNI]
-* mediacontrol
-
+[build system]
+* Detect SWT to add the SWTVideoWidget
 
 
 Items are ordered by priority, the first having the highest priority
index 25ab90668e0ca0405041394e9f74a72a95913c68..c6e0fd150d55f47b9b6f3e8744db620c7b6df442 100644 (file)
@@ -1,3 +1,4 @@
+import org.videolan.jvlc.AudioIntf;
 import org.videolan.jvlc.JVLC;
 import org.videolan.jvlc.VLCException;
 
@@ -73,7 +74,7 @@ public class VLCExample
             System.out.print("done.");
             Thread.sleep(3000);
             System.out.print("Setting right channel... ");
-            jvlc.audio.setChannel("right");
+            jvlc.audio.setChannel(AudioIntf.RIGHT_CHANNEL);
             System.out.print("done.");
             Thread.sleep(3000);
             System.out.println("INPUT INFORMATION");
@@ -92,6 +93,7 @@ public class VLCExample
                System.out.println("Something was wrong. I die :(.");
             jvlc.destroy();
             e.printStackTrace();
+            System.exit(0);
         }
         
        System.out.println("Everything fine ;)");
index e204cfb4c7dab7abfa9a3271b567750c4272d8fb..79c535f0654ba60f4904aa48e465f573b4b18e8e 100644 (file)
@@ -149,7 +149,8 @@ public class JVLC implements Runnable {
                                                Thread.sleep(resolution);
                                        } // while playlist running
                                } catch (VLCException e) {
-                                       e.printStackTrace();
+                                       // it is non-sense to show the stacktrace here
+                                       // e.printStackTrace();
                                }
                                inputPlaying = false;
                                inputVout = false;
index 695f8ed1287c55bcca0fb09e77d4a2e7f2edbe59..cf0549f808fd8e0c77e1eaf8f7f089a8dd174a85 100644 (file)
 JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getTrack (JNIEnv *env, jobject _this)
 {
     INIT_FUNCTION;
+    GET_INPUT_THREAD;
+    
     jint res = 0;
     
-    res = libvlc_audio_get_track( ( libvlc_instance_t * ) instance, exception );
+    res = libvlc_audio_get_track( input, exception );
     
     CHECK_EXCEPTION_FREE;
     
@@ -48,8 +50,9 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getTrack (JNIEnv *env, job
 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setTrack (JNIEnv *env, jobject _this, jint value)
 {
     INIT_FUNCTION;
+    GET_INPUT_THREAD;
 
-    libvlc_audio_set_track( ( libvlc_instance_t * ) instance, value, exception );
+    libvlc_audio_set_track( input, value, exception );
 
     CHECK_EXCEPTION_FREE;
 }
@@ -60,7 +63,7 @@ JNIEXPORT jstring JNICALL Java_org_videolan_jvlc_Audio__1getChannel (JNIEnv *env
 
     char* res;
 
-    res = libvlc_audio_get_channel( (libvlc_instance_t *) instance, exception);
+    res = libvlc_audio_get_channel( ( libvlc_instance_t * ) instance, exception);
 
     CHECK_EXCEPTION_FREE;