[libbluray-devel] Added SeekPlayitemN, SelectRateN and UpdateGraphicsN
hpi1
git at videolan.org
Fri Sep 14 14:46:07 CEST 2012
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Sep 14 11:32:36 2012 +0300| [425ca7fa59f84dd9f0530989f674beff56a94e50] | committer: hpi1
Added SeekPlayitemN, SelectRateN and UpdateGraphicsN
(merge from dslibbluray)
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=425ca7fa59f84dd9f0530989f674beff56a94e50
---
src/libbluray/bdj/java/org/videolan/Libbluray.java | 25 ++++++++++++--
src/libbluray/bdj/native/org_videolan_Libbluray.c | 24 +++++++++++++
src/libbluray/bdj/native/org_videolan_Libbluray.h | 36 +++++++++++++++++++-
3 files changed, 82 insertions(+), 3 deletions(-)
diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index b9cf54b..b4c94a2 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -76,6 +76,16 @@ public class Libbluray {
return result;
}
+ public static long seekPlayItem(int clip) {
+ if (clip < 0)
+ throw new IllegalArgumentException("Mark cannot be negative");
+
+ long result = seekPlayItemN(nativePointer, clip);
+ if (result == -1)
+ throw new IllegalArgumentException("Seek error");
+ return result;
+ }
+
public static boolean selectPlaylist(int playlist) {
if (playlist < 0)
throw new IllegalArgumentException("Playlist cannot be negative");
@@ -124,6 +134,10 @@ public class Libbluray {
return tellTimeN(nativePointer);
}
+ public static boolean selectRate(float rate) {
+ return selectRateN(nativePointer, rate) == 1 ? true : false;
+ }
+
public static void writeGPR(int num, int value) {
int ret = writeGPRN(nativePointer, num, value);
@@ -156,6 +170,10 @@ public class Libbluray {
return getBdjoN(nativePointer, name);
}
+ public static void updateGraphic(int width, int height, int[] rgbArray) {
+ updateGraphicN(nativePointer, width, height, rgbArray);
+ }
+
public static final int PSR_IG_STREAM_ID = 0;
public static final int PSR_PRIMARY_AUDIO_ID = 1;
public static final int PSR_PG_STREAM = 2;
@@ -189,8 +207,6 @@ public class Libbluray {
public static final int PSR_BACKUP_PSR11 = 43;
public static final int PSR_BACKUP_PSR12 = 44;
- protected static long nativePointer = 0;
-
private static native TitleInfo getTitleInfoN(long np, int title);
private static native PlaylistInfo getPlaylistInfoN(long np, int playlist);
private static native int getTitlesN(long np);
@@ -200,6 +216,7 @@ public class Libbluray {
private static native long chapterPosN(long np, int chapter);
private static native int getCurrentChapterN(long np);
private static native long seekMarkN(long np, int mark);
+ private static native long seekPlayItemN(long np, int clip);
private static native int selectPlaylistN(long np, int playlist);
private static native int selectTitleN(long np, int title);
private static native int selectAngleN(long np, int angle);
@@ -209,9 +226,13 @@ public class Libbluray {
private static native int getCurrentAngleN(long np);
private static native long tellN(long np);
private static native long tellTimeN(long np);
+ private static native int selectRateN(long np, float rate);
private static native int writeGPRN(long np, int num, int value);
private static native int writePSRN(long np, int num, int value);
private static native int readGPRN(long np, int num);
private static native int readPSRN(long np, int num);
private static native Bdjo getBdjoN(long np, String name);
+ private static native void updateGraphicN(long np, int width, int height, int[] rgbArray);
+
+ protected static long nativePointer = 0;
}
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 8097e11..8a15c7e 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -190,6 +190,12 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekMarkN(JNIEnv * env,
return bd_seek_mark(bdj->bd, mark);
}
+JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekPlayItemN(JNIEnv * env,
+ jclass cls, jlong np, jint clip) {
+ BDJAVA* bdj = (BDJAVA*) np;
+ return bd_seek_playitem(bdj->bd, clip);
+}
+
JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectPlaylistN(
JNIEnv * env, jclass cls, jlong np, jint playlist) {
BDJAVA* bdj = (BDJAVA*) np;
@@ -244,6 +250,12 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_tellTimeN(JNIEnv * env,
return bd_tell_time(bdj->bd);
}
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN(JNIEnv * env,
+ jclass cls, jlong np, jfloat rate) {
+ BDJAVA* bdj = (BDJAVA*) np;
+ return 1;
+}
+
JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writeGPRN(JNIEnv * env,
jclass cls, jlong np, jint num, jint value) {
BDJAVA* bdj = (BDJAVA*) np;
@@ -256,6 +268,12 @@ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readGPRN(JNIEnv * env,
return bd_gpr_read(bdj->reg, num);
}
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN(JNIEnv * env,
+ jclass cls, jlong np, jint num, jint value) {
+ BDJAVA* bdj = (BDJAVA*) np;
+ return bd_psr_write(bdj->reg, num, value);
+}
+
JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readPSRN(JNIEnv * env,
jclass cls, jlong np, jint num) {
BDJAVA* bdj = (BDJAVA*) np;
@@ -274,3 +292,9 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env,
return bdjo;
}
+
+JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
+ jclass cls, jlong np, jint width, jint height, jintArray rgbArray) {
+
+ BDJAVA* bdj = (BDJAVA*) np;
+}
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.h b/src/libbluray/bdj/native/org_videolan_Libbluray.h
index eaed2a0..e933f59 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.h
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.h
@@ -1,5 +1,7 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
+
+#include "jni.h"
+
/* Header for class org_videolan_Libbluray */
#ifndef _Included_org_videolan_Libbluray
@@ -81,6 +83,14 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekMarkN
/*
* Class: org_videolan_Libbluray
+ * Method: seekPlayItemN
+ * Signature: (JI)J
+ */
+JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekPlayItemN
+ (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class: org_videolan_Libbluray
* Method: selectPlaylistN
* Signature: (JI)I
*/
@@ -153,6 +163,14 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_tellTimeN
/*
* Class: org_videolan_Libbluray
+ * Method: selectRateN
+ * Signature: (JF)I
+ */
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN
+ (JNIEnv * env, jclass cls, jlong np, jfloat rate);
+
+/*
+ * Class: org_videolan_Libbluray
* Method: writeGPRN
* Signature: (JII)I
*/
@@ -169,6 +187,14 @@ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readGPRN
/*
* Class: org_videolan_Libbluray
+ * Method: writePSRN
+ * Signature: (JII)I
+ */
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN
+ (JNIEnv *, jclass, jlong, jint, jint);
+
+/*
+ * Class: org_videolan_Libbluray
* Method: readPSRN
* Signature: (JI)I
*/
@@ -182,6 +208,14 @@ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readPSRN
*/
JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv *, jclass, jlong, jstring);
+/*
+ * Class: org_videolan_Libbluray
+ * Method: updateGraphicN
+ * Signature: (JI)I
+ */
+JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
+ jclass, jlong, jint, jint, jintArray);
+
#ifdef __cplusplus
}
#endif
More information about the libbluray-devel
mailing list