Commit 13408dd1 authored by Petri Hintukainen's avatar Petri Hintukainen

Notify BD-J on stream change

parent 012fd330
......@@ -629,6 +629,8 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
"STOP",
"RATE",
"AUDIO_STREAM",
"SECONDARY_STREAM",
};
JNIEnv* env;
......
......@@ -40,6 +40,8 @@ typedef enum {
BDJ_EVENT_STOP,
BDJ_EVENT_RATE,
BDJ_EVENT_AUDIO_STREAM,
BDJ_EVENT_SECONDARY_STREAM,
} BDJ_EVENT;
typedef struct {
......
......@@ -537,7 +537,7 @@ public class Libbluray {
}
break;
default:
System.err.println("Unknown event %d.%d\n", event, param);
System.err.println("Unknown event " + event + "." + param);
result = false;
}
......@@ -560,6 +560,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;
......
......@@ -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;
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment