[libbluray-devel] Signal frame buffer dirty area to application

hpi1 git at videolan.org
Tue Apr 23 22:04:56 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Apr 23 15:35:06 2013 +0300| [13dcd4485fc50815279259720bc4ac66ad90ffc5] | committer: hpi1

Signal frame buffer dirty area to application

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=13dcd4485fc50815279259720bc4ac66ad90ffc5
---

 src/libbluray/bdj/java/java/awt/BDRootWindow.java  |    6 +++---
 src/libbluray/bdj/java/org/videolan/Libbluray.java |   10 +++++-----
 src/libbluray/bdj/native/org_videolan_Libbluray.c  |    7 ++++---
 src/libbluray/bdj/native/org_videolan_Libbluray.h  |    4 ++--
 4 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/libbluray/bdj/java/java/awt/BDRootWindow.java b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
index 1f8829d..822be9e 100644
--- a/src/libbluray/bdj/java/java/awt/BDRootWindow.java
+++ b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
@@ -85,10 +85,10 @@ public class BDRootWindow extends Frame {
                 timerTask = null;
             }
             changeCount = 0;
-            //Libbluray.updateGraphic(getWidth(), getHeight(), backBuffer, dirty.x, dirty.y, dirty.width, dirty.height);
-            Libbluray.updateGraphic(getWidth(), getHeight(), backBuffer);
 
-            dirty.setBounds(getWidth(), getHeight(), 0, 0);
+            Libbluray.updateGraphic(getWidth(), getHeight(), backBuffer, dirty.x, dirty.y, dirty.width, dirty.height);
+
+            dirty.setBounds(0xffff, 0xffff, 0, 0);
         }
     }
 
diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index a5074a0..8ab3cb2 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -296,12 +296,13 @@ public class Libbluray {
     }
 
     public static void updateGraphic(int width, int height, int[] rgbArray) {
-        updateGraphicN(nativePointer, width, height, rgbArray);
+        updateGraphicN(nativePointer, width, height, rgbArray,
+                       0, 0, width - 1, height - 1);
     }
 
     public static void updateGraphic(int width, int height, int[] rgbArray,
                                      int x0, int y0, int x1, int y1) {
-        updateGraphicDirtyN(nativePointer, width, height, rgbArray,
+        updateGraphicN(nativePointer, width, height, rgbArray,
                        x0, y0, x1, y1);
     }
 
@@ -434,9 +435,8 @@ public class Libbluray {
     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);
-    private static native void updateGraphicDirtyN(long np, int width, int height, int[] rgbArray,
-                                                   int x0, int y0, int x1, int y1);
+    private static native void updateGraphicN(long np, int width, int height, int[] rgbArray,
+                                              int x0, int y0, int x1, int y1);
 
     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 6723b69..5ff9477 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -392,7 +392,8 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env,
 }
 
 JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
-        jclass cls, jlong np, jint width, jint height, jintArray rgbArray) {
+        jclass cls, jlong np, jint width, jint height, jintArray rgbArray,
+        jint x0, jint y0, jint x1, jint y1) {
 
     BDJAVA* bdj = (BDJAVA*)(intptr_t)np;
 
@@ -437,7 +438,7 @@ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
         jint *image = (jint *)(*env)->GetPrimitiveArrayCritical(env, rgbArray, NULL);
         if (image) {
             bdj->osd_cb(bdj->bd, (const unsigned *)image, (int)width, (int)height,
-                        0, 0, width-1, height-1);
+                        x0, y0, x1, y1);
             (*env)->ReleasePrimitiveArrayCritical(env, rgbArray, image, JNI_ABORT);
         } else {
             BD_DEBUG(DBG_BDJ | DBG_CRIT, "GetPrimitiveArrayCritical() failed\n");
@@ -591,7 +592,7 @@ Java_org_videolan_Libbluray_methods[] =
     },
     {
         CC("updateGraphicN"),
-        CC("(JII[I)V"),
+        CC("(JII[IIIII)V"),
         VC(Java_org_videolan_Libbluray_updateGraphicN),
     },
 };
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.h b/src/libbluray/bdj/native/org_videolan_Libbluray.h
index 516a7c2..ab87c7a 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.h
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.h
@@ -311,10 +311,10 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN
 /*
  * Class:     org_videolan_Libbluray
  * Method:    updateGraphicN
- * Signature: (JII[I)V
+ * Signature: (JII[IIIII)V
  */
 JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN
-  (JNIEnv *, jclass, jlong, jint, jint, jintArray);
+(JNIEnv *, jclass, jlong, jint, jint, jintArray, jint, jint, jint, jint);
 
 #ifdef __cplusplus
 }



More information about the libbluray-devel mailing list