[libbluray-devel] Notify BD-J on seek
hpi1
git at videolan.org
Fri Apr 15 12:19:09 CEST 2016
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Apr 14 21:35:35 2016 +0300| [a0c08436165357af3f6acc8582215a52f1fe9c3f] | committer: hpi1
Notify BD-J on seek
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=a0c08436165357af3f6acc8582215a52f1fe9c3f
---
src/libbluray/bdj/bdj.c | 1 +
src/libbluray/bdj/bdj.h | 1 +
src/libbluray/bdj/java/org/videolan/Libbluray.java | 2 ++
src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java | 6 ++++++
.../bdj/java/org/videolan/media/content/playlist/Handler.java | 4 ++++
src/libbluray/bluray.c | 5 +++--
6 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 7764630..6ff6f2b 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -696,6 +696,7 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
"AUDIO_STREAM",
"SECONDARY_STREAM",
"UO_MASKED",
+ "SEEK",
};
JNIEnv* env;
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index f6cd97b..8c9feaf 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -42,6 +42,7 @@ typedef enum {
BDJ_EVENT_AUDIO_STREAM,
BDJ_EVENT_SECONDARY_STREAM,
BDJ_EVENT_UO_MASKED,
+ BDJ_EVENT_SEEK,
} 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 2ab68a4..e640575 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -535,6 +535,7 @@ public class Libbluray {
case BDJ_EVENT_END_OF_PLAYLIST:
case BDJ_EVENT_PTS:
case BDJ_EVENT_UO_MASKED:
+ case BDJ_EVENT_SEEK:
PlayerManager.getInstance().onEvent(event, param);
break;
case BDJ_EVENT_RATE:
@@ -618,6 +619,7 @@ public class Libbluray {
public static final int BDJ_EVENT_AUDIO_STREAM = 14;
public static final int BDJ_EVENT_SECONDARY_STREAM = 15;
public static final int BDJ_EVENT_UO_MASKED = 16;
+ public static final int BDJ_EVENT_SEEK = 17;
/* 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 92269f1..9180610 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -376,6 +376,9 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
}
}
+ protected void doSeekNotify(long tick) {
+ updateTime(new Time(tick * TO_SECONDS));
+ }
protected void doPlaylistStarted(int playlist) {};
protected void doChapterReached(int chapter) {};
@@ -655,6 +658,9 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
case Libbluray.BDJ_EVENT_UO_MASKED:
player.doUOMasked(param2);
break;
+ case Libbluray.BDJ_EVENT_SEEK:
+ player.doSeekNotify(param2 * 2 /* 45kHz -> 90kHz */);
+ break;
default:
System.err.println("Unknown ACTION_STATUS: id " + param + ", value " + param2);
break;
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 8728628..62c2d2c 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
@@ -308,6 +308,10 @@ public class Handler extends BDHandler {
super.doEndOfMediaReached(playlist);
}
+ protected void doSeekNotify(long tick) {
+ super.doSeekNotify(Libbluray.tellTime());
+ }
+
protected BDLocator getLocator() {
return locator;
}
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 1614d85..dee0d87 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1561,11 +1561,12 @@ static void _seek_internal(BLURAY *bd,
{
if (_seek_stream(bd, &bd->st0, clip, clip_pkt) >= 0) {
- _queue_event(bd, BD_EVENT_SEEK, 0);
-
/* update title position */
bd->s_pos = (uint64_t)title_pkt * 192;
+ _queue_event(bd, BD_EVENT_SEEK, 0);
+ _bdj_event(bd, BDJ_EVENT_SEEK, 0);
+
/* playmark tracking */
_find_next_playmark(bd);
More information about the libbluray-devel
mailing list