[libbluray-devel] Notify BD-J on stream change

hpi1 git at videolan.org
Wed Apr 15 11:00:01 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  6 15:36:35 2015 +0300| [849bba984e9705750ee8d04f8efa21d6924b2d49] | committer: hpi1

Notify BD-J on stream change

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

 src/libbluray/bdj/bdj.c                                        |    2 ++
 src/libbluray/bdj/bdj.h                                        |    2 ++
 src/libbluray/bdj/java/org/videolan/Libbluray.java             |    4 ++++
 .../bdj/java/org/videolan/media/content/BDHandler.java         |    8 ++++++++
 src/libbluray/bluray.c                                         |    2 ++
 5 files changed, 18 insertions(+)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index a168860..671d355 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -629,6 +629,8 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
         "STOP",
 
         "RATE",
+        "AUDIO_STREAM",
+        "SECONDARY_STREAM",
     };
 
     JNIEnv* env;
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index 756395b..c998ceb 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -40,6 +40,8 @@ typedef enum {
     BDJ_EVENT_STOP,
 
     BDJ_EVENT_RATE,
+    BDJ_EVENT_AUDIO_STREAM,
+    BDJ_EVENT_SECONDARY_STREAM,
 } BDJ_EVENT;
 
 typedef struct {
diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index 7239318..1816af5 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -488,6 +488,8 @@ public class Libbluray {
         case BDJ_EVENT_SECONDARY_STREAM:
         case BDJ_EVENT_END_OF_PLAYLIST:
         case BDJ_EVENT_PTS:
+        case BDJ_EVENT_AUDIO_STREAM:
+        case BDJ_EVENT_SECONDARY_STREAM:
             PlayerManager.getInstance().onEvent(event, param);
             break;
         case BDJ_EVENT_RATE:
@@ -560,6 +562,8 @@ public class Libbluray {
     private static final int BDJ_EVENT_STOP                     = 13;
 
     public  static final int BDJ_EVENT_RATE                     = 14;
+    public  static final int BDJ_EVENT_AUDIO_STREAM             = 15;
+    public  static final int BDJ_EVENT_SECONDARY_STREAM         = 16;
 
     /* 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 4c92b75..fdc37c6 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -381,6 +381,8 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
     protected void doAngleChanged(int angle) {};
     protected void doSubtitleChanged(int param) {};
     protected void doPiPChanged(int param) {};
+    protected void doAudioStreamChanged(int param) {};
+    protected void doSecondaryStreamChanged(int param) {};
 
     /*
      *
@@ -644,6 +646,12 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
                 case Libbluray.BDJ_EVENT_PTS:
                     player.doTimeChanged(param2);
                     break;
+                case Libbluray.BDJ_EVENT_AUDIO_STREAM:
+                    player.doAudioStreamChanged(param2);
+                    break;
+                case Libbluray.BDJ_EVENT_SECONDARY_STREAM:
+                    player.doSecondaryStreamChanged(param2);
+                    break;
                 default:
                     System.err.println("Unknown ACTION_STATUS: id " + param + ", value " + param2);
                     break;
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 58c9922..817962b 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2808,6 +2808,7 @@ static void _process_psr_change_event(BLURAY *bd, BD_PSR_EVENT *ev)
             break;
 
         case PSR_PRIMARY_AUDIO_ID:
+            _bdj_event(bd, BDJ_EVENT_AUDIO_STREAM, ev->new_val);
             _queue_event(bd, BD_EVENT_AUDIO_STREAM, ev->new_val);
             break;
 
@@ -2842,6 +2843,7 @@ static void _process_psr_change_event(BLURAY *bd, BD_PSR_EVENT *ev)
                 _queue_event(bd, BD_EVENT_SECONDARY_AUDIO, !!(ev->new_val & 0x40000000));
                 _queue_event(bd, BD_EVENT_SECONDARY_AUDIO_STREAM, ev->new_val & 0xff);
             }
+            _bdj_event(bd, BDJ_EVENT_SECONDARY_STREAM, ev->new_val);
             break;
 
         /* 3D status */



More information about the libbluray-devel mailing list