[libbluray-devel] Notify BD-J when playlist changes

hpi1 git at videolan.org
Tue Jan 14 12:35:44 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Dec 21 16:52:01 2013 +0200| [d66a47a37d6bfd4a5419ae0638462c4c7bdcd628] | committer: hpi1

Notify BD-J when playlist changes

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

 src/libbluray/bdj/bdj.c                                        |    1 +
 src/libbluray/bdj/bdj.h                                        |    1 +
 src/libbluray/bdj/java/org/videolan/Libbluray.java             |    4 ++++
 .../bdj/java/org/videolan/media/content/BDHandler.java         |    8 ++++++++
 .../bdj/java/org/videolan/media/content/playlist/Handler.java  |    3 +++
 src/libbluray/bluray.c                                         |    1 +
 6 files changed, 18 insertions(+)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index be68d10..c2c88cd 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -591,6 +591,7 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
         "VK_KEY",
         "MARK",
         "PSR102",
+        "PLAYLIST",
     };
 
     JNIEnv* env;
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index 869ceda..f7086ff 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -36,6 +36,7 @@ typedef enum {
     BDJ_EVENT_VK_KEY,
     BDJ_EVENT_MARK,
     BDJ_EVENT_PSR102,
+    BDJ_EVENT_PLAYLIST,
 } BDJ_EVENT;
 
 /* bdj_get_uo_mask() */
diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index 762bede..7bb928f 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -320,6 +320,9 @@ public class Libbluray {
         case BDJ_EVENT_PLAYITEM:
             BDHandler.onPlayItemReach(param);
             break;
+        case BDJ_EVENT_PLAYLIST:
+            BDHandler.onPlaylistStart(param);
+            break;
         case BDJ_EVENT_ANGLE:
             BDHandler.onAngleChange(param);
             break;
@@ -392,6 +395,7 @@ public class Libbluray {
     private static final int BDJ_EVENT_VK_KEY                   = 8;
     private static final int BDJ_EVENT_MARK                     = 9;
     private static final int BDJ_EVENT_PSR102                   = 10;
+    private static final int BDJ_EVENT_PLAYLIST                 = 11;
 
     /* TODO: use org/bluray/system/RegisterAccess instead */
     public static final int PSR_IG_STREAM_ID     = 0;
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
index 3ea811e..855d8a4 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -305,6 +305,13 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
         }
     }
 
+    public static void onPlaylistStart(int param) {
+        synchronized (BDHandler.class) {
+            if (activePlayer != null)
+                activePlayer.doPlaylistStart(param);
+        }
+    }
+
     public static void onPlayItemReach(int param) {
         synchronized (BDHandler.class) {
             if (activePlayer != null)
@@ -333,6 +340,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
         }
     }
 
+    protected abstract void doPlaylistStart(int param);
     protected abstract void doChapterReach(int param);
     protected abstract void doMarkReach(int param);
     protected abstract void doPlayItemReach(int param);
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
index 0cdf2b2..e266074 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
@@ -190,6 +190,9 @@ public class Handler extends BDHandler {
         ((PlaybackControlImpl)controls[9]).onMarkReach(param);
     }
 
+    protected void doPlaylistStart(int param) {
+    }
+
     protected void doPlayItemReach(int param) {
         ((PlaybackControlImpl)controls[9]).onPlayItemReach(param);
         ((UOMaskTableControlImpl)controls[16]).onPlayItemReach(param);
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 4f6d3a3..f107e86 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2557,6 +2557,7 @@ static void _process_psr_write_event(BLURAY *bd, BD_PSR_EVENT *ev)
             libbdplus_event(bd->libbdplus, 0x110, ev->new_val, 0);
             break;
         case PSR_PLAYLIST:
+            _bdj_event  (bd, BDJ_EVENT_PLAYLIST,ev->new_val);
             _queue_event(bd, BD_EVENT_PLAYLIST, ev->new_val);
             break;
         case PSR_PLAYITEM:



More information about the libbluray-devel mailing list