[libbluray-devel] Forward BD-J rate changes to application

hpi1 git at videolan.org
Sun Mar 23 12:32:25 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Mar 22 22:16:47 2014 +0200| [758d47ffa7e2d4a18aaaf8d540f7d48613c1151a] | committer: hpi1

Forward BD-J rate changes to application

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

 src/libbluray/bdj/native/org_videolan_Libbluray.c |    2 ++
 src/libbluray/bluray.c                            |   14 ++++++++++++++
 src/libbluray/bluray_internal.h                   |    2 ++
 3 files changed, 18 insertions(+)

diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 3135f18..f6c27e9 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -330,6 +330,8 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_tellTimeN(JNIEnv * env,
 
 JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN(JNIEnv * env,
         jclass cls, jlong np, jfloat rate, jint reason) {
+    BDJAVA* bdj = (BDJAVA*)(intptr_t)np;
+    bd_select_rate(bdj->bd, (float)rate, reason);
     return 1;
 }
 
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index ef75edb..277b46c 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1018,6 +1018,20 @@ uint64_t bd_get_uo_mask(BLURAY *bd)
 
     return mask.u64;
 }
+
+void bd_select_rate(BLURAY *bd, float rate, int reason)
+{
+    if (reason == 2) {
+        /* playback stop. Might want to wait for buffers empty here. */
+        return;
+    }
+    if (rate < 0.5) {
+        _queue_event(bd, BD_EVENT_STILL, 1);
+    } else {
+        _queue_event(bd, BD_EVENT_STILL, 0);
+    }
+}
+
 #endif
 
 #ifdef USING_BDJAVA
diff --git a/src/libbluray/bluray_internal.h b/src/libbluray/bluray_internal.h
index a834fe1..d114ef8 100644
--- a/src/libbluray/bluray_internal.h
+++ b/src/libbluray/bluray_internal.h
@@ -34,4 +34,6 @@ BD_PRIVATE int bd_play_title_internal(BLURAY *bd, unsigned title);
 BD_PRIVATE uint32_t bd_reg_read(BLURAY *bd, int psr, int reg);
 BD_PRIVATE int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value);
 
+BD_PRIVATE void bd_select_rate(BLURAY *bd, float rate, int reason);
+
 #endif  /* _BLURAY_INTERNAL_H_ */



More information about the libbluray-devel mailing list