Commit fbe32b99 authored by Philippe Morin's avatar Philippe Morin
Browse files

Update snapshot method.

parent 181b5884
...@@ -77,7 +77,7 @@ public class VLCExample ...@@ -77,7 +77,7 @@ public class VLCExample
System.out.println("real size."); System.out.println("real size.");
jvlc.video.setFullscreen(false); jvlc.video.setFullscreen(false);
System.out.print("Taking snapshot... "); 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 )"); System.out.println("taken. (see " + System.getProperty("user.dir") + "/snap.png )");
Thread.sleep(2000); Thread.sleep(2000);
System.out.println("Resizing to 300x300"); System.out.println("Resizing to 300x300");
......
...@@ -25,14 +25,16 @@ ...@@ -25,14 +25,16 @@
/* These are a must*/ /* These are a must*/
#include <jni.h> #include <jni.h>
#include <jawt.h>
#include <vlc/libvlc.h> #include <vlc/libvlc.h>
#include <stdio.h>
/* JVLC internal imports, generated by gcjh */ /* JVLC internal imports, generated by gcjh */
#include "../includes/Video.h" #include "../includes/Video.h"
#include "utils.h" #include "utils.h"
#include <stdio.h>
JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1toggleFullscreen (JNIEnv *env, jobject _this) 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 ...@@ -104,7 +106,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Video__1getWidth (JNIEnv *env, job
return res; 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; INIT_FUNCTION;
...@@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env, ...@@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env,
GET_INPUT_THREAD ; 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); libvlc_media_instance_release(input);
CHECK_EXCEPTION ; CHECK_EXCEPTION ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment