[libbluray-devel] hdmv_test: print overlay events

hpi1 git at videolan.org
Fri Aug 19 17:36:18 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Aug 15 13:29:59 2016 +0300| [4f5995cca9ecdd3e12bb981a1963ce2d734a654c] | committer: hpi1

hdmv_test: print overlay events

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

 src/devtools/hdmv_test.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/devtools/hdmv_test.c b/src/devtools/hdmv_test.c
index 89142ad..7016ee1 100644
--- a/src/devtools/hdmv_test.c
+++ b/src/devtools/hdmv_test.c
@@ -24,6 +24,7 @@
 
 #include "util/log_control.h"
 #include "libbluray/bluray.h"
+#include "libbluray/decoders/overlay.h"
 
 
 #define PRINT_EV0(e)                                \
@@ -136,6 +137,30 @@ static void _play_pl(BLURAY *bd)
     printf("\n");
 }
 
+static void _overlay_cb(void *h, const struct bd_overlay_s * const ov)
+{
+    (void)h;
+
+    if (ov) {
+        printf("OVERLAY @%ld p%d %d: %d,%d %dx%d\n", (long)ov->pts, ov->plane, ov->cmd, ov->x, ov->y, ov->w, ov->h);
+
+    } else {
+        printf("OVERLAY CLOSE\n");
+    }
+}
+
+static void _argb_overlay_cb(void *h, const struct bd_argb_overlay_s * const ov)
+{
+    (void)h;
+
+    if (ov) {
+      printf("ARGB OVERLAY @%ld p%d %d: %d,%d %dx%d\n", (long)ov->pts, ov->plane, ov->cmd, ov->x, ov->y, ov->w, ov->h);
+
+    } else {
+        printf("ARGB OVERLAY CLOSE\n");
+    }
+}
+
 int main(int argc, char *argv[])
 {
     int title = -1;
@@ -187,6 +212,9 @@ int main(int argc, char *argv[])
     bd_set_player_setting_str(bd, BLURAY_PLAYER_SETTING_MENU_LANG,    "eng");
     bd_set_player_setting_str(bd, BLURAY_PLAYER_SETTING_COUNTRY_CODE, NULL);
 
+    bd_register_overlay_proc(bd, bd, _overlay_cb);
+    bd_register_argb_overlay_proc(bd, bd, _argb_overlay_cb, NULL);
+
     /*
      * play
      */



More information about the libbluray-devel mailing list