]> git.sesse.net Git - vlc/commitdiff
Update snapshot method.
authorPhilippe Morin <phmo95@videolan.org>
Sun, 9 Dec 2007 14:33:18 +0000 (14:33 +0000)
committerPhilippe Morin <phmo95@videolan.org>
Sun, 9 Dec 2007 14:33:18 +0000 (14:33 +0000)
bindings/java/VLCExample.java
bindings/java/src/video-jni.cc

index 72e02a8f144c08a3d8f7bd19d63a2d6a4df487d8..46481172db4326380fb9bd67f59a4ab9a1361baa 100644 (file)
@@ -77,7 +77,7 @@ public class VLCExample
                 System.out.println("real size.");
                 jvlc.video.setFullscreen(false);
                 System.out.print("Taking snapshot... ");
-                jvlc.video.getSnapshot(System.getProperty("user.dir") + "/snap.png");
+                jvlc.video.getSnapshot(System.getProperty("user.dir") + "/snap.png",0,0);
                 System.out.println("taken. (see " + System.getProperty("user.dir") + "/snap.png )");
                 Thread.sleep(2000);
                 System.out.println("Resizing to 300x300");
index 9db7bb086681cfec061c1ccf9ef5a6f8d9e3ec85..64eaac356e482477211620d0c0370d6552e5c152 100644 (file)
 
 /* These are a must*/
 #include <jni.h>
+#include <jawt.h>
 
 #include <vlc/libvlc.h>
+#include <stdio.h>
 
 /* JVLC internal imports, generated by gcjh */
 #include "../includes/Video.h"
 
 #include "utils.h"
-#include <stdio.h>
+
 
 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1toggleFullscreen (JNIEnv *env, jobject _this)
 {
@@ -104,7 +106,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Video__1getWidth (JNIEnv *env, job
     return res;
 }
 
-JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env, jobject _this, jstring filepath) 
+JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env, jobject _this, jstring filepath, jint width, jint height
 {
     INIT_FUNCTION;
     
@@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env,
 
     GET_INPUT_THREAD ;
 
-    libvlc_video_take_snapshot( input, (char *) psz_filepath, &exception );
+    libvlc_video_take_snapshot( input, (char *) psz_filepath,(unsigned int) width,(unsigned int) height, &exception );
 
     libvlc_media_instance_release(input);
     CHECK_EXCEPTION ;